/* =============================================================
   TONE — PUBLIC PAGES (V92.71)
   -------------------------------------------------------------
   A self-contained stylesheet for the public marketing pages
   only: the homepage, how it works, for educators, the learning
   approach, plans, and the not-found page.

   WHY THIS FILE EXISTS
   The public pages used to load css/styles.css (339 KB),
   css/tone-foundation.css (115 KB) and css/tone-refresh.css
   (127 KB) — the whole application's styling, most of it for
   screens a visitor cannot reach — plus Chart.js and the
   Supabase client. A visitor reading a marketing page needed
   none of it. This sheet is the only stylesheet those pages
   load now; the application's own stack is untouched.

   The identity is unchanged: bone ground, ink text, Fraunces
   for display, Inter for reading, JetBrains Mono for labels,
   fine rules, generous space.
   ============================================================= */

:root {
  --bone:      #F3EEE4;
  --paper:     #E8E1D1;
  --cream:     #FAF6EE;
  --ink:       #141110;
  --ink-2:     #3A332E;
  --ink-3:     #5F564E;  /* darkened from #776C62 for 4.5:1 on bone */
  --line:      #C9BFAD;
  --line-soft: #DDD5C6;
  --oxblood:   #5A1918;
  --champagne: #B99B6B;

  --serif: 'Fraunces', 'Didot', 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:  'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  --gut: clamp(20px, 5vw, 34px);
  --max: 1180px;
  --prose: 64ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(36px, 6.2vw, 68px); }
h2 { font-size: clamp(28px, 4vw, 42px); }
h3 { font-size: clamp(20px, 2.2vw, 25px); letter-spacing: -0.01em; }
h4 { font-size: 18px; letter-spacing: -0.005em; }
em { font-style: italic; }

p { margin: 0 0 1em; max-width: var(--prose); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }
a:hover { text-decoration-thickness: 2px; }

.lede { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: 15px; }

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
}

/* ---------- skip link + focus ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bone);
  padding: 12px 18px; font-family: var(--mono); font-size: 12px;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gut); }
.wrap-prose { max-width: 780px; margin: 0 auto; padding-inline: var(--gut); }

section { padding-block: clamp(48px, 8vw, 96px); }
.rule-top { border-top: 1px solid var(--line); }

.grid { display: grid; gap: clamp(20px, 3vw, 34px); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: 14px var(--gut);
  /* V92.88 — clear the phone's status bar. Opened from the Home Screen,
     the page runs full-screen and the time / signal / battery sit on
     top of whatever is at the very top — which was this header, so
     Sign in and Try the demo were under the clock and couldn't be
     tapped. env() is 0 everywhere that has no status bar to avoid. */
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gut), env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bone) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.site-brand {
  font-family: var(--serif); font-size: 24px; letter-spacing: -0.01em;
  text-decoration: none; line-height: 1; margin-right: auto;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  font-size: 15px; text-decoration: none; color: var(--ink-2);
  padding: 10px 12px; border-radius: 4px; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--paper); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--oxblood); }
.header-cta { display: flex; align-items: center; gap: 8px; }

.nav-toggle {
  display: none;
  min-height: 44px; min-width: 44px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: 4px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink); cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.09em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 2px;
  background: transparent; color: var(--ink);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bone); }
.btn-primary:hover { background: var(--oxblood); border-color: var(--oxblood); }
.btn-ghost:hover { background: var(--paper); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 11px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 80px) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero .lede { max-width: 50ch; }
.hero-note { margin-top: 20px; font-size: 14px; color: var(--ink-3); }

/* ---------- cards ---------- */
.card {
  background: var(--cream);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: clamp(20px, 2.6vw, 28px);
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: 16px; color: var(--ink-2); }

.numbered { counter-reset: step; }
.step { position: relative; padding-left: 54px; margin-bottom: 30px; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  color: var(--oxblood);
  border-top: 1px solid var(--line); padding-top: 6px; width: 38px;
}
.step h3 { margin-bottom: 6px; }
.step p { font-size: 16px; color: var(--ink-2); margin: 0; }

/* ---------- the chain (consultation → … → next step) ---------- */
.chain { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; list-style: none; margin: 0; padding: 0; }
.chain li {
  flex: 1 1 150px;
  background: var(--cream); border: 1px solid var(--line-soft);
  padding: 16px 16px 18px; border-radius: 3px;
  border-top: 3px solid var(--oxblood);
}
.chain .n {
  display: block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 8px;
}
.chain strong { display: block; font-family: var(--serif); font-size: 19px; font-weight: 400; letter-spacing: -0.01em; margin-bottom: 4px; }
.chain span.d { font-size: 14px; color: var(--ink-2); line-height: 1.45; }

/* ---------- product preview (rendered, not a screenshot) ---------- */
.preview {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20,17,16,0.05), 0 30px 60px -40px rgba(20,17,16,0.45);
}
.preview-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--ink); color: var(--bone);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.preview-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--champagne); flex: none; }
.preview-body { padding: 18px; display: grid; gap: 14px; }
.preview-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.preview-row:last-child { border-bottom: 0; padding-bottom: 0; }
.preview-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line-soft);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 15px; color: var(--ink-2);
}
.preview-name { font-size: 15px; font-weight: 500; }
.preview-sub { font-size: 13px; color: var(--ink-3); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 5px 9px; border-radius: 2px;
  border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.tag-mark { background: var(--oxblood); border-color: var(--oxblood); color: var(--cream); }
.tag-ok { background: var(--paper); }
.demo-flag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
  margin-top: 12px;
}
.demo-flag::before { content: "◇"; color: var(--champagne); }

