/* ── Self-hosted variable fonts (Latin subset) ── */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('./fonts/cormorant-garamond-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
  size-adjust: 105%;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-display: swap;
  font-weight: 300 700;
  src: url('./fonts/cormorant-garamond-latin-wght-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
  size-adjust: 105%;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ===== Custom Properties ===== */

:root {
  --paper: #f5f2ec;
  --paper-warm: #ede6d9;
  --paper-deep: #e4dac8;
  --ink: #2c2a26;
  --ink-soft: #4e473f;
  --ink-muted: #6e6355;
  --ink-faint: #9a8e7c;
  --ink-rgb: 44 42 38;
  --hi-rgb: 255 255 255;
  --red-pen: #b04040;
  --red-pen-soft: #c4604f;
  --mark-repetition: #9c4e28;
  --mark-pacing: #566a8e;
  --mark-style: #7a5290;
  --mark-taught: #2f6e5e;
  --accent-gold: #c4a24e;
  --accent-gold-soft: rgba(196, 162, 78, 0.1);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Dark Theme ===== */

:root.theme-dark {
  --paper: #1a1614;
  --paper-warm: #221d1a;
  --paper-deep: #2a2420;
  --ink: #f5f2ec;
  --ink-soft: #d0c8b8;
  --ink-muted: #b0a595;
  --ink-faint: #8a7e6e;
  --ink-rgb: 245 242 236;
  --hi-rgb: 40 36 32;
  --red-pen: #d06050;
  --red-pen-soft: #e07868;
  --mark-repetition: #eda26e;
  --mark-pacing: #b0caf0;
  --mark-style: #d2ace8;
  --mark-taught: #82dcc4;
  --accent-gold: #d4b462;
  --accent-gold-soft: rgba(212, 180, 98, 0.12);
}

:root.theme-dark body {
  background:
    radial-gradient(circle at top left, rgba(0, 0, 0, 0.4), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(125, 103, 80, 0.05), transparent 24%),
    linear-gradient(180deg, #161210 0%, #1c1715 48%, #14100e 100%);
}

:root.theme-dark .topbar {
  background: rgba(26, 22, 20, 0.82);
}

:root.theme-dark .site-nav .nav-cta {
  background: var(--ink);
  color: var(--red-pen);
  border: 1px solid var(--ink);
}

:root.theme-dark .site-nav .nav-cta:hover {
  background: transparent;
  color: var(--ink);
  border-color: rgb(var(--ink-rgb) / 0.35);
}

:root.theme-dark .btn-primary {
  background: var(--ink);
  color: var(--red-pen);
  border-color: var(--ink);
  box-shadow: 0 4px 20px rgb(var(--ink-rgb) / 0.1);
}

:root.theme-dark .btn-primary:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

:root.theme-dark .demo-panel {
  background: rgb(var(--hi-rgb) / 0.7);
}

:root.theme-dark .panel-quickfix {
  background: rgb(var(--hi-rgb) / 0.12);
}

:root.theme-dark .quickfix-field {
  background: rgb(var(--hi-rgb) / 0.18);
  border-color: rgb(var(--hi-rgb) / 0.15);
}

:root.theme-dark .demo-whisper {
  border-left-color: rgba(237, 162, 110, 0.3);
  background: rgba(237, 162, 110, 0.04);
}

:root.theme-dark .plan.is-featured {
  background: rgb(var(--hi-rgb) / 0.14);
  color: var(--ink);
  border-color: var(--accent-gold);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

:root.theme-dark .plan.is-featured .plan-desc { color: var(--ink-muted); }
:root.theme-dark .plan.is-featured .plan-features li { color: var(--ink-muted); border-color: rgb(var(--ink-rgb) / 0.06); }
:root.theme-dark .plan.is-featured .plan-features li::before { color: var(--accent-gold); }
:root.theme-dark .plan.is-featured .plan-cta { background: var(--accent-gold); color: var(--paper); }
:root.theme-dark .plan.is-featured .plan-cta:hover { filter: brightness(1.1); }
:root.theme-dark .plan:not(.is-featured) { background: rgb(var(--hi-rgb) / 0.4); }

:root.theme-dark .signup-form input {
  background: rgb(var(--hi-rgb) / 0.4);
  border-color: rgb(var(--ink-rgb) / 0.12);
  color: var(--ink);
}

:root.theme-dark .signup-btn {
  background: var(--ink);
  color: var(--red-pen);
}

:root.theme-dark .signup-btn:hover {
  background: var(--ink-soft);
}

:root.theme-dark .how-step { background: var(--paper-warm); }
:root.theme-dark .how-step:hover { background: var(--paper-deep); }

/* ===== Reset & Base ===== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper grain: SVG fractal noise for tactile book-page feel.
   z-index 80 sits above page content but below nav-backdrop (90),
   topbar (100), and scroll-progress (200). */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.028;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 80;
  mix-blend-mode: multiply;
}
:root.theme-dark body::after {
  mix-blend-mode: soft-light;
  opacity: 0.05;
}

::selection { background: var(--accent-gold-soft); color: var(--ink); }
a { color: inherit; }

/* ===== Utilities ===== */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

.skip-link, .skip-demo {
  position: absolute; left: -9999px; top: auto; z-index: 200;
  padding: 0.6em 1.2em; background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 0.85rem;
  border-radius: 6px; text-decoration: none;
}
.skip-link:focus, .skip-demo:focus { left: 1em; top: 1em; }

/* ===== Scroll Progress ===== */

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200; height: 2px; pointer-events: none;
}

.scroll-progress span {
  display: block; height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, rgba(156, 78, 40, 0.9), rgba(86, 106, 142, 0.9), rgba(47, 110, 94, 0.85));
  box-shadow: 0 0 16px rgba(86, 106, 142, 0.25);
}

/* ===== Topbar ===== */

.topbar {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 999px;
  background: rgb(var(--hi-rgb) / 0.82);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgb(var(--ink-rgb) / 0.06);
  box-shadow: 0 8px 40px rgb(var(--ink-rgb) / 0.06);
  opacity: 0; animation: fadeDown 0.8s var(--ease) 0.2s forwards;
  transition: box-shadow 320ms var(--ease), background 320ms var(--ease), border-color 320ms var(--ease);
}

.topbar.is-scrolled {
  background: rgb(var(--hi-rgb) / 0.92);
  border-color: rgb(var(--ink-rgb) / 0.1);
  box-shadow: 0 14px 50px rgb(var(--ink-rgb) / 0.1);
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; min-width: 0;
}

.brand-mark {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--paper-warm);
  border: 1px solid rgb(var(--ink-rgb) / 0.06); overflow: hidden;
}

.brand-logo { width: 80%; height: 80%; object-fit: contain; }

.brand-name {
  font-family: var(--sans); font-weight: 600; font-size: 0.88rem;
  letter-spacing: -0.02em; white-space: nowrap;
}

.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 450;
  text-decoration: none; color: var(--ink-muted);
  padding: 6px 12px; border-radius: 999px;
  transition: all 0.25s var(--ease); white-space: nowrap;
}

