@font-face {
  font-family: "Cascadia Mono";
  src: url("fonts/CascadiaMono.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --bg: #0a1117;
  --bg-2: #0e1820;
  --panel: #121f29;
  --panel-2: #172733;
  --edge: #22404b;
  --edge-2: #2f5a66;
  --text: #e4e9ea;
  --muted: #a3b8bc;
  --teal: #3cc4c0;
  --teal-deep: #1b6f73;
  --orange: #ffa53d;
  --orange-soft: #ffc27a;
  --ink: #05090d;
  --gutter: 16px;
  --wrap: 1180px;
  --mono: "Cascadia Mono", "Cascadia Code", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--orange-soft); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(10, 17, 23, 0.92); border-bottom: 1px solid var(--edge); backdrop-filter: blur(6px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: 30px; }
.brand b { font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; }
.top nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.top nav a { color: var(--text); text-decoration: none; font-size: 13px; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--orange); }

/* Type */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--orange); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 18px; }
.eyebrow::before { content: ""; width: 9px; height: 9px; background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 165, 61, 0.18); }
h1, h2, h3 { font-weight: 700; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 6.4vw, 68px); line-height: 1.04; }
h1 em, h2 em { font-style: normal; color: var(--teal); }
h2 { font-size: clamp(28px, 4.4vw, 48px); line-height: 1.08; }
h3 { font-size: 18px; line-height: 1.3; }
p { margin: 0 0 14px; }
.lead { color: var(--muted); font-size: 17px; max-width: 58ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 26px; }
.button { display: inline-flex; align-items: center; gap: 10px; padding: 13px 18px; font: 700 13px/1 var(--mono); text-decoration: none; border: 1px solid var(--edge-2); color: var(--text); background: var(--panel); }
.button:hover { border-color: var(--orange); color: var(--orange); }
.button.primary { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.button.primary:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }

/* Hero */
.hero { padding: 64px 0 56px; display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); padding: 88px 0 72px; } }
.hero .note { margin-top: 20px; font-size: 13px; color: var(--muted); }

/* Specimen panel */
.specimen { position: relative; border: 1px solid var(--edge-2); background:
  radial-gradient(circle at 50% 46%, rgba(60, 196, 192, 0.16), transparent 58%),
  repeating-linear-gradient(0deg, transparent 0 23px, rgba(60, 196, 192, 0.06) 23px 24px),
  repeating-linear-gradient(90deg, transparent 0 23px, rgba(60, 196, 192, 0.06) 23px 24px),
  var(--bg-2);
  padding: 18px; display: grid; gap: 14px; }
.specimen header { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.specimen header b { color: var(--teal); font-weight: 700; }
.stage { height: 300px; display: grid; place-items: center; border-bottom: 1px solid var(--edge); }
.sprite { image-rendering: auto; background-repeat: no-repeat; transform-origin: center bottom; }
.specimen .readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 16px; font-size: 12px; }
.readout dt { color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.readout dd { margin: 0; color: var(--text); }
.swatch { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; margin-right: 6px; border: 1px solid var(--ink); }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.controls button { font: 600 12px/1 var(--mono); padding: 9px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--edge-2); cursor: pointer; }
.controls button:hover { border-color: var(--teal); color: var(--teal); }
.controls button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.controls .next { margin-left: auto; border-color: var(--orange); color: var(--orange); }
.specimen .caption { font-size: 11px; color: var(--muted); margin: 0; }

/* Ticker */
.ticker { border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); background: var(--bg-2); overflow: hidden; }
.ticker ul { list-style: none; margin: 0 auto; padding: 18px var(--gutter); max-width: var(--wrap); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; }
.ticker li { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; display: flex; align-items: center; gap: 28px; }
.ticker li b { color: var(--teal); font-weight: 700; margin-right: 8px; }
.ticker li + li::before { content: "✳"; color: var(--orange); }

