/* knowb.run: the BetterHackdays RFP Connector manual, served at hack.knowb.run.
   A self-contained port of the knowb.run design system:
   - Editorial layer (space-age minimalism): ground, type, saber lines, horizon.
   - Arcade layer (tailfin): buttons, chips, cabinets, alerts, all behind the CRT pass. */

:root {
    --ground: #161211;
    --surface: #1D1514;
    --raised: #241A18;
    --marquee: #2A1D1B;
    --led-off: #3B1E1D;
    --screen: #120E0D;
    --shadow-ink: #0D0A09;

    --ivory: #FCF6F3;
    --ivory-2: rgba(252,246,243,0.78);
    --ivory-3: rgba(252,246,243,0.66);
    --ember: #F59A52;
    --fire: #FF4A1A;
    --rust: #8E2F2A;
    --saber: #86E8FF;
    --terracotta: #E9C2B3;

    --saber-line: linear-gradient(90deg, rgba(134,232,255,0.10) 0%, #86E8FF 44%, rgba(255,74,26,0.50) 100%);
    --ember-line: linear-gradient(90deg, rgba(245,154,82,0.10) 0%, #F59A52 44%, rgba(134,232,255,0.30) 100%);
    --fringe: drop-shadow(-1px 0 0 rgba(134,232,255,0.7)) drop-shadow(1px 0 0 rgba(255,74,26,0.7));

    --tf-clip: polygon(0 0, calc(100% - 12px) 0, calc(100% - 12px) 4px, calc(100% - 8px) 4px, calc(100% - 8px) 8px, calc(100% - 4px) 8px, calc(100% - 4px) 12px, 100% 12px, 100% 100%, 12px 100%, 12px calc(100% - 4px), 8px calc(100% - 4px), 8px calc(100% - 8px), 4px calc(100% - 8px), 4px calc(100% - 12px), 0 calc(100% - 12px));
    --tf-clip-sm: polygon(0 0, calc(100% - 6px) 0, calc(100% - 6px) 2px, calc(100% - 4px) 2px, calc(100% - 4px) 4px, calc(100% - 2px) 4px, calc(100% - 2px) 6px, 100% 6px, 100% 100%, 6px 100%, 6px calc(100% - 2px), 4px calc(100% - 2px), 4px calc(100% - 4px), 2px calc(100% - 4px), 2px calc(100% - 6px), 0 calc(100% - 6px));

    --crt-layers:
        linear-gradient(118deg, rgba(252,246,243,0.05) 0%, rgba(252,246,243,0) 26%),
        repeating-linear-gradient(180deg, rgba(252,246,243,0.035) 0 1px, transparent 1px 3px),
        radial-gradient(120% 90% at 18% 0%, rgba(134,232,255,0.09), transparent 55%),
        radial-gradient(90% 80% at 100% 100%, rgba(245,154,82,0.08), transparent 60%);
    --crt-vignette: inset 0 0 44px rgba(0,0,0,0.38);

    --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --body: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --topbar-h: 64px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ground);
    color: var(--ivory);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--saber); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ivory); }
:focus-visible { outline: 2px solid var(--saber); outline-offset: 3px; }
code, kbd, pre, .console-log { font-family: var(--mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
code { font-size: 0.86em; color: var(--terracotta); overflow-wrap: anywhere; }
strong { color: var(--ivory); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip {
    position: fixed; left: 16px; top: -60px; z-index: 100;
    padding: 0.6rem 1rem; background: var(--ember); color: var(--ground);
    font-weight: 700; text-decoration: none; transition: top 0.15s;
}
.skip:focus { top: 12px; }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--saber-line); }

/* --- Top bar --- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    height: var(--topbar-h);
    background: rgba(22,18,17,0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(233,194,179,0.12);
}
.topbar-inner {
    max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 28px;
}
/* Brand: the knowb.run wordmark, then the product it hosts. */
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark {
    font-family: 'Audiowide', var(--display);
    font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em;
    color: var(--ivory); text-decoration: none; white-space: nowrap;
}
.product {
    padding-left: 14px; border-left: 1px solid rgba(233,194,179,0.28);
    font: 600 0.74rem var(--display); letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--saber); text-decoration: none; white-space: nowrap;
}
.product:hover { color: var(--ivory); }
.wordmark .dot { color: var(--ember); }
.wordmark:hover { color: var(--ivory); }
.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a {
    font-family: var(--display); font-size: 0.78rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ivory-2); text-decoration: none;
}
.topnav a:hover { color: var(--saber); }
.search-trigger {
    display: inline-flex; align-items: center; gap: 10px;
    min-width: 230px; padding: 8px 10px 8px 12px;
    background: var(--screen); color: var(--ivory-3);
    border: 1px solid rgba(134,232,255,0.28); border-radius: 12px 0 12px 0;
    font: 500 0.85rem var(--body); cursor: pointer;
}
.search-trigger:hover { border-color: var(--saber); color: var(--ivory); }
.search-trigger svg { width: 15px; height: 15px; fill: currentColor; }
.search-trigger span { flex: 1; text-align: left; }
kbd {
    display: inline-block; min-width: 1.4em; padding: 1px 6px;
    background: var(--raised); color: var(--saber);
    border: 1px solid rgba(134,232,255,0.3); border-radius: 4px;
    font-size: 0.72rem; text-align: center;
}
.index-toggle { display: none; }

