/* Byson PacketBench — Byson design system with a phosphor "terminal" accent. */
@font-face { font-family: Manrope; src: url("./fonts/manrope-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #080b0a;
  --ink-2: #0f1412;
  --ink-3: #18201c;
  --on-ink: #eef4ef;
  --on-ink-muted: #9fb0a6;
  --ink-line: #ffffff1c;
  --phos: #7cf5a8;
  --phos-soft: #c8fbd9;
  --bg: #eff1ee;
  --paper: #fbfcfa;
  --panel-2: #e4e9e4;
  --text: #0f1512;
  --muted: #56615a;
  --border: #d3dad4;
  --accent: #0b7a43;
  --accent-bg: #d8f5e2;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --radius: 20px;
  --header: 72px;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #0b0f0d;
  --paper: #121815;
  --panel-2: #18201c;
  --text: #eef4ef;
  --muted: #a3b2a9;
  --border: #26302b;
  --accent: #7cf5a8;
  --accent-bg: #173326;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; }
main { overflow-x: clip; }
body:has(.mobile-menu[open]) { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
:where(h1, h2, h3, p) { margin: 0; }
h1, h2, h3 { font-weight: 650; letter-spacing: -.045em; line-height: 1; }
:is(h1, h2) em, .section-head h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.03em; color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--phos); color: var(--ink); }
.mono, code { font-family: var(--mono); }
.wrap { width: min(1400px, calc(100% - clamp(32px, 6vw, 110px))); margin-inline: auto; }
.skip { position: fixed; z-index: 100; left: 1rem; top: 1rem; padding: .6rem 1rem; border-radius: 999px; background: var(--phos); color: var(--ink); font-weight: 700; transform: translateY(-200%); }
.skip:focus { transform: none; }
main#main { outline: none; animation: page-in .6s var(--ease) backwards; }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes rise { from { opacity: 0; transform: translateY(32px); } }
.icon { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ---------- Buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.1rem; border: 0; border-radius: 999px; background: var(--paper); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); font-weight: 650; font-size: .92rem; cursor: pointer; transition: background-color .3s, color .3s, box-shadow .3s, transform .4s var(--ease); }
button:hover, .btn:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--text); }
.primary, button.primary { background: var(--ink); color: var(--on-ink); box-shadow: none; }
:root[data-theme=dark] .primary { background: var(--phos); color: var(--ink); }
.primary:hover { background: var(--accent); color: #fff; box-shadow: none; }
:root[data-theme=dark] .primary:hover { background: var(--phos-soft); color: var(--ink); }
.tabs [aria-pressed=true], button[aria-pressed=true] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
:root[data-theme=dark] .tabs [aria-pressed=true], :root[data-theme=dark] button[aria-pressed=true] { background: var(--phos); color: var(--ink); }
.icon-btn { width: 44px; padding: 0; }
.nav, .tools, .actions, .meta, .filters, .tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* ---------- Header ---------- */
header#header { position: sticky; top: 0; z-index: 50; color: var(--on-ink); }
header#header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--ink-line); }
.header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header); }
.brand { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: .65rem; color: inherit; font-weight: 800; letter-spacing: -.045em; line-height: .95; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--phos); color: var(--ink); transition: transform .8s var(--ease); }
.brand-mark .icon { width: 20px; height: 20px; }
.brand:hover .brand-mark { transform: rotate(-10deg) scale(1.05); }
.brand-text { font-size: 1.25rem; }
.brand-text small { display: block; margin-top: .3rem; font: 500 .5rem/1.2 var(--mono); letter-spacing: .24em; text-transform: uppercase; opacity: .7; }
.header > .nav { gap: .15rem; padding: .3rem; border-radius: 999px; background: #ffffff0d; box-shadow: inset 0 0 0 1px var(--ink-line); }
.nav a { padding: .45rem .9rem; border-radius: 999px; color: var(--on-ink-muted); font-size: .85rem; font-weight: 650; transition: color .3s, background-color .3s; }
.nav a:hover { color: var(--on-ink); background: #ffffff12; }
.nav a[aria-current=page] { color: var(--ink); background: var(--on-ink); }
.header .tools { flex-wrap: nowrap; }
.header .tools button { min-height: 42px; background: #ffffff0d; color: var(--on-ink); box-shadow: inset 0 0 0 1px var(--ink-line); }
.header .tools button:hover { background: #ffffff1c; }
.header .tools .progress-btn { background: var(--phos); color: var(--ink); box-shadow: none; }
.header .tools .progress-btn:hover { background: var(--phos-soft); }
.mobile-menu { display: none; position: relative; z-index: 2; }
.mobile-menu summary { display: flex; align-items: center; min-height: 42px; padding: .4rem 1rem; list-style: none; border-radius: 999px; background: #ffffff0d; box-shadow: inset 0 0 0 1px var(--ink-line); font-weight: 650; font-size: .88rem; cursor: pointer; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu[open] summary { background: var(--on-ink); color: var(--ink); }
.mobile-menu nav { position: fixed; inset: 0; z-index: -1; display: flex; flex-direction: column; justify-content: flex-start; gap: 0; height: 100dvh; overflow: auto; padding: calc(var(--header) + 2rem) clamp(16px, 5vw, 48px) 3rem; background: var(--ink); animation: menu-in .7s var(--ease) both; }
@keyframes menu-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.mobile-menu nav a { display: flex; align-items: baseline; gap: 1rem; padding: .25rem 0; border-bottom: 1px solid var(--ink-line); color: var(--on-ink); font-size: clamp(2rem, 9vw, 3.6rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.1; animation: rise .8s var(--ease) both; }
.mobile-menu nav a small { font: 500 .7rem/1 var(--mono); color: var(--phos); transform: translateY(-1.3em); }
.mobile-menu nav a:hover, .mobile-menu nav [aria-current=page] { color: var(--phos); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: var(--on-ink); margin-top: calc(var(--header) * -1); padding-top: var(--header); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: linear-gradient(var(--ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--ink-line) 1px, transparent 1px); background-size: 88px 88px; mask-image: radial-gradient(ellipse at 75% 35%, #000 5%, transparent 65%); }
.hero::after { content: ""; position: absolute; z-index: -1; width: 60vmax; aspect-ratio: 1; right: -20vmax; top: -25vmax; border-radius: 50%; background: radial-gradient(circle, #7cf5a833, transparent 62%); filter: blur(30px); animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-6vmax, 8vmax) scale(1.1); } }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; min-height: calc(88svh - var(--header)); padding-block: clamp(3rem, 8vh, 6rem) clamp(2rem, 5vh, 3rem); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .6rem; color: var(--phos); animation: rise 1s var(--ease) both; }
.hero .eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.hero h1 { margin-top: 1.4rem; font-size: clamp(3.2rem, 8vw, 8.6rem); line-height: .88; letter-spacing: -.07em; }
.hero h1 em { color: var(--phos); }
.line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.line > span { display: inline-block; animation: line-up 1.2s var(--ease) both; }
.line:nth-child(2) > span { animation-delay: .1s; }
@keyframes line-up { from { transform: translateY(110%) rotate(3deg); } }
.hero p { max-width: 46ch; margin-top: 1.6rem; font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.55; color: #c9d4cd; animation: rise 1.1s .25s var(--ease) both; }
.hero .actions { margin-top: 2rem; gap: .8rem; animation: rise 1.1s .35s var(--ease) both; }
.hero .btn { min-height: 52px; padding-inline: 1.4rem; font-size: .95rem; }
.hero .primary { background: var(--phos); color: var(--ink); }
.hero .primary:hover { background: var(--phos-soft); color: var(--ink); }
.hero .secondary { background: transparent; color: var(--on-ink); box-shadow: inset 0 0 0 1px #ffffff40; }
.hero .secondary:hover { background: #ffffff12; color: var(--on-ink); }
.hero-visual { animation: rise 1.3s .3s var(--ease) both; }
.hero-visual svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 40px 60px #0008); }
.hd-frame { fill: #0f1512; stroke: #ffffff22; }
.hd-dot { fill: #7cf5a8; opacity: .18; }
.hd-rule { stroke: #ffffff1a; }
.hd-label { fill: #9fb0a6; }
.hd-links path { fill: none; stroke: #7cf5a8; stroke-opacity: .55; stroke-width: 1.6; stroke-dasharray: 3 5; }
.hd-packet { fill: #7cf5a8; filter: drop-shadow(0 0 4px #7cf5a8); }
.hd-node { color: #7cf5a8; }
.hd-node rect { fill: #151d19; stroke: #7cf5a866; }
.hd-node text { fill: #eef4ef; }
.stats-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 2rem; border-top: 1px solid var(--ink-line); animation: rise 1.2s .45s var(--ease) both; }
.stat { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.2rem 0 0; }
.stat + .stat { padding-left: 1.2rem; border-left: 1px solid var(--ink-line); }
.stat b { font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 650; letter-spacing: -.05em; line-height: 1; color: var(--on-ink); }
.stat span { color: var(--on-ink-muted); font-size: .88rem; }

/* Ticker */
.ticker { position: relative; z-index: 2; overflow: hidden; margin-top: -1rem; padding-block: .95rem; background: var(--phos); color: var(--ink); transform: rotate(-1deg) scale(1.03); }
.ticker-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.ticker-track span { display: flex; align-items: center; gap: 1.8rem; padding-right: 1.8rem; font-size: clamp(1.2rem, 2.4vw, 2.2rem); font-weight: 650; letter-spacing: -.04em; white-space: nowrap; }
.ticker-track span::after { content: "✦"; font-size: .6em; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section h1 { font-size: clamp(2.6rem, 6vw, 6rem); line-height: .94; letter-spacing: -.06em; }
.section h2 { font-size: clamp(1.9rem, 3.8vw, 3.8rem); line-height: .98; letter-spacing: -.05em; }
.section h3 { font-size: clamp(1.15rem, 1.6vw, 1.45rem); letter-spacing: -.03em; line-height: 1.15; }
.section > .eyebrow { display: block; margin-bottom: 1rem; }
.eyebrow { font: 600 .72rem/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.eyebrow .icon { margin-right: .35rem; }
.section-index { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; margin-bottom: clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--border); font: 500 .72rem/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr); gap: 1rem 3rem; align-items: end; margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.section-head .sub { margin: 0; }
.muted, .sub { color: var(--muted); }
.sub { max-width: 52ch; margin-top: 1rem; font-size: 1.08rem; }
.section > h1 + .sub { margin-bottom: clamp(2rem, 4vw, 3rem); }

/* Filters */
.filters { gap: .6rem; margin-bottom: 1rem; }
.search { flex: 1 1 320px; display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: 0 1.1rem; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); transition: box-shadow .3s; }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 1rem; color: var(--text); }
.filters select { min-height: 52px; padding: 0 2.2rem 0 1.1rem; border: 0; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--border); appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.tabs { gap: .4rem; margin-bottom: 1.4rem; }
.tabs button { min-height: 40px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; color: var(--muted); font-size: .92rem; }

/* Grid & cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: clamp(.8rem, 1.5vw, 1.2rem); }
.card, .panel { border-radius: var(--radius); background: var(--paper); box-shadow: inset 0 0 0 1px var(--border); }
.card { position: relative; display: flex; flex-direction: column; gap: .7rem; padding: 1.4rem; transition: transform .55s var(--ease), box-shadow .3s, background-color .4s; }
.card:hover { transform: translateY(-5px); box-shadow: inset 0 0 0 1px var(--accent), 0 30px 60px -40px #0007; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.card h3 { font-size: 1.35rem; letter-spacing: -.035em; line-height: 1.12; }
.card h3 a { color: var(--text); }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-top button, .card .icon-btn { position: relative; z-index: 1; }
.card p { color: var(--muted); font-size: .95rem; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .9rem; border-top: 1px dashed var(--border); font-weight: 700; }
.card-bottom a { position: relative; z-index: 1; }
.card-bottom a::after { content: " ↗"; }
.tile { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-bg); color: var(--accent); transition: transform .6s var(--ease); }
.tile .icon { width: 24px; height: 24px; }
.card:hover .tile { transform: rotate(-8deg) scale(1.06); }
.tile.routing, .tile.wan { background: #dfe9ff; color: #2650b8; }
.tile.security, .tile.troubleshooting { background: #ffe5dc; color: #b2431b; }
.tile.ip-services, .tile.wireless { background: #f2e7ff; color: #6b3bb8; }
:root[data-theme=dark] .tile.routing, :root[data-theme=dark] .tile.wan { background: #1b2847; color: #9db8ff; }
:root[data-theme=dark] .tile.security, :root[data-theme=dark] .tile.troubleshooting { background: #3a2119; color: #ffb196; }
:root[data-theme=dark] .tile.ip-services, :root[data-theme=dark] .tile.wireless { background: #2c2140; color: #d2b8ff; }
.meta { gap: .35rem .8rem; color: var(--muted); font-size: .85rem; }
.meta .icon { margin-right: .2rem; vertical-align: -2px; }
.tag { padding: .2rem .65rem; border-radius: 999px; background: var(--ink); color: var(--on-ink); font: 600 .7rem/1.5 var(--mono); letter-spacing: .06em; }
:root[data-theme=dark] .tag { background: var(--phos); color: var(--ink); }
.empty { grid-column: 1 / -1; padding: 2rem; border-radius: var(--radius); background: var(--paper); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.card-top button[aria-pressed=true] { background: var(--phos); color: var(--ink); }

/* Panels */
.panel { padding: clamp(1.3rem, 2.4vw, 2rem); }
.panel h2 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); margin-bottom: .8rem; }
.panel h3 { margin: 1.2rem 0 .5rem; }
.panel p { color: var(--muted); }
.panel p + p { margin-top: .7rem; }
.panel ul, .panel ol { padding-left: 1.2rem; color: var(--muted); }
.panel li + li { margin-top: .35rem; }
.grid > .panel .tile { margin-bottom: 1.2rem; }
.grid > .panel { display: flex; flex-direction: column; gap: .6rem; }
.grid > .panel > h3 { margin: 0; font-size: 1.6rem; }
progress { width: 100%; height: 8px; margin-top: .6rem; border: 0; border-radius: 999px; overflow: hidden; background: var(--panel-2); appearance: none; }
progress::-webkit-progress-bar { background: var(--panel-2); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--phos)); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); }
.path-list { list-style: none; padding: 0 !important; margin: .8rem 0 0; border-top: 1px solid var(--border); counter-reset: step; }
.path-list li { counter-increment: step; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; margin: 0 !important; padding-block: .7rem; border-bottom: 1px solid var(--border); }
.path-list li::before { content: counter(step, decimal-leading-zero); font: 500 .72rem/1 var(--mono); color: var(--accent); }
.path-list a { color: var(--text); font-weight: 650; }
.path-list a:hover { color: var(--accent); }

/* Lab detail */
.detail-top { position: relative; isolation: isolate; overflow: hidden; margin: calc(clamp(3.5rem, 8vw, 7rem) * -1) calc(50% - 50vw) clamp(2rem, 4vw, 3rem); padding: clamp(3rem, 7vw, 6rem) calc(50vw - 50%) clamp(2.5rem, 5vw, 4rem); background: var(--ink); color: var(--on-ink); }
.detail-top::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: linear-gradient(var(--ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--ink-line) 1px, transparent 1px); background-size: 88px 88px; mask-image: radial-gradient(ellipse at 80% 0%, #000 0%, transparent 60%); }
.detail-top > a { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--ink-line); color: var(--on-ink-muted); font-size: .85rem; font-weight: 650; }
.detail-top > a::before { content: "←"; color: var(--phos); }
.detail-top > a:hover { color: var(--on-ink); background: #ffffff0d; }
.detail-top .eyebrow { margin-top: 1.6rem; color: var(--phos); }
.detail-top h1 { max-width: 18ch; margin-top: .8rem; font-size: clamp(2.4rem, 5.6vw, 5.4rem); animation: rise 1s var(--ease) both; }
.detail-top .sub { color: #c9d4cd; animation: rise 1s .1s var(--ease) both; }
.detail-top .meta { margin-top: 1.4rem; color: var(--on-ink-muted); }
.detail-top .tag { background: var(--phos); color: var(--ink); }
.detail-top .icon-btn { background: #ffffff0d; color: var(--on-ink); box-shadow: inset 0 0 0 1px var(--ink-line); }
.detail-top .icon-btn[aria-pressed=true] { background: var(--phos); color: var(--ink); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.stack { display: grid; gap: clamp(.8rem, 1.5vw, 1.2rem); }
.flow > * + * { margin-top: .9rem; }
.flow h3 { margin-top: 1.6rem; }
.sticky { position: sticky; top: calc(var(--header) + 1rem); display: grid; gap: .9rem; }
.sticky h2 { font-size: 1.4rem; margin: 0; }
.sticky .toc { display: grid; gap: 0; margin-top: .4rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.sticky .toc h3 { margin: 0 0 .4rem; font: 600 .7rem/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sticky a { padding: .45rem .7rem; border-radius: 10px; color: var(--text); font-size: .92rem; font-weight: 600; transition: background-color .3s, color .3s; }
.sticky a:hover { background: var(--accent-bg); color: var(--accent); }

/* Topology & code */
.topology, .code { border-radius: 16px; overflow: hidden; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-line); }
.topology { padding: 1rem; }
.topology svg { display: block; width: 100%; height: auto; }
.tp-link { fill: none; stroke: #7cf5a8; stroke-opacity: .6; stroke-width: 2; }
.tp-label { fill: #c8fbd9; paint-order: stroke; stroke: #0f1412; stroke-width: 5px; stroke-linejoin: round; }
.tp-node { color: #7cf5a8; }
.tp-node rect { fill: #151d19; stroke: #7cf5a866; }
.tp-node text { fill: #eef4ef; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .6rem .5rem 1rem; border-bottom: 1px solid var(--ink-line); color: var(--on-ink-muted); font: 600 .72rem/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.code button { min-height: 34px; padding: .3rem .8rem; background: #ffffff0d; color: var(--on-ink); box-shadow: inset 0 0 0 1px var(--ink-line); font-size: .8rem; }
.code button:hover { background: var(--phos); color: var(--ink); }
.code pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; color: #dfe9e2; font-size: .88rem; line-height: 1.65; }
.kw { color: #7cf5a8; }
.num { color: #ffd479; }
.table-scroll { overflow-x: auto; margin-top: 1rem; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font: 600 .7rem/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td { font-family: var(--mono); font-size: .85rem; }
.downloads { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
main details { border-top: 1px solid var(--border); }
main details:last-child { border-bottom: 1px solid var(--border); }
main summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .9rem; list-style: none; font-weight: 650; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.panel summary::after { content: "+"; display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--border); transition: transform .4s var(--ease), background-color .3s; }
.panel details[open] summary::after { transform: rotate(45deg); background: var(--phos); color: var(--ink); box-shadow: none; }
details > p, details > ol { padding-bottom: 1rem; }
.quiz fieldset { margin: 0; padding: 0; border: 0; }
.quiz legend { margin-bottom: .8rem; font-weight: 700; font-size: 1.1rem; }
.quiz label { display: flex; gap: .7rem; align-items: center; margin-bottom: .5rem; padding: .8rem 1rem; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; transition: box-shadow .3s, background-color .3s; }
.quiz label:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.quiz label:has(input:checked) { background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.quiz input { accent-color: var(--accent); }
.quiz-result { font-weight: 700; color: var(--accent) !important; }
.workspace-fields { display: grid; gap: 1rem; margin-top: 1rem; }
.workspace-fields label { display: grid; gap: .4rem; font-weight: 650; font-size: .9rem; }
.workspace-fields textarea { min-height: 160px; padding: .9rem 1rem; border: 0; border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); resize: vertical; transition: box-shadow .3s; }
.workspace-fields textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.workspace-fields textarea[name=config] { font-family: var(--mono); font-size: .85rem; background: var(--ink-2); color: #dfe9e2; }

/* Dialog & notice */
dialog { width: min(92vw, 620px); max-height: 88vh; padding: clamp(1.4rem, 3vw, 2.2rem); border: 0; border-radius: 24px; background: var(--paper); color: var(--text); box-shadow: 0 40px 100px -30px #000a; }
dialog[open] { animation: rise .5s var(--ease) both; }
dialog::backdrop { background: #080b0aa6; backdrop-filter: blur(6px); }
dialog h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
dialog .section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
#notice:not(:empty) { position: fixed; left: 50%; bottom: 1.5rem; z-index: 80; transform: translateX(-50%); padding: .8rem 1.2rem; border-radius: 999px; background: var(--ink); color: var(--on-ink); box-shadow: 0 20px 40px -20px #000a; font-weight: 650; font-size: .92rem; animation: rise .5s var(--ease) both; }

/* ---------- Footer ---------- */
footer#footer { position: relative; overflow: hidden; margin-top: clamp(3rem, 6vw, 5rem); background: var(--ink); color: var(--on-ink); }
.footer { padding-top: clamp(3.5rem, 7vw, 6rem); }
.footer-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--ink-line); }
.footer-top p { max-width: 36ch; color: var(--on-ink-muted); }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; padding-block: 2.5rem; }
.footer-cols > * { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.footer-cols h2 { margin-bottom: .6rem; font: 600 .7rem/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--phos); }
.footer-cols a, .footer-cols button { width: 100%; justify-content: flex-start; min-height: 0; padding: .5rem 0; border-radius: 0; border-bottom: 1px solid var(--ink-line); background: none; box-shadow: none; color: var(--on-ink-muted); font-size: .92rem; font-weight: 500; text-align: left; transition: color .3s, padding .5s var(--ease); }
.footer-cols a:hover, .footer-cols button:hover { color: var(--on-ink); padding-left: .4rem; box-shadow: none; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 1.3rem; border-top: 1px solid var(--ink-line); color: var(--on-ink-muted); font-size: .82rem; }
.footer-base a { color: var(--on-ink-muted); }
.footer-base a:hover { color: var(--phos); }
.footer-wordmark { display: block; margin-top: .5rem; font-size: clamp(3.6rem, 15.5vw, 17rem); font-weight: 800; letter-spacing: -.08em; line-height: .78; text-align: center; white-space: nowrap; color: transparent; background: linear-gradient(180deg, #7cf5a830, #7cf5a805 85%); -webkit-background-clip: text; background-clip: text; transform: translateY(.08em); user-select: none; }

/* ---------- Reveal ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform 1s var(--ease); transition-delay: var(--delay, 0s); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .header > .nav { display: none; }
  .mobile-menu { display: block; }
}
@media (max-width: 980px) {
  .hero-inner, .section-head, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { min-height: 0; }
  .hero-visual { max-width: 560px; }
  .sticky { position: static; order: -1; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 660px) {
  :root { --header: 64px; }
  .header .tools .progress-btn > span:not(.icon), .brand-text small { display: none; }
  .header .tools .progress-btn { width: 42px; padding: 0; }
  .hero h1 { font-size: clamp(2.8rem, 13vw, 4.6rem); }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(-n+2) { padding-bottom: 1rem; border-bottom: 1px solid var(--ink-line); }
  .filters select { flex: 1 1 45%; }
  .footer-cols { grid-template-columns: 1fr; }
  .path-list li { grid-template-columns: 2rem minmax(0, 1fr); }
  .path-list li .meta { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ticker-track { animation: none !important; }
  .js-reveal .reveal { opacity: 1; transform: none; }
  .hd-packet { display: none; }
}

/* Hero headline: never more than 3 lines on desktop.
   The second line ("one lab at a time.") always fits its column, so at most the first line wraps. */
@media (min-width: 981px) { .hero h1 { font-size: clamp(3.2rem, 7.1vw, 7rem); } }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-block-start: 1.5rem; }
.pagination[hidden] { display: none; }
.pagination button[aria-current=page] { background: var(--ink); color: var(--on-ink); }
.pagination button:disabled, button[data-project]:disabled { opacity: .55; cursor: default; }
.result-head { scroll-margin-top: calc(var(--header) + 1rem); }
.path-topic { display: block; color: var(--muted); font-weight: 400; }
.workspace-fields input[type=file] { max-inline-size: 100%; }
.attachment-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.attachment-list span, .project-details dd { overflow-wrap: anywhere; }
.project-details { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: .5rem .75rem; }
.project-details dt { font-weight: 650; }
.project-details dd { margin: 0; }
@media (max-width: 520px) {
  .project-details { grid-template-columns: 1fr; }
  .project-details dd { margin-bottom: .5rem; }
}

.source-topology { display: block; width: 100%; height: auto; border-radius: .75rem; }
.workspace-fields select { width: 100%; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--bg); }

.expected-results { white-space: pre-line; }

.flash-study { max-width: 880px; }
.flash-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 1.75rem 0 1rem; }
.flash-toolbar label { font-weight: 700; }
.flash-toolbar select { min-height: 44px; max-width: 100%; padding: .45rem .7rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--paper); }
.flash-toolbar .meta { margin-left: auto; font-variant-numeric: tabular-nums; }
.flash-study button:disabled { opacity: .5; cursor: default; }

button.flash-card {
  display: block; width: 100%; min-height: 0; padding: 0; border: 0;
  border-radius: var(--radius); background: transparent; color: inherit; text-align: left;
  box-shadow: none; perspective: 1100px;
}
button.flash-card:hover, button.flash-card[aria-pressed=true],
:root[data-theme=dark] button.flash-card[aria-pressed=true] { background: transparent; box-shadow: none; color: inherit; }
.flash-rotor { display: grid; transform-style: preserve-3d; transition: transform .52s cubic-bezier(.35,.02,.25,1); }
.flash-card[data-flipped=true] .flash-rotor { transform: rotateY(180deg); }
.flash-face {
  grid-area: 1 / 1; display: flex; min-height: clamp(240px, 37vw, 340px); flex-direction: column;
  justify-content: space-between; gap: 1.35rem; padding: clamp(1.25rem, 4vw, 2.75rem);
  border: 1px solid var(--border); border-radius: var(--radius); backface-visibility: hidden;
  background: var(--paper); color: var(--text);
}
.flash-front { transform: rotateY(0); }
.flash-back { transform: rotateY(180deg); background: var(--ink-2); color: var(--on-ink); border-color: var(--ink-line); }
.flash-card:hover .flash-front { border-color: var(--accent); }
.flash-card:hover .flash-back { border-color: var(--phos); }
.flash-face-label, .flash-face-action { display: flex; justify-content: space-between; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; }
.flash-face-label { font-weight: 750; }
.flash-face-label span { text-align: right; font-weight: 600; }
.flash-back :is(.flash-face-label,.flash-face-action) { color: var(--on-ink-muted); }
.flash-face-action span { font-size: 1.45rem; line-height: 1; color: var(--accent); }
.flash-back .flash-face-action span { color: var(--phos); }
.flash-question, .flash-answer { display: block; max-width: 32ch; line-height: 1.22; letter-spacing: -.03em; overflow-wrap: anywhere; }
.flash-question { font-size: clamp(1.35rem, 3.4vw, 2.65rem); font-weight: 700; }
.flash-answer { font-size: clamp(1.2rem, 2.65vw, 2.1rem); font-weight: 600; }
.flash-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: .9rem; }
.flash-hint { margin: 0 0 .85rem; padding: .8rem 1rem; border-radius: .7rem; background: var(--accent-bg); }
.flash-hint strong { margin-inline-end: .45rem; }
.flash-reference { margin-block: .9rem; padding: .65rem 0; }
.flash-reference summary { width: fit-content; color: var(--accent); cursor: pointer; }
.flash-reference img { display: block; max-width: 100%; height: auto; margin-top: .8rem; border-radius: .75rem; }
.flash-navigation { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding-block-start: 1rem; border-top: 1px solid var(--border); }
.flash-navigation button:last-child { grid-column: 3; }
.flash-lab { display: inline-flex; align-items: center; justify-self: center; gap: .45rem; text-align: center; font-size: .85rem; }
.flash-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 560px) {
  .flash-toolbar .meta { flex-basis: 100%; }
  .flash-navigation .flash-lab { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .flash-rotor { transition: none; }
}

.learning-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.5rem; }
.learning-tabs a { padding: .55rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--paper); color: var(--text); font-size: .9rem; font-weight: 650; }
.learning-tabs a[aria-current=page] { background: var(--ink); color: var(--on-ink); }
:root[data-theme=dark] .learning-tabs a[aria-current=page] { background: var(--phos); color: var(--ink); }
.learning-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-block-end: 1rem; }
.learning-progress progress { width: min(240px, 100%); display: block; }
.learning-support { margin: 0 0 1rem; }
.learning-stage { padding-block: .6rem; }
.learning-stage summary strong { display: block; line-height: 1.25; }
.learning-stage summary small { color: var(--muted); font-weight: 500; }
.learning-topic-list { margin: 0; padding: 0; list-style: none; }
.learning-topic { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .75rem; padding: .9rem 0; border-top: 1px solid var(--border); }
.learning-topic h3 { font-size: 1.12rem; line-height: 1.3; }
.learning-topic > div:only-child { grid-column: 1/-1; }
.learning-topic p { margin-top: .35rem; }
.learning-links { display: flex; flex-wrap: wrap; gap: .45rem; margin-block-start: .6rem; }
.learning-lab { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .2rem .45rem; border: 1px solid var(--border); padding: .4rem .65rem; border-radius: .5rem; font-size: .9rem; }
.learning-lab .meta { font-size: .75rem; }
.command-entry h2 { font-size: 1.28rem; line-height: 1.2; }

.resource-reader { max-width: 1040px; }
.reader-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-block-end: 1rem; }
.markdown-body { min-inline-size: 0; overflow-wrap: anywhere; }
.markdown-body > * + * { margin-block-start: 1rem; }
.markdown-body h1 { font-size: clamp(2rem,5vw,3.75rem); line-height: 1.05; }
.markdown-body h2 { font-size: clamp(1.35rem,3vw,2.2rem); margin-block-start: 1.8rem; line-height: 1.18; }
.markdown-body h3 { font-size: 1.18rem; line-height: 1.25; }
.markdown-body pre { overflow: auto; padding: .85rem 1rem; background: var(--ink-2); color: var(--on-ink); border-radius: .65rem; }
.markdown-body code { font-size: .86em; }
.markdown-body blockquote { margin-inline: 0; padding-inline-start: 1rem; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.markdown-body :is(ol,ul) { padding-inline-start: 1.35rem; }
.markdown-body img { display: block; max-width: 100%; height: auto; }
.markdown-table { width: 100%; overflow-x: auto; }
.markdown-table th { text-align: start; color: var(--text); background: var(--panel-2); }
.markdown-table :is(th,td) { min-inline-size: 6rem; padding: .65rem .6rem; vertical-align: top; border-bottom: 1px solid var(--border); }
.markdown-body a:hover { text-decoration: underline; }

.learning-topic button[data-checked] { border-color: var(--accent); color: var(--accent); }