.site-nav a:hover { color: var(--ink); background: rgb(var(--ink-rgb) / 0.04); }
.site-nav a.is-current { color: var(--ink); }

.site-nav .nav-cta {
  background: var(--ink); color: var(--paper);
  font-weight: 500; padding: 6px 18px; margin-left: 4px;
}

.site-nav .nav-cta:hover { background: var(--ink-soft); }

.theme-toggle {
  background: none; border: 1px solid rgb(var(--ink-rgb) / 0.1);
  border-radius: 8px; padding: 0.3em 0.45em; cursor: pointer;
  color: var(--ink-muted); font-size: 0.82rem; line-height: 1;
  transition: color 0.2s, border-color 0.2s; display: flex;
  align-items: center; margin-left: 2px;
}

.theme-toggle:hover { color: var(--ink); border-color: rgb(var(--ink-rgb) / 0.2); }
.theme-toggle:focus-visible, .nav-toggle:focus-visible,
.btn:focus-visible, .plan-cta:focus-visible, .signup-btn:focus-visible,
.nav-cta:focus-visible, .site-nav a:focus-visible,
.footer-links a:focus-visible { outline: 2px solid rgb(var(--ink-rgb) / 0.35); outline-offset: 2px; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; padding: 10px;
  background: none; border: none; border-radius: 999px; cursor: pointer;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}

.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--ink);
  border-radius: 999px; transition: transform 220ms var(--ease), opacity 220ms var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.nav-backdrop {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0; background: rgba(0, 0, 0, 0.35); transition: opacity 240ms ease;
}

body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

/* ===== Hero ===== */

.hero {
  min-height: 90vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 140px 24px 100px; position: relative; overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; top: -20%; left: 50%;
  transform: translateX(-50%); width: 900px; height: 900px;
  background: radial-gradient(circle, var(--accent-gold-soft) 0%, transparent 65%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-muted);
  margin-bottom: 40px; opacity: 0; animation: revealUp 0.9s var(--ease) 0.4s forwards;
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
  font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 300; line-height: 1.1; letter-spacing: -0.025em;
  max-width: 780px; margin-bottom: 24px;
  opacity: 0; animation: revealUp 1s var(--ease) 0.6s forwards;
}

.hero h1 em { font-style: italic; font-weight: 400; color: var(--red-pen); }

.hero-sub {
  font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 300;
  color: var(--ink-soft); max-width: 480px; line-height: 1.5; margin-bottom: 12px;
  opacity: 0; animation: revealUp 0.9s var(--ease) 0.85s forwards;
}

.hero-invite {
  font-size: clamp(1rem, 1.8vw, 1.18rem); color: var(--ink-muted);
  max-width: 420px; line-height: 1.6; margin-bottom: 44px;
  opacity: 0; animation: revealUp 0.8s var(--ease) 1.05s forwards;
}

.hero-actions {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 48px; opacity: 0; animation: revealUp 0.7s var(--ease) 1.2s forwards;
}

.hero-proof {
  display: flex; gap: 32px; font-family: var(--sans);
  font-size: 0.78rem; color: var(--ink-faint);
  opacity: 0; animation: revealUp 0.7s var(--ease) 1.35s forwards;
}

.hero-proof span::before {
  content: ''; display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent-gold);
  margin-right: 8px; vertical-align: middle;
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 0.88rem; font-weight: 500;
  text-decoration: none; padding: 14px 32px; border-radius: 999px;
  border: none; cursor: pointer; transition: all 0.3s var(--ease);
}

.btn-primary {
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  box-shadow: 0 4px 20px rgb(var(--ink-rgb) / 0.15);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgb(var(--ink-rgb) / 0.2); }

.btn-ghost {
  background: transparent; color: var(--ink-soft);
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
}

.btn-ghost:hover { background: rgb(var(--ink-rgb) / 0.03); border-color: rgb(var(--ink-rgb) / 0.25); }

/* ===== Section System ===== */

.section-label {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-faint);
  margin-bottom: 20px;
}

.section-heading {
  font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; max-width: 680px;
}

.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ===== Demo ===== */

.demo {
  position: relative;
  padding: 0 1.5rem;
}

.demo-intro {
  text-align: center;
  margin-bottom: 2.5rem;
}