/* --- Editorial: kicker, display, rules --- */
.kicker {
    display: inline-flex; align-items: center; gap: 0.85rem; margin: 0 0 1.4rem;
    font-family: var(--display); font-size: 0.74rem; font-weight: 600;
    letter-spacing: 0.24em; text-transform: uppercase; color: var(--saber);
}
.orbit {
    position: relative; width: 22px; height: 22px; flex: none;
    border: 1px solid rgba(134,232,255,0.6); border-radius: 50%;
}
.orbit::after {
    content: ''; position: absolute; width: 6px; height: 6px; top: -3px; left: 50%;
    margin-left: -3px; background: var(--ember); border-radius: 50%;
    transform-origin: 3px 14px; animation: orbit 6s linear infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }
.display {
    margin: 0 0 1.5rem;
    font-family: var(--display); font-weight: 300;
    font-size: clamp(2.4rem, 5.4vw, 4.9rem); line-height: 0.98; letter-spacing: -0.035em;
}
.display .hl { white-space: nowrap; }
.display .hl {
    background: linear-gradient(90deg, var(--ember), var(--fire) 60%, var(--saber));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-weight: 400;
}
.lead { max-width: 36rem; margin: 0 0 2rem; font-size: 1.12rem; color: var(--ivory-2); }
.rule { height: 1px; margin: 0.4rem 0 1.8rem; background: var(--saber-line); max-width: 220px; }

/* --- Hero --- */
.hero {
    position: relative; overflow: hidden;
    padding: clamp(48px, 8vw, 96px) 24px 0;
    border-bottom: 1px solid rgba(233,194,179,0.12);
}
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-scene .stars circle { animation: twinkle 4s ease-in-out infinite; }
.hero-scene .stars circle:nth-child(3n) { animation-delay: 1.3s; }
.hero-scene .stars circle:nth-child(3n+1) { animation-delay: 2.6s; }
@keyframes twinkle { 50% { opacity: 0.25; } }
.hero-scene .satellite { animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift {
    from { transform: translate(880px, 252px) rotate(-14deg); }
    to { transform: translate(1370px, 128px) rotate(-14deg); }
}
.hero-scene .flame { transform-origin: 30px -4px; animation: flame 0.18s steps(2) infinite alternate; }
@keyframes flame { to { transform: scaleY(0.6); } }
.hero-inner {
    position: relative; z-index: 1;
    max-width: 1320px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px); align-items: center;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 1.8rem; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }

/* --- Arcade: tailfin shell --- */
.tf-btn, .cabinet, .chip, .alert { position: relative; isolation: isolate; }
.tf-btn::before, .tf-btn::after,
.cabinet::before, .cabinet::after,
.chip::before, .chip::after,
.alert::before, .alert::after {
    content: ''; position: absolute; pointer-events: none; clip-path: var(--tf-clip);
}
.tf-btn::before, .cabinet::before, .chip::before, .alert::before {
    inset: 0; z-index: -2; background: var(--tf-edge);
    border-radius: var(--tf-r) 0 var(--tf-r) 0;
}
.tf-btn::after, .cabinet::after, .chip::after, .alert::after {
    inset: var(--tf-w); z-index: -1; background: var(--tf-fill);
    border-radius: calc(var(--tf-r) - var(--tf-w)) 0 calc(var(--tf-r) - var(--tf-w)) 0;
}
.fins { display: inline-flex; align-items: flex-end; gap: 3px; flex: none; }
.fins i { display: block; width: 4px; background: currentColor; }
.fins i:nth-child(1) { height: 6px; }
.fins i:nth-child(2) { height: 11px; }
.fins i:nth-child(3) { height: 16px; }