/* ---------- worked example ---------- */
.example { background: var(--paper); }
.example-steps { display: grid; gap: 2px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 3px; overflow: hidden; }
.example-step { background: var(--cream); padding: 18px 20px; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; }
.example-step dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--oxblood); padding-top: 3px; }
.example-step dd { margin: 0; font-size: 16px; color: var(--ink-2); }
.example-step dd b { color: var(--ink); font-weight: 500; }

/* ---------- plans ---------- */
.plan { display: flex; flex-direction: column; }
.plan .price { font-family: var(--serif); font-size: 38px; line-height: 1; margin: 6px 0 4px; }
.plan .cadence { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.plan ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; }
.plan li { font-size: 15px; color: var(--ink-2); padding-left: 20px; position: relative; }
.plan li::before { content: "—"; position: absolute; left: 0; color: var(--champagne); }
.plan-note { margin-top: 20px; font-size: 14px; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  font-family: var(--serif); font-size: clamp(18px, 2vw, 21px); letter-spacing: -0.01em;
  list-style: none; min-height: 44px; display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 20px; color: var(--ink-3);
}
.faq details[open] summary::after { content: "–"; }
.faq details > p { padding: 0 0 20px; color: var(--ink-2); font-size: 16px; }

/* ---------- audience paths ---------- */
.path { border-top: 3px solid var(--ink); padding-top: 18px; }
.path h3 { margin-bottom: 8px; }
.path p { font-size: 16px; color: var(--ink-2); }
.path a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; display: inline-block; margin-top: 12px; }

/* ---------- closing call ---------- */
.closing { background: var(--ink); color: var(--bone); }
.closing h2 { color: var(--bone); }
.closing p { color: color-mix(in srgb, var(--bone) 75%, transparent); }
.closing .btn { border-color: var(--bone); color: var(--bone); }
.closing .btn-primary { background: var(--bone); color: var(--ink); }
.closing .btn-primary:hover { background: var(--champagne); border-color: var(--champagne); color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 44px var(--gut); }
.footer-grid { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px 44px; align-items: flex-start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { font-size: 15px; color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { width: 100%; border-top: 1px solid var(--line-soft); padding-top: 20px; font-size: 13px; color: var(--ink-3); }

/* ---------- not found ---------- */
.notfound { min-height: 60vh; display: grid; align-content: center; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2-wide { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 8px var(--gut) 14px;
  }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav a { padding: 13px 4px; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .site-header { position: relative; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .example-step { grid-template-columns: 1fr; gap: 6px; }
  .chain li { flex: 1 1 100%; }
  .step { padding-left: 0; padding-top: 34px; }
  .step::before { top: 0; }
}
@media (max-width: 380px) {
  .header-cta .btn-ghost { display: none; } /* Sign in stays reachable in the menu + footer */
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .btn:hover { transform: none; }
}

@media print {
  .site-header, .closing, .nav-toggle { display: none; }
  body { background: #fff; }
}

/* Comfortable targets on touch devices (V92.71). */
@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
}
/* V92.71.1 — and on any narrow viewport, not only where the browser
   reports a coarse pointer. The header's "Try the demo" measured 40px
   at 360px wide, because pointer:coarse is not reported by every phone
   browser (or by a narrow desktop window, which is what a11y-manual
   tests with). Width is the more reliable signal for this one. */
@media (max-width: 600px) {
  .btn-sm { min-height: 44px; }
}

/* =============================================================
   V92.71.1 — one-time section reveals
   =============================================================
   The reveal is an enhancement layered on top of a page that is
   already complete. `.rv` on its own does nothing; the hidden state
   only exists while <body> carries `js-reveal`, and js/public-reveal.js
   adds that class only after it has confirmed it can finish the job
   (IntersectionObserver present, reduced motion not requested). So a
   reader with no JavaScript, an old browser, a blocked script or a
   reduced-motion preference gets the full page immediately.

   No pinning, no scroll hijacking, no full-screen slides, and nothing
   that re-animates when you scroll back up.
   ============================================================= */
.rv { opacity: 1; }

body.js-reveal .rv {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 420ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
body.js-reveal .rv.rv-on {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  body.js-reveal .rv,
  body.js-reveal .rv.rv-on {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* A subtle surface change on the existing sticky header as the page
   leaves the top — the header itself is unchanged in structure. */
.site-header { transition: background-color 200ms ease, box-shadow 200ms ease; }
.site-header.is-stuck { box-shadow: 0 1px 0 rgba(20, 17, 16, 0.08); }

/* Printing, and anything that renders the whole page at once, must get
   the whole page. A reveal that hasn't fired yet would otherwise print
   as a blank section. */
@media print {
  body.js-reveal .rv,
  body.js-reveal .rv.rv-on {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
