/* ============================================================
   Through — marketing site
   Dark-only. Four real app palettes as scoped CSS tokens.
   Type: Space Grotesk (UI) + Caveat (expressive moments) —
   the app's own two-family system.
   ============================================================ */

/* ---------- Palette tokens (from docs/design/design-system.md) ---------- */
:root {
  /* Midnight = page default */
  --bg:        #0F0D1C;
  --surface:   #1C1929;
  --surface2:  #252138;
  --primary:   #9080FF;
  --primary-sh:#4A38CC;
  --success:   #4FD9A0;
  --text:      #ECE8FF;
  --muted:     #7B748F;

  /* constants across all palettes */
  --celebrate: #FFD166;
  --hairline:  rgba(255, 255, 255, .07);
  --hairline-strong: rgba(255, 255, 255, .12);

  /* type */
  --ui: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;

  /* rhythm */
  --maxw: 1180px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --ease: cubic-bezier(.22, 1, .36, .42);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

/* Per-section palette themes. Applied via [data-theme] — each section
   re-binds the accent tokens, and a CSS transition on color/background
   makes the accent "travel" as you scroll. */
[data-theme="midnight"] {
  --bg:#0F0D1C; --surface:#1C1929; --surface2:#252138;
  --primary:#9080FF; --primary-sh:#4A38CC; --success:#4FD9A0;
  --text:#ECE8FF; --muted:#7B748F;
}
[data-theme="forest"] {
  --bg:#091510; --surface:#112018; --surface2:#192C20;
  --primary:#4FD9A0; --primary-sh:#1A7548; --success:#7ADCFF;
  --text:#E4F5EC; --muted:#5A7A68;
}
[data-theme="ember"] {
  --bg:#1A0C08; --surface:#221410; --surface2:#2C1C12;
  --primary:#FF7A4A; --primary-sh:#B42C10; --success:#FF5A8A;
  --text:#FFF0E8; --muted:#886055;
}
[data-theme="ocean"] {
  --bg:#080F1A; --surface:#101728; --surface2:#162032;
  --primary:#5AB4FF; --primary-sh:#1844C4; --success:#5AFFEC;
  --text:#E8F2FF; --muted:#4A6880;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  transition: background-color .9s var(--ease-out), color .9s var(--ease-out);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary); color: var(--bg); }

/* ---------- layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
section { position: relative; padding: clamp(72px, 11vw, 152px) 0; transition: background-color .9s var(--ease-out); }
.section-bg { background: var(--bg); }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 18px; display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--primary); opacity: .6; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
h2 { font-size: clamp(30px, 4.6vw, 54px); }
h3 { font-size: clamp(19px, 2.2vw, 24px); letter-spacing: -0.02em; }
.lead { font-size: clamp(17px, 1.9vw, 21px); color: var(--muted); max-width: 56ch; }
.hand { font-family: var(--hand); font-weight: 600; letter-spacing: 0; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 48px);
  transition: background-color .4s ease, backdrop-filter .4s ease, border-color .4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}
.nav__brand { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.nav__mark { width: 30px; height: 30px; border-radius: 50%; mix-blend-mode: screen; }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a:not(.btn) { font-size: 15px; color: var(--muted); transition: color .25s ease; }
.nav__links a:not(.btn):hover { color: var(--text); }
@media (max-width: 760px) { .nav__links .nav__link { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--ui); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .3s ease;
}
.btn--primary { background: var(--primary); color: var(--bg); box-shadow: 0 8px 30px -8px color-mix(in srgb, var(--primary) 60%, transparent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px color-mix(in srgb, var(--primary) 75%, transparent); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--hairline-strong); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

/* Apple-style App Store badge (CSS, no external asset) */
.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg);
  transition: transform .25s var(--ease-out), box-shadow .3s ease;
  box-shadow: 0 10px 40px -12px rgba(0,0,0,.7);
}
.appstore:hover { transform: translateY(-2px); }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore__txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore__txt small { font-size: 10px; font-weight: 500; letter-spacing: .02em; opacity: .8; }
.appstore__txt strong { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(130px, 18vh, 200px); text-align: center; overflow: hidden; }
.hero__portal {
  position: absolute; top: 8%; left: 50%; translate: -50% 0;
  width: min(720px, 120vw); aspect-ratio: 1; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 50% 45%,
              color-mix(in srgb, var(--primary) 38%, transparent) 0%,
              transparent 58%);
  filter: blur(20px); opacity: .85;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }
.hero .wrap { position: relative; z-index: 2; }
.hero__orb {
  width: clamp(120px, 20vw, 184px); aspect-ratio: 1; margin: 0 auto 30px;
  border-radius: 50%; mix-blend-mode: screen;
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero h1 { font-size: clamp(40px, 7.2vw, 88px); letter-spacing: -0.045em; }
.hero h1 .accent { color: var(--primary); }
.hero__sub { margin: 26px auto 0; max-width: 60ch; font-size: clamp(17px, 2vw, 21px); color: var(--muted); }
.hero__sub b { color: var(--text); font-weight: 600; }
.hero__cta { margin-top: 38px; display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hero__note { margin-top: 20px; font-size: 14px; color: var(--muted); }
.hero__note .hand { font-size: 21px; color: var(--celebrate); }

/* trust strip */
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 26px; margin-top: 64px; }
.trust span { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.trust span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.shead { max-width: 640px; margin-bottom: clamp(40px, 6vw, 72px); }
.shead.center { margin-inline: auto; text-align: center; }
.shead.center .eyebrow { justify-content: center; }
.shead p { margin-top: 18px; color: var(--muted); font-size: clamp(16px, 1.8vw, 19px); }

/* ============================================================
   THE LOOP
   ============================================================ */
.loop__grid { display: grid; gap: clamp(48px, 8vw, 96px); }
.loop__row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.loop__row:nth-child(even) .loop__phone { order: 2; }
.loop__step { font-family: var(--hand); font-size: 44px; color: var(--primary); line-height: 1; opacity: .55; margin-bottom: 6px; }
.loop__text h3 { margin-bottom: 14px; }
.loop__text p { color: var(--muted); font-size: 17px; max-width: 42ch; }
.loop__caption { margin-top: 18px; font-family: var(--hand); font-size: 26px; color: var(--text); }
@media (max-width: 800px) {
  .loop__row, .loop__row:nth-child(even) .loop__phone { grid-template-columns: 1fr; order: 0; }
  .loop__phone { margin-inline: auto; }
}

/* ---------- phone mockup (screenshots are frameless captures) ---------- */
.phone {
  position: relative; width: clamp(220px, 30vw, 290px); margin-inline: auto;
  border-radius: 44px; padding: 11px;
  background: linear-gradient(160deg, #2a2738, #15131f);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px var(--hairline-strong),
              inset 0 0 0 1px rgba(255,255,255,.04);
}
.phone::before { /* notch */
  content: ""; position: absolute; top: 20px; left: 50%; translate: -50% 0;
  width: 92px; height: 26px; background: #08070d; border-radius: 0 0 16px 16px; z-index: 3;
}
.phone img { border-radius: 34px; width: 100%; }
.phone--glow::after {
  content: ""; position: absolute; inset: -30% -30% -30% -30%; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 34%, transparent), transparent 65%);
  filter: blur(30px); animation: breathe 7s ease-in-out infinite;
}

/* ============================================================
   WHY DIFFERENT — pillars
   ============================================================ */
.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 30px 30px 34px;
  transition: transform .35s var(--ease-out), border-color .35s ease, background-color .35s ease;
}
.pillar:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 50%, transparent); background: var(--surface2); }
.pillar__icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary);
  margin-bottom: 20px; font-size: 22px;
}
.pillar h3 { margin-bottom: 10px; }
.pillar p { color: var(--muted); font-size: 16px; }
.pillar em { color: var(--text); font-style: normal; }