.tf-btn {
    --tf-r: 22px; --tf-w: 0px; --tf-edge: var(--ember); --tf-fill: var(--ember);
    --tf-drop: var(--rust); --tf-lift: 5px;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.9rem;
    padding: 1.05rem 1.25rem 1.05rem 1.6rem;
    color: var(--ground); text-decoration: none;
    font: 700 0.8rem/1.2 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
    filter: var(--fringe) drop-shadow(var(--tf-lift) var(--tf-lift) 0 var(--tf-drop));
    transition: transform 0.15s ease, filter 0.15s ease;
}
.tf-btn::after { box-shadow: inset 0 3px 0 rgba(252,246,243,0.45); }
.tf-btn:hover { --tf-lift: 7px; transform: translate(-2px, -2px); color: var(--ground); }
.tf-btn:hover .fins i { background: var(--saber); }
.tf-btn:active { --tf-lift: 0px; transform: translate(4px, 4px); }
.tf-btn:focus-visible { outline: none; --tf-edge: var(--ivory); --tf-w: 3px; }
.tf-btn-saber { --tf-edge: var(--saber); --tf-w: 2px; --tf-fill: var(--ground); --tf-drop: var(--shadow-ink); color: var(--saber); }
.tf-btn-saber::after { box-shadow: none; }
.tf-btn-saber:hover { --tf-edge: linear-gradient(90deg, var(--saber) 0%, var(--saber) 40%, var(--ember) 100%); --tf-fill: var(--raised); color: var(--ivory); }
.tf-btn-saber:hover .fins i { background: var(--ember); }

.chip {
    --tf-r: 10px; --tf-w: 1px; --tf-edge: rgba(134,232,255,0.55); --tf-fill: var(--raised);
    display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.6rem 0.85rem;
    font: 600 0.68rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--saber);
}
.chip::before, .chip::after { clip-path: var(--tf-clip-sm); }
.chip-ember { --tf-edge: rgba(245,154,82,0.6); color: var(--ember); }
.led { display: inline-block; flex: none; width: 6px; height: 6px; background: currentColor; }

.cabinet {
    --tf-r: 28px; --tf-w: 1px; --tf-edge: rgba(134,232,255,0.6); --tf-fill: var(--raised);
    --tf-lift: 6px;
    display: block; padding: 1.4rem 1.5rem 1.6rem; color: var(--ivory);
    filter: var(--fringe) drop-shadow(var(--tf-lift) var(--tf-lift) 0 var(--shadow-ink));
}
.cabinet::after { background: var(--crt-layers), var(--tf-fill); box-shadow: var(--crt-vignette); }
.cabinet-ember { --tf-edge: rgba(245,154,82,0.7); }

