/* ===========================================================================
   round0 — shared styles
   Vanilla CSS, no build step. Monochrome "v0" aesthetic: near-black canvas,
   white primary actions, restrained color (blue links, green/red answers).
   =========================================================================== */

:root {
  --bg:      #08090a;   /* deepest canvas */
  --panel:   #0e0f11;   /* cards, panels */
  --panel-2: #151619;   /* raised / hover surfaces */
  --border:  #21232a;   /* hairline dividers */
  --border-strong: #34373d; /* outlined controls, emphasis frames */
  --sheen:   rgba(255, 255, 255, 0.055); /* top-edge highlight on frames */
  --text:    #f7f8f8;   /* primary text (Linear) */
  --muted:   #8a8f98;   /* secondary text (Linear grey) */
  --faint:   #62666d;   /* tertiary / micro-labels */
  --accent:  #f7f8f8;   /* primary = near-white */
  --accent-ink: #08090a;/* text on a light surface */
  --good:    #4cb782;   /* correct answer */
  --bad:     #eb5757;   /* wrong answer */
  --vc:      #7aa2f7;   /* VC name / link highlight */
  --mono:    'Geist Mono', ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
  --sans:    'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
  --nav-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--text); }

body {
  font: 16px/1.55 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  hyphens: none;
}

@media (max-width: 599px) {
  body { line-height: 1.6; }
}

a { color: inherit; }

img { display: block; }

/* Accessible focus ring — amber, never the default dotted line */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  background: var(--accent); color: #0a0a0a;
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  font-size: 14px; text-decoration: none;
  transform: translateY(-200%); transition: transform 0.15s;
}
.skip-link:focus { transform: translateY(0); }

/* ===========================================================================
   Sticky top nav (§8.1)
   =========================================================================== */

.site-nav {
  position: sticky; top: 0; z-index: 150;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
  transition: transform 0.25s ease;
}
.site-nav.nav-hidden { transform: translateY(calc(-100% - var(--safe-top))); }

.nav-inner {
  max-width: 960px; margin: 0 auto;
  min-height: var(--nav-h);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
@media (min-width: 700px) { .nav-inner { padding: 0 32px; } }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.brand-logo { width: 28px; height: 28px; flex-shrink: 0; }
.brand-name { white-space: nowrap; }

.nav-links {
  display: flex; align-items: center; gap: 22px;
}
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  transition: color 0.15s;
}
.nav-links a.nav-cta {
  color: var(--text); border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  padding: 0 12px; border-radius: 8px; min-height: 32px;
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center;
  box-shadow: inset 0 1px 0 0 var(--sheen);
}
.nav-links a.nav-cta:hover { background: rgba(255, 255, 255, 0.07); border-color: #44474e; }

@media (hover: hover) {
  .nav-links a:hover { color: var(--text); }
}

/* Hamburger — sits in a fixed slot in the nav; morphs into an X when open */
.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0;
  background: none; border: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  z-index: 160; /* stay above the menu panel */
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 759px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* Mobile menu — full-screen panel that slides in BELOW the nav.
   The nav (logo + hamburger) stays fixed in place; only the panel animates. */
.mobile-menu {
  position: fixed; inset: 0; z-index: 140;
  background: var(--bg);
  padding: calc(var(--nav-h) + var(--safe-top) + 12px) 20px calc(var(--safe-bottom) + 24px) 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.24s;
}
.mobile-menu.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }

/* Stagger the menu items in as the panel opens */
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav > *, .mobile-menu .m-cta, .mobile-menu .m-foot {
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.open nav > *, .mobile-menu.open .m-cta, .mobile-menu.open .m-foot {
  opacity: 1; transform: none;
}
.mobile-menu.open nav > *:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.open nav > *:nth-child(2) { transition-delay: 0.09s; }
.mobile-menu.open nav > *:nth-child(3) { transition-delay: 0.13s; }
.mobile-menu.open nav > *:nth-child(4) { transition-delay: 0.17s; }
.mobile-menu.open .m-cta { transition-delay: 0.21s; }
.mobile-menu.open .m-foot { transition-delay: 0.25s; }
.mobile-menu .m-link {
  display: block; padding: 16px 4px; font-size: 19px; font-weight: 600;
  text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.mobile-menu details { border-bottom: 1px solid var(--border); }
.mobile-menu details > summary {
  padding: 16px 4px; font-size: 19px; font-weight: 600; cursor: pointer;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.mobile-menu details > summary::-webkit-details-marker { display: none; }
.mobile-menu details > summary::after {
  content: '+'; color: var(--muted); font-weight: 400; font-size: 22px;
}
.mobile-menu details[open] > summary::after { content: '–'; }
.mobile-menu .m-sub {
  padding: 0 4px 14px 4px; display: flex; flex-direction: column; gap: 2px;
}
.mobile-menu .m-sub a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 11px 8px; text-decoration: none; color: var(--muted);
  font-size: 15px; font-weight: 400; border-radius: 8px; min-height: 44px;
}
.mobile-menu .m-sub a:active { background: var(--panel); }
.mobile-menu .m-sub a .m-num { font-family: var(--mono); color: var(--faint); font-size: 12px; }
.mobile-menu .m-cta {
  margin-top: 22px; background: rgba(255, 255, 255, 0.05); color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: inset 0 1px 0 0 var(--sheen);
  text-align: center; padding: 0 16px; border-radius: 8px; font-size: 14px; letter-spacing: -0.01em;
  font-weight: 600; text-decoration: none; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-menu .m-foot {
  margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 13px;
}
.mobile-menu .m-foot a { color: var(--text); }

body.menu-open { overflow: hidden; }

/* ===========================================================================
   Shared layout + components
   =========================================================================== */

.wrap { max-width: 720px; margin: 0 auto; padding: 28px 20px calc(40px + var(--safe-bottom)) 20px; }
@media (min-width: 700px) { .wrap { padding: 40px 32px 64px 32px; } }

/* Buttons — all outlined, sharp small text, max 44px tall (small variants 32px) */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 16px; min-height: 44px;
  background: rgba(255, 255, 255, 0.05); color: var(--text); text-decoration: none;
  border-radius: 8px; font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em;
  border: 1px solid var(--border-strong); cursor: pointer; font-family: inherit;
  box-shadow: inset 0 1px 0 0 var(--sheen);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-primary:hover { background: rgba(255, 255, 255, 0.09); border-color: #44474e; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 16px; min-height: 44px;
  background: transparent; color: var(--muted); text-decoration: none;
  border-radius: 8px; font-weight: 500; font-size: 13.5px; letter-spacing: -0.01em;
  border: 1px solid var(--border); transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-secondary:hover { border-color: var(--border-strong); color: var(--text); }

.section-label {
  color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px;
}

h2 {
  font-size: clamp(22px, 4vw, 28px); font-weight: 600;
  letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 20px;
}

/* ===========================================================================
   Landing page (§4.1)
   =========================================================================== */

.hero { margin: 24px 0 72px 0; }
@media (min-width: 700px) { .hero { margin: 48px 0 88px 0; } }
.hero h1 {
  font-size: clamp(32px, 7vw, 52px); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.08; margin-bottom: 20px;
}
.hero h1 .em { color: var(--accent); font-style: normal; }
.lede {
  font-size: clamp(16px, 2.4vw, 19px); color: var(--muted);
  line-height: 1.6; max-width: 580px; margin-bottom: 28px;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.free-tag { color: var(--muted); font-size: 13px; font-family: var(--mono); }

section { margin-bottom: 72px; }

/* Continue card (§8.6) */
.continue-card {
  display: none; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 40px;
  text-decoration: none; color: var(--text);
  box-shadow: inset 0 1px 0 0 var(--sheen);
  transition: border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) { .continue-card:hover { background: var(--panel-2); border-color: #44474e; } }
.continue-card.show { display: flex; }
.continue-card .cc-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 4px;
}
.continue-card .cc-title { font-weight: 600; font-size: 15px; }
.continue-card .cc-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Drill cards */
.drills { display: grid; gap: 12px; }
@media (min-width: 600px) { .drills { grid-template-columns: 1fr 1fr; gap: 14px; } }
.drill-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px;
  box-shadow: inset 0 1px 0 0 var(--sheen);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
@media (hover: hover) {
  .drill-card:hover { border-color: var(--border-strong); background: var(--panel-2); transform: translateY(-2px); }
}
.drill-card:active { border-color: var(--border-strong); }
.drill-card .num {
  font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: 0.06em;
}
.drill-card h3 { font-size: 16px; font-weight: 600; margin: 4px 0 8px 0; letter-spacing: -0.005em; }
.drill-card p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.drill-card .go { font-size: 12px; color: var(--text); margin-top: 10px; font-family: var(--mono); }

/* How it works */
.steps { display: grid; gap: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-n {
  flex-shrink: 0; width: 28px; height: 28px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--muted); font-family: var(--mono); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 0 var(--sheen);
}
.step-body { flex: 1; padding-top: 2px; }
.step-body strong { display: block; margin-bottom: 4px; }
.step-body p { color: var(--muted); font-size: 14px; }

/* Routine */
.routine-box {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
  font-family: var(--mono); font-size: 13px; line-height: 1.8;
}
.routine-box .min { color: var(--accent); }
.routine-box .dash { color: var(--muted); }
.routine-note { color: var(--muted); font-size: 13px; margin-top: 16px; line-height: 1.6; }

/* Origin */
.origin {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px;
}
@media (min-width: 600px) { .origin { padding: 28px; } }
.origin .quote { font-size: 15px; line-height: 1.7; }
.origin .signature { margin-top: 16px; font-size: 13px; color: var(--muted); font-family: var(--mono); }

/* Bottom CTA */
.cta-bottom { text-align: center; padding: 48px 0 24px 0; border-top: 1px solid var(--border); }
.cta-bottom h2 { margin-bottom: 8px; }
.cta-bottom .lede { margin: 0 auto 24px auto; }

/* ===========================================================================
   Footer (all pages)
   =========================================================================== */

footer.site-footer {
  position: relative;
  max-width: 720px; margin: 0 auto;
  padding: 32px 20px calc(40px + var(--safe-bottom)) 20px;
  color: var(--muted); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: space-between; align-items: baseline;
}
/* Divider inset to the content column so it lines up with the frames/text above */
footer.site-footer::before {
  content: ''; position: absolute; top: 0; left: 20px; right: 20px;
  height: 1px; background: var(--border);
}
@media (min-width: 700px) {
  footer.site-footer { padding-left: 32px; padding-right: 32px; }
  footer.site-footer::before { left: 32px; right: 32px; }
}
footer.site-footer a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
footer.site-footer a:hover { border-bottom-color: var(--accent); color: var(--accent); }
footer.site-footer .ack { font-size: 12px; }
footer.site-footer nav { display: flex; gap: 16px; }
footer.site-footer nav a { border-bottom: none; }

/* ===========================================================================
   Drill app (§4.2 / §9)
   =========================================================================== */

body.drill-body { padding-bottom: calc(96px + var(--safe-bottom)); }
.drill-wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 0 16px; }

.drill-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.drill-head h1 { font-size: clamp(20px, 5vw, 26px); font-weight: 600; letter-spacing: -0.01em; }
.drill-head .learn-link { font-size: 13px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.drill-head .learn-link:hover { text-decoration: underline; }

/* "Learn the concepts" promoted block */
.learn-block {
  display: flex; align-items: center; gap: 16px;
  margin: 28px 0 0 0; padding: 18px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255,0.10), rgba(255, 255, 255,0.03));
  border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text);
  transition: border-color 0.18s ease, transform 0.15s ease, background 0.2s ease;
}
@media (hover: hover) {
  .learn-block:hover { border-color: var(--accent); transform: translateY(-2px); }
}
.learn-block:active { transform: translateY(0) scale(0.99); }
.learn-block-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.learn-block-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.learn-block-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.learn-block-arrow {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent); color: var(--accent); font-size: 16px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease;
}
@media (hover: hover) {
  .learn-block:hover .learn-block-arrow { transform: translateX(3px); background: rgba(255, 255, 255,0.12); }
}

.drill-credit { color: var(--muted); font-size: 12px; text-align: center; margin: 20px 0 8px 0; }
.drill-credit a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.drill-credit a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 0 12px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); font-size: 13px; cursor: pointer; border-radius: 8px;
  font-family: inherit; transition: all 0.15s; white-space: nowrap; letter-spacing: -0.01em;
  flex-shrink: 0; scroll-snap-align: start; min-height: 32px;
  display: inline-flex; align-items: center;
}
.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab.active {
  color: var(--text); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 0 var(--sheen);
}

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px;
  box-shadow: inset 0 1px 0 0 var(--sheen), 0 1px 2px 0 rgba(0, 0, 0, 0.5);
}
@media (min-width: 600px) { .panel { padding: 24px; } }

