/* Quantify — shared styles. Palette + tokens mirror the app (constants/Theme.ts). */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* warm-dark ground */
  --bg:            #151311;
  --bg-2:          #1b1815;
  --surface:       #211d19;
  --surface-2:     #29241f;
  --line:          rgba(245,240,235,0.09);
  --line-strong:   rgba(245,240,235,0.16);

  --ink:           #F5F0EB;
  --ink-2:         rgba(245,240,235,0.62);
  --ink-3:         rgba(245,240,235,0.38);

  --gold:          #D4A574;
  --gold-hi:       #e6bd8f;
  --lav:           #8B7EC8;
  --sage:          #6BAF8D;
  --steel:         #7BA7C9;
  --amber:         #D4976A;
  --rose:          #C97070;

  --maxw: 1140px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Bricolage Grotesque", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, "Roboto Mono", monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

:root[data-theme="light"] {
  --bg:            #f6f2ec;
  --bg-2:          #efe9e0;
  --surface:       #fffdf9;
  --surface-2:     #f4eee5;
  --line:          rgba(30,22,14,0.10);
  --line-strong:   rgba(30,22,14,0.18);
  --ink:           #241d16;
  --ink-2:         rgba(36,29,22,0.66);
  --ink-3:         rgba(36,29,22,0.42);
  --gold:          #a9743e;
  --gold-hi:       #8c5d2c;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:            #f6f2ec;
    --bg-2:          #efe9e0;
    --surface:       #fffdf9;
    --surface-2:     #f4eee5;
    --line:          rgba(30,22,14,0.10);
    --line-strong:   rgba(30,22,14,0.18);
    --ink:           #241d16;
    --ink-2:         rgba(36,29,22,0.66);
    --ink-3:         rgba(36,29,22,0.42);
    --gold:          #a9743e;
    --gold-hi:       #8c5d2c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }

/* ── logo lockup (exact app/auth.tsx ratios: clip 72 / img 96 / offset -12 /
   marginRight -20 / wordmark 30 — every dimension derived from --q so the
   glowing Q always dominates the wordmark like it does in the app) ── */
.brand { --q: 44px; display: inline-flex; align-items: center; font-weight: 700; letter-spacing: -0.02em; }
.logo-clip {
  overflow: hidden; display: inline-block; flex: none;
  width: var(--q); height: var(--q);
  margin-right: calc(var(--q) * -0.278);
}
.logo-clip img {
  display: block;
  width: calc(var(--q) * 1.3333); height: calc(var(--q) * 1.3333);
  margin-left: calc(var(--q) * -0.1667); margin-top: calc(var(--q) * -0.1667);
}
.wordmark { color: var(--ink); font-family: var(--sans); font-weight: 700; font-size: calc(var(--q) * 0.4167); letter-spacing: -0.03em; }

.brand.sm { --q: 46px; }   /* nav / footer */
.brand.lg { --q: 108px; }  /* hero */

/* ── nav ── */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink-2); font-size: 14.5px; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line-strong);
  color: var(--ink) !important;
}
.nav-cta { transition: border-color .16s var(--ease-out), transform .16s var(--ease-out); }
.nav-cta:hover { border-color: var(--gold); }
.nav-cta:active, #themeBtn:active { transform: scale(0.95); }
#themeBtn { background: none; border: 1px solid var(--line-strong); color: var(--ink-2); cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; font-size: 15px; display: grid; place-items: center; }
#themeBtn:hover { color: var(--ink); border-color: var(--gold); }
@media (max-width: 720px){ .nav-links a.hide-sm { display: none; } }

/* ── hero ── */
header { position: relative; overflow: hidden; }
#walk { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hero-fade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 78% 8%, transparent 0%, var(--bg) 72%),
              linear-gradient(180deg, transparent 55%, var(--bg) 100%); }