/* --- Console --- */
.console { --tf-fill: var(--screen); margin: 0; padding: 0 0 1.2rem; min-width: 0; }
.console-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 0.85rem 1.4rem; margin-bottom: 0.6rem;
    border-bottom: 1px solid rgba(134,232,255,0.18);
    font: 500 0.7rem var(--mono); letter-spacing: 0.08em; color: var(--ivory-3);
}
.lights { display: inline-flex; gap: 6px; }
.lights i { width: 8px; height: 8px; background: var(--led-off); }
.lights i:nth-child(1) { background: var(--fire); }
.lights i:nth-child(2) { background: var(--ember); }
.lights i:nth-child(3) { background: var(--saber); }
.console-log {
    margin: 0; padding: 0 1.4rem; list-style: none;
    font: 400 0.8rem/1.55 var(--mono); min-height: 21rem;
}
.console-log li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 0.6em; padding: 0.22rem 0; }
.console-log .who { color: var(--ivory-3); }
.console-log .you .who { color: var(--ember); }
.console-log .you .say { color: var(--ivory); }
.console-log .call .who, .console-log .call .say { color: var(--saber); }
.console-log .out .say { color: var(--ivory-2); }
.console-log .ok .say { color: #B8F5C8; }
.console-log b { color: var(--ivory); font-weight: 500; }
.console-log .say { overflow-wrap: anywhere; }
.console.is-typing .console-log li { opacity: 0; transform: translateY(4px); transition: opacity 0.3s, transform 0.3s; }
.console.is-typing .console-log li.is-shown { opacity: 1; transform: none; }
.console-log li.is-active .say::after {
    content: ''; display: inline-block; width: 0.55em; height: 1em; margin-left: 2px;
    vertical-align: -0.15em; background: var(--saber); animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Flight plan --- */
.flightplan {
    position: relative; z-index: 1;
    max-width: 1320px; margin: clamp(48px, 7vw, 88px) auto 0; padding: 0;
    list-style: none; display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgba(233,194,179,0.14);
}
.flightplan li {
    position: relative; padding: 1.4rem 1.4rem 1.8rem;
    border-right: 1px solid rgba(233,194,179,0.10);
    background: linear-gradient(180deg, rgba(29,21,20,0.85), rgba(22,18,17,0.6));
}
.flightplan li:last-child { border-right: 0; }
.flightplan li::before {
    content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
    background: var(--saber-line); transform: scaleX(0); transform-origin: left;
    transition: transform 0.6s ease;
}
.flightplan.is-lit li::before { transform: scaleX(1); }
.flightplan.is-lit li:nth-child(2)::before { transition-delay: 0.15s; }
.flightplan.is-lit li:nth-child(3)::before { transition-delay: 0.3s; }
.flightplan.is-lit li:nth-child(4)::before { transition-delay: 0.45s; background: var(--ember-line); }
.fp-no { display: block; font: 500 0.72rem var(--mono); color: var(--saber); margin-bottom: 0.5rem; }
.fp-t { display: block; font: 400 1.5rem/1.1 var(--display); letter-spacing: -0.01em; margin-bottom: 0.4rem; }
.fp-d { display: block; font-size: 0.9rem; color: var(--ivory-2); }
.fp-gate .fp-no, .fp-gate .fp-t { color: var(--ember); }

/* --- Manual layout --- */
.manual {
    max-width: 1320px; margin: 0 auto; padding: 0 24px;
    display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 64px;
}
.sidebar {
    position: sticky; top: var(--topbar-h); align-self: start;
    max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
    padding: 48px 0 32px;
}
.sidebar-label {
    margin: 0 0 1rem; font: 600 0.68rem var(--display); letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--ivory-3);
}
.toc, .toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
    position: relative; display: flex; gap: 12px; padding: 7px 0 7px 14px;
    font-size: 0.9rem; color: var(--ivory-2); text-decoration: none;
    border-left: 1px solid rgba(233,194,179,0.14);
}
.toc a span { font: 500 0.72rem/1.9 var(--mono); color: var(--ivory-3); }
.toc ol a { padding-left: 50px; font-size: 0.84rem; }
.toc a:hover { color: var(--ivory); }
.toc a.is-active { color: var(--saber); border-left-color: var(--saber); }
.toc a.is-active::before {
    content: ''; position: absolute; left: -4px; top: 50%; margin-top: -3px;
    width: 7px; height: 7px; background: var(--ember);
}
.toc a.is-active span { color: var(--saber); }
.sidebar-edit {
    display: inline-block; margin-top: 2rem; font-size: 0.8rem; color: var(--ivory-3);
}