.drill-meta { color: var(--faint); font-size: 11px; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.scenario { font-size: 15px; line-height: 1.65; margin-bottom: 18px; }
.scenario .num { font-family: var(--mono); color: var(--text); white-space: nowrap; }
.scenario .vc { color: var(--vc); }
.question { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.input-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
@media (min-width: 600px) {
  .input-row { flex-direction: row; align-items: center; gap: 12px; }
  .input-row label { min-width: 220px; }
}
.input-row label { color: var(--muted); font-size: 13px; }
input[type="text"] {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 8px; font-family: var(--mono); font-size: 16px;
  outline: none; transition: border-color 0.15s; min-height: 44px;
  -webkit-appearance: none; appearance: none;
}
input[type="text"]:focus { border-color: var(--border-strong); box-shadow: 0 0 0 1px var(--border-strong); }
input.match { border-color: var(--good); }
input.miss { border-color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 16px; border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  border-radius: 8px; font-family: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; min-height: 44px;
  box-shadow: inset 0 1px 0 0 var(--sheen);
  -webkit-appearance: none; appearance: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: #44474e; }
.btn.secondary { background: transparent; color: var(--muted); border-color: var(--border); box-shadow: none; }
.btn.secondary:hover { color: var(--text); border-color: var(--border-strong); }
.actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 140px; }

.feedback {
  margin-top: 22px; padding: 16px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
.feedback.correct { border-color: var(--good); background: rgba(108,212,127,0.06); }
.feedback.wrong { border-color: var(--bad); background: rgba(227,100,100,0.06); }
.feedback.partial { border-color: var(--accent); background: rgba(255, 255, 255,0.06); }
.feedback-title { font-weight: 600; margin-bottom: 10px; font-size: 14px; }
.feedback.correct .feedback-title { color: var(--good); }
.feedback.wrong .feedback-title { color: var(--bad); }
.feedback.partial .feedback-title { color: var(--accent); }

.formula {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  margin: 6px 0; padding: 10px 12px; background: var(--bg); border-radius: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; line-height: 1.55;
}
.formula strong { color: var(--text); }

.verbal-prompt {
  color: var(--accent); font-size: 13px; margin-top: 14px; padding: 12px 14px;
  background: rgba(255, 255, 255,0.06); border-left: 3px solid var(--accent);
  line-height: 1.55; border-radius: 0 6px 6px 0;
}
.verbal-prompt strong { color: var(--text); }

.answers-grid { display: grid; gap: 4px; margin-top: 8px; }
.ans { display: flex; justify-content: space-between; padding: 6px 0; font-family: var(--mono); font-size: 13px; gap: 8px; flex-wrap: wrap; }
.ans .lbl { color: var(--muted); flex: 1; min-width: 160px; }
.ans .got.match { color: var(--good); }
.ans .got.miss { color: var(--bad); }
.ans .truth { color: var(--text); margin-left: 6px; }

/* Sticky stats bar */
.stats-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(10, 10, 10,0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + var(--safe-bottom)) 16px;
  display: flex; gap: 18px; color: var(--muted); font-size: 11px;
  align-items: center; justify-content: space-between; flex-wrap: wrap; z-index: 10;
}
.stats-bar .stat { text-transform: uppercase; letter-spacing: 0.06em; display: flex; flex-direction: column; align-items: flex-start; }
.stats-bar .stat strong {
  color: var(--text); font-family: var(--mono); font-size: 14px;
  margin-top: 2px; text-transform: none; letter-spacing: 0;
}
.stats-bar .stat.streak strong { color: var(--accent); }
.stats-bar .actions-mini { display: flex; gap: 6px; }
#reset-stats { color: var(--muted); text-decoration: none; font-size: 11px; padding: 4px 8px; border-radius: 4px; }
#reset-stats:hover { color: var(--bad); }

/* ===========================================================================
   Learn pages (§4.3 / §8.2 / §8.3 / §8.4)
   =========================================================================== */

/* Reading progress bar */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 120;
  transform: translateY(var(--safe-top));
}
@supports (animation-timeline: scroll()) {
  .progress-bar {
    width: 100%;
    transform-origin: 0 50%;
    transform: translateY(var(--safe-top)) scaleX(0);
    animation: progress-grow linear;
    animation-timeline: scroll(root);
  }
  @keyframes progress-grow { from { transform: translateY(var(--safe-top)) scaleX(0); } to { transform: translateY(var(--safe-top)) scaleX(1); } }
}

.article { max-width: 720px; margin: 0 auto; padding: 24px 20px calc(40px + var(--safe-bottom)) 20px; }
@media (min-width: 700px) { .article { padding: 32px 32px 64px 32px; } }
@media (max-width: 759px) { .article { padding-bottom: calc(88px + var(--safe-bottom)); } } /* room for bottom CTA bar */

.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 16px; font-family: var(--mono); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.5; }