.demo-intro .section-heading { margin: 0 auto 16px; }

.demo-intro p {
  font-size: 1.05rem; color: var(--ink-soft);
  max-width: 480px; margin: 0 auto;
}

.demo-stage {
  display: grid;
  grid-template-columns: 1fr minmax(0, 640px) 40px;
  gap: 0;
  max-width: 760px;
  margin: 0 auto;
}

.manuscript {
  grid-column: 2;
  padding: 2rem 0 6rem;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.85;
  color: var(--ink);
}

.ms-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 500;
  margin-bottom: 2rem;
  text-align: center;
}

.manuscript > p { margin-bottom: 1.2em; text-indent: 0; }
.manuscript em { font-style: italic; }

/* Mark colors */
[data-mark] { text-decoration: none; transition: color 0.5s var(--ease); }
[data-mark]:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

[data-mark="seed"] { color: var(--mark-repetition); }
[data-mark="seed"]:hover { text-decoration-color: var(--mark-repetition); }
[data-mark="fix"] { color: var(--mark-repetition); }
[data-mark="fix"]:hover { text-decoration-color: var(--mark-repetition); }
[data-mark="fix"].fix-applied {
  color: inherit;
  background: var(--accent-gold-soft);
  border-radius: 3px;
  transition: color 0.6s var(--ease), background 1.2s var(--ease);
}
[data-mark="fix"].fix-settled {
  background: transparent;
  transition: background 0.8s var(--ease);
}
[data-mark="pacing"] { color: var(--mark-pacing); }
[data-mark="pacing"]:hover { text-decoration-color: var(--mark-pacing); }
[data-mark="style"] { color: var(--mark-style); cursor: pointer; }
[data-mark="style"]:hover { text-decoration-color: var(--mark-style); }
[data-mark="style"].dismissed { color: inherit; cursor: default; text-decoration: none; }
[data-mark="teach-echo"] { color: var(--mark-repetition); }
[data-mark="teach-echo"]:hover { text-decoration-color: var(--mark-repetition); }

/* Mark chip */
.mark-chip {
  display: inline-block; font-family: var(--serif);
  font-size: 0.7rem; font-weight: 400; font-style: italic;
  letter-spacing: 0.02em; padding: 0 0.3em 0.1em 0;
  border-radius: 2px; margin-left: 0.3em; vertical-align: middle;
  opacity: 0; transition: opacity 0.4s var(--ease);
  color: rgb(var(--ink-rgb) / 0.65);
}

.mark-chip.visible { opacity: 1; }
.mark-chip[data-category="pacing"] { color: var(--mark-pacing); }
.mark-chip[data-category="style"] { color: var(--mark-style); }
.mark-chip[data-category="repetition"] { color: var(--mark-repetition); }

/* Demo panels */
[data-panel="fix"],
[data-panel="teach"] { --panel-color: var(--mark-repetition); }
[data-panel="style"] { --panel-color: var(--mark-style); }

.pro-badge {
  font-size: .5rem; background: var(--mark-style); color: var(--paper);
  padding: .1em .45em; border-radius: 3px; text-transform: uppercase;
  letter-spacing: .03em; vertical-align: middle;
}

.demo-panel {
  border: 1px solid rgb(var(--ink-rgb) / 0.08);
  border-top: 2px solid var(--panel-color, var(--mark-pacing));
  border-radius: 10px;
  padding: 1.1em 1.35em;
  margin: 0.7em 0 0.9em;
  font-family: var(--serif);
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgb(var(--ink-rgb) / 0.7);
  background: rgb(var(--hi-rgb) / 0.5);
  box-shadow: 0 3px 12px rgb(var(--ink-rgb) / 0.05), 0 1px 3px rgb(var(--ink-rgb) / 0.03);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), margin 0.4s var(--ease);
}

.demo-panel.open { max-height: 800px; opacity: 1; }

.demo-panel.collapsed {
  max-height: 0; opacity: 0; margin: 0; padding: 0;
  border: none; box-shadow: none;
}

.panel-category {
  font-family: var(--serif); font-size: 0.78rem; font-weight: 500;
  font-style: italic; letter-spacing: 0.06em;
  color: var(--panel-color, var(--mark-pacing)); margin-bottom: 0.6em;
}

.panel-body {
  color: rgb(var(--ink-rgb) / 0.65); font-family: var(--serif);
  font-size: 0.88rem; margin-bottom: 0.7em;
}

.panel-actions {
  display: flex; gap: 0.65em; padding-top: 0.6em;
  border-top: 1px solid rgb(var(--ink-rgb) / 0.05); flex-wrap: wrap;
}

.panel-btn {
  display: inline-flex; align-items: center; gap: 0.25em;
  padding: 0.25em 0.5em; border: none; border-radius: 3px;
  background: transparent; font-family: var(--sans);
  font-size: 0.6rem; font-weight: 400;
  color: rgb(var(--ink-rgb) / 0.55); cursor: default;
}

.panel-btn kbd {
  font-family: var(--sans); font-size: 0.85em; font-weight: 500;
  color: rgb(var(--ink-rgb) / 0.35);
}