.content { min-width: 0; padding: 32px 0 96px; max-width: 820px; }
.doc { padding: 48px 0 24px; border-bottom: 1px solid rgba(233,194,179,0.08); }
.doc:last-child { border-bottom: 0; }
.doc-no { margin: 0; font: 500 0.78rem var(--mono); color: var(--ember); letter-spacing: 0.1em; }
.doc h2 {
    margin: 0.3rem 0 0.4rem; font: 300 clamp(2rem, 4vw, 2.9rem)/1.05 var(--display);
    letter-spacing: -0.025em;
}
.doc h3 {
    margin: 2.4rem 0 0.8rem; font: 500 1.3rem/1.25 var(--display); letter-spacing: -0.01em;
}
.doc p, .doc li, .doc dd { color: var(--ivory-2); }
.doc h2, .doc h3, .doc h4 { position: relative; }
.heading-anchor {
    position: absolute; left: -1.1em; top: 0; padding-right: 0.3em;
    color: var(--ivory-3); text-decoration: none; opacity: 0; font-weight: 400;
}
.doc h2:hover .heading-anchor, .doc h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.note { font-size: 0.88rem; color: var(--ivory-3) !important; }
.doc-edit { display: inline-block; margin-top: 1.6rem; font-size: 0.78rem; color: var(--ivory-3); }
.doc-edit:hover { color: var(--saber); }

/* --- 404 --- */
.lost { min-height: calc(100vh - var(--topbar-h) - 200px); display: grid; place-items: center; padding: 64px 24px; }
.lost-inner { max-width: 640px; }
button.tf-btn { border: 0; background: none; cursor: pointer; }

.ticks ul, .prompts ul { padding: 0; margin: 0.6rem 0; list-style: none; }
.ticks li { position: relative; padding-left: 1.6rem; margin: 0.5rem 0; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; background: var(--saber); }

.grid-3, .grid-2 { display: grid; gap: 22px; margin: 2rem 0 0.5rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card p { margin: 0; font-size: 0.93rem; }
.card-k {
    display: block; margin: 0 0 0.6rem !important;
    font: 600 0.7rem var(--display); letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--saber) !important;
}
.cabinet-ember .card-k { color: var(--ember) !important; }
.mini {
    padding: 1.1rem 1.2rem; background: var(--surface);
    border: 1px solid rgba(233,194,179,0.12); border-radius: 16px 0 16px 0;
}
.mini-h {
    display: block; font: 600 0.7rem var(--display); letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--ember);
}
.mini-h code { font-size: 0.9rem; letter-spacing: 0; text-transform: none; color: var(--saber); }
.mini p { margin: 0.4rem 0 0; font-size: 0.92rem; }

