/* ============================================================
   Aquastat — Design System
   Aquatic, glassy, calm. Built to echo the native app:
   deep-ocean ink, aqua gradients, frosted glass, soft depth.
   ============================================================ */

:root {
  /* — Brand & aqua palette — */
  --aqua-50:  #ecfbff;
  --aqua-100: #cdf3fb;
  --aqua-200: #9fe7f5;
  --aqua-300: #5fd4ec;
  --aqua-400: #34c6df;
  --aqua-500: #11a9c8;
  --aqua-600: #0ca5c0;   /* brand accent (matches app) */
  --aqua-700: #0a7e95;
  --aqua-800: #0a5f70;
  --ocean-900: #062d39;
  --ocean-950: #03212a;

  /* — Ink / text — */
  --ink:        #07303b;
  --ink-soft:   #335763;
  --ink-faint:  #6b8a92;
  --on-dark:    #eafaff;
  --on-dark-soft: #a9d6e0;

  /* — Status — */
  --good:   #22c55e;
  --watch:  #f59e0b;
  --alert:  #ef4444;

  /* — Surfaces — */
  --surface:        #ffffff;
  --surface-tint:   #f4fdff;
  --glass:          rgba(255, 255, 255, 0.72);
  --glass-dark:     rgba(7, 38, 47, 0.42);
  --hairline:       rgba(7, 48, 59, 0.10);
  --hairline-light: rgba(255, 255, 255, 0.22);

  /* — Gradients — */
  --grad-aqua:  linear-gradient(135deg, #34c6df 0%, #1aa9c8 48%, #06a6c8 100%);
  --grad-deep:  linear-gradient(160deg, #0a7e95 0%, #074a59 55%, #03212a 100%);
  --grad-sheen: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.55));

  /* — Typography — */
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --fs-display: clamp(2.6rem, 6vw, 4.6rem);
  --fs-h1: clamp(2rem, 4.4vw, 3.1rem);
  --fs-h2: clamp(1.5rem, 3vw, 2.1rem);
  --fs-lede: clamp(1.05rem, 1.6vw, 1.3rem);

  /* — Radii / spacing / shadow — */
  --r-sm: 10px;  --r-md: 16px;  --r-lg: 24px;  --r-xl: 34px;  --r-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(7,48,59,.08);
  --shadow-md: 0 14px 40px rgba(7,48,59,.14);
  --shadow-lg: 0 30px 80px rgba(6,45,57,.28);
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-tint);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--aqua-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--aqua-600); }
img { max-width: 100%; display: block; }
.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700; color: var(--aqua-600); margin: 0 0 .8em; }

/* — Animated aqua background — */
.aqua-bg {
  position: fixed; inset: 0; z-index: -2;
  background: var(--grad-aqua);
  background-size: 200% 200%;
  animation: drift 22s ease-in-out infinite;
}
.aqua-bg::after {                      /* caustic light sheen */
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 30% at 20% 15%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(35% 28% at 80% 25%, rgba(255,255,255,.22), transparent 60%),
    radial-gradient(50% 40% at 60% 90%, rgba(3,33,42,.35), transparent 60%);
  mix-blend-mode: soft-light;
  animation: drift 30s ease-in-out infinite reverse;
}
.bubbles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bubbles i {
  position: absolute; bottom: -8vh; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.85), rgba(255,255,255,.12) 60%, transparent);
  animation: rise linear infinite;
  opacity: .0;
}
@keyframes drift { 0%,100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }
@keyframes rise {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  10%  { opacity: .7; }
  90%  { opacity: .5; }
  100% { transform: translateY(-118vh) scale(1); opacity: 0; }
}

/* — Glass + cards — */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--hairline-light);
  box-shadow: var(--shadow-md);
  border-radius: var(--r-lg);
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

