/* Big Research Guide — single stylesheet */
:root {
  --navy: #0f1f3d;
  --navy-2: #182c52;
  --navy-3: #2c4370;
  --amber: #f2a93b;
  --amber-soft: #fff3df;
  --amber-ink: #7a4a00;
  --ink: #18223a;
  --muted: #4a5670;
  --bg: #f8f7f3;
  --paper: #ffffff;
  --line: #d9dee8;
  --tint: #eef2f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 31, 61, .06), 0 6px 18px rgba(15, 31, 61, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; color: var(--navy); margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.75rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p, ul, ol, dl { margin: 0 0 1.1em; }
a { color: #1d4ea3; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 3px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.narrow-wrap { max-width: 820px; }

/* Skip link */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--amber); color: var(--navy); font-weight: 700;
  padding: .6rem 1rem; border-radius: 0 0 8px 8px; text-decoration: none;
}
.skip-link:focus { top: 0; outline: 3px solid var(--navy); }

/* Header */
.site-header { background: var(--navy); color: #fff; border-bottom: 4px solid var(--amber); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-size: 1.1rem; letter-spacing: .01em; }
.brand strong { color: var(--amber); }
.brand:hover { color: #fff; }
.logo-mark { flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .25rem; }
.site-nav a {
  display: block; color: #e6ecf7; text-decoration: none; font-weight: 600; font-size: .98rem;
  padding: .4rem .6rem; border-radius: 6px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { background: var(--navy-2); color: #fff; }
.site-nav a[aria-current="page"], .site-nav a.is-section { color: #fff; border-bottom-color: var(--amber); border-radius: 6px 6px 0 0; }
.site-nav a:focus-visible { outline-color: var(--amber); }

/* Buttons */
.button {
  display: inline-block; background: var(--amber); color: var(--navy); font-weight: 700;
  padding: .7rem 1.15rem; border-radius: 8px; text-decoration: none; border: 2px solid var(--amber);
  margin: 0 .4rem .5rem 0;
}
.button:hover { background: #ffc061; border-color: #ffc061; color: var(--navy); text-decoration: none; }
.button.ghost { background: transparent; color: #fff; border-color: #8ea3c7; }
.button.ghost:hover { background: var(--navy-2); border-color: #fff; }
.button.ghost.dark { color: var(--navy); border-color: var(--navy); }
.button.ghost.dark:hover { background: var(--tint); }

/* Hero */
.hero {
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px;
  color: #e6ecf7;
  padding: 3rem 0 3.25rem;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero-inner { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .hero-inner { grid-template-columns: 1.3fr 1fr; } }
.hero-lede { font-size: 1.12rem; max-width: 60ch; color: #dfe6f3; }
.hero-art { width: 100%; max-width: 420px; justify-self: center; }
.hero-actions { margin-top: 1.5rem; }

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--amber-ink); margin-bottom: .5rem; }
.eyebrow.light { color: var(--amber); }

/* Sections */
.section { padding: 3rem 0; }
.section.wrap { padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) { .section.wrap { padding-left: 24px; padding-right: 24px; } }
.section-head { max-width: 70ch; margin-bottom: 1.5rem; }
.band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Cards */
.card-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.card-grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card {
  display: flex; flex-direction: column; height: 100%; gap: .45rem;
  background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--amber);
  border-radius: var(--radius); padding: 1.15rem 1.2rem 1.25rem; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,31,61,.08), 0 12px 28px rgba(15,31,61,.12); color: var(--ink); text-decoration: none; }
.card-kicker { font-family: var(--mono); font-size: .8rem; color: var(--amber-ink); font-weight: 700; letter-spacing: .04em; }
.card-title { font-weight: 700; font-size: 1.1rem; color: var(--navy); line-height: 1.3; }
.card-text { color: var(--muted); font-size: .97rem; }
.card-more { margin-top: auto; padding-top: .4rem; color: #1d4ea3; font-weight: 600; font-size: .95rem; }

.audience { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.audience li { border-left: 4px solid var(--navy); padding: .25rem 0 .25rem 1rem; }
.audience h3 { margin-bottom: .3rem; }
.audience p { color: var(--muted); margin: 0; }

.note { color: var(--muted); font-size: .97rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.5rem; }

/* Page heads & breadcrumbs */
.page-head { padding: 2.5rem 0 1rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 65ch; }
.meta { color: var(--muted); font-size: .92rem; }
.breadcrumbs { padding-top: 1.25rem; font-size: .92rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.breadcrumbs li + li::before { content: "/"; color: #8a94a8; margin-right: .3rem; }
.breadcrumbs [aria-current] { color: var(--muted); }

/* Guide layout */
.guide { max-width: 780px; padding-bottom: 3rem; }
.guide-head { padding: 1.25rem 0 .5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.toc { background: var(--tint); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 2rem; }
.toc-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem; color: var(--navy); }
.toc ol { margin: 0; padding-left: 1.25rem; columns: 1; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: 2rem; } }
.toc li { margin-bottom: .25rem; break-inside: avoid; }

.prose h2 { margin-top: 2.25rem; padding-top: .25rem; }
.prose h2::before { content: ""; display: block; width: 40px; height: 4px; background: var(--amber); border-radius: 2px; margin-bottom: .6rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: .4rem; }
.prose .lede { color: var(--ink); font-size: 1.18rem; }

.notice, .callout {
  background: var(--amber-soft); border: 1px solid #f0d3a2; border-left: 5px solid var(--amber);
  border-radius: 8px; padding: .9rem 1.1rem;
}
.formula {
  font-family: var(--mono); font-size: 1.05rem; background: var(--navy); color: #fff;
  padding: .9rem 1.1rem; border-radius: 8px; text-align: center;
}

/* Numbered steps */
.prose ol.steps, ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.75rem; margin-bottom: .85rem; min-height: 2rem; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .05rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--navy); color: var(--amber);
  font-weight: 700; font-size: .95rem; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
}
ol.steps.compact { max-width: 70ch; }

/* Checklist */
.prose ul.checklist, ul.checklist { list-style: none; padding: 1rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
ul.checklist li { position: relative; padding-left: 2rem; margin-bottom: .55rem; }
ul.checklist li:last-child { margin-bottom: 0; }
ul.checklist li::before {
  content: ""; position: absolute; left: 0; top: .2rem; width: 1.2rem; height: 1.2rem;
  border: 2px solid var(--navy); border-radius: 4px; background: #fff;
}
ul.checklist li::after {
  content: ""; position: absolute; left: .42rem; top: .38rem; width: .38rem; height: .7rem;
  border: solid var(--amber-ink); border-width: 0 3px 3px 0; transform: rotate(45deg);
}

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); max-width: 100%; }
.table-wrap:focus-visible { outline: 3px solid var(--amber); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
table.narrow { min-width: 300px; }
caption { caption-side: top; text-align: left; padding: .6rem .9rem; font-size: .85rem; font-weight: 700; color: var(--amber-ink); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
th, td { text-align: left; vertical-align: top; padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--navy); color: #fff; font-weight: 700; white-space: nowrap; }
tbody th { color: var(--navy); background: var(--tint); }
tbody tr:nth-child(even) td { background: #f9fafc; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tr.row-key td { background: var(--amber-soft) !important; }

/* Figure */
.figure-rings { margin: 0 0 1.25rem; text-align: center; }
.figure-rings svg { width: 100%; max-width: 320px; }
.figure-rings figcaption { color: var(--muted); font-size: .92rem; }

/* Takeaways */
.takeaways {
  background: var(--navy); color: #e6ecf7; border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.1rem; margin: 2.5rem 0 1rem; position: relative; overflow: hidden;
}
.takeaways::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; border: 18px solid rgba(242,169,59,.18); }
.prose .takeaways h2 { color: var(--amber); margin-top: 0; font-size: 1.3rem; }
.prose .takeaways h2::before { display: none; }
.takeaways ul { margin: 0; padding-left: 1.25rem; position: relative; z-index: 1; }
.takeaways li { margin-bottom: .5rem; }
.takeaways li::marker { color: var(--amber); }

.related { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* Guides index */
.guide-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.guide-item { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.guide-num { font-family: var(--mono); font-weight: 700; font-size: 1.4rem; color: var(--navy); background: var(--amber); border-radius: 8px; width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; }
.guide-item h2 { font-size: 1.25rem; margin-bottom: .35rem; }
.guide-item h2 a { color: var(--navy); }
.guide-item p { margin-bottom: .4rem; }
.guide-meta { color: var(--muted); font-size: .92rem; }

/* Glossary */
.alpha-jump ul { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.alpha-jump a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; height: 2.4rem; border-radius: 6px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; font-family: var(--mono); }
.alpha-jump a:hover { background: var(--amber); color: var(--navy); }
.letter-group { margin-bottom: 1.5rem; }
.letter-group > h2 { font-family: var(--mono); font-size: 1.5rem; border-bottom: 3px solid var(--amber); display: inline-block; padding-right: .6rem; margin-bottom: .75rem; }
.letter-group dl { margin: 0; }
.term { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .85rem 1rem; margin-bottom: .6rem; }
.term:target { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242,169,59,.35); }
.term dt { font-weight: 700; color: var(--navy); }
.term dd { margin: .25rem 0 0; color: var(--ink); }
.anchor { color: #6b7790; text-decoration: none; font-weight: 400; margin-left: .25rem; }
.anchor:hover { color: var(--amber-ink); }

/* Simple pages */
.prose-page { padding-bottom: 3rem; }
.contact-box { font-size: 1.2rem; font-weight: 700; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--amber); border-radius: 8px; padding: 1rem 1.2rem; }

/* 404 */
.notfound { padding: 3rem 16px 4rem; }
.big-code { font-family: var(--mono); font-size: clamp(4rem, 3rem + 6vw, 7rem); font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: .5rem; }
.big-code::after { content: ""; display: block; width: 80px; height: 8px; background: var(--amber); border-radius: 4px; margin-top: .6rem; }
.link-list { padding-left: 1.25rem; }

/* Footer */
.site-footer { background: var(--navy); color: #cfd8ea; padding: 2rem 0 1.5rem; margin-top: 2rem; border-top: 4px solid var(--amber); font-size: .95rem; }
.site-footer .disclaimer { max-width: 75ch; color: #e6ecf7; }
.footer-links { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.site-footer a { color: #ffd58a; }
.site-footer a:hover { color: #fff; }
.copyright { margin: 0; color: #aebbd4; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .toc, .skip-link { display: none; }
  .takeaways { background: none; color: #000; border: 2px solid #000; }
}