/* --- Steps --- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; }
.steps > li {
    counter-increment: step; position: relative;
    padding: 0 0 1.6rem 3.4rem; border-left: 1px solid rgba(134,232,255,0.22); margin-left: 1rem;
}
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute; left: -1rem; top: -0.1rem; width: 2rem; height: 2rem;
    display: grid; place-items: center;
    background: var(--ground); border: 1px solid var(--saber); color: var(--saber);
    border-radius: 10px 0 10px 0; font: 500 0.75rem var(--mono);
}
.steps h3 { margin-top: 0 !important; }
.steps-tight > li { padding-bottom: 1.2rem; }
.prompts ul { display: grid; gap: 8px; }
.prompts li {
    padding: 0.6rem 0.9rem; background: var(--surface); border-left: 2px solid var(--ember);
    font-size: 0.93rem; color: var(--ivory) !important;
}

/* --- Code --- */
pre { margin: 1rem 0; }
.doc pre:not(.sig) {
    position: relative; overflow-x: auto;
    padding: 1.1rem 1.2rem; background: var(--screen);
    border: 1px solid rgba(134,232,255,0.18); border-radius: 14px 0 14px 0;
    font-size: 0.82rem; line-height: 1.6;
}
.doc pre:not(.sig) code { color: var(--ivory); font-size: inherit; overflow-wrap: normal; white-space: pre; }
.copy {
    position: absolute; top: 8px; right: 8px;
    padding: 4px 10px; background: var(--raised); color: var(--saber);
    border: 1px solid rgba(134,232,255,0.35); border-radius: 8px 0 8px 0;
    font: 600 0.66rem var(--display); letter-spacing: 0.14em; text-transform: uppercase;
    cursor: pointer; opacity: 0.85;
}
.copy:hover, .copy:focus-visible { opacity: 1; color: var(--ivory); }
.copy.is-done { color: #B8F5C8; border-color: #B8F5C8; }

/* --- Tabs --- */
.tabs { margin-top: 1rem; }
.tablist { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid rgba(233,194,179,0.14); }
.tablist button {
    padding: 0.6rem 1rem; background: none; border: 0; border-bottom: 2px solid transparent;
    margin-bottom: -1px; color: var(--ivory-3); cursor: pointer;
    font: 600 0.74rem var(--display); letter-spacing: 0.14em; text-transform: uppercase;
}
.tablist button[aria-selected="true"] { color: var(--saber); border-bottom-color: var(--saber); }
.tablist button:hover { color: var(--ivory); }

/* --- RFP board --- */
.board-wrap {
    margin: 2rem 0 0.8rem; background: var(--screen);
    border: 1px solid rgba(134,232,255,0.2); border-radius: 22px 0 22px 0; overflow: hidden;
}
.board-head, .board-row {
    display: grid; grid-template-columns: 3rem minmax(0, 1.4fr) minmax(0, 1fr) 9rem; gap: 14px; align-items: baseline;
}
.board-head {
    padding: 0.7rem 1.2rem; background: var(--marquee);
    font: 600 0.66rem var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ivory-3);
}
.board { list-style: none; margin: 0; padding: 0; }
.board-row {
    padding: 0.9rem 1.2rem; border-top: 1px solid rgba(233,194,179,0.08);
    cursor: pointer; transition: background 0.2s;
}
.board-row:hover, .board-row.is-open { background: rgba(134,232,255,0.04); }
.board-no { font: 500 0.78rem var(--mono); color: var(--ivory-3); }
.board-title { font: 500 1.08rem var(--display); color: var(--ivory); letter-spacing: 0.01em; }
.board-id { font-size: 0.78rem; color: var(--terracotta); }
.board-kind {
    display: inline-flex; align-items: center; gap: 8px; justify-self: start;
    font: 600 0.64rem var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--saber);
}
.board-row.is-live .board-kind { color: var(--ember); }
.board-row.is-live .board-kind .led { animation: blink 1.6s steps(2) infinite; }
.board-tags, .board-summary { grid-column: 2 / -1; }
.board-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0.15rem 0 0; padding: 0; list-style: none; }
.board-tags li { font-size: 0.78rem; color: var(--ivory-3); }
.board-tags li::before { content: '/ '; color: rgba(134,232,255,0.5); }
.board-summary {
    margin: 0; font-size: 0.9rem; color: var(--ivory-2);
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.board-row.is-open .board-summary { display: block; }

/* --- Pipelines and routes --- */
.pipeline { list-style: none; padding: 0; margin: 1.6rem 0; display: grid; gap: 12px; }
.pipeline li {
    display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 4px 18px;
    padding: 1rem 1.2rem; background: var(--surface);
    border: 1px solid rgba(233,194,179,0.10); border-radius: 16px 0 16px 0;
}
.pl-k {
    grid-row: span 2; font: 600 0.72rem var(--display); letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--ember); padding-top: 0.15rem;
}
.pipeline code { color: var(--saber); }
.pipeline p { margin: 0; font-size: 0.92rem; }

.alert {
    --tf-r: 24px; --tf-w: 2px; --tf-edge: linear-gradient(90deg, var(--fire), var(--ember) 60%, var(--saber));
    --tf-fill: #1F1312;
    display: flex; gap: 18px; align-items: flex-start;
    padding: 1.5rem 1.6rem; margin: 1.6rem 0;
    filter: var(--fringe) drop-shadow(6px 6px 0 var(--shadow-ink));
}
.alert::after { background: var(--crt-layers), var(--tf-fill); }
.alert-icon {
    flex: none; width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
    background: var(--fire); color: var(--ground); font: 700 1.2rem var(--display);
    border-radius: 10px 0 10px 0;
}
.alert-title { margin: 0 0 0.4rem !important; font: 500 1.5rem/1.2 var(--display); color: var(--ivory) !important; letter-spacing: -0.01em; }
.alert p:last-child { margin: 0; }

.route { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; gap: 0; }
.route li {
    position: relative; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 16px;
    padding: 0 0 1.4rem;
}
.route li::before {
    content: ''; position: absolute; left: 1.2rem; top: 2.4rem; bottom: 0; width: 1px;
    background: linear-gradient(180deg, var(--saber), rgba(134,232,255,0.1));
}
.route li:last-child::before { display: none; }
.route-no {
    width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
    border: 1px solid var(--saber); color: var(--saber); border-radius: 50%;
    font: 500 0.85rem var(--mono); background: var(--ground);
}
.route-gate .route-no { border-color: var(--ember); color: var(--ground); background: var(--ember); }
.route li > div { padding-top: 0.35rem; color: var(--ivory-2); }