.bignote {
  margin-top: clamp(48px, 7vw, 88px); text-align: center;
  font-size: clamp(24px, 3.6vw, 42px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.25;
  max-width: 20ch; margin-inline: auto;
}
.bignote .no { color: var(--success); font-family: var(--hand); font-weight: 700; }

/* ============================================================
   PRO
   ============================================================ */
.pro__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .pro__grid { grid-template-columns: 1fr; } }
.pro__price { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 28px; }
.pro__price .amt { font-size: clamp(48px, 7vw, 72px); font-weight: 600; letter-spacing: -0.04em; color: var(--primary); }
.pro__price .once { font-size: 18px; color: var(--text); }
.pro__price .strike { font-size: 15px; color: var(--muted); }
.feature-list { display: grid; gap: 2px; margin: 8px 0 30px; }
.feature {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.feature:last-child { border-bottom: 0; }
.feature__ic { color: var(--primary); font-size: 19px; line-height: 1.5; flex: none; width: 24px; text-align: center; }
.feature b { font-weight: 600; display: block; }
.feature span { color: var(--muted); font-size: 15px; }
.pro__phones { position: relative; display: flex; justify-content: center; gap: 0; }
.pro__phones .phone:nth-child(2) { margin-left: -90px; margin-top: 46px; rotate: 5deg; z-index: 1; }
.pro__phones .phone:first-child { rotate: -4deg; z-index: 2; }
@media (max-width: 480px) { .pro__phones .phone:nth-child(2) { display: none; } .pro__phones .phone:first-child { rotate: 0; } }
.pro__watch {
  position: absolute; bottom: -10px; right: 0; width: 132px; border-radius: 26px;
  border: 1px solid var(--hairline-strong); box-shadow: 0 20px 50px -20px rgba(0,0,0,.8);
  rotate: 6deg; z-index: 3; background: #000;
}

/* ============================================================
   PALETTES — "make it yours"
   ============================================================ */
.palettes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 720px) { .palettes { grid-template-columns: repeat(2, 1fr); } }
.swatch {
  border-radius: var(--r-md); padding: 22px 22px 20px; border: 1px solid var(--hairline);
  position: relative; overflow: hidden; aspect-ratio: 3/4; display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .35s var(--ease-out);
}
.swatch:hover { transform: translateY(-6px) scale(1.01); }
.swatch__orb { position: absolute; top: 18px; left: 18px; width: 54px; height: 54px; border-radius: 50%; filter: blur(2px); }
.swatch__orb::after { content:""; position:absolute; inset: 18px; border-radius:50%; background: var(--celebrate); filter: blur(4px); }
.swatch__name { font-weight: 600; font-size: 17px; }
.swatch__hint { font-size: 13px; opacity: .7; }

.watch-row { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-top: clamp(40px, 6vw, 64px); }
.watch {
  width: 168px; border-radius: 34px; padding: 14px;
  background: linear-gradient(160deg, #2a2738, #111018);
  box-shadow: 0 30px 60px -28px rgba(0,0,0,.8), 0 0 0 1px var(--hairline-strong);
}
.watch img { border-radius: 22px; }
.watch__cap { text-align: center; font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ============================================================
   PRIVACY
   ============================================================ */
.privacy { text-align: center; }
.privacy__badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px; border-radius: 999px;
  background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  font-size: 14px; font-weight: 600; margin-bottom: 28px;
}
.privacy h2 { max-width: 18ch; margin-inline: auto; }
.privacy__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 40px; }
.privacy__chip { padding: 11px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--hairline); font-size: 15px; color: var(--text); }

/* ============================================================
   FINAL CTA
   ============================================================ */
.final { text-align: center; overflow: hidden; }
.final h2 { font-size: clamp(34px, 5.5vw, 64px); max-width: 16ch; margin: 0 auto 16px; }
.final .lead { margin: 0 auto 36px; }
.final__portal {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 55%);
}
.final .wrap { position: relative; z-index: 2; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: 56px 0 40px; border-top: 1px solid var(--hairline); background: var(--bg); }
.footer__grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.footer__brand { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 18px; }
.footer__brand img { width: 28px; height: 28px; border-radius: 50%; mix-blend-mode: screen; }
.footer__tag { color: var(--muted); font-size: 14px; margin-top: 12px; max-width: 30ch; }
.footer__links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer__col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.footer__col a { display: block; font-size: 15px; color: var(--text); opacity: .8; padding: 5px 0; transition: opacity .2s, color .2s; }
.footer__col a:hover { opacity: 1; color: var(--primary); }
.footer__bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }

/* ============================================================
   LEGAL / SUPPORT PAGES
   ============================================================ */
.legal { padding-top: clamp(130px, 16vh, 180px); padding-bottom: 100px; }
.legal .wrap { max-width: 760px; }
.legal__back { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; margin-bottom: 28px; transition: color .2s; }
.legal__back:hover { color: var(--primary); }
.legal h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 8px; }
.legal__meta { color: var(--muted); font-size: 14px; margin-bottom: 44px; }
.legal h2 { font-size: clamp(21px, 2.6vw, 27px); margin: 44px 0 14px; }
.legal h3 { font-size: 18px; margin: 28px 0 10px; }
.legal p, .legal li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); font-size: 16px; margin-bottom: 14px; }
.legal ul { padding-left: 22px; margin-bottom: 14px; }
.legal li { margin-bottom: 8px; }
.legal a:not(.legal__back) { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.legal strong { color: var(--text); }
.callout {
  background: var(--surface); border: 1px solid var(--hairline);
  border-left: 3px solid var(--primary); border-radius: var(--r-sm);
  padding: 20px 24px; margin: 24px 0;
}
.callout p:last-child { margin-bottom: 0; }

/* FAQ (support) */
.faq { border-top: 1px solid var(--hairline); margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 0; font-size: 18px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 26px; font-weight: 400; color: var(--primary); transition: transform .3s; line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; margin: 0; color: var(--muted); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