.panel-btn-live {
  cursor: pointer;
  color: rgb(var(--ink-rgb) / 0.7);
  border: 1px solid rgb(var(--ink-rgb) / 0.12);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.panel-btn-live:hover { background: rgb(var(--ink-rgb) / 0.06); }
.panel-btn-live.highlight {
  background: var(--mark-style); color: var(--paper);
  box-shadow: 0 0 14px rgba(122, 82, 144, 0.35);
  transform: scale(1.06);
}
.panel-btn-live.highlight kbd { color: rgba(255,255,255,0.7); }

/* Quick fix */
.panel-quickfix {
  margin: 0.85rem 0 1rem; padding: 0.8rem 0.9rem;
  border: 1px solid rgb(var(--ink-rgb) / 0.08);
  border-radius: 8px; background: rgb(var(--ink-rgb) / 0.025);
}

.panel-quickfix-label {
  font-family: var(--sans); font-size: 0.58rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 0.45rem;
}

.quickfix-field {
  width: 100%; padding: 0.55rem 0.65rem;
  border: 1px solid rgb(var(--ink-rgb) / 0.1);
  border-radius: 6px; background: rgb(var(--hi-rgb) / 0.7);
  font-family: var(--serif); font-size: 0.95rem;
  line-height: 1.45; color: inherit;
}

.quickfix-actions {
  display: flex; gap: 0.75rem; align-items: center;
  justify-content: space-between; margin-top: 0.5rem; flex-wrap: wrap;
}

.quickfix-buttons { display: flex; gap: 0.55rem; align-items: center; }

.quickfix-retry, .quickfix-apply {
  border: 1px solid rgb(var(--ink-rgb) / 0.12); background: transparent;
  border-radius: 999px; padding: 0.4rem 0.8rem; cursor: default;
  font-family: var(--sans); font-size: 0.65rem; color: inherit;
}

.quickfix-note { font-family: var(--sans); font-size: 0.6rem; color: rgb(var(--ink-rgb) / 0.5); }

/* Teach section */
.panel-teach { margin-top: 0.6em; padding-top: 0.6em; }
.teach-label { font-family: var(--sans); font-size: 0.75rem; color: var(--ink-muted); margin-bottom: 0.3em; }
.teach-note { font-style: italic; color: var(--ink); font-family: var(--serif); }

.teach-saved {
  display: flex; align-items: center; gap: 0.4em; margin-top: 0.5em;
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink-muted);
  opacity: 0; transition: opacity 0.4s var(--ease);
}

.teach-saved.visible { opacity: 1; }

.teach-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--mark-repetition);
}

/* Whisper */
.demo-whisper {
  font-family: var(--sans); font-size: 0.78rem; color: var(--ink-muted);
  padding: 0.4em 0.7em; margin: 0.2em 0 1em;
  border-left: 2px solid rgba(156, 78, 40, 0.3);
  background: rgba(156, 78, 40, 0.04);
  border-radius: 0 4px 4px 0;
  opacity: 0; transition: opacity 0.8s var(--ease);
}

.demo-whisper.visible { opacity: 1; }

.whisper-check { color: var(--mark-repetition); margin-right: 0.3em; font-size: 0.85em; }

/* Demo rail */
.demo-rail {
  grid-column: 3; position: sticky; top: 50%;
  transform: translateY(-50%); height: fit-content;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 1em 0;
  opacity: 0; transition: opacity 0.5s var(--ease);
}

.demo-rail.visible { opacity: 1; }

.rail-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-muted); opacity: 0;
  transition: opacity 0.4s var(--ease), transform 0.3s var(--ease), background 0.4s var(--ease);
}

.rail-dot.active { opacity: 1; }
.rail-dot.emphasis { transform: scale(1.4); }
.rail-dot.learned { opacity: 0.5; background: var(--mark-taught); }
.rail-dot[data-category="pacing"] { background: var(--mark-pacing); }
.rail-dot[data-category="style"] { background: var(--mark-style); }
.rail-dot[data-category="repetition"] { background: var(--mark-repetition); }

/* ===== Pull Quote ===== */

.pull-quote { padding: 100px 24px; text-align: center; }

.pull-quote blockquote {
  font-family: var(--serif); font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 300; font-style: italic; line-height: 1.35;
  max-width: 700px; margin: 0 auto; color: var(--ink-soft);
}

.pull-quote .pq-accent { color: var(--red-pen-soft); font-weight: 400; }

/* ===== How It Works ===== */

.how-section { padding: 120px 24px; }

.how-inner { max-width: 1100px; margin: 0 auto; }
.how-header { text-align: center; margin-bottom: 80px; }
.how-header .section-heading { margin: 0 auto; }

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }

.how-step {
  padding: 44px 36px; position: relative;
  background: var(--paper-warm); transition: background 0.4s;
}

.how-step:first-child { border-radius: 20px 0 0 20px; }
.how-step:last-child { border-radius: 0 20px 20px 0; }
.how-step:hover { background: var(--paper-deep); }

.how-step-num {
  font-family: var(--serif); font-size: 3.2rem; font-weight: 300;
  color: rgb(var(--ink-rgb) / 0.12); line-height: 1;
  margin-bottom: 20px; transition: color 0.4s;
}

.how-step:hover .how-step-num { color: var(--red-pen-soft); }

.how-step h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; margin-bottom: 12px; letter-spacing: -0.01em; }
.how-step p { font-family: var(--sans); font-size: 0.86rem; line-height: 1.65; color: var(--ink-muted); }

.how-guide-link { text-align: center; margin-top: 48px; }
.how-guide-link a {
  font-family: var(--sans); font-size: 0.86rem; color: var(--ink-muted);
  text-decoration: none; border-bottom: 1px solid rgb(var(--ink-rgb) / 0.12);
  padding-bottom: 2px; transition: color 0.2s, border-color 0.2s;
}
.how-guide-link a:hover { color: var(--ink); border-bottom-color: var(--ink-soft); }

/* ===== Who ===== */

.who-section { padding: 80px 24px 120px; }
.who-inner { max-width: 800px; margin: 0 auto; }
.who-inner .section-heading { margin-bottom: 20px; }

