:root {
  color-scheme: dark;
  --bg: #030a12;
  --panel: #07111f;
  --panel-2: #0b1728;
  --line: #1c344d;
  --text: #f3f8ff;
  --muted: #91a3ba;
  --red: #ff2d55;
  --red-soft: #ff6885;
  --teal: #00d4ff;
  --blue: #168bff;
  --green: #32d77b;
  --amber: #ff9f43;
  --sidebar: 282px;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 84% 4%, rgba(0, 212, 255, .11), transparent 30rem),
    radial-gradient(circle at 55% 115%, rgba(22, 139, 255, .08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--red-soft); text-underline-offset: 3px; }
a:hover { color: #fff; }
img { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }

.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 100;
  padding: .7rem 1rem; background: white; color: black; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20;
  display: flex; flex-direction: column; padding: 24px 18px;
  background: rgba(3, 10, 18, .95); border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; padding: 0 8px 22px; }
.brand img { width: 52px; height: 52px; border-radius: 15px; box-shadow: 0 0 30px rgba(0,212,255,.18); }
.brand strong { display: block; letter-spacing: .08em; font-size: 1.05rem; }
.brand span { display: block; color: var(--muted); font-size: .74rem; }
.nav-scroll { min-height: 0; overflow-y: auto; padding-right: 3px; }
.nav-label { margin: 15px 10px 5px; color: #60758d; font-size: .65rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.nav { display: grid; gap: 3px; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 9px 11px; border-radius: 10px; font-size: .91rem;
}
.nav a:hover { color: white; background: var(--panel-2); }
.nav a[aria-current="page"] { color: white; background: rgba(0,212,255,.10); box-shadow: inset 3px 0 var(--teal); }
.sidebar-bottom { margin-top: auto; padding: 14px 9px 0; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.sidebar-bottom a { color: var(--muted); text-decoration: none; margin-right: 10px; }

.mobile-bar { display: none; }
.page { margin-left: var(--sidebar); min-width: 0; min-height: 100vh; }
.content { width: min(calc(100% - 48px), 990px); min-width: 0; margin: 0 auto; padding: 68px 0 96px; }
.content.narrow { width: min(calc(100% - 48px), 820px); }

.eyebrow { color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.025em; }
h1 { max-width: 850px; margin: 14px 0 18px; font-size: clamp(2.5rem, 6vw, 5.6rem); }
.guide h1 { font-size: clamp(2.35rem, 5vw, 4.25rem); }
h2 { margin: 3.4rem 0 1rem; font-size: clamp(1.65rem, 3vw, 2.35rem); }
h3 { margin: 1.8rem 0 .6rem; font-size: 1.12rem; }
p { max-width: 74ch; }
.lede { color: #d0d3da; font-size: clamp(1.08rem, 2vw, 1.3rem); max-width: 70ch; }
.muted { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 11px; margin: 30px 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 45px; padding: 0 17px; border: 1px solid var(--line); border-radius: 11px;
  color: white; background: var(--panel); text-decoration: none; font-weight: 750;
}
.button.primary { border-color: var(--teal); background: var(--teal); color: #001019; box-shadow: 0 10px 35px rgba(0,212,255,.18); }
.button:hover { transform: translateY(-1px); border-color: #555c6b; }

.hero-card { margin-top: 42px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.hero-card img { display: block; width: 100%; }
.caption { padding: 12px 16px; background: var(--panel); color: var(--muted); font-size: .8rem; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(21,24,33,.95), rgba(13,15,20,.95)); }
.card .number { color: var(--teal); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.card h3 { margin-top: 10px; }
.card p { margin-bottom: 0; color: var(--muted); font-size: .93rem; }
.card a { color: white; text-decoration: none; }
.card a::after { content: "  →"; color: var(--teal); }

.steps { counter-reset: step; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 18px; margin: 26px 0; }
.step { position: relative; min-width: 0; padding: 2px 0 6px 64px; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(0,212,255,.10); border: 1px solid rgba(0,212,255,.4); color: var(--teal); font-weight: 900;
}
.steps-unnumbered .step { padding-left: 0; }
.steps-unnumbered .step::before { display: none; }
.step h2, .step h3 { margin-top: .35rem; }

pre { position: relative; max-width: 100%; margin: 18px 0 24px; padding: 20px; overflow-x: auto; border: 1px solid #303541; border-radius: 14px; background: #0d0f14; box-shadow: inset 0 1px rgba(255,255,255,.025); }
code { font: .9em/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
:not(pre) > code { padding: .14em .38em; border: 1px solid var(--line); border-radius: 6px; color: #8deaff; background: var(--panel); }
.copy {
  position: absolute; right: 10px; top: 10px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); background: #171a21; cursor: pointer; font: 700 .7rem inherit;
}
.copy:hover { color: white; }
.callout { margin: 22px 0; padding: 16px 18px; border-left: 3px solid var(--teal); border-radius: 0 12px 12px 0; background: rgba(53,196,189,.08); }
.callout.warning { border-color: var(--red); background: rgba(228,59,69,.08); }
.callout strong { display: block; margin-bottom: 3px; }
.checklist { padding: 0; list-style: none; }
.checklist li { position: relative; margin: .65rem 0; padding-left: 27px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 900; }

.command-table { width: 100%; border-collapse: collapse; margin: 22px 0; }
.command-table th, .command-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.command-table th { color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.command-table td:first-child { color: #8deaff; font-family: ui-monospace, monospace; white-space: nowrap; }
.next { display: flex; justify-content: space-between; gap: 20px; margin-top: 58px; padding-top: 24px; border-top: 1px solid var(--line); }
.next a { text-decoration: none; font-weight: 800; }
footer { margin-top: 70px; color: #727887; font-size: .8rem; }

/* Observatory components */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; gap: 42px; min-width: 0; min-height: 520px; }
.hero > * { min-width: 0; }
.hero h1 { font-size: clamp(3rem, 7vw, 6.4rem); margin-bottom: 14px; }
.hero-mark { position: relative; display: grid; place-items: center; min-height: 340px; }
.hero-mark::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(0,212,255,.18), rgba(22,139,255,.05) 48%, transparent 70%); filter: blur(4px); }
.hero-mark::after { content: ""; position: absolute; inset: 6%; border: 1px solid rgba(0,212,255,.18); border-radius: 50%; animation: orbit 18s linear infinite; }
.hero-mark img { position: relative; z-index: 1; width: 260px; border-radius: 34px; box-shadow: 0 28px 85px rgba(0,0,0,.55), 0 0 0 1px rgba(0,212,255,.25); }
.status-line { display: flex; flex-wrap: wrap; gap: 10px; margin: 25px 0 0; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin: 8px 0 56px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.metric { padding: 18px 16px; background: rgba(7,17,31,.98); }
.metric strong { display: block; color: white; font-size: 1.65rem; line-height: 1; }
.metric span { display: block; margin-top: 7px; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 4rem 0 1.2rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.family-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.family { position: relative; min-height: 185px; padding: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(11,23,40,.96), rgba(5,13,23,.98)); text-decoration: none; }
.family:hover { border-color: rgba(0,212,255,.55); transform: translateY(-2px); }
.family .kicker { color: var(--teal); font: 800 .68rem/1 ui-monospace, monospace; letter-spacing: .13em; text-transform: uppercase; }
.family h3 { margin: 14px 0 7px; color: white; font-size: 1.35rem; }
.family p { margin: 0; color: var(--muted); font-size: .9rem; }
.family .count { position: absolute; right: 18px; bottom: 6px; color: rgba(141,234,255,.09); font: 900 4.8rem/1 ui-monospace, monospace; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shot { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; object-position: center; background: #050b12; }
.shot-body { padding: 16px 18px 18px; }
.shot-body strong { display: block; font-size: 1rem; }
.shot-body span { color: var(--muted); font-size: .8rem; }
.gallery-grid a.shot { color: inherit; text-decoration: none; }
.shot-body em { display: block; margin-top: 11px; color: #79a9df; font-size: .72rem; font-style: normal; font-weight: 800; }
.gallery-grid a.shot:hover .shot-body strong,
.gallery-grid a.shot:focus-visible .shot-body strong { color: #ea7482; }
.gallery-grid a.shot:focus-visible { outline: 2px solid #8d2332; outline-offset: 3px; }
.terminal { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #02070c; box-shadow: var(--shadow); }
.terminal-top { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #0a1420; }
.terminal-top i { width: 8px; height: 8px; border-radius: 50%; background: #46566a; }
.terminal-top i:first-child { background: var(--red); }.terminal-top i:nth-child(2) { background: var(--amber); }.terminal-top i:nth-child(3) { background: var(--green); }
.terminal pre { margin: 0; border: 0; border-radius: 0; background: transparent; }
.terminal .prompt { color: var(--teal); }
.catalogue { display: grid; gap: 9px; margin-top: 24px; }
.catalogue-item { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.7fr) auto; align-items: center; gap: 18px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,17,31,.72); }
.catalogue-item strong { color: white; }
.catalogue-item p { margin: 0; color: var(--muted); font-size: .86rem; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.badge { padding: 4px 7px; border: 1px solid #27506c; border-radius: 999px; color: #9feeff; background: rgba(0,212,255,.07); font: 750 .62rem/1 ui-monospace, monospace; text-transform: uppercase; }
.badge.formal { border-color: #744a1d; color: #ffc57a; background: rgba(255,159,67,.08); }
.badge.intervention { border-color: #6a2940; color: #ff8da3; background: rgba(255,45,85,.08); }
.badge.cohort { border-color: #235f47; color: #84efbd; background: rgba(50,215,123,.08); }
.pathway { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0; }
.pathway > div { position: relative; padding: 17px; border-top: 2px solid var(--teal); background: var(--panel); }
.pathway small { display: block; color: var(--teal); font-weight: 800; }
.pathway strong { display: block; margin-top: 6px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.panel h3 { margin-top: 0; }
.mini-raven { float: right; width: 82px; margin: 0 0 12px 18px; border-radius: 18px; }
.case-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); align-items: center; gap: 42px; margin-bottom: 32px; }
.case-hero figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.case-hero figure img { display: block; width: 100%; height: 320px; object-fit: cover; }
.case-hero figcaption { padding: 10px 14px; color: var(--muted); font-size: .72rem; }
.walk-step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 22px; margin: 0; padding: 45px 0; border-top: 1px solid var(--line); }
.walk-step > div { min-width: 0; }
.step-no { position: sticky; top: 82px; align-self: start; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(0,212,255,.42); border-radius: 14px; color: var(--teal); background: rgba(0,212,255,.08); font: 850 .78rem/1 ui-monospace, monospace; }
.walk-step h2 { margin: .5rem 0 1rem; }
.walk-step details { margin: 20px 0; padding: 14px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.walk-step summary { cursor: pointer; color: white; font-weight: 800; }
.rank-list { display: grid; gap: 9px; margin: 22px 0; }
.rank-list > div { display: grid; grid-template-columns: 190px minmax(0, 1fr) 58px; align-items: center; gap: 12px; color: var(--muted); font-size: .84rem; }
.rank-list i { position: relative; height: 8px; overflow: hidden; border-radius: 99px; background: #122338; }
.rank-list i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--score); border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.rank-list strong { color: white; text-align: right; }
.result-figure { margin: 26px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #030a12; }
.diagram-viewport { display: block; overflow: hidden; aspect-ratio: 1098 / 648; background: #030a12; }
.diagram-viewport img { display: block; width: 100%; height: auto; max-width: none; }
.diagram-viewport.export-crop { aspect-ratio: 1108 / 658; }
.diagram-viewport.export-crop img { width: 115.53%; }
.result-figure figcaption { display: flex; align-items: center; gap: 10px; padding: 13px 16px; color: var(--muted); font-size: .78rem; background: var(--panel); }
.license-note { display: flex; align-items: center; gap: 18px; margin-top: 32px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.license-note img { flex: 0 0 auto; width: 66px; height: 66px; border-radius: 15px; }
.license-note p { margin: 0; color: var(--muted); font-size: .82rem; }
@keyframes orbit { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-bar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 0 18px; background: rgba(8,9,12,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
  .mobile-bar a { color: white; text-decoration: none; font-weight: 900; letter-spacing: .07em; }
  .menu-button { color: white; background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
  .page { margin-left: 0; }
  .content { padding-top: 42px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-mark { order: -1; min-height: 245px; }
  .hero-mark img { width: 190px; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .pathway { grid-template-columns: repeat(2, 1fr); }
  .case-hero { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .content, .content.narrow { width: min(calc(100% - 30px), 990px); }
  .grid { grid-template-columns: 1fr; }
  .step { padding-left: 54px; }
  .command-table { display: block; overflow-x: auto; }
  .next { flex-direction: column; }
  .hero { gap: 4px; }
  .hero-mark { min-height: 220px; }
  .metrics, .family-grid, .gallery-grid, .split { grid-template-columns: 1fr; }
  .metric { display: flex; align-items: baseline; gap: 10px; }
  .metric span { margin-top: 0; }
  .section-head { display: block; }
  .section-head p { margin-top: 8px; }
  .catalogue-item { grid-template-columns: 1fr; gap: 7px; }
  .badges { justify-content: flex-start; }
  .pathway { grid-template-columns: 1fr; }
  .hero .actions { display: grid; grid-template-columns: 1fr; }
  .hero .button { width: 100%; }
  .walk-step { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 34px 0; }
  .step-no { width: 38px; height: 38px; }
  .rank-list > div { grid-template-columns: 1fr 48px; }
  .rank-list i { grid-column: 1 / -1; grid-row: 2; }
  .result-figure figcaption { align-items: flex-start; flex-direction: column; }
  .license-note { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Raven field guide — editorial documentation, not a neon product dashboard. */
:root {
  --bg: #0b0b0c;
  --panel: #121214;
  --panel-2: #1a191a;
  --line: #353133;
  --text: #eee8dc;
  --muted: #aaa29a;
  --red: #a93542;
  --red-soft: #d36670;
  --teal: #91a5aa;
  --blue: #738890;
  --green: #7e9b78;
  --amber: #b58a56;
  --radius: 8px;
  --shadow: 0 20px 55px rgba(0, 0, 0, .32);
}

body {
  background: var(--bg);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 {
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  letter-spacing: -.018em;
}
h1, h2 { text-wrap: balance; }
p, li { text-wrap: pretty; }
h1 { color: #f5efe4; }
a { color: #d17b82; }
a:hover { color: #fff8ec; }
.sidebar { background: #0e0e10; backdrop-filter: none; }
.brand img { border-radius: 5px; box-shadow: none; }
.brand strong { font-family: "Iowan Old Style", Georgia, serif; font-size: 1.15rem; letter-spacing: .05em; }
.nav a { border-radius: 4px; }
.nav a:hover { background: #1b191a; }
.nav a[aria-current="page"] { background: #21191b; box-shadow: inset 2px 0 var(--red); }
.nav-label, .eyebrow { color: #9b8d84; }
.eyebrow { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.button { border-radius: 4px; background: #171617; }
.button.primary { border-color: var(--red); background: var(--red); color: #fff8ed; box-shadow: none; }
.card, .family, .catalogue-item { background: var(--panel); border-radius: 6px; }
.family:hover { border-color: #765056; }
.family .kicker { color: #a7646d; }
.family .count { display: none; }
.hero-mark::before, .hero-mark::after { display: none; }
.hero-mark img { border-radius: 5px; box-shadow: 18px 18px 0 #231719; }
.metric { background: #121214; }
.terminal { border-radius: 5px; background: #080809; }
.terminal-top { background: #171617; }
.terminal-top i { background: #716b67 !important; }
.terminal-top i:first-child { background: var(--red) !important; }
.step::before, .step-no { border-radius: 50%; border-color: #765056; background: #211719; color: #d98a92; }
pre { border-radius: 4px; background: #101011; }
:not(pre) > code { color: #c9d2d1; background: #171719; }
.callout { border-color: #7f959a; border-radius: 0 4px 4px 0; background: #15191a; }
.callout.warning { border-color: var(--red); background: #201416; }
.checklist li::before { color: #8ea28b; }
.rank-list i::before { background: #8f3945; }
.status::before { box-shadow: none; }
.badge { color: #c0cbcb; border-color: #4a5d61; background: #15191a; }

.backlink { display: inline-block; margin-bottom: 2rem; color: var(--muted); text-decoration: none; font-size: .86rem; }
.output-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 34px 0 22px; padding: 13px 0; border-block: 1px solid var(--line); font-size: .82rem; }
.output-nav a { text-decoration: none; font-weight: 700; }
.output-nav a:last-child { text-align: right; }
.output-nav span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.evidence-figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #f1eee8; box-shadow: var(--shadow); }
.evidence-figure img { display: block; width: 100%; height: auto; max-height: 760px; object-fit: contain; object-position: top left; }
.evidence-figure figcaption { padding: 12px 15px; color: var(--muted); background: #151416; font-size: .78rem; }
.reading-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 24px 0; border: 1px solid var(--line); background: var(--line); }
.reading-grid > div { padding: 22px; background: var(--panel); }
.reading-grid h2 { margin: 0 0 8px; font-size: 1.25rem; }
.reading-grid p { margin: 0; color: var(--muted); }
.parameter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 24px 0; border: 1px solid var(--line); background: var(--line); }
.parameter-grid > div { display: grid; gap: 5px; padding: 17px; background: var(--panel); }
.parameter-grid strong { color: #f4eee4; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.parameter-grid span { color: var(--muted); font-size: .86rem; }
.output-summary { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: baseline; gap: 10px; margin: 32px 0 56px; padding: 19px 22px; border-block: 1px solid var(--line); }
.output-summary strong { color: #d2767f; font: 600 2rem/1 "Iowan Old Style", Georgia, serif; }
.output-summary span { color: var(--muted); }
.output-family { scroll-margin-top: 2rem; }
.output-family h2 small { color: var(--muted); font: .55em ui-monospace, monospace; }
.output-family ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.output-family li { border-bottom: 1px solid var(--line); }
.output-family li a { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 1.3fr); gap: 22px; padding: 15px 5px; color: inherit; text-decoration: none; }
.output-family li a:hover strong { color: #d77e87; }
.output-family li span { color: var(--muted); font-size: .86rem; }

.signature { margin: 24px 0; padding: 18px; overflow-x: auto; border-left: 3px solid var(--red); background: #111113; }
.signature code { color: #eee6d9; white-space: pre-wrap; overflow-wrap: anywhere; }
.api-doc { color: #c9c1b8; }
.api-members { display: grid; gap: 8px; }
.api-members details { padding: 13px 15px; border: 1px solid var(--line); background: var(--panel); }
.api-members summary { cursor: pointer; }
.api-members p { color: var(--muted); }
.api-list { border-top: 1px solid var(--line); }
.api-row { display: grid; grid-template-columns: minmax(230px, .75fr) minmax(0, 1.25fr); gap: 24px; align-items: start; padding: 15px 5px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.api-row span { display: flex; align-items: baseline; gap: 9px; }
.api-row code { color: #eadfd3; }
.api-row small { color: #9f5e66; font: .64rem ui-monospace, monospace; text-transform: uppercase; }
.api-row p { margin: 0; color: var(--muted); font-size: .86rem; }
.api-row:hover code { color: #d77e87; }
.reference-search { display: grid; gap: 7px; margin: 26px 0; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.reference-search input { width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 3px; outline: none; color: var(--text); background: #111113; font: inherit; text-transform: none; letter-spacing: 0; }
.reference-search input:focus { border-color: #86545a; }
.table-scroll { overflow-x: auto; }

footer {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.footer-note { max-width: 74ch; color: #88817b; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 13px; color: #aaa29a; font-size: .76rem; }
.footer-meta a { color: inherit; }

/* Restrained editorial motion: hierarchy and orientation, never spectacle. */
@keyframes raven-reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes raven-mark {
  from { opacity: 0; transform: translateY(10px) rotate(-1.5deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}
.hero > div:first-child { animation: raven-reveal .62s cubic-bezier(.2,.7,.2,1) both; }
.hero-mark img { animation: raven-mark .78s .08s cubic-bezier(.2,.7,.2,1) both; }
.metrics { animation: raven-reveal .58s .14s cubic-bezier(.2,.7,.2,1) both; }
.family, .card, .shot { transition: transform .22s ease, border-color .22s ease, background-color .22s ease; }
.family::before, .card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .24s ease;
}
.family:hover::before, .card:hover::before { transform: scaleY(1); }
.family:hover, .card:hover, .shot:hover { transform: translateY(-3px); border-color: #6d4b50; }
.card { position: relative; overflow: hidden; }
.button { transition: transform .18s ease, border-color .18s ease, background-color .18s ease; }
.brand img { transition: transform .28s ease; }
.brand:hover img { transform: rotate(-2deg) translateY(-1px); }
.motion-ready .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .48s ease var(--reveal-delay, 0ms), transform .48s cubic-bezier(.2,.7,.2,1) var(--reveal-delay, 0ms), border-color .22s ease;
}
.motion-ready .reveal.is-visible { opacity: 1; transform: translateY(0); }
.motion-ready .family.reveal.is-visible:hover,
.motion-ready .card.reveal.is-visible:hover,
.motion-ready .shot.reveal.is-visible:hover { transform: translateY(-3px); }

.research-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 34px;
  margin: 56px 0 30px;
  padding: 28px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  background: var(--panel);
}
.research-link h2 { margin: 8px 0 10px; font-size: clamp(1.55rem, 3vw, 2.15rem); }
.research-link p { margin: 0; color: var(--muted); }
.research-principle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 34px 0 64px;
  border: 1px solid var(--line);
  background: var(--line);
}
.research-principle strong {
  padding: 21px;
  color: #d8d0c5;
  background: var(--panel);
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: 1.02rem;
  font-weight: 500;
}
.paper-group { margin-top: 70px; scroll-margin-top: 28px; }
.paper-list { border-top: 1px solid var(--line); }
.paper {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 1.25fr) auto;
  gap: 24px;
  align-items: start;
  padding: 22px 5px;
  border-bottom: 1px solid var(--line);
}
.paper.featured { border-left: 2px solid var(--red); padding-left: 18px; }
.paper span { color: #a36d73; font: 700 .68rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; }
.paper h3 { margin: 8px 0 0; font-size: 1.14rem; }
.paper p { margin: 0; color: var(--muted); font-size: .9rem; }
.paper > a { white-space: nowrap; text-decoration: none; font-size: .8rem; font-weight: 700; }

/* Built-in syntax colour: dependency-free and shared by every documentation page. */
pre.has-syntax {
  padding-top: 49px;
  border-color: #3c3944;
  border-left: 3px solid #9f1729;
  background:
    linear-gradient(90deg, rgba(151, 16, 36, .07), transparent 18%),
    #0d0d10;
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 18px 45px rgba(0, 0, 0, .16);
}
pre.has-syntax::before {
  content: attr(data-language);
  position: absolute;
  top: 14px;
  left: 18px;
  color: #7da9e8;
  font: 800 .64rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
pre.has-syntax::after {
  content: "";
  position: absolute;
  top: 34px;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, #8f1728, #274f82 46%, transparent 78%);
  opacity: .65;
}
pre.has-syntax code { color: #d7dde7; text-shadow: 0 1px #000; }
.tok-keyword { color: #c792ea; font-weight: 700; }
.tok-function { color: #45d6c4; }
.tok-method { color: #c792ea; }
.tok-builtin { color: #4fd6be; }
.tok-namespace { color: #5eb4ff; font-weight: 800; }
.tok-class { color: #ff6b7f; font-weight: 750; }
.tok-parameter { color: #ffa657; }
.tok-variable { color: #d7dde7; }
.tok-attribute { color: #bd93f9; }
.tok-string { color: #8ecbff; }
.tok-property { color: #ff9f55; }
.tok-option { color: #ff8f56; }
.tok-number { color: #b5d98c; }
.tok-constant { color: #66aaff; font-weight: 650; }
.tok-operator { color: #ff667d; }
.tok-punctuation { color: #ffd60a; }
.tok-brace { color: #ff68d4; }
.tok-delimiter { color: #9aa4b2; }
.tok-comment { color: #6f7886; font-style: italic; }
code.language-shell .tok-variable { color: #c792ea; }
.tok-path { color: #b5d98c; }
.terminal pre.has-syntax { padding-top: 20px; border-left: 0; box-shadow: none; }
.terminal pre.has-syntax::before, .terminal pre.has-syntax::after { display: none; }

.catalogue a.catalogue-item { position: relative; color: inherit; text-decoration: none; padding-right: 132px; }
.catalogue a.catalogue-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(#bd1c31, #326cac);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .2s ease;
}
.catalogue a.catalogue-item:hover,
.catalogue a.catalogue-item:focus-visible { border-color: #684248; background: #171416; outline: none; }
.catalogue a.catalogue-item:hover::before,
.catalogue a.catalogue-item:focus-visible::before { transform: scaleY(1); }
.catalogue a.catalogue-item strong { color: #f2ece3; }
.catalogue a.catalogue-item:hover strong { color: #eb7786; }
.catalogue-open { position: absolute; right: 17px; color: #7ca9df; font-size: .72rem; font-weight: 800; white-space: nowrap; }

/* Identity and origin — the raven mark, the name, and the research lineage. */
.vraven-wordmark {
  position: relative;
  z-index: 0;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  color: #b90d21;
  background: linear-gradient(180deg, #ff4052 0%, #b4091e 43%, #62030e 72%, #0a0002 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: Copperplate, Baskerville, "Iowan Old Style", Georgia, serif;
  font-weight: 900;
  line-height: .82;
  letter-spacing: .055em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .9), 0 8px 22px rgba(134, 0, 20, .2);
  filter: saturate(1.08) contrast(1.08);
}
.vraven-wordmark::before {
  content: attr(data-text);
  position: absolute;
  inset: .045em auto auto .04em;
  z-index: -1;
  color: #020203;
  -webkit-text-fill-color: #020203;
  text-shadow: 0 .045em .02em #000;
}
.vraven-wordmark::after {
  content: "";
  position: absolute;
  left: 16%;
  bottom: -.19em;
  width: .055em;
  height: .23em;
  border-radius: 0 0 99px 99px;
  background: linear-gradient(#870414, #250005 80%, transparent);
  box-shadow:
    1.05em .05em 0 -.012em #69030f,
    2.15em -.02em 0 -.018em #300006,
    3.25em .08em 0 -.012em #8f0618,
    4.25em .01em 0 -.02em #430008;
  opacity: .9;
}
.hero-wordmark { margin: 0 0 27px; font-size: clamp(3.3rem, 7vw, 6.7rem); }
.identity-wordmark { margin: 24px 0 30px; font-size: clamp(3.8rem, 8vw, 7rem); }
.banner-wordmark {
  display: block;
  max-width: 100%;
  margin-bottom: 20px;
  font-size: clamp(2rem, 3.2vw, 3rem);
  letter-spacing: .035em;
  white-space: nowrap;
}

.brand-wordmark, .mobile-wordmark {
  color: #c9192e !important;
  background: linear-gradient(180deg, #f34151, #9a0718 62%, #150003);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: Copperplate, Baskerville, "Iowan Old Style", Georgia, serif !important;
  font-weight: 900 !important;
  text-shadow: 1px 2px 0 #000;
}
.brand-wordmark { font-size: 1.18rem !important; }
.mobile-wordmark { font-size: 1.04rem; letter-spacing: .11em !important; }

.raven-portrait {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 10px;
  border: 1px solid #4b3034;
  background: linear-gradient(145deg, #211417, #0a090a 64%);
  box-shadow: 18px 18px 0 #231416, 0 28px 72px rgba(0, 0, 0, .46);
}
.raven-portrait::before {
  content: "";
  position: absolute;
  inset: -8px auto -8px -8px;
  width: 2px;
  background: linear-gradient(transparent, #c7192c 18%, #3c030b 82%, transparent);
}
.raven-portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 0 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}
.raven-portrait figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  margin: 0 !important;
  padding: 12px 4px 3px;
  color: #8f8580;
  font: 700 .62rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.raven-portrait figcaption span { color: #bd5360; }
.raven-portrait figcaption strong { color: #aba29a; font-weight: 600; text-align: right; }
.hero-mark { min-height: 405px; }
.hero-mark .raven-portrait { width: 278px; transform: rotate(1deg); }
.hero-mark .raven-portrait:hover { transform: rotate(0); }

.identity-banner {
  display: grid;
  grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr);
  gap: 44px;
  align-items: center;
  margin: 58px 0 30px;
  padding: 34px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  background: linear-gradient(115deg, #171214, var(--panel) 58%);
}
.identity-signature { min-width: 0; overflow: hidden; padding: 8px 26px 12px 3px; border-right: 1px solid #472c30; }
.identity-signature > span { display: block; max-width: 31ch; color: #867e77; font: 700 .66rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.identity-banner h2 { margin: 8px 0 12px; }
.identity-banner p { margin: 0 0 14px; color: var(--muted); }
.identity-banner a { font-weight: 700; text-decoration: none; }

.identity-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: clamp(32px, 7vw, 84px);
  align-items: center;
  padding-bottom: 58px;
  border-bottom: 1px solid var(--line);
}
.identity-hero h1 { margin-bottom: 18px; }
.identity-hero .raven-portrait { width: min(100%, 300px); justify-self: end; }
.origin-section { margin-top: 68px; }
.origin-section > p { max-width: 76ch; color: #c3bbb2; }
.acronym-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--line);
}
.acronym-grid > div {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 15px;
  align-items: center;
  min-height: 96px;
  padding: 18px 20px;
  background: var(--panel);
}
.acronym-grid strong {
  color: #d37079;
  font: 600 2.5rem/1 "Iowan Old Style", Georgia, serif;
}
.acronym-grid span { color: var(--muted); font-size: .9rem; }
.acronym-grid b { color: #eee8dc; }
.translation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.translation-grid article {
  position: relative;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}
.translation-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--red);
}
.translation-grid span {
  color: #a66a70;
  font: 700 .66rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.translation-grid h3 { margin: 9px 0; }
.translation-grid p { margin: 0; color: var(--muted); font-size: .9rem; }
.lineage-statement {
  display: grid;
  grid-template-columns: minmax(150px, .3fr) minmax(0, 1.7fr);
  gap: 28px;
  margin: 38px 0 62px;
  padding: 25px 0;
  border-block: 1px solid #56363a;
}
.lineage-statement > span {
  color: #bf747b;
  font: 700 .72rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.lineage-statement p { margin: 0; color: #d0c7bc; }

/* Intermediate laptop widths keep the reading column comfortable. */
@media (min-width: 901px) and (max-width: 1200px) {
  :root { --sidebar: 244px; }
  .sidebar { padding-inline: 14px; }
  .content, .content.narrow { width: min(calc(100% - 36px), 880px); }
  .hero { grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; }
  .hero-mark { min-height: 280px; }
  .hero-mark .raven-portrait { width: 210px; }
  .gallery-grid { grid-template-columns: 1fr; }
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --red: #c92a3e;
  --red-soft: #be123c;
  --teal: #0369a1;
  --blue: #1d4ed8;
  --green: #15803d;
  --amber: #b45309;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #0f172a;
}

[data-theme="light"] a {
  color: #be123c;
}
[data-theme="light"] a:hover {
  color: #9f1239;
}

[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: #e2e8f0;
}

[data-theme="light"] .mobile-bar {
  background: rgba(255, 255, 255, .96);
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .menu-button {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f1f5f9;
}

[data-theme="light"] .brand,
[data-theme="light"] .mobile-wordmark {
  color: #0f172a;
}

[data-theme="light"] .nav-label,
[data-theme="light"] .eyebrow {
  color: #64748b;
}

[data-theme="light"] .nav a {
  color: #334155;
}

[data-theme="light"] .nav a:hover {
  color: #0f172a;
  background: #f1f5f9;
}

[data-theme="light"] .nav a[aria-current="page"] {
  color: #be123c;
  background: #ffe4e6;
  box-shadow: inset 2px 0 #be123c;
}

[data-theme="light"] .button {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .button:hover {
  border-color: #94a3b8;
  background: #e2e8f0;
}

[data-theme="light"] .button.primary {
  border-color: #be123c;
  background: #be123c;
  color: #ffffff;
}

[data-theme="light"] .card,
[data-theme="light"] .family,
[data-theme="light"] .catalogue-item,
[data-theme="light"] .panel,
[data-theme="light"] .research-link,
[data-theme="light"] .identity-banner {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .card a,
[data-theme="light"] .family h3,
[data-theme="light"] .catalogue-item strong,
[data-theme="light"] .research-link h2 {
  color: #0f172a;
}

[data-theme="light"] .metric {
  background: #ffffff;
}
[data-theme="light"] .metric strong {
  color: #0f172a;
}
[data-theme="light"] .metrics {
  background: #e2e8f0;
  border-color: #e2e8f0;
}

/* Fix callout boxes in light mode */
[data-theme="light"] .callout {
  border-color: #0284c7;
  border-left-width: 4px;
  background: #f0f9ff;
  color: #0f172a;
}
[data-theme="light"] .callout.warning {
  border-color: #be123c;
  background: #fff1f2;
  color: #881337;
}
[data-theme="light"] .callout strong {
  color: #0f172a;
}

[data-theme="light"] pre {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="light"] :not(pre) > code {
  color: #0284c7;
  background: #e0f2fe;
  border-color: #bae6fd;
}

[data-theme="light"] .signature {
  background: #f1f5f9;
  border-left-color: #be123c;
}
[data-theme="light"] .signature code {
  color: #0f172a;
}

[data-theme="light"] .api-row code {
  color: #be123c;
}
[data-theme="light"] .api-row p {
  color: #475569;
}

[data-theme="light"] .badge {
  color: #0369a1;
  border-color: #bae6fd;
  background: #e0f2fe;
}

[data-theme="light"] .terminal {
  background: #0f172a;
  border-color: #334155;
}
[data-theme="light"] .terminal-top {
  background: #1e293b;
}

[data-theme="light"] .hero-card {
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  border-color: #e2e8f0;
}

[data-theme="light"] .hero-mark img {
  box-shadow: 14px 14px 0 #e2e8f0;
}

[data-theme="light"] .pathway > div {
  background: #ffffff;
  border-top-color: #be123c;
  border-color: #e2e8f0;
}

[data-theme="light"] .research-principle strong {
  color: #0f172a;
  background: #ffffff;
}

[data-theme="light"] .paper {
  border-color: #e2e8f0;
}

[data-theme="light"] .reading-grid > div,
[data-theme="light"] .parameter-grid > div {
  background: #ffffff;
}
[data-theme="light"] .parameter-grid strong {
  color: #0f172a;
}

[data-theme="light"] .output-summary strong {
  color: #be123c;
}

[data-theme="light"] .reference-search input {
  color: #0f172a;
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .footer-note,
[data-theme="light"] .footer-meta {
  color: #64748b;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--teal);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.search-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 12px 0 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}

.search-trigger:hover {
  border-color: var(--teal);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 212, 255, .12);
}

.search-trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--muted);
}

.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(12vh, 100px) 16px 24px;
  background: rgba(3, 10, 18, .78);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.search-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.search-modal {
  position: relative;
  width: min(100%, 640px);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 212, 255, .15);
  overflow: hidden;
  transform: scale(.96);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1);
}

.search-backdrop.is-open .search-modal {
  transform: scale(1);
}

.search-input-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.search-input-header svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 480px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: background .15s ease;
}

.search-result-item:hover,
.search-result-item.is-selected {
  background: var(--panel-2);
}

.search-result-item.is-selected {
  box-shadow: inset 3px 0 var(--teal);
}

.search-result-title {
  font-weight: 650;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-desc {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 2px;
}

.search-result-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(0, 212, 255, .1);
  color: var(--teal);
}

.search-result-tag.tag-tutorial { background: rgba(50, 215, 123, .12); color: var(--green); }
.search-result-tag.tag-api { background: rgba(22, 139, 255, .12); color: var(--blue); }
.search-result-tag.tag-cli { background: rgba(255, 159, 67, .12); color: var(--amber); }
.search-result-tag.tag-output { background: rgba(255, 45, 85, .12); color: var(--red-soft); }

.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
}

.search-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--muted);
}

.search-footer-keys {
  display: flex;
  gap: 12px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: .82rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--teal);
}

.breadcrumbs span {
  opacity: .5;
}

.colab-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 24px;
  border: 1px solid #f97316;
  border-radius: 30px;
  background: rgba(249, 115, 22, .1);
  color: #fb923c;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  transition: all .2s ease;
}

.colab-badge:hover {
  background: rgba(249, 115, 22, .2);
  color: #fff;
  transform: translateY(-1px);
}

.colab-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all .25s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  color: var(--teal);
  border-color: var(--teal);
  transform: translateY(-2px);
}

/* Tablet and mobile navigation updates */
@media (max-width: 900px) {
  body.menu-open { overflow: hidden; }
  .sidebar { width: min(86vw, 320px); }
  body.menu-open .page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(0, 0, 0, .58);
  }
  .mobile-bar { padding-inline: max(16px, env(safe-area-inset-left)); }
  .menu-button { min-width: 48px; min-height: 40px; }
  .content, .content.narrow { width: min(calc(100% - 40px), 820px); }
  .output-family li a, .api-row { grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr); }
  .evidence-figure img { max-height: none; }
}

@media (max-width: 720px) {
  h1 { font-size: clamp(2.2rem, 11vw, 3.5rem); overflow-wrap: anywhere; }
  h2 { font-size: clamp(1.55rem, 7vw, 2.1rem); }
  .lede { font-size: 1.04rem; }
  .content, .content.narrow { width: min(calc(100% - 30px), 680px); padding-top: 34px; padding-bottom: 68px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .grid, .family-grid, .gallery-grid, .split { grid-template-columns: 1fr; }
  .case-hero figure img { height: auto; aspect-ratio: 16 / 10; }
  .shot img { height: auto; aspect-ratio: auto; }
  pre { padding: 17px 14px; font-size: .88rem; }
  .copy { position: sticky; float: right; margin: -8px -5px 8px 10px; min-height: 34px; }
  .command-table { min-width: 680px; }
  .table-scroll { margin-inline: -15px; padding-inline: 15px; }
  .output-family li a, .api-row { grid-template-columns: 1fr; gap: 5px; }
  .reading-grid, .parameter-grid { grid-template-columns: 1fr; }
  .output-summary { grid-template-columns: auto 1fr; }
  .license-note { flex-direction: column; }
  .research-link { grid-template-columns: 1fr; align-items: start; }
  .research-link .button { justify-self: start; }
  .research-principle { grid-template-columns: 1fr; }
  .paper { grid-template-columns: 1fr; gap: 9px; }
  .catalogue a.catalogue-item { padding-right: 17px; }
  .catalogue-open { position: static; grid-column: 1 / -1; margin-top: 4px; }
  .identity-banner, .identity-hero { grid-template-columns: 1fr; }
  .identity-banner { gap: 26px; padding: 26px; }
  .identity-signature { border-right: 0; border-bottom: 1px solid #472c30; padding: 4px 0 25px; }
  .identity-hero figure { width: min(300px, 82vw); }
  .acronym-grid, .translation-grid { grid-template-columns: 1fr; }
  .lineage-statement { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 420px) {
  .content, .content.narrow { width: min(calc(100% - 24px), 396px); }
  .mobile-bar { height: 56px; }
  .hero-mark { min-height: 190px; }
  .hero-mark .raven-portrait { width: min(210px, 72vw); box-shadow: 10px 10px 0 #231719; }
  .hero-wordmark { font-size: clamp(2.8rem, 18vw, 4.2rem); }
  .identity-wordmark { font-size: clamp(3rem, 19vw, 4.4rem); }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-width: 0; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; }
  .output-nav { grid-template-columns: 1fr 1fr; font-size: .76rem; }
  .output-nav span { grid-column: 1 / -1; grid-row: 1; overflow-wrap: anywhere; }
  .output-nav a:last-child { text-align: right; }
  .signature { padding: 14px 12px; }
  .walk-step { grid-template-columns: 1fr; }
  .step-no { position: static; }
}

@media (max-width: 600px) {
  .output-nav { grid-template-columns: 1fr 1fr; }
  .output-nav span { grid-column: 1 / -1; grid-row: 1; }
  .reading-grid, .parameter-grid { grid-template-columns: 1fr; }
  .output-summary { grid-template-columns: auto 1fr; }
  .output-family li a, .api-row { grid-template-columns: 1fr; gap: 5px; }
}