.lesson-indicator { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 12px; }

.article h1 {
  font-size: clamp(28px, 5.5vw, 42px); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.12; margin-bottom: 16px;
}
.article .lede { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); line-height: 1.6; margin-bottom: 20px; }

.read-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.read-meta .read-time { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.article section { margin: 36px 0; }
.article h2 { font-size: clamp(20px, 4vw, 26px); margin-bottom: 14px; }
.article p { line-height: 1.65; margin-bottom: 14px; }
.article p + p { margin-top: -2px; }
.article .vc { color: var(--vc); }
.article .num { font-family: var(--mono); color: var(--accent); white-space: nowrap; }
.article strong { color: var(--text); font-weight: 600; }

.article ul { margin: 0 0 14px 0; padding-left: 0; list-style: none; }
.article ul li { position: relative; padding-left: 22px; margin-bottom: 10px; line-height: 1.6; }
.article ul li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }

/* Formula box (§ section 3) */
.formula-box {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 16px 18px; margin: 8px 0 14px 0;
  font-family: var(--mono); font-size: 13px; line-height: 1.9;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.formula-box .v { color: var(--accent); }
.formula-box .c { color: var(--muted); }

/* Worked example table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 14px 0; }
table.waterfall { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; min-width: 520px; }
table.waterfall th, table.waterfall td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.waterfall th { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
table.waterfall td:first-child { color: var(--text); }
table.waterfall td { color: var(--muted); }

/* Step-by-step worked example */
.worked { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin: 8px 0 14px 0; }
.worked .w-step { display: flex; gap: 12px; padding: 8px 0; line-height: 1.6; }
.worked .w-step + .w-step { border-top: 1px solid var(--border); }
.worked .w-step .w-res { margin-left: auto; font-family: var(--mono); color: var(--accent); white-space: nowrap; }

/* Callout — 30-second meeting line */
.callout {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; margin: 8px 0 14px 0;
}
.callout .callout-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.callout .callout-quote { font-style: italic; font-size: 16px; line-height: 1.65; }

/* Verbal precision drill — accent callout */
.callout.verbal { border-color: var(--border-strong); border-left: 2px solid var(--text); background: rgba(255, 255, 255, 0.05); }
.callout.verbal .callout-label { color: var(--text); }
.callout.verbal .callout-quote { color: var(--text); font-style: normal; }

/* Inline drill CTA at bottom of article */
.article-cta { margin: 40px 0 8px 0; }

/* Lesson navigation (§8.4) */
.lesson-nav { margin: 48px 0 8px 0; padding-top: 32px; border-top: 1px solid var(--border); }
.lesson-nav .ln-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lesson-nav .ln-link { display: flex; flex-direction: column; gap: 2px; text-decoration: none; max-width: 45%; }
.lesson-nav .ln-link.next { text-align: right; align-items: flex-end; }
.lesson-nav .ln-link .ln-dir { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.lesson-nav .ln-link .ln-title { font-size: 14px; font-weight: 600; color: var(--text); }
.lesson-nav .ln-link.disabled { visibility: hidden; }
.lesson-nav .ln-count { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

.lesson-dots { display: flex; gap: 8px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.lesson-dots a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted); text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.lesson-dots a { border-radius: 8px; }
.lesson-dots a:hover { border-color: var(--border-strong); color: var(--text); }
.lesson-dots a.current {
  background: rgba(255, 255, 255, 0.07); color: var(--text); border-color: var(--border-strong); font-weight: 600;
  box-shadow: inset 0 1px 0 0 var(--sheen);
}

/* Bottom CTA bar — mobile only (§8.2) */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: rgba(10, 10, 10,0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + var(--safe-bottom)) 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bottom-bar a.bb-prev { color: var(--muted); text-decoration: none; font-size: 13px; display: flex; align-items: center; min-height: 44px; }
.bottom-bar a.bb-prev.disabled { visibility: hidden; }
.bottom-bar a.bb-drill {
  background: rgba(255, 255, 255, 0.05); color: var(--text); text-decoration: none; font-weight: 600;
  border: 1px solid var(--border-strong); box-shadow: inset 0 1px 0 0 var(--sheen);
  padding: 0 16px; border-radius: 8px; font-size: 13.5px; letter-spacing: -0.01em; min-height: 40px;
  display: flex; align-items: center; gap: 6px;
}
@media (min-width: 760px) { .bottom-bar { display: none; } }

/* Share button */
.share-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 0 12px; font-size: 13px; cursor: pointer; letter-spacing: -0.01em;
  font-family: inherit; min-height: 32px; transition: border-color 0.15s, color 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.share-btn:hover { border-color: var(--accent); color: var(--text); }

/* ===========================================================================
   Motion polish — subtle, fast, and disabled under prefers-reduced-motion
   =========================================================================== */

/* Primary buttons: lift on hover, press on tap */
.btn-primary { transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease; }
@media (hover: hover) { .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px -12px rgba(255, 255, 255, 0.25); } }
.btn-primary:active { transform: translateY(0) scale(0.985); }

.btn-secondary { transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease; }
@media (hover: hover) { .btn-secondary:hover { transform: translateY(-1px); } }
.btn-secondary:active { transform: scale(0.985); }

/* Drill buttons */
.btn { transition: opacity 0.15s ease, transform 0.12s ease; }
.btn:active { transform: scale(0.98); }

/* Nav + menu CTAs */
.nav-links a.nav-cta { transition: color 0.15s ease, background 0.18s ease, transform 0.15s ease; }
.nav-links a.nav-cta:active { transform: scale(0.97); }
.mobile-menu .m-cta { transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22,1,0.36,1), filter 0.15s ease; }
.mobile-menu.open .m-cta:active { transform: scale(0.985); filter: brightness(0.95); }

/* Bottom-bar drill CTA + share */
.bottom-bar a.bb-drill { transition: transform 0.15s ease, box-shadow 0.2s ease; }
.bottom-bar a.bb-drill:active { transform: scale(0.97); }
.share-btn { transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease; }
.share-btn:active { transform: scale(0.96); }

/* Tabs + lesson dots press feedback */
.tab:active { transform: scale(0.96); }
.lesson-dots a:active { transform: scale(0.92); }

/* Brand logo gives a tiny nod on hover */
@media (hover: hover) { .brand:hover .brand-logo { transform: rotate(-4deg) scale(1.05); } }
.brand-logo { transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }

/* Content fade-in: new drill problems, feedback, and the continue card */
@keyframes rr-fade-in-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.scenario { animation: rr-fade-in-up 0.32s ease both; }
.feedback { animation: rr-fade-in-up 0.28s ease both; }
.continue-card.show { animation: rr-fade-in-up 0.4s ease both; }

/* Inputs settle smoothly into pass/fail color */
input[type="text"] { transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }

/* ===========================================================================
   Linear-style frames — a faint top-edge "shiny stroke" on every card surface
   so panels read as lit glass. Very subtle; the intensity lives in the stroke,
   not a fill.
   =========================================================================== */
.formula-box, .callout, .worked, .routine-box, .origin, .learn-block, .feedback {
  box-shadow: inset 0 1px 0 0 var(--sheen);
}
/* The two emphasis frames carry a touch more light + lift off the canvas */
.panel, .continue-card, .learn-block {
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.07), 0 1px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Honor reduced-motion: kill non-essential animation, keep things instant */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Keep the menu functional without motion */
  .mobile-menu, .mobile-menu nav > *, .mobile-menu .m-cta, .mobile-menu .m-foot { transform: none !important; }
}