.who-body { font-size: 1.08rem; color: var(--ink-soft); margin-bottom: 40px; line-height: 1.75; }

.who-list { list-style: none; display: grid; gap: 2px; }

.who-list li {
  font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft);
  padding: 16px 22px; background: var(--paper-warm);
  display: flex; align-items: center; gap: 14px;
}

.who-list li:first-child { border-radius: 14px 14px 0 0; }
.who-list li:last-child { border-radius: 0 0 14px 14px; }

.who-list li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-gold); flex-shrink: 0;
}

/* ===== Pricing ===== */

.pricing-section { padding: 100px 24px 120px; }
.pricing-header { text-align: center; margin-bottom: 60px; }
.pricing-header .section-heading { margin: 0 auto 12px; }
.pricing-header p { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-muted); max-width: 500px; margin: 0 auto; }

.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; max-width: 1060px; margin: 0 auto;
}

.plan {
  background: rgb(var(--hi-rgb) / 0.7); border-radius: 20px;
  padding: 36px 32px; border: 1px solid rgb(var(--ink-rgb) / 0.06);
  box-shadow: 0 2px 16px rgb(var(--ink-rgb) / 0.03);
  display: flex; flex-direction: column; transition: all 0.35s var(--ease);
}

.plan:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgb(var(--ink-rgb) / 0.08); }

.plan.is-featured {
  background: var(--ink); color: var(--paper);
  border-color: transparent; box-shadow: 0 24px 64px rgb(var(--ink-rgb) / 0.18);
  transform: scale(1.03);
}

.plan.is-featured:hover { transform: scale(1.03) translateY(-4px); }

.plan-name { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.plan.is-featured .plan-name { color: var(--accent-gold); }

.plan-price { font-family: var(--serif); font-size: 2.8rem; font-weight: 300; letter-spacing: -0.03em; margin-bottom: 6px; }
.plan-price span { font-size: 0.9rem; color: var(--ink-faint); }
.plan.is-featured .plan-price span { color: rgb(var(--hi-rgb) / 0.5); }

.plan-desc { font-family: var(--sans); font-size: 0.84rem; line-height: 1.55; color: var(--ink-muted); margin-bottom: 28px; }
.plan.is-featured .plan-desc { color: rgb(var(--hi-rgb) / 0.6); }

.plan-features { list-style: none; margin-bottom: 32px; flex-grow: 1; }

.plan-features li {
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink-muted);
  padding: 7px 0; border-bottom: 1px solid rgb(var(--ink-rgb) / 0.04);
  display: flex; align-items: baseline; gap: 10px;
}

.plan.is-featured .plan-features li { color: rgb(var(--hi-rgb) / 0.55); border-color: rgb(var(--hi-rgb) / 0.08); }

.plan-features li::before { content: '\2014'; color: var(--ink-faint); flex-shrink: 0; }
.plan.is-featured .plan-features li::before { color: var(--accent-gold); }

.plan-cta {
  display: block; text-align: center; font-family: var(--sans);
  font-size: 0.84rem; font-weight: 500; text-decoration: none;
  padding: 14px 24px; border-radius: 12px; transition: all 0.25s;
  background: rgb(var(--ink-rgb) / 0.04); color: var(--ink);
  border: none; cursor: pointer;
}

.plan-cta:hover { background: rgb(var(--ink-rgb) / 0.08); }
.plan.is-featured .plan-cta { background: var(--paper); color: var(--ink); }
.plan.is-featured .plan-cta:hover { background: var(--paper-warm); }

.plan-note { text-align: center; font-family: var(--sans); font-size: 0.8rem; color: var(--ink-faint); margin-top: 24px; }

/* ===== Trust ===== */

.trust-section { padding: 80px 24px; text-align: center; }
.trust-inner { max-width: 640px; margin: 0 auto; }
.trust-inner .section-heading { margin: 0 auto 28px; }

.trust-intro {
  font-family: var(--sans); font-size: 0.92rem; color: var(--ink-muted);
  line-height: 1.65; margin: 20px auto 0; max-width: 560px;
  text-align: left;
}
.trust-points { list-style: none; text-align: left; display: grid; gap: 16px; }
.trust-section .trust-inner + .trust-inner .trust-points {
  max-width: 560px; margin: 8px auto 0;
}
.trust-section .trust-inner + .trust-inner .trust-link {
  display: block; max-width: 560px; margin-left: auto; margin-right: auto;
}

.trust-points li {
  font-family: var(--sans); font-size: 0.88rem; color: var(--ink-muted);
  line-height: 1.6; padding-left: 20px; position: relative;
}

.trust-points li::before {
  content: ''; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--mark-taught);
}

.trust-detail { text-align: left; margin-top: 24px; }
.trust-detail p { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-muted); line-height: 1.7; margin: 0 0 12px; }
.trust-detail a { color: var(--accent-gold); }

.trust-link { display: inline-block; margin-top: 20px; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-muted); }

/* ===== Kit section (homepage) ===== */
.kit-section { background: rgb(var(--ink-rgb) / 0.02); position: relative; }
.kit-section::before {
  content: ''; position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  width: 1px; height: 44px;
  background: linear-gradient(180deg, transparent, rgb(var(--ink-rgb) / 0.18));
}

.kit-tile {
  transition: background 0.4s, transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  transition-delay: 0ms;
}
.kit-tile:nth-child(2) { transition-delay: 80ms; }
.kit-tile:nth-child(3) { transition-delay: 160ms; }
.kit-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -28px rgb(var(--ink-rgb) / 0.25);
  z-index: 1;
}