/* — Buttons — */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1rem; padding: .85rem 1.5rem;
  border-radius: var(--r-pill); border: 0; cursor: pointer;
  background: var(--ink); color: var(--on-dark);
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--on-dark); }
.btn.primary { background: linear-gradient(135deg, var(--aqua-500), var(--aqua-700)); color: #fff; }
.btn.ghost { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.4); backdrop-filter: blur(8px); }
.btn.light { background: #fff; color: var(--aqua-700); }

/* — Reveal on scroll (progressive enhancement: visible unless JS is active) — */
.reveal { transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .aqua-bg, .aqua-bg::after, .bubbles i { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* — Top bar — */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0;
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: min(100% - 2.5rem, var(--maxw)); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; gap: 1.4rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,.92); font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: #fff; }
.nav.scrolled { background: var(--glass-dark); backdrop-filter: blur(14px); border-bottom: 1px solid var(--hairline-light); }

/* — Hero — */
.hero { position: relative; color: #fff; padding: clamp(3rem, 8vh, 6rem) 0 clamp(4rem, 12vh, 8rem); text-align: center; }
.hero .badge { display: inline-flex; gap: .5rem; align-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.32); color: #fff; padding: .4rem .9rem; border-radius: var(--r-pill); font-size: .85rem; font-weight: 600; backdrop-filter: blur(8px); margin-bottom: 1.4rem; }
.hero h1 { font-size: var(--fs-display); font-weight: 800; max-width: 14ch; margin-inline: auto; text-shadow: 0 4px 30px rgba(3,33,42,.25); }
.hero .lede { font-size: var(--fs-lede); color: var(--on-dark); max-width: 46ch; margin: 1.1rem auto 2rem; }
.hero-cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.hero-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 1.4rem; box-shadow: var(--shadow-lg); }

/* — Section — */
.section { padding: clamp(3.5rem, 9vh, 6.5rem) 0; }
.section.tint { background: var(--surface-tint); }
.section.plain { background: var(--surface); }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 3rem; }
.section-head h2 { font-size: var(--fs-h2); color: var(--ink); }
.section-head p { color: var(--ink-soft); font-size: var(--fs-lede); }

/* — Feature grid — */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.feature .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--aqua-100), var(--aqua-300)); color: var(--aqua-800); margin-bottom: 1rem; }
.feature .ic svg { width: 26px; height: 26px; }
.feature h3 { font-size: 1.15rem; color: var(--ink); }
.feature p { color: var(--ink-soft); font-size: .98rem; margin: 0; }

/* — Showcase (floating phones) — */
.showcase { display: flex; gap: clamp(1rem, 4vw, 3rem); justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.phone { width: clamp(190px, 24vw, 260px); border-radius: 38px; box-shadow: var(--shadow-lg); border: 6px solid rgba(7,38,47,.85); background: #000; overflow: hidden; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.phone img { display: block; }
.phone.mid { transform: translateY(-26px) scale(1.04); z-index: 2; }
.phone:hover { transform: translateY(-12px) scale(1.05); }

/* — Pricing — */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; max-width: 760px; margin-inline: auto; }
.tier { text-align: center; }
.tier .price { font-size: 2.4rem; font-weight: 800; color: var(--ink); margin: .2rem 0; }
.tier ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; text-align: left; }
.tier li { padding: .35rem 0 .35rem 1.7rem; position: relative; color: var(--ink-soft); }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.tier.featured { border: 2px solid var(--aqua-500); box-shadow: var(--shadow-md); }
.tier .tag { display: inline-block; background: var(--aqua-100); color: var(--aqua-800); font-weight: 700; font-size: .75rem; padding: .25rem .7rem; border-radius: var(--r-pill); }

/* — Footer — */
.footer { background: var(--grad-deep); color: var(--on-dark-soft); padding: 3rem 0 2rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.footer a { color: var(--on-dark-soft); }
.footer a:hover { color: #fff; }
.footer .cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer h4 { color: #fff; font-size: .9rem; margin: 0 0 .7rem; }
.footer nav { display: flex; flex-direction: column; gap: .5rem; font-size: .95rem; }
.footer .legal { width: 100%; border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.6rem; padding-top: 1.4rem; font-size: .85rem; color: var(--on-dark-soft); }

/* ============ Docs pages ============ */
.doc-shell { background: var(--surface); min-height: 100vh; }
.doc-top { position: sticky; top: 0; z-index: 20; background: var(--glass); backdrop-filter: blur(16px); border-bottom: 1px solid var(--hairline); }
.doc-top .wrap { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; }
.doc-top .brand { color: var(--ink); }
.doc-top .crumbs { color: var(--ink-faint); font-size: .9rem; }
.doc-top .crumbs a { color: var(--aqua-700); }
.doc-main { width: min(100% - 2.5rem, 760px); margin: 2.5rem auto 4rem; }
.doc-main h1 { font-size: var(--fs-h1); color: var(--ink); }
.doc-main h2 { font-size: 1.35rem; color: var(--ink); margin-top: 2.2rem; }
.doc-main .lede { font-size: var(--fs-lede); color: var(--ink-soft); }
.doc-main .updated { color: var(--ink-faint); font-size: .9rem; }
.doc-main ul { padding-left: 1.2rem; }
.doc-main li { margin: .35rem 0; color: var(--ink-soft); }
.doc-main p { color: var(--ink-soft); }
.note { background: var(--aqua-50); border: 1px solid var(--aqua-200); border-radius: var(--r-md); padding: .9rem 1.1rem; }
.note p { margin: 0; color: var(--ink-soft); }
.deflist .row { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--hairline); }
.deflist .term { font-weight: 700; color: var(--ink); }
@media (max-width: 620px) { .deflist .row { grid-template-columns: 1fr; gap: .2rem; } }
.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.4rem 0; }
.rule { border: 0; border-top: 1px solid var(--hairline); margin: 2.4rem 0; }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; margin: 1.5rem 0; }
.cards-2 a.card { text-decoration: none; }
.cards-2 .card .t { font-weight: 700; color: var(--ink); margin-bottom: .2rem; }
.cards-2 .card .d { color: var(--ink-soft); font-size: .92rem; }
