:root {
  color-scheme: dark;
  --bg: #071014;
  --panel: #0e1c22;
  --panel2: #12252c;
  --text: #edf4f1;
  --muted: #9db0ad;
  --line: #244048;
  --cyan: #5bc6cf;
  --green: #6cc69a;
  --amber: #d6a65c;
  --danger: #d46f68;
  --paper: #f7f5ed;
  --ink: #142023;
  --max: 1180px;
  --radius: 4px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(rgba(91,198,207,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(91,198,207,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--cyan); text-underline-offset: .2em; }
a:hover { color: #8ee1e5; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }
.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: var(--paper); color: var(--ink); }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(7,16,20,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.nav-wrap { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.brand > span:last-child > span { color: var(--cyan); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--cyan); color: var(--cyan); font: 700 .72rem ui-monospace, monospace; letter-spacing: .08em; }
.site-nav ul, .site-footer ul { display: flex; align-items: center; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.site-nav a { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .025em; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.menu-button { display: none; padding: .5rem .75rem; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; }

.hero { padding: clamp(5rem, 10vw, 9rem) 0 5rem; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.7fr); align-items: end; gap: clamp(3rem,8vw,8rem); }
h1, h2, h3 { margin: 0 0 .75rem; line-height: 1.09; letter-spacing: -.035em; }
h1 { max-width: 15ch; font-size: clamp(3rem, 7.3vw, 6.7rem); }
h2 { font-size: clamp(1.7rem,3.2vw,2.65rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
.lede { max-width: 64ch; color: var(--text); font-size: clamp(1.15rem,2vw,1.38rem); }
.hero p:not(.eyebrow):not(.lede) { max-width: 68ch; color: var(--muted); }
.eyebrow, .terminal-label { margin-bottom: .7rem; color: var(--cyan); font: 700 .75rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.lab-panel { position: relative; padding: 1.6rem; border: 1px solid var(--line); background: rgba(14,28,34,.78); box-shadow: 14px 14px 0 rgba(36,64,72,.15); }
.lab-panel::before { content: ""; position: absolute; top: -1px; left: -1px; width: 48px; border-top: 3px solid var(--cyan); }
.lab-panel ol { margin: 1.1rem 0 0; padding-left: 1.4rem; color: var(--muted); }
.lab-panel li + li { margin-top: .55rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .72rem 1rem; border: 1px solid var(--cyan); border-radius: 2px; color: var(--text); font-size: .86rem; font-weight: 760; text-decoration: none; cursor: pointer; }
button.button { font-family: inherit; }
.button.primary { background: var(--cyan); color: var(--bg); }
.button.secondary { background: transparent; color: var(--cyan); }
.button.ghost { border-color: var(--line); color: var(--muted); }
.button:hover { background: #8ee1e5; border-color: #8ee1e5; color: var(--bg); }

.section { padding-block: clamp(4rem,8vw,7rem); }
.section-heading { max-width: 720px; margin-bottom: 2rem; }
.section-heading > p:not(.eyebrow) { color: var(--muted); }
.direct-answer { max-width: 980px; padding: clamp(1.35rem,3vw,2rem); border-left: 3px solid var(--cyan); background: linear-gradient(110deg, rgba(91,198,207,.1), rgba(14,28,34,.6)); }
.direct-answer h2 { margin-bottom: .7rem; }
.direct-answer p:last-child { margin: 0; font-size: clamp(1.1rem,2vw,1.35rem); line-height: 1.55; }
.card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.card-grid.compact { grid-template-columns: repeat(4,minmax(0,1fr)); }
.card { min-width: 0; padding: 1.5rem; border: 1px solid var(--line); background: rgba(14,28,34,.82); }
.card:hover { border-color: #37626d; }
.card h2 { font-size: 1.35rem; }
.card h3 a, .card h2 a { color: var(--text); text-decoration: none; }
.card p { color: var(--muted); }
.card-index { color: var(--cyan) !important; font: 700 .8rem ui-monospace,monospace; }
.evidence { display: inline-flex; color: var(--green); font: 700 .68rem ui-monospace,monospace; letter-spacing: .08em; text-transform: uppercase; }
.download-card > a:not(.button), .text-link { font-weight: 750; }
.audience { padding-top: .8rem; border-top: 1px solid var(--line); font-size: .85rem; }
.band { border-block: 1px solid var(--line); background: rgba(14,28,34,.56); }
.section-action { margin-top: 1.5rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,7vw,7rem); align-items: start; }
.split > div > p:not(.eyebrow) { color: var(--muted); }
.safety-box { padding: 2rem; border: 1px solid rgba(214,166,92,.55); background: rgba(214,166,92,.06); }
.safety-box .eyebrow { color: var(--amber); }
.link-list { border-top: 1px solid var(--line); }
.link-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 700; text-decoration: none; }
.link-list small { color: var(--muted); font-weight: 500; }

.page { padding-block: clamp(3rem,7vw,6rem); }
.page-head { max-width: 1000px; margin-bottom: 3rem; }
.page-head h1 { max-width: 18ch; margin-bottom: 1.5rem; font-size: clamp(2.8rem,6vw,5rem); }
.page-head .direct-answer { margin-block: 1.25rem; }
.evidence-row { margin-top: 1rem; }
.article-layout { display: grid; grid-template-columns: minmax(0,760px) minmax(240px,1fr); gap: clamp(2rem,7vw,7rem); align-items: start; }
.prose section { padding: 0 0 2.4rem; margin-bottom: 2.4rem; border-bottom: 1px solid var(--line); }
.prose p, .prose li { color: #c5d3d0; }
.prose ul { padding-left: 1.3rem; }
.prose li + li { margin-top: .55rem; }
.prose details { padding: 1rem 0; border-top: 1px solid var(--line); }
.prose summary { cursor: pointer; color: var(--text); font-weight: 720; }
.prose details p { margin: .7rem 0 0; }
.source-rail { position: sticky; top: 100px; display: grid; gap: 1rem; }
.rail-box { padding: 1.25rem; border: 1px solid var(--line); background: rgba(14,28,34,.78); font-size: .9rem; }
.rail-box p:not(.eyebrow), .rail-box li { color: var(--muted); }
.rail-box ul, .rail-box ol { margin: 0; padding-left: 1.15rem; }
.rail-box li + li { margin-top: .55rem; }
.reviewed { margin-top: 1rem; font-size: .76rem; }

.safety-strip { margin: 1.2rem 0; padding: 1rem 1.1rem; border: 1px solid rgba(214,166,92,.5); color: #ead8b8; background: rgba(214,166,92,.05); font-size: .92rem; }
.worksheet-meta { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-bottom: 2rem; padding: 1.4rem; border: 1px solid var(--line); background: var(--panel); }
.worksheet-meta label { display: grid; gap: .5rem; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.worksheet-meta span { display: block; height: 1.5rem; border-bottom: 1px solid var(--muted); }
.tool-sections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.tool-section { padding: 1.5rem; border: 1px solid var(--line); background: rgba(14,28,34,.75); }
.tool-section h2 { font-size: 1.55rem; }
.check-row { display: flex; gap: .8rem; align-items: flex-start; margin-top: 1rem; color: #c5d3d0; cursor: pointer; }
.check-row input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; margin-top: .3rem; accent-color: var(--cyan); }
.write-lines { height: 3rem; margin: .2rem 0 0 1.95rem; background: repeating-linear-gradient(transparent 0,transparent 23px,var(--line) 24px); }
.tool-review { margin-top: 2rem; padding: 1.5rem; border: 1px solid var(--green); background: rgba(108,198,154,.05); }
.tool-review h2 { font-size: 1.5rem; }
.card-actions { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; font-size: .84rem; font-weight: 700; }
.source-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.source-cards a { display: grid; gap: .3rem; padding: 1rem; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.source-cards a:hover { border-color: var(--cyan); }
.source-cards small { color: var(--muted); }
.source-cards .source-type { color: var(--green); font: 700 .68rem/1.4 ui-monospace,monospace; letter-spacing: .06em; text-transform: uppercase; }
.glossary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.glossary div { padding: 1.4rem; border: 1px solid var(--line); background: rgba(14,28,34,.72); }
.glossary dt { margin-bottom: .45rem; color: var(--cyan); font-weight: 800; font-size: 1.12rem; }
.glossary dd { margin: 0; color: var(--muted); }

.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: #050c0f; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding-block: 3rem; }
.footer-grid > div > p:not(.eyebrow) { max-width: 52ch; color: var(--muted); }
.site-footer nav ul { justify-content: flex-end; flex-wrap: wrap; align-items: flex-start; }
.site-footer nav a { color: var(--muted); font-size: .82rem; }
.legal-note { padding-block: 1.25rem 2rem; border-top: 1px solid var(--line); color: #78908d; font-size: .73rem; }
.legal-note p { max-width: 120ch; }

@media (max-width: 1050px) {
  .menu-button { display: block; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; padding: 1rem 20px 1.5rem; border-bottom: 1px solid var(--line); background: var(--bg); }
  .site-nav.is-open { display: block; }
  .site-nav ul { display: grid; grid-template-columns: repeat(2,1fr); align-items: stretch; }
  .site-nav a { display: block; padding: .55rem; }
  .card-grid.compact { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .hero-grid, .split, .article-layout, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 4rem; }
  h1 { font-size: clamp(2.8rem,14vw,4.8rem); }
  .card-grid, .card-grid.compact, .tool-sections, .glossary, .source-cards { grid-template-columns: 1fr; }
  .source-rail { position: static; }
  .worksheet-meta { grid-template-columns: 1fr; }
  .site-footer nav ul { justify-content: flex-start; }
  .link-list a { display: grid; }
}

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

@media print {
  :root { color-scheme: light; }
  @page { size: letter; margin: .55in; }
  .site-header, .site-footer, .button-row, .no-print, .source-rail { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .shell { width: 100%; }
  a { color: #111; }
  .page { padding: 0; }
  .page-head { margin-bottom: .2in; }
  .page-head h1 { font-size: 24pt; }
  .direct-answer, .safety-strip, .worksheet-meta, .tool-section, .tool-review { background: #fff; color: #111; border-color: #555; }
  .direct-answer p, .tool-section *, .tool-review *, .worksheet-meta label { color: #111 !important; }
  .tool-sections { grid-template-columns: 1fr; }
  .tool-section, .checklist-section { break-inside: avoid; page-break-inside: avoid; }
  .write-lines { background: repeating-linear-gradient(transparent 0,transparent 23px,#aaa 24px); }
  .eyebrow, .evidence { color: #333; }
}