.kit-tile h3 {
  position: relative; display: inline-block;
}
.kit-tile h3::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1.5px;
  background: var(--red-pen-soft);
  transform: scaleX(0); transform-origin: left;
  transition: transform 600ms var(--ease) 120ms;
  opacity: 0.45;
}
.kit-tile.is-visible h3::after { transform: scaleX(0.32); }
.kit-tile:hover h3::after { transform: scaleX(1); opacity: 0.7; }

.kit-demo {
  height: 96px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  position: relative;
  opacity: 0.78;
  transition: opacity 400ms var(--ease), color 400ms var(--ease);
}
.kit-tile:hover .kit-demo { opacity: 1; color: var(--ink); }

.kit-tag {
  font-family: var(--sans); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-faint); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.kit-tag .pro-badge { font-size: 0.6rem; }

/* --- Files demo: doc + comment bubble --- */
.kit-doc {
  position: relative; width: 58px; height: 74px;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: rgb(var(--ink-rgb) / 0.02);
  padding: 12px 8px; display: flex; flex-direction: column; gap: 6px;
  transform: rotate(-3deg);
  transition: transform 500ms var(--ease);
}
.kit-tile:hover .kit-doc { transform: rotate(-1deg) translateX(-4px); }
.kit-doc-line {
  height: 2px; background: currentColor; opacity: 0.35; border-radius: 1px;
}
.kit-doc-line.short { width: 62%; }

.kit-bubble {
  position: absolute; top: 14px; left: calc(50% + 18px);
  width: 62px; padding: 8px 10px;
  border-radius: 8px 8px 8px 2px;
  background: var(--accent-gold-soft, rgba(176, 64, 64, 0.08));
  border: 1px solid var(--red-pen-soft);
  display: flex; flex-direction: column; gap: 4px;
  opacity: 0; transform: translate(-10px, 6px) scale(0.92);
  transition: opacity 500ms var(--ease) 300ms, transform 500ms var(--ease) 300ms;
}
.kit-bubble::after {
  content: ''; position: absolute; left: -6px; bottom: 0;
  width: 6px; height: 6px;
  background: var(--accent-gold-soft, rgba(176, 64, 64, 0.08));
  border-left: 1px solid var(--red-pen-soft);
  border-bottom: 1px solid var(--red-pen-soft);
  border-radius: 0 0 0 2px;
}
.kit-bubble-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red-pen-soft);
}
.kit-bubble-line {
  height: 2px; background: var(--red-pen-soft); opacity: 0.4; border-radius: 1px;
}
.kit-bubble-line.short { width: 58%; }
.kit-tile.is-visible .kit-bubble {
  opacity: 1; transform: translate(0, 0) scale(1);
}

/* --- Arc demo: tension curve draws in --- */
.kit-arc { width: 180px; height: 72px; overflow: visible; }
.kit-arc-line {
  fill: none;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
}
.kit-tile.is-visible .kit-arc-line {
  animation: kitArcDraw 1600ms var(--ease) 200ms forwards;
}
@keyframes kitArcDraw { to { stroke-dashoffset: 0; } }

.kit-arc-dot {
  fill: var(--red-pen-soft);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.3);
}
.kit-tile.is-visible .kit-arc-dot:nth-of-type(1) { animation: kitDotIn 500ms var(--ease) 900ms forwards; }
.kit-tile.is-visible .kit-arc-dot:nth-of-type(2) { animation: kitDotIn 500ms var(--ease) 1250ms forwards; }
.kit-tile.is-visible .kit-arc-dot:nth-of-type(3) { animation: kitDotIn 500ms var(--ease) 1600ms forwards; }
@keyframes kitDotIn {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { opacity: 1; transform: scale(1.4); }
  100% { opacity: 1; transform: scale(1); }
}
.kit-tile:hover .kit-arc-line { stroke-width: 2; }

/* --- Swap demo: struck-through word becomes replacement --- */
.kit-swap {
  font-family: var(--serif); font-style: italic; font-size: 1.15rem;
  color: var(--ink-soft); text-align: center; line-height: 1.4;
  margin: 0;
}
.kit-swap del {
  color: rgb(var(--ink-rgb) / 0.45);
  text-decoration: line-through;
  text-decoration-color: var(--red-pen-soft);
  text-decoration-thickness: 1.5px;
  margin-right: 0.35em;
  transition: color 400ms;
}
.kit-swap ins {
  color: var(--red-pen-soft);
  text-decoration: none; font-weight: 500;
  opacity: 0;
  display: inline-block;
  transform: translateY(6px);
  transition: opacity 550ms var(--ease) 700ms, transform 550ms var(--ease) 700ms, color 400ms;
}
.kit-tile.is-visible .kit-swap ins { opacity: 1; transform: translateY(0); }
.kit-tile:hover .kit-swap del { color: rgb(var(--ink-rgb) / 0.25); }
.kit-tile:hover .kit-swap ins { color: var(--ink); }

/* ===== Terms page ===== */
.terms-agreement {
  padding: 20px 24px 96px;
}
.terms-inner {
  max-width: 38rem; margin: 0 auto;
  position: relative;
}
.terms-inner::before {
  content: ''; position: absolute; left: -1px; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgb(var(--ink-rgb) / 0.1) 8%, rgb(var(--ink-rgb) / 0.1) 92%, transparent);
}
.terms-header {
  margin-bottom: 56px; text-align: center;
  padding-left: 28px;
}
.terms-heading {
  font-family: var(--serif); font-size: 2rem; font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.15; color: var(--ink);
  margin: 8px 0 0;
}
.terms-heading em {
  font-style: italic; color: var(--red-pen-soft); font-weight: 400;
}

