/* Unhooked — marketing site. Drenched health-device dark + teal.
   System mirrors the iOS app (DESIGN.md): Hanken Grotesk on web echoing the app's
   rounded SF, real app screenshots as hero imagery, the breathing-glow motif. */

:root {
  /* Canonical palette (Theme.swift / DESIGN.md) */
  --bg:           #0B1220;
  --bg-elevated:  #141C2E;
  --bg-input:     #1C2740;
  --accent:       #2DD4BF;
  --accent-deep:  #14B8A6;
  --danger:       #FB7185;
  --warning:      #FBBF24;
  --ink:          #F8FAFC;
  --muted:        #A6B4CC;   /* nudged a touch lighter than #94A3B8 for AA on ink */
  --faint:        #6B7A95;
  --stroke:       rgba(255,255,255,.08);
  --stroke-strong:rgba(255,255,255,.14);

  --accent-grad: linear-gradient(135deg, var(--accent), var(--accent-deep));
  --ink-on-accent: #06231F;

  /* 8pt spatial grid */
  --s-xs: 4px; --s-sm: 8px; --s-md: 16px; --s-lg: 24px; --s-xl: 32px; --s-2xl: 48px; --s-3xl: 80px;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;

  --shell: 1120px;
  --ease: cubic-bezier(.16,.84,.34,1);     /* ease-out-quint-ish */
  --font: "Hanken Grotesk", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --z-nav: 50; --z-glow: 0; --z-content: 1;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Subtle full-page vertical depth so the drench isn't flat */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(45,212,191,.10), transparent 60%),
    linear-gradient(180deg, #0C1424 0%, var(--bg) 40%, #090F1B 100%);
}

a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(45,212,191,.28); color: var(--ink); }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

/* ---------- Type scale ---------- */
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(2.1rem, 6.2vw, 5.2rem); }
h2 { font-size: clamp(1.6rem, 4.6vw, 3.4rem); }
/* Flex/grid children must be allowed to shrink, or long content forces page overflow. */
.hero-copy, .hero-stage, .row-copy, .row-media, .calc { min-width: 0; }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.45rem); letter-spacing: -0.02em; }
p  { margin: 0; }
.lead { font-size: clamp(1.06rem, 1.7vw, 1.32rem); color: var(--muted); line-height: 1.55; max-width: 60ch; text-wrap: pretty; }
.eyebrow { font-size: .9rem; font-weight: 600; color: var(--accent); letter-spacing: 0; margin: 0 0 var(--s-md); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--stroke); }
.nav .shell { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.18rem; color: var(--ink); letter-spacing: -0.02em; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-grad); display: grid; place-items: center; box-shadow: 0 4px 16px -4px rgba(45,212,191,.6); }
.brand .mark svg { width: 18px; height: 18px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) { color: var(--muted); font-size: .98rem; font-weight: 500; transition: color .2s; }
.nav-links a:not(.btn):hover { color: var(--ink); }
@media (max-width: 720px) { .nav-links a:not(.btn) { display: none; } }
@media (max-width: 440px) {
  .nav .shell { padding-left: 18px; padding-right: 18px; }
  .brand { font-size: 1.05rem; gap: 9px; }
  .brand .mark { width: 28px; height: 28px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-weight: 700; font-size: 1.02rem; line-height: 1;
  padding: 15px 28px; border-radius: var(--r-pill); border: 0; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), filter .2s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent-grad); color: var(--ink-on-accent); box-shadow: 0 10px 30px -8px rgba(45,212,191,.45); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(45,212,191,.6); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--ink); border: 1px solid var(--stroke-strong); }
.btn-ghost:hover { border-color: var(--accent); background: rgba(45,212,191,.06); }
.btn-sm { padding: 10px 18px; font-size: .92rem; }

/* ---------- Phone device frame ---------- */
.device {
  position: relative; width: 100%; max-width: 300px;
  border-radius: 46px; padding: 11px;
  background: linear-gradient(155deg, #1a2030, #06080e 60%);
  box-shadow:
    0 2px 2px rgba(255,255,255,.06) inset,
    0 50px 90px -30px rgba(0,0,0,.8),
    0 0 0 1px rgba(255,255,255,.05);
}
/* Show the screenshot at its natural ratio — never crop the side gutters. */
.device > img { width: 100%; height: auto; display: block; border-radius: 36px; background: var(--bg); }
.device::after { /* side button hint */ content: ""; position: absolute; right: 0; top: 30%; width: 3px; height: 64px; border-radius: 2px; background: linear-gradient(#2a3346, #11161f); }
.device-glow { position: absolute; inset: -12% -4%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,191,.34), transparent 62%); filter: blur(26px); }

/* ---------- Sections ---------- */
section { position: relative; padding: clamp(64px, 9vw, 120px) 0; }
.divider-soft { border-top: 1px solid var(--stroke); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 7vw, 92px); padding-bottom: clamp(56px, 8vw, 104px); overflow: clip; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero-copy { max-width: 38ch; }
.hero h1 { margin-bottom: var(--s-lg); }
.hero .lead { margin-bottom: var(--s-xl); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: var(--s-md); color: var(--faint); font-size: .92rem; }
.hero-stage { position: relative; display: grid; place-items: center; min-height: 480px; }
.hero-glow {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; z-index: var(--z-glow);
  background: radial-gradient(circle, rgba(45,212,191,.30), rgba(20,184,166,.10) 40%, transparent 66%);
  filter: blur(18px); animation: breathe 7s ease-in-out infinite;
}
.hero-stage .device { max-width: 290px; }
@keyframes breathe { 0%,100% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.08); opacity: 1; } }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero-copy { max-width: 30ch; margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .hero-stage { min-height: 0; }
}