.hero { position: relative; z-index: 2; padding: 92px 0 104px; }
.hero-inner { max-width: 680px; }
.hero-logo { margin-bottom: 30px; }
@media (max-width: 560px){ .brand.lg { --q: 78px; } }
.hero h1 { font-size: clamp(40px, 6.6vw, 74px); line-height: 1.02; font-weight: 800; margin: 20px 0 0; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--gold-hi), var(--lav));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede { font-size: clamp(17px, 2.1vw, 20px); color: var(--ink-2); margin: 22px 0 0; max-width: 40ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 34px; }
.appstore {
  display: inline-flex; align-items: center; gap: 12px; padding: 13px 20px 13px 17px;
  background: var(--ink); color: var(--bg); border-radius: 13px; font-weight: 600; transition: transform .16s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .appstore:hover { transform: translateY(-2px); }
}
.appstore:active { transform: scale(0.97); }
.appstore svg { width: 26px; height: 26px; }
.appstore .small { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; display: block; line-height: 1.3; }
.appstore .big { font-size: 18px; letter-spacing: -0.01em; line-height: 1.1; }
.ghost-link { font-family: var(--mono); font-size: 13px; color: var(--ink-2); letter-spacing: .02em; }
.ghost-link:hover { color: var(--gold); }

.tickerbar {
  position: relative; z-index: 2; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); overflow: hidden; white-space: nowrap;
}
.ticker-track { display: inline-flex; gap: 40px; padding: 11px 0; animation: slide 34s linear infinite; }
.ticker-track span b { color: var(--gold); font-weight: 600; }
@keyframes slide { from { transform: translateX(0);} to { transform: translateX(-50%);} }
@media (prefers-reduced-motion: reduce){ .ticker-track { animation: none; } }

/* ── sections ── */
section { padding: 90px 0; }
.sec-head { max-width: 620px; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-top: 14px; line-height: 1.08; }
.sec-head p { color: var(--ink-2); font-size: 17px; margin: 16px 0 0; }

.topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px){ .topics { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 520px){ .topics { grid-template-columns: 1fr;} }
.topic {
  position: relative; padding: 22px 20px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .22s var(--ease-out), border-color .22s var(--ease-out); overflow: hidden;
}
@media (hover: hover) and (pointer: fine) {
  .topic:hover { transform: translateY(-4px); border-color: var(--line-strong); }
}
.topic:active { transform: scale(0.985); }
.topic { animation: topicIn .5s var(--ease-out) backwards; }
@keyframes topicIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .topic { animation: none; } }
.topic::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--tc); opacity:.85; }
.topic .ic { font-size: 26px; }
.topic h3 { font-size: 16px; font-weight: 700; margin-top: 14px; }
.topic small { font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: .04em; display:block; margin-top: 4px; }
.topic p { color: var(--ink-2); font-size: 13.5px; margin: 9px 0 0; line-height: 1.5; }