.terms-article {
  position: relative;
  padding: 18px 0 18px 64px;
  margin: 0;
  border-top: 1px solid rgb(var(--ink-rgb) / 0.06);
  transition: background 400ms var(--ease);
}
.terms-article:first-of-type { border-top: none; }
.terms-article:hover {
  background: rgb(var(--ink-rgb) / 0.015);
}
.terms-article::before {
  content: attr(data-num);
  position: absolute;
  left: 0; top: 22px;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 300;
  font-feature-settings: "lnum";
  color: rgb(var(--ink-rgb) / 0.22);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 400ms var(--ease), transform 400ms var(--ease);
  width: 48px;
}
.terms-article:hover::before,
.terms-article:focus-within::before {
  color: var(--red-pen-soft);
  transform: translateX(-2px);
}
.terms-article::after {
  content: ''; position: absolute;
  left: 48px; top: 28px; bottom: 28px;
  width: 1px;
  background: var(--red-pen-soft);
  opacity: 0; transform: scaleY(0.4); transform-origin: top;
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.terms-article.is-visible::after { opacity: 0.35; transform: scaleY(1); }
.terms-article:hover::after { opacity: 0.7; }

.terms-article h3 {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 400;
  font-style: italic;
  margin: 0 0 10px; color: var(--ink);
  letter-spacing: -0.005em;
}
.terms-article p {
  font-family: var(--sans); font-size: 0.92rem; line-height: 1.72;
  color: var(--ink-muted); margin: 0 0 10px;
}
.terms-article p:last-child { margin-bottom: 0; }
.terms-article a {
  color: var(--ink);
  border-bottom: 1px solid rgb(var(--ink-rgb) / 0.3);
  text-decoration: none;
  transition: border-color 200ms, color 200ms;
}
.terms-article a:hover {
  color: var(--red-pen-soft);
  border-bottom-color: var(--red-pen-soft);
}
.terms-effective {
  font-family: var(--serif); font-style: italic;
  font-size: 0.9rem; color: var(--ink-faint);
  margin-top: 20px !important;
  padding-top: 14px;
  border-top: 1px dashed rgb(var(--ink-rgb) / 0.1);
}

@media (max-width: 640px) {
  .terms-article { padding-left: 48px; }
  .terms-article::before { font-size: 1.35rem; width: 36px; }
  .terms-article::after { left: 36px; }
  .terms-heading { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .kit-tile.is-visible .kit-bubble,
  .kit-tile.is-visible .kit-swap ins { opacity: 1; transform: none; }
  .kit-tile.is-visible .kit-arc-line { stroke-dashoffset: 0; animation: none; }
  .kit-tile.is-visible .kit-arc-dot { opacity: 1; animation: none; }
  .kit-tile h3::after { transform: scaleX(0.32); }
  .terms-article.is-visible::after { opacity: 0.35; transform: scaleY(1); }
}

/* ===== Privacy page: data path diagram ===== */
.path-diagram {
  margin: 32px auto 12px; max-width: 620px; position: relative;
}
.path-svg { width: 100%; height: auto; display: block; color: var(--ink-muted); overflow: visible; }
.path-svg .path-node circle {
  fill: rgb(var(--ink-rgb) / 0.02);
  stroke: currentColor; stroke-width: 1;
  transition: fill 400ms var(--ease), stroke 400ms var(--ease);
}
.path-svg .path-node rect,
.path-svg .path-node line,
.path-svg .path-node path {
  stroke: currentColor; stroke-width: 1.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.path-svg .path-node text {
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; fill: var(--ink-muted);
}
.path-svg .path-wire {
  stroke: currentColor; stroke-width: 1; fill: none;
  stroke-dasharray: 3 3; opacity: 0.45; color: var(--ink-faint);
}
.path-svg .path-wire-return { opacity: 0.3; }
.path-svg .path-packet {
  fill: var(--red-pen-soft);
  filter: drop-shadow(0 0 4px rgb(196 96 79 / 0.45));
}
.path-diagram:hover .path-svg .path-node circle {
  fill: var(--accent-gold-soft);
  stroke: var(--ink);
}
.path-caption {
  font-family: var(--serif); font-style: italic; font-size: 0.98rem;
  color: var(--ink-muted); margin-top: 14px; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .path-svg .path-packet { display: none; }
}

/* ===== FAQ ===== */

.faq-section { padding: 80px 24px 120px; max-width: 740px; margin: 0 auto; }
.faq-section .section-heading { margin-bottom: 48px; }
.faq-section details { border-bottom: 1px solid rgb(var(--ink-rgb) / 0.08); }

.faq-section summary {
  font-family: var(--serif); font-size: 1.08rem; font-weight: 500;
  padding: 18px 0; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; transition: color 0.2s;
}

.faq-section summary:hover { color: var(--red-pen); }

.faq-section summary::after {
  content: '+'; font-family: var(--sans); font-weight: 300;
  font-size: 1.3rem; color: var(--ink-faint); flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.faq-section details[open] summary::after { transform: rotate(45deg); }
.faq-section summary::-webkit-details-marker { display: none; }

.faq-section details p {
  font-family: var(--sans); font-size: 0.88rem; line-height: 1.7;
  color: var(--ink-muted); padding-bottom: 18px; max-width: 580px;
}

/* ===== CTA ===== */

.cta-section { padding: 120px 24px; text-align: center; position: relative; overflow: hidden; }

.cta-section::before {
  content: ''; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%); width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(176, 64, 64, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.cta-section h2 { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 300; letter-spacing: -0.025em; margin-bottom: 16px; }
.cta-sub { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-muted); margin-bottom: 40px; }

.signup-form {
  display: flex; gap: 8px; max-width: 420px;
  margin: 0 auto 16px; justify-content: center;
}

.signup-form input {
  flex: 1; font-family: var(--sans); font-size: 0.9rem;
  padding: 14px 20px; border-radius: 14px;
  border: 1px solid rgb(var(--ink-rgb) / 0.12);
  background: rgb(var(--hi-rgb) / 0.7); color: var(--ink);
  outline: none; transition: border-color 0.25s;
}

.signup-form input:focus { border-color: var(--red-pen-soft); }
.signup-form input[aria-invalid="true"] { border-color: var(--red-pen); box-shadow: 0 0 0 3px rgba(176, 64, 64, 0.12); }

.signup-btn {
  font-family: var(--sans); font-size: 0.88rem; font-weight: 500;
  padding: 14px 28px; border-radius: 14px; background: var(--ink);
  color: var(--paper); border: none; cursor: pointer;
  white-space: nowrap; transition: all 0.25s;
}

.signup-btn:hover { background: var(--ink-soft); }
.signup-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.signup-status { font-family: var(--sans); font-size: 0.82rem; min-height: 1.2em; margin-bottom: 8px; }
.signup-status.error { color: var(--red-pen); }
.signup-status.success { color: var(--mark-taught); }
.cta-fine { font-family: var(--sans); font-size: 0.75rem; color: var(--ink-faint); margin-bottom: 24px; }

.cta-secondary {
  display: inline-block; margin-top: 1rem;
  font-family: var(--sans); font-size: 0.85rem; color: var(--ink-muted);
}

/* ===== Footer ===== */

.site-footer { padding: 40px 24px; border-top: 1px solid rgb(var(--ink-rgb) / 0.06); }

.footer-inner {
  max-width: 1100px; margin: 0 auto; display: flex;
  justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}

.footer-brand { text-decoration: none; }
.footer-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.footer-brand .brand-name { font-size: 0.82rem; }

.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-faint); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--ink); }

/* ===== Responsive ===== */

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed; inset: 85px 12px auto; z-index: 95;
    flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 18px; border-radius: 20px;
    border: 1px solid rgb(var(--ink-rgb) / 0.08);
    background: var(--paper);
    box-shadow: 0 28px 80px rgb(var(--ink-rgb) / 0.15);
    visibility: hidden; opacity: 0; transform: translateY(-10px);
    transition: opacity 250ms ease, transform 250ms ease, visibility 0s 250ms;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }

  body.nav-open .site-nav {
    visibility: visible; opacity: 1; transform: translateY(0);
    transition: opacity 250ms ease, transform 250ms ease, visibility 0s 0s;
  }

  .site-nav a { width: 100%; padding: 10px 14px; font-size: 0.9rem; }
  .site-nav .nav-cta { margin-left: 0; margin-top: 4px; text-align: center; width: 100%; display: block; }
  .theme-toggle { margin-top: 6px; }

  .topbar {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: var(--paper); overflow: visible;
  }

  .topbar,
  :root.theme-dark .topbar,
  .topbar.is-scrolled,
  :root.theme-dark .topbar.is-scrolled {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: var(--paper); transform: translateX(-50%);
  }

  .how-grid { grid-template-columns: 1fr; gap: 0; }
  .how-step { border-radius: 0 !important; }
  .how-step:first-child { border-radius: 20px 20px 0 0 !important; }
  .how-step:last-child { border-radius: 0 0 20px 20px !important; }

  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .plan.is-featured { transform: none; }
  .plan.is-featured:hover { transform: translateY(-4px); }

  .hero-proof { flex-direction: column; gap: 10px; }
}