/* ---------- Feature rows (alternating image / text) ---------- */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.row.reverse .row-media { order: 2; }
.row + .row { margin-top: clamp(72px, 10vw, 132px); }
.row-copy { max-width: 46ch; }
.row-copy h2 { margin-bottom: var(--s-md); }
.row-copy .lead { margin-bottom: var(--s-lg); }
.row-media { display: grid; place-items: center; position: relative; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--accent);
  padding: 6px 12px; border-radius: var(--r-pill); background: rgba(45,212,191,.10); border: 1px solid rgba(45,212,191,.22); margin-bottom: var(--s-md); }
.tag.danger { color: var(--danger); background: rgba(251,113,133,.10); border-color: rgba(251,113,133,.24); }
.minilist { list-style: none; margin: var(--s-lg) 0 0; padding: 0; display: grid; gap: 14px; }
.minilist li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.minilist svg { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.minilist b { color: var(--ink); font-weight: 600; }
@media (max-width: 800px) {
  .row { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .row.reverse .row-media { order: 0; }
  .row-copy { max-width: 31ch; margin: 0 auto; }
  .tag { margin-left: auto; margin-right: auto; }
  .minilist { text-align: left; max-width: 30ch; margin-inline: auto; }
}

/* ---------- Savings calculator ---------- */
.calc { background: var(--bg-elevated); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px); }
.calc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: var(--s-lg); }
.calc-out { font-weight: 800; font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -0.04em; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.calc-out span { color: var(--faint); font-size: 1rem; font-weight: 600; margin-left: 8px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-md); margin-top: var(--s-lg); }
.calc-cell { background: var(--bg-input); border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 16px 18px 14px; }
.calc-cell .calc-out { font-size: clamp(1.7rem, 4.8vw, 2.4rem); }
.calc-cap { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.calc-sub { color: var(--faint); font-size: .82rem; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--stroke); }
@media (max-width: 440px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-row { margin-bottom: var(--s-lg); }
.calc-row label { display: flex; justify-content: space-between; font-size: .95rem; color: var(--muted); margin-bottom: 12px; }
.calc-row label b { color: var(--ink); font-weight: 700; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; background: var(--bg-input); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-grad); cursor: pointer; box-shadow: 0 4px 14px -2px rgba(45,212,191,.7); border: 3px solid #0e1626; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid #0e1626; }
.calc-foot { color: var(--faint); font-size: .88rem; margin-top: var(--s-md); }

/* ---------- Founder ---------- */
.founder { background: linear-gradient(180deg, transparent, rgba(45,212,191,.04)); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); }
.founder .shell { max-width: 820px; text-align: center; }
.founder .quote-mark { color: var(--accent); font-size: 3rem; line-height: 0; opacity: .8; }
.founder blockquote { margin: var(--s-md) 0 0; font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight: 600; line-height: 1.42; letter-spacing: -0.02em; color: var(--ink); }
.founder .by { display: inline-flex; align-items: center; gap: 10px; margin-top: var(--s-lg); color: var(--muted); font-weight: 600; }
.founder .by .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Pricing / CTA ---------- */
.pricing .row-copy { max-width: 44ch; }
.price-card { background: var(--bg-elevated); border: 1px solid var(--stroke-strong); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 36px); max-width: 420px; }
.price-card .free { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.price-card .then { color: var(--muted); margin-top: 4px; }
.price-card ul { list-style: none; padding: 0; margin: var(--s-lg) 0; display: grid; gap: 12px; }
.price-card li { display: flex; gap: 10px; color: var(--muted); }
.price-card li svg { flex: none; width: 19px; height: 19px; color: var(--accent); }
.price-card .btn { width: 100%; margin-top: var(--s-sm); }
.price-card .fine { font-size: .82rem; color: var(--faint); text-align: center; margin-top: 14px; }

.final-cta { text-align: center; }
.final-cta .shell { max-width: 720px; }
.final-cta h2 { margin-bottom: var(--s-md); }
.final-cta .lead { margin: 0 auto var(--s-xl); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--stroke); padding: 48px 0; color: var(--faint); font-size: .92rem; }
.footer .shell { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.footer .brand { font-size: 1rem; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ---------- Legal / prose ---------- */
.prose { max-width: 70ch; margin: 0 auto; padding: clamp(56px, 9vw, 104px) 0; }
.prose .back { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 600; font-size: .92rem; margin-bottom: var(--s-xl); }
.prose h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin-bottom: 10px; }
.prose .updated { color: var(--faint); font-size: .92rem; margin-bottom: var(--s-2xl); }
.prose h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin: var(--s-2xl) 0 var(--s-md); }
.prose p, .prose li { color: var(--muted); font-size: 1.04rem; line-height: 1.7; }
.prose p + p { margin-top: var(--s-md); }
.prose ul { padding-left: 22px; display: grid; gap: 10px; margin: var(--s-md) 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { font-weight: 600; }

/* ---------- Scroll reveal (enhances already-visible content) ---------- */
/* Reveal only hides when JS is active (html.js), so no-JS / crawlers get visible content. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .reveal.d1 { transition-delay: .08s; } .js .reveal.d2 { transition-delay: .16s; } .js .reveal.d3 { transition-delay: .24s; }
}
/* Breathing brand mark — a calm echo of the app's breathing motif */
@media (prefers-reduced-motion: no-preference) {
  .brand .mark { animation: markBreathe 6s ease-in-out infinite; }
}
@keyframes markBreathe {
  0%, 100% { transform: scale(1);    box-shadow: 0 4px 16px -6px rgba(45,212,191,.55); }
  50%      { transform: scale(1.07); box-shadow: 0 7px 22px -4px rgba(45,212,191,.85); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow, .device-glow { animation: none; }
}