.features { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
@media (max-width: 860px){ .features { grid-template-columns: 1fr; gap: 40px; } }
.flist { display: flex; flex-direction: column; gap: 26px; }
.frow { display: flex; gap: 16px; }
.frow .fic { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 20px; }
.frow h3 { font-size: 17px; font-weight: 700; }
.frow p { color: var(--ink-2); font-size: 15px; margin: 5px 0 0; }

.phone {
  justify-self: center; width: min(300px, 100%); border-radius: 34px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px -30px rgba(0,0,0,.7);
}
.phone .screen { background: var(--bg-2); border-radius: 24px; padding: 22px 18px 26px; }
.lesson-top { display:flex; align-items:center; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.prog { height: 5px; border-radius: 99px; background: var(--surface-2); margin: 12px 0 22px; overflow:hidden; }
.prog i { display:block; height:100%; width:60%; background: linear-gradient(90deg,var(--gold),var(--lav)); }
.lcard-tag { font-family: var(--mono); font-size: 10px; letter-spacing:.14em; text-transform: uppercase; color: var(--sage); }
.lcard h4 { font-size: 19px; font-weight: 800; margin: 10px 0 8px; line-height:1.15; }
.lcard p { color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.opt { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border:1px solid var(--line);
  font-size: 13.5px; display:flex; align-items:center; gap:10px; }
.opt.correct { border-color: var(--sage); background: color-mix(in srgb, var(--sage) 12%, var(--surface)); }
.opt .k { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.opt.correct .k { color: var(--sage); }

.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; text-align: center;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 46px 0; }
@media (max-width: 640px){ .stats { grid-template-columns: repeat(2,1fr); gap: 34px; } }
.stat .n { font-family: var(--mono); font-size: clamp(30px,5vw,44px); font-weight: 700; letter-spacing:-0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink); }
.stat .n b { color: var(--gold); font-weight: 700; }
.stat .l { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 720px; margin: 0 auto; }
@media (max-width: 560px){ .plans { grid-template-columns: 1fr; } }
.plan { padding: 30px 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.plan.pro { border-color: var(--gold); background: linear-gradient(180deg, color-mix(in srgb,var(--gold) 8%, var(--surface)), var(--surface)); }
.plan .pname { font-family: var(--mono); font-size: 12px; letter-spacing:.12em; text-transform: uppercase; color: var(--ink-2); }
.plan.pro .pname { color: var(--gold); }
.plan .price { font-family: var(--display); font-size: 36px; font-weight: 800; margin: 10px 0 2px; letter-spacing:-0.03em; }
.plan .price span { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.plan ul { list-style: none; padding: 0; margin: 18px 0 0; display:flex; flex-direction:column; gap:10px; }
.plan li { font-size: 14px; color: var(--ink-2); display:flex; gap:10px; }
.plan li::before { content:"→"; color: var(--gold); font-family: var(--mono); }

.band { text-align:center; padding: 88px 0; }
.band h2 { font-size: clamp(30px,5vw,52px); font-weight: 800; line-height:1.05; }
.band p { color: var(--ink-2); font-size: 18px; margin: 18px 0 30px; }

/* ── article pages (privacy / terms / support) ── */
.page-hero { border-bottom: 1px solid var(--line); padding: 66px 0 44px; }
.page-hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; margin-top: 12px; }
.page-hero .updated { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); margin-top: 14px; letter-spacing: .03em; }
.article { max-width: 760px; padding: 56px 24px 90px; margin: 0 auto; }
.article h2 { font-size: 22px; font-weight: 800; margin: 44px 0 12px; }
.article h3 { font-size: 17px; font-weight: 700; margin: 26px 0 8px; }
.article p, .article li { color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.article p { margin: 0 0 16px; }
.article ul { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.article a { color: var(--gold); }
.article a:hover { text-decoration: underline; }
.article strong { color: var(--ink); }
.article .toc { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.article .toc a { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 8px; }
.article .toc a:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 12px; padding: 16px 18px; margin: 0 0 22px; }
.callout p { margin: 0; font-size: 14.5px; }

/* data table (privacy) */
.dtable { width: 100%; border-collapse: collapse; margin: 4px 0 22px; font-size: 14.5px; }
.dtable th, .dtable td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dtable th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.dtable td { color: var(--ink-2); }
.dtable-wrap { overflow-x: auto; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 20px 34px 20px 2px; position: relative;
  font-size: 17px; font-weight: 600; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-family: var(--mono);
  font-size: 22px; color: var(--gold); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); font-size: 15.5px; line-height: 1.7; margin: 0 34px 20px 2px; }
.faq details a { color: var(--gold); }

/* ── footer ── */
footer { border-top: 1px solid var(--line); padding: 54px 0 40px; }
.foot-grid { display:flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.foot-brand { max-width: 300px; }
.foot-brand p { color: var(--ink-2); font-size: 14px; margin: 14px 0 0; }
.foot-col h5 { font-family: var(--mono); font-size: 11px; letter-spacing:.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.foot-col a { display:block; color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.foot-col a:hover { color: var(--gold); }
.foot-bottom { display:flex; justify-content: space-between; flex-wrap: wrap; gap:12px; margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity:1; transform:none; } }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ── mobile polish ── */

/* nav: centered logo, theme toggle pinned right, drop the redundant CTA */
@media (max-width: 720px) {
  nav .wrap { position: relative; justify-content: center; height: 60px; }
  .nav-cta { display: none; }
  .nav-links { position: absolute; right: 16px; top: 0; height: 100%; gap: 0; }
  #themeBtn { width: 34px; height: 34px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  section { padding: 60px 0; }
  .sec-head { margin-bottom: 32px; }

  /* hero: center everything so nothing is stuck to the left edge */
  .hero { padding: 52px 0 66px; text-align: center; }
  .hero-inner { max-width: 100%; }
  .hero-logo { justify-content: center; margin-bottom: 20px; }
  .hero p.lede { font-size: 16.5px; margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; margin-top: 28px; gap: 12px; }
  .appstore { padding: 12px 18px 12px 15px; }

  .features { gap: 34px; }
  .flist { gap: 22px; }

  .stats { padding: 34px 0; gap: 26px 16px; }
  .plan { padding: 26px 22px; }

  .page-hero { padding: 46px 0 32px; }
  .article { padding: 40px 20px 72px; }
  .article h2 { margin-top: 34px; }
  .band { padding: 60px 0; }

  .foot-grid { gap: 30px 32px; }
}

@media (max-width: 380px) {
  .brand.sm { --q: 42px; }
  .brand.lg { --q: 68px; }
}