.guarantees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 1.6rem 0 0; }
.guarantees > div {
    padding: 1.2rem 1.3rem; background: var(--surface);
    border-top: 2px solid var(--saber);
}
.guarantees > div:nth-child(4) { border-top-color: var(--ember); }
.guarantees dt { font: 500 1.02rem/1.3 var(--display); color: var(--ivory); margin-bottom: 0.5rem; }
.guarantees dd { margin: 0; font-size: 0.92rem; }

/* --- Reference --- */
.ref-count { font-size: 0.92rem; }
.ref-group {
    margin: 2rem 0 0.8rem; font: 600 0.72rem var(--display); letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--ember);
}
.ref-list { display: grid; gap: 10px; }
.ref-item {
    padding: 1rem 1.2rem 0.4rem; background: var(--surface);
    border: 1px solid rgba(233,194,179,0.10); border-radius: 14px 0 14px 0;
    scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.ref-item:target, .board-row:target, tr:target { box-shadow: 0 0 0 1px var(--saber), 0 0 24px rgba(134,232,255,0.22); }
.ref-item h5 { margin: 0; font-size: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ref-item h5 code { color: var(--saber); font-size: 0.95rem; }
.ref-item h5 .anchor { color: var(--ivory-3); text-decoration: none; font-weight: 400; }
.ref-item p { margin: 0.4rem 0 0; font-size: 0.92rem; }
.sig {
    margin: 0.7rem 0 0.6rem; padding: 0.7rem 0.9rem; overflow-x: auto;
    background: var(--screen); border-radius: 10px 0 10px 0; font-size: 0.78rem;
}
.sig code { color: var(--ivory-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sig-n { color: var(--ivory); }
.sig-p { color: var(--saber); }
.sig-t { color: var(--terracotta); }
.sig-d { color: var(--ember); }
.badge {
    display: inline-block; padding: 2px 8px; border: 1px solid rgba(245,154,82,0.6);
    border-radius: 6px 0 6px 0; color: var(--ember);
    font: 600 0.62rem var(--display); letter-spacing: 0.12em; text-transform: uppercase; vertical-align: middle;
}
.table-wrap { overflow-x: auto; margin: 1rem 0; }
/* Markdown tables: the same look, scrolling on their own at phone width. */
.doc table:not(.ref-table) { display: block; overflow-x: auto; margin: 1rem 0; border-collapse: collapse; font-size: 0.9rem; }
.doc table:not(.ref-table) th {
    text-align: left; padding: 0.6rem 0.8rem; background: var(--marquee);
    font: 600 0.66rem var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ivory-3);
}
.doc table:not(.ref-table) td { padding: 0.65rem 0.8rem; border-top: 1px solid rgba(233,194,179,0.08); color: var(--ivory-2); vertical-align: top; }
.doc table:not(.ref-table) td code { color: var(--terracotta); white-space: nowrap; overflow-wrap: normal; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ref-table th {
    text-align: left; padding: 0.6rem 0.8rem; background: var(--marquee);
    font: 600 0.66rem var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ivory-3);
}
.ref-table td { padding: 0.65rem 0.8rem; border-top: 1px solid rgba(233,194,179,0.08); color: var(--ivory-2); vertical-align: top; }
.ref-table td code { color: var(--terracotta); }
.verb {
    display: inline-block; min-width: 3.4rem; padding: 2px 6px; text-align: center;
    font: 600 0.7rem var(--mono); border-radius: 6px 0 6px 0;
}
.verb-get { background: rgba(134,232,255,0.12); color: var(--saber); }
.verb-post { background: rgba(245,154,82,0.14); color: var(--ember); }

/* --- FAQ --- */
.faq details { border-top: 1px solid rgba(233,194,179,0.12); }
.faq details:last-child { border-bottom: 1px solid rgba(233,194,179,0.12); }
.faq summary {
    list-style: none; cursor: pointer; position: relative;
    padding: 1.1rem 2.4rem 1.1rem 0; font: 500 1.05rem var(--display); color: var(--ivory);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+'; position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
    font: 400 1.4rem var(--mono); color: var(--saber); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); color: var(--ember); }
.faq details p { margin: 0 0 1.2rem; }

/* --- Footer --- */
.footer { border-top: 1px solid rgba(233,194,179,0.14); background: var(--surface); }
.footer::before { content: ''; display: block; height: 1px; background: var(--saber-line); }
.footer-inner {
    max-width: 1320px; margin: 0 auto; padding: 48px 24px;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px;
}
.footer p { max-width: 28rem; font-size: 0.88rem; color: var(--ivory-3); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: right; }
.footer-links a { color: var(--ivory-2); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--saber); }

/* --- Search palette --- */
.palette {
    position: fixed; inset: 0; z-index: 80; display: grid; justify-items: center; align-items: start;
    padding: 12vh 16px 16px; background: rgba(13,10,9,0.72); backdrop-filter: blur(6px);
}
.palette[hidden] { display: none; }
.palette-box { --tf-fill: var(--surface); width: min(640px, 100%); padding: 1rem; }
.palette input {
    width: 100%; padding: 0.85rem 1rem; background: var(--screen); color: var(--ivory);
    border: 1px solid rgba(134,232,255,0.4); border-radius: 12px 0 12px 0;
    font: 400 1rem var(--body); outline: none;
}
.palette input:focus { border-color: var(--saber); }
.palette-results { list-style: none; margin: 0.6rem 0 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.palette-results li a {
    display: grid; gap: 2px; padding: 0.6rem 0.8rem; text-decoration: none;
    border-left: 2px solid transparent; color: var(--ivory);
}
.palette-results li a small { color: var(--ivory-3); font-size: 0.78rem; }
.palette-results li[aria-selected="true"] a { background: rgba(134,232,255,0.07); border-left-color: var(--saber); }
.palette-results .empty { padding: 0.8rem; color: var(--ivory-3); font-size: 0.9rem; }
.palette-hint { margin: 0.6rem 0 0; font-size: 0.74rem; color: var(--ivory-3); }

/* --- Responsive --- */
@media (max-width: 1080px) {
    .hero-inner { grid-template-columns: 1fr; }
    .topnav { display: none; }
    .search-trigger { margin-left: auto; min-width: 0; }
    .manual { grid-template-columns: 1fr; gap: 0; }
    .index-toggle {
        display: inline-flex; padding: 8px 12px; background: var(--raised); color: var(--saber);
        border: 1px solid rgba(134,232,255,0.35); border-radius: 10px 0 10px 0;
        font: 600 0.72rem var(--display); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
    }
    .sidebar {
        position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 45;
        width: min(320px, 86vw); max-height: none; padding: 28px 24px;
        background: var(--surface); border-right: 1px solid rgba(134,232,255,0.2);
        transform: translateX(-102%); transition: transform 0.25s ease; visibility: hidden;
    }
    .sidebar.is-open { transform: none; visibility: visible; }
}
@media (max-width: 760px) {
    .topbar-inner { padding: 0 16px; gap: 12px; }
    .wordmark { font-size: 1.05rem; }
    .brand { gap: 10px; }
    .product { padding-left: 10px; font-size: 0.64rem; letter-spacing: 0.08em; }
    .search-trigger span, .search-trigger kbd { display: none; }
    .hero { padding-left: 16px; padding-right: 16px; }
    .manual { padding: 0 16px; }
    .flightplan { grid-template-columns: 1fr 1fr; }
    .flightplan li:nth-child(2) { border-right: 0; }
    .grid-3, .grid-2, .guarantees { grid-template-columns: 1fr; }
    .board-head { display: none; }
    .board-row { grid-template-columns: 2.2rem minmax(0, 1fr); }
    .board-id { grid-column: 2; }
    .board-kind { grid-column: 2; }
    .pipeline li { grid-template-columns: 1fr; }
    .pl-k { grid-row: auto; }
    .steps > li { padding-left: 2.2rem; }
    .heading-anchor { display: none; }
    .console-log { font-size: 0.74rem; min-height: 0; }
    .footer-links { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

.index-toggle[hidden] { display: none !important; }