@media (max-width: 600px) {
  .topbar { top: 12px; padding: 8px 10px 8px 14px; gap: 8px; }
  .hero { padding: 120px 20px 80px; min-height: 80vh; }
  .signup-form { flex-direction: column; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* Touch targets: theme toggle, nav links */
  .theme-toggle { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .site-nav a { min-height: 44px; display: flex; align-items: center; }

  /* Skip-demo: visible on mobile so users can bypass the 2700px scroll-driven demo */
  .skip-demo {
    position: static; left: auto; top: auto;
    display: block; width: fit-content; margin: 0 auto 1.5rem;
    padding: 0.55em 1.4em; border-radius: 999px;
    font-size: 0.72rem; letter-spacing: 0.04em;
    border: 1px solid rgb(var(--ink-rgb) / 0.12);
    background: rgb(var(--hi-rgb) / 0.06); color: var(--ink-muted);
    text-decoration: none;
  }

  .demo { padding: 0 1rem; }
  .demo-stage { grid-template-columns: 1fr; }
  .manuscript { grid-column: 1; font-size: 1rem; line-height: 1.78; padding-bottom: 4rem; }
  .manuscript > p { margin-bottom: 1.05em; }

  .mark-chip { display: block; width: fit-content; margin: 0.45rem 0 0; }
  .demo-panel { padding: 0.8em 0.9em; }
  .panel-actions { flex-wrap: wrap; }

  .demo-rail {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    transform: none; flex-direction: row; justify-content: center;
    gap: 10px; padding: 0.5em; background: var(--paper);
    border-top: 1px solid rgb(var(--ink-rgb) / 0.08); z-index: 10;
  }

  .scroll-progress { height: 2px; }
}

/* ===== Reduced Motion ===== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .hero h1, .hero-sub, .hero-invite, .hero-actions,
  .hero-proof, .hero-eyebrow { opacity: 1; transform: none; }
  .topbar { opacity: 1; transform: translateX(-50%); animation: none; }
  [data-mark], .mark-chip, .demo-panel, .teach-saved,
  .demo-whisper, .topbar, .demo-rail, .rail-dot,
  .nav-toggle span, .theme-toggle, .nav-backdrop { transition: none; }
}