/* Sections */
section.block { padding: 76px 0; border-bottom: 1px solid var(--edge); }
.block-head { display: grid; gap: 18px 48px; margin-bottom: 36px; }
@media (min-width: 900px) { .block-head { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; } }
.block-head p { color: var(--muted); max-width: 60ch; margin: 0; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.card { background: var(--panel); border: 1px solid var(--edge); padding: 22px; display: grid; gap: 10px; align-content: start; }
.card .num { color: var(--orange); font-size: 12px; letter-spacing: 0.12em; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.figure { margin: 0; }
.figure img { display: block; width: 100%; height: auto; border: 1px solid var(--edge-2); background: var(--bg-2); }
.figure img.pixel { image-rendering: pixelated; }
.figure figcaption { color: var(--muted); font-size: 12px; margin-top: 10px; }
.split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } .split.flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { border-top: 1px solid var(--edge); padding: 14px 0; display: grid; gap: 4px; }
@media (min-width: 720px) { .list li { grid-template-columns: 19ch minmax(0, 1fr); gap: 20px; } }
.list strong { font-weight: 700; color: var(--text); }
.list span { color: var(--muted); font-size: 14px; }
.order { counter-reset: n; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.order li { counter-increment: n; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--muted); }
.order li::before { content: counter(n, decimal-leading-zero); color: var(--orange); font-weight: 700; }
.order b { color: var(--text); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--edge); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--edge); vertical-align: top; }
th { color: var(--text); font-weight: 700; background: var(--panel); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
td { color: var(--muted); }
td b { color: var(--text); }
tr:last-child td { border-bottom: 0; }

/* Annotated screen */
.annotated { position: relative; }
.annotated img { display: block; width: 100%; height: auto; border: 1px solid var(--edge-2); }
.pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--orange); color: var(--ink); font-weight: 700; font-size: 13px; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }
@media (max-width: 560px) { .pin { width: 20px; height: 20px; margin: -10px 0 0 -10px; font-size: 11px; } }
.legend { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 4px 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.legend li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--edge); font-size: 14px; }
.legend .n { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: var(--ink); font-weight: 700; display: grid; place-items: center; font-size: 12px; }
.legend b { display: block; color: var(--text); }
.legend span.d { color: var(--muted); }

/* Habitat strip and guide */
.habitats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.habitats figure { margin: 0; border: 1px solid var(--edge); background: var(--panel); }
.habitats img { display: block; width: 100%; height: auto; }
.habitats figcaption { padding: 10px 12px; font-size: 12px; color: var(--muted); }
.habitats figcaption b { display: block; color: var(--text); font-size: 13px; }
.guide { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.guide article { background: var(--panel); border: 1px solid var(--edge); display: grid; grid-template-rows: auto 1fr; }
.guide .pane { height: 190px; display: grid; place-items: center; border-bottom: 1px solid var(--edge); background: radial-gradient(circle at 50% 60%, rgba(60, 196, 192, 0.12), transparent 62%), var(--bg-2); }
.guide .body { padding: 18px 20px 20px; display: grid; gap: 10px; align-content: start; }
.guide .body p { color: var(--muted); font-size: 14px; margin: 0; }
.guide dl { display: grid; grid-template-columns: 11ch 1fr; gap: 4px 12px; margin: 4px 0 0; font-size: 13px; }
.guide dt { color: var(--muted); }
.guide dd { margin: 0; }

/* Status and closing */
.status { border: 1px solid var(--orange); background: linear-gradient(90deg, rgba(255, 165, 61, 0.08), transparent); padding: 28px; display: grid; gap: 10px; max-width: 820px; }
.status p { margin: 0; color: var(--muted); }
.status strong { color: var(--text); }
.closing { padding: 90px 0; text-align: center; }
.closing h2 { margin-bottom: 18px; }
.page-head { padding: 64px 0 36px; border-bottom: 1px solid var(--edge); }
.page-head p { max-width: 64ch; }
.prose { max-width: 74ch; }
.prose h3 { margin: 30px 0 10px; }
.sources { font-size: 13px; color: var(--muted); padding-left: 18px; }
.sources li { margin: 6px 0; overflow-wrap: anywhere; }

/* Footer */
footer.foot { padding: 40px 0 48px; color: var(--muted); font-size: 13px; }
footer.foot .wrap { display: grid; gap: 6px; }
footer.foot b { color: var(--text); }
.nanolytics-choice { max-width: var(--wrap); margin: 22px auto 0; padding: 18px var(--gutter) 0; border-top: 1px solid var(--edge); }
.nanolytics-choice-text, .nanolytics-choice-status { max-width: 760px; }
.nanolytics-choice-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.nanolytics-choice-actions button { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--teal); padding: 8px 12px; cursor: pointer; }
.nanolytics-choice-actions button:hover { background: var(--edge); }
.nanolytics-choice [hidden] { display: none !important; }
