:root {
  --paper: #f4f1e8;
  --paper-deep: #e9e4d7;
  --ink: #171815;
  --muted: #686960;
  --line: #cbc6b8;
  --acid: #d9ff57;
  --acid-deep: #b9e432;
  --orange: #ff6a3d;
  --terminal: #161916;
  --white: #fffef8;
  --max: 1240px;
}

html[data-theme="dark"] {
  --paper: #11130f;
  --paper-deep: #191c16;
  --ink: #f2f0e7;
  --muted: #b1b5aa;
  --line: #3a3e35;
  --acid: #cffa52;
  --acid-deep: #a8d52f;
  --orange: #ff7a52;
  --terminal: #080a07;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
.theme-toggle {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
  min-width: 92px;
  padding: .68rem .82rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
}
.theme-toggle:hover { transform: translateY(-2px); }
.theme-toggle:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
a { color: inherit; text-underline-offset: .22em; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--ink); color: white; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.site-header {
  width: min(calc(100% - 3rem), var(--max));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: block; width: 36px; height: 36px; border-radius: 8px; }
.version-badge { padding: .16rem .45rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 1.65rem; font-size: .86rem; font-weight: 650; }
nav a { text-decoration: none; }
.nav-cta { padding: .58rem .85rem; border: 1px solid var(--ink); border-radius: 5px; }

.hero, .section, footer { width: min(calc(100% - 3rem), var(--max)); margin-left: auto; margin-right: auto; }
.hero { min-height: 720px; display: grid; grid-template-columns: 1.03fr .97fr; gap: 6vw; align-items: center; padding: 5.5rem 0 6rem; }
.eyebrow { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.2rem; color: #505249; font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow span { display: block; width: 28px; height: 2px; background: var(--orange); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 740px; margin-bottom: 1.5rem; font-size: clamp(3.5rem, 6.4vw, 6.75rem); line-height: .93; letter-spacing: -.065em; font-weight: 850; }
.lede { max-width: 660px; color: #4d4f47; font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: .78rem 1.1rem; border: 1px solid var(--ink); border-radius: 5px; font-weight: 800; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); }
.button.primary { background: var(--ink); color: var(--white); }
.button.secondary { background: transparent; }
.trust-row { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; margin: 2.2rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .79rem; font-weight: 700; }
.trust-row li::before { content: "✓"; margin-right: .38rem; color: #597400; }

.terminal-wrap { position: relative; }
.terminal-wrap::before { content: ""; position: absolute; inset: -28px 20px 25px -28px; z-index: -1; background: var(--acid); border-radius: 18px; transform: rotate(-2deg); }
.terminal { overflow: hidden; background: var(--terminal); color: #f1f4e8; border: 1px solid #080908; border-radius: 12px; box-shadow: 0 28px 70px rgba(25,25,18,.22); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.terminal-bar { display: flex; align-items: center; gap: .4rem; height: 46px; padding: 0 1rem; background: #222620; border-bottom: 1px solid #343a31; }
.terminal-bar span { width: 10px; height: 10px; border-radius: 99px; background: #6b7165; }
.terminal-bar span:first-child { background: var(--orange); }
.terminal-bar p { margin: 0 auto 0 .6rem; color: #a6ac9e; font-size: .7rem; }
.terminal-body { padding: 1.5rem; }
.terminal-body p { margin-bottom: .55rem; }
.prompt { color: var(--acid); }
.muted { color: #8f9788; }
.finding { margin-top: 1.25rem; padding: 1rem; border-left: 2px solid var(--acid); background: #1d211c; }
.line { color: #d9ded2; }
.tag { display: inline-block; margin-right: .45rem; padding: .12rem .38rem; background: var(--acid); color: #151712; font-size: .64rem; font-weight: 900; }
.tag.warn { background: #ffc254; }
.scan-end { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid #343a31; color: #c4cabd; }
.ok { color: var(--acid); }
.caption { margin: .8rem 0 0; color: var(--muted); font-size: .72rem; }

.section { padding: 7rem 0; border-top: 1px solid var(--line); }
.section-label { margin-bottom: 2rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h2 { font-size: clamp(2.4rem, 4.5vw, 4.8rem); line-height: 1.02; letter-spacing: -.05em; }
.problem-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 9vw; }
.body-copy { color: #44463f; font-size: 1.12rem; }
.body-copy p + p { margin-top: 1.25rem; }
.residue-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 1.3rem; margin-top: 5rem; }
.residue-flow > div:not(.flow-arrow) { min-height: 190px; padding: 1.4rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.28); }
.residue-flow span { display: block; margin-bottom: 2.2rem; color: var(--orange); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }
.residue-flow strong { display: block; margin-bottom: .5rem; font-size: 1.06rem; }
.residue-flow p { margin: 0; color: var(--muted); font-size: .88rem; }
.flow-arrow { color: #77786f; font-size: 1.5rem; }
.symptoms-intro { display: grid; grid-template-columns: .75fr 1.25fr; gap: 8vw; }
.symptoms-intro .section-label { grid-column: 1 / -1; margin-bottom: 0; }
.symptoms-intro h2 { font-size: clamp(2.4rem, 4.2vw, 4.5rem); }
.symptoms-intro > p { color: var(--muted); font-size: 1.12rem; }
.symptom-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 3rem; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.symptom-grid article { min-height: 190px; padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.symptom-grid h3 { font-size: 1.1rem; }
.symptom-grid p { color: var(--muted); }
.symptom-grid code { color: #4e6800; font-weight: 700; }
.diagnostic-boundary { margin-top: 2rem; padding: 1.5rem; background: var(--acid); border-radius: 8px; }
.diagnostic-boundary strong { display: block; margin-bottom: .45rem; }
.diagnostic-boundary p { max-width: 900px; color: #3f432f; }
.diagnostic-boundary a { font-weight: 800; }

.signals { display: grid; grid-template-columns: .7fr 1.3fr; gap: 7vw; }
.section-heading { position: sticky; top: 2rem; align-self: start; }
.section-heading p { max-width: 430px; color: var(--muted); }
.signal-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.signal-grid article { min-height: 250px; padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.signal-no { display: block; margin-bottom: 3rem; color: var(--orange); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; text-transform: uppercase; }
.signal-grid h3 { margin-bottom: .7rem; font-size: 1.17rem; }
.signal-grid p { color: var(--muted); font-size: .9rem; }
.signal-grid .principle { background: var(--acid); }
.principle blockquote { margin: 0 0 1rem; font-size: 1.7rem; font-weight: 850; letter-spacing: -.04em; }
.principle p { color: #383c2b; }

.boundary-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8vw; padding: 4rem; background: var(--ink); color: var(--white); border-radius: 12px; }
.boundary-card h2 { margin-bottom: 0; }
.boundary-list > div { display: grid; grid-template-columns: .55fr 1fr; gap: 2rem; padding: 1.2rem 0; border-top: 1px solid #3e413b; }
.boundary-list span { font-weight: 800; }
.boundary-list p { margin: 0; color: #afb2aa; }
.boundary-list code { color: var(--acid); }

.try { display: grid; grid-template-columns: 1.15fr .85fr; gap: 8vw; align-items: center; }
.try-copy > p { max-width: 650px; color: var(--muted); font-size: 1.08rem; }
.command { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 1rem; margin-top: 2rem; padding: 1.1rem; background: var(--terminal); color: #e9eee1; border-radius: 8px; }
.command code { overflow-x: auto; white-space: nowrap; font-size: .78rem; line-height: 1.8; }
.command button { padding: .45rem .65rem; border: 1px solid #62685d; border-radius: 4px; background: transparent; color: var(--acid); cursor: pointer; font: inherit; font-size: .7rem; font-weight: 800; }
.fine-print { margin-top: .7rem; font-size: .76rem !important; }
.compatibility { margin-top: -.25rem; font-size: .82rem !important; font-weight: 700; }
.feedback-card { padding: 2rem; background: var(--acid); border-radius: 10px; box-shadow: 12px 12px 0 var(--ink); }
.feedback-card h3 { font-size: 1.7rem; line-height: 1.1; letter-spacing: -.035em; }
.feedback-card p:not(.eyebrow) { color: #414531; }
.feedback-card > a { display: block; padding: .8rem 0; border-top: 1px solid rgba(23,24,21,.3); font-weight: 800; text-decoration: none; }

.evidence { background-image: linear-gradient(to right, transparent 49.95%, var(--line) 50%, transparent 50.05%); }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; }
.evidence-grid h2 { font-size: clamp(2.2rem, 3.7vw, 4rem); }
.evidence-grid p { color: var(--muted); }
.source-links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2rem; font-weight: 800; }
.faq { display: grid; grid-template-columns: .75fr 1.25fr; gap: 8vw; }
.faq-intro { position: sticky; top: 2rem; align-self: start; }
.faq-intro > p { max-width: 430px; color: var(--muted); }
.faq-list { border-top: 1px solid var(--line); }
.faq-list article { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; padding: 1.7rem 0; border-bottom: 1px solid var(--line); }
.faq-list h3 { font-size: 1.05rem; }
.faq-list p { margin: 0; color: var(--muted); }
.faq-list code { color: #4e6800; font-weight: 700; }
.origin { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; background: var(--acid); border-top: 0; border-radius: 12px; padding-left: 4rem; padding-right: 4rem; }
.origin h2 { font-size: clamp(2.2rem, 3.7vw, 4rem); }
.origin-copy { align-self: center; }
.origin-copy p { color: #3f432f; }
.origin-copy a { font-weight: 800; }
.closing { text-align: center; }
.closing .eyebrow, .closing .hero-actions { justify-content: center; }
.closing h2 { font-size: clamp(3rem, 6vw, 6.4rem); }

footer { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 2.5rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
footer p { margin: 0; text-align: center; }
footer p:last-child { text-align: right; }
.guide { width: min(calc(100% - 3rem), 900px); margin: 0 auto; padding: 6rem 0; }
.guide article > h1 { max-width: 880px; font-size: clamp(3.2rem, 7vw, 6.3rem); }
.guide-lede { color: #4d4f47; font-size: 1.3rem; }
.guide article > h2 { margin-top: 5rem; font-size: clamp(2rem, 4vw, 3.4rem); }
.guide article > p, .guide article > ul, .guide article > ol { font-size: 1.06rem; }
.guide li { margin-bottom: .65rem; }
.answer-box { margin: 3rem 0; padding: 1.5rem; background: var(--acid); border-radius: 8px; }
.answer-box p { margin: .4rem 0 0; color: #3f432f; }
.guide-table { overflow-x: auto; }
.guide table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.25); }
.guide th, .guide td { padding: 1rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.guide thead th { background: var(--ink); color: var(--white); }
.guide tbody th { min-width: 160px; }
.guide pre { overflow-x: auto; padding: 1.4rem; background: var(--terminal); color: var(--white); border-radius: 8px; line-height: 1.7; }
.guide-cta { margin-top: 5rem; padding: 2.5rem; background: var(--acid); border-radius: 10px; }
.guide-cta h2 { margin-bottom: .7rem; font-size: 2.2rem; }

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .lede,
html[data-theme="dark"] .body-copy,
html[data-theme="dark"] .flow-arrow,
html[data-theme="dark"] .guide-lede { color: #c3c7bc; }
html[data-theme="dark"] .residue-flow > div:not(.flow-arrow),
html[data-theme="dark"] .guide table { background: rgba(255,255,255,.035); }
html[data-theme="dark"] .boundary-card { background: #080a07; }
html[data-theme="dark"] .button.primary { background: var(--acid); color: #171815; border-color: var(--acid); }
html[data-theme="dark"] .symptom-grid code,
html[data-theme="dark"] .faq-list code { color: var(--acid); }
html[data-theme="dark"] .diagnostic-boundary,
html[data-theme="dark"] .signal-grid .principle,
html[data-theme="dark"] .feedback-card,
html[data-theme="dark"] .origin,
html[data-theme="dark"] .answer-box,
html[data-theme="dark"] .guide-cta { color: #171815; }
html[data-theme="dark"] .guide thead th { background: var(--acid); color: #171815; }

@media (max-width: 900px) {
  nav > a:not(.nav-cta) { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 5rem; }
  .terminal-wrap { max-width: 650px; }
  .problem-grid, .signals, .try, .evidence-grid, .boundary-card, .faq, .origin { grid-template-columns: 1fr; }
  .symptoms-intro { grid-template-columns: 1fr; }
  .section-heading, .faq-intro { position: static; }
  .residue-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .boundary-card { padding: 2.5rem; }
  .evidence { background-image: none; }
}

@media (max-width: 600px) {
  .site-header, .hero, .section, footer { width: min(calc(100% - 2rem), var(--max)); }
  .site-header { min-height: 68px; }
  .version-badge { display: none; }
  .nav-cta { padding: .5rem .65rem; font-size: .75rem; }
  .hero { padding-top: 4rem; }
  h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .section { padding: 5rem 0; }
  .signal-grid { grid-template-columns: 1fr; }
  .symptom-grid { grid-template-columns: 1fr; }
  .signal-grid article { min-height: 210px; }
  .boundary-card { padding: 1.5rem; }
  .faq-list article { grid-template-columns: 1fr; gap: .4rem; }
  .origin { padding-left: 1.5rem; padding-right: 1.5rem; }
  .boundary-list > div { grid-template-columns: 1fr; gap: .4rem; }
  .command { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; gap: 1rem; text-align: left; }
  footer p, footer p:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
