/* tfui site: a terraforming base at night. Rust and night for surfaces, hologram amber for what to act
   on, dome blue for reference, terraform's own green, amber and red for create, change and destroy. Dark is the base
   at night; light is the same base by day. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
/* Box drawing, blocks and arrows, so tfui's own screens render with the same glyph widths as the terminal. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-symbols.woff2") format("woff2");
  unicode-range: U+2190-21FF, U+2500-25FF;
  font-display: swap;
}

:root {
  --bg: #140c0a;
  --bg-raised: #1f1310;
  --bg-sunken: #0f0806;
  --bg-code: #180e0b;
  --line: #3a2620;
  --line-strong: #553629;
  --text: #f1e6dc;
  --text-muted: #b39a8d;
  --accent: #ffb347;
  --accent-ink: #1a0f0b;
  --link: #ffb347;
  --link-hover: #ffd089;
  --rust: #c8502e;
  --dust: #e07b4e;
  --dome: #5fb3e6;
  --add: #4fd18b;
  --change: #ffb347;
  --destroy: #ff5c4d;
  --shadow: #000;
  --night: #0b0605;
  --night-raised: #1a100c;
  --night-line: #33211b;
  --night-text: #f1e6dc;
  --night-muted: #a88f82;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar-h: 60px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7efe8;
    --bg-raised: #fff8f3;
    --bg-sunken: #efe2d8;
    --bg-code: #f3e7de;
    --line: #e3cfc2;
    --line-strong: #c9ad9b;
    --text: #231512;
    --text-muted: #6d574d;
    --accent: #a65f00;
    --accent-ink: #fff;
    --link: #9a3f1f;
    --link-hover: #5e2410;
    --rust: #9a3f1f;
    --dust: #c8502e;
    --dome: #1f6fa3;
    --add: #1d7a3d;
    --change: #a65f00;
    --destroy: #b42323;
    --shadow: #231512;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--topbar-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; font-weight: 600; }
.skip:focus { left: 8px; }

/* The horizon: rust ground, amber hologram, blue dome. */
.horizon { height: 4px; background: linear-gradient(90deg, #c8502e, #ffb347 55%, #5fb3e6); }

.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }

/* Top bar: always night, so the brand reads the same in both schemes. */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--night); color: var(--night-text); border-bottom: 1px solid var(--night-line); }
.topbar-inner {
  max-width: 1400px; margin: 0 auto; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--night-text); text-decoration: none; }
.brand:hover { color: #fff; }
.brand .mark { --rust: #c8502e; --dome: #5fb3e6; --accent: #ffb347; display: block; }
.brand-name { font: 700 21px/1 var(--font-body); letter-spacing: -.5px; }
.release {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 12px/1 var(--font-mono); color: #ffb347; text-decoration: none;
  border: 1px solid #5a3a18; border-radius: 999px; padding: 5px 9px; background: #1d120a;
}
.release .icon { width: 13px; height: 13px; }
.release:hover { color: #1a0f0b; background: #ffb347; }
.topnav { margin-left: auto; display: flex; gap: 4px; }
.topnav a {
  display: inline-flex; align-items: center; gap: 7px;
  color: #d4c3b8; text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px;
  border-bottom: 2px solid transparent;
}
.topnav a:hover { color: #fff; }
.topnav a[aria-current] { color: #fff; border-bottom-color: #ffb347; }

/* Search: Pagefind's UI, themed. Hidden when the index is absent, as under jekyll serve. */
.search { width: min(320px, 32vw); margin-left: 12px; position: relative; }
.no-search .search { display: none; }
.search {
  --pagefind-ui-scale: .78;
  --pagefind-ui-primary: #ffb347;
  --pagefind-ui-text: #f1e6dc;
  --pagefind-ui-background: #1a100c;
  --pagefind-ui-border: #33211b;
  --pagefind-ui-tag: #33211b;
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 6px;
  --pagefind-ui-font: var(--font-body);
}
.search .pagefind-ui__drawer {
  position: absolute; top: calc(100% + 8px); left: 0; width: min(560px, 90vw); max-height: 70vh; overflow-y: auto;
  background: #1a100c; border: 1px solid #33211b; border-radius: 8px; padding: 8px 16px; box-shadow: 0 16px 40px #000a;
}
.search .pagefind-ui__drawer:not(:has(.pagefind-ui__result)) { display: none; }
.search .pagefind-ui__result-link { color: #ffb347; }
.search mark { background: #ffb34733; color: inherit; }

/* Docs shell */
.docs-shell {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 48px;
}
.sidebar {
  position: sticky; top: calc(var(--topbar-h) + 6px); align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 6px); overflow-y: auto;
  padding: 28px 8px 40px 0; font-size: 14.5px;
}
.sidebar-section {
  margin: 24px 0 6px; font: 600 11.5px/1.2 var(--font-mono); letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--dust);
}
.sidebar-section:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  display: block; padding: 4px 10px; color: var(--text); text-decoration: none;
  border-left: 2px solid var(--line); border-radius: 0 4px 4px 0;
}
.sidebar a:hover { border-left-color: var(--line-strong); background: var(--bg-raised); color: var(--text); }
.sidebar a[aria-current] { border-left-color: var(--accent); background: var(--bg-raised); font-weight: 600; color: var(--link); }
.nav-toggle, .nav-toggle-label { display: none; }

.content { min-width: 0; padding: 36px 0 64px; outline: none; }
.page-source { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }

.toc {
  position: sticky; top: calc(var(--topbar-h) + 6px); align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 6px); overflow-y: auto; padding: 36px 0 40px; font-size: 13.5px;
}
.toc:empty { display: none; }
.toc p { margin: 0 0 8px; font: 600 11.5px/1.2 var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 3px 0 3px 10px; color: var(--text-muted); text-decoration: none; border-left: 1px solid var(--line); }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--link); border-left: 2px solid var(--accent); }

/* Prose: rendered Markdown */
.prose { max-width: 780px; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { line-height: 1.25; position: relative; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.prose h1 { font: 700 40px/1.12 var(--font-body); letter-spacing: -1px; margin: 0 0 24px; }
.prose h1 + p { font-size: 18px; margin-bottom: 28px; color: var(--text-muted); }
.prose h2 { font-size: 26px; font-weight: 700; letter-spacing: -.4px; margin: 52px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 20px; font-weight: 600; margin: 32px 0 10px; }
.prose h4 { font-size: 17px; font-weight: 600; margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote { margin: 0 0 18px; }
.prose li { margin: 4px 0; }
.prose li > p { margin: 0 0 8px; }
.prose strong { font-weight: 600; }
.prose hr { border: 0; height: 1px; margin: 40px 0; background: var(--line); }
.prose blockquote { margin-left: 0; padding: 10px 18px; border-left: 3px solid var(--dome); color: var(--text-muted); background: var(--bg-raised); border-radius: 0 6px 6px 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose img { display: block; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; }
.prose .anchor { position: absolute; left: -1.1em; padding-right: .3em; color: var(--text-muted); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2 .anchor { top: 20px; }
.prose :is(h1, h2, h3, h4):hover .anchor, .prose .anchor:focus { opacity: 1; }

.prose code {
  font: .86em/1.5 var(--font-mono); background: var(--bg-code); border: 1px solid var(--line); border-radius: 4px;
  padding: .08em .35em; overflow-wrap: anywhere;
}
.prose a code { color: inherit; }
.prose pre, .terminal pre {
  font: 13.5px/1.6 var(--font-mono); background: var(--bg-code); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; tab-size: 2;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.highlighter-rouge, figure.highlight { position: relative; }
figure.highlight { margin: 0 0 18px; }
.copy {
  position: absolute; top: 8px; right: 8px; font: 600 12px/1 var(--font-mono); padding: 6px 8px; cursor: pointer; border-radius: 4px;
  color: var(--text-muted); background: var(--bg-raised); border: 1px solid var(--line-strong); opacity: 0;
}
.highlighter-rouge:hover .copy, figure.highlight:hover .copy, .copy:focus { opacity: 1; }
.copy:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-raised); font-weight: 600; white-space: nowrap; }
.prose tr:nth-child(2n) td { background: color-mix(in srgb, var(--bg-raised) 45%, transparent); }

/* Rouge tokens */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: var(--text-muted); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .nt { color: var(--dust); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sh, .highlight .se, .highlight .sx { color: var(--add); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .kc { color: var(--change); }
.highlight .nb, .highlight .nf, .highlight .na, .highlight .nn { color: var(--dome); }
.highlight .nv, .highlight .vg, .highlight .vi { color: var(--accent); }
.highlight .gi { color: var(--add); }
.highlight .gd { color: var(--destroy); }
.highlight .gu, .highlight .gh { color: var(--dome); }
.highlight .err { color: inherit; background: none; }

/* Footer */
.footer { background: var(--night); color: var(--night-muted); font-size: 14px; border-top: 1px solid var(--night-line); }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 22px 20px 30px; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; }
.footer p { margin: 0; }
.footer a { color: #ffb347; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; }

/* Landing page */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.kicker { font: 600 12.5px/1.2 var(--font-mono); letter-spacing: 2px; text-transform: uppercase; color: var(--dust); margin: 0 0 12px; }
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--line); }
/* A section that stays at night in both schemes, lit from the horizon above. */
.section.night {
  --bg: #140c0a; --bg-raised: #1f1310; --bg-sunken: #0f0806; --bg-code: #180e0b; --line: #3a2620; --line-strong: #553629;
  --text: #f1e6dc; --text-muted: #b39a8d; --accent: #ffb347; --accent-ink: #1a0f0b; --link: #ffb347; --link-hover: #ffd089;
  --rust: #c8502e; --dust: #e07b4e; --dome: #5fb3e6; --add: #4fd18b; --change: #ffb347; --destroy: #ff5c4d; --shadow: #000;
  color-scheme: dark; color: var(--text); border-top-color: var(--night-line);
  background: radial-gradient(ellipse 60% 120% at 50% 0%, #4a1d0e 0%, transparent 70%), var(--night);
}
.section.night + .section { border-top-color: var(--night-line); }
.section h2 { font: 700 clamp(28px, 3.4vw, 38px)/1.12 var(--font-body); margin: 0 0 14px; letter-spacing: -.8px; }
.section .lede { max-width: 720px; color: var(--text-muted); font-size: 18px; margin: 0 0 36px; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

@media (min-width: 981px) {
  .hero { height: calc(100svh - var(--topbar-h)); min-height: 620px; }
  .hero-grid { min-height: 0; padding-bottom: 32px; }
  .tour { min-height: 0; padding-top: 12px; }
}

/* Hero: night on the planet, the pitch beside the stage. Focusing the stage (.drive) folds the pitch
   away and hands the stage the whole slide; esc, a click outside or a scroll folds it back. */
.hero {
  background: radial-gradient(ellipse 80% 60% at 50% 100%, #3a170c 0%, transparent 70%), var(--night);
  color: var(--night-text); border-bottom: 1px solid var(--night-line);
  min-height: calc(100svh - var(--topbar-h)); display: flex; flex-direction: column;
}
.hero-grid {
  flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 36px 24px 40px; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 56px; align-items: stretch;
  transition: grid-template-columns .55s cubic-bezier(.4, 0, .2, 1), gap .55s cubic-bezier(.4, 0, .2, 1);
}
.pitch { min-width: 0; overflow: hidden; align-self: center; transition: opacity .25s; }
.hero.drive .hero-grid { grid-template-columns: 0fr minmax(0, 1fr); gap: 0; }
.hero.drive .pitch { opacity: 0; pointer-events: none; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 6px 12px;
  font: 600 12px/1 var(--font-mono); letter-spacing: 1px; text-transform: uppercase; color: #ffb347;
  border: 1px solid #5a3a18; border-radius: 999px; background: #1d120a;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4fd18b; box-shadow: 0 0 8px #4fd18b; }
.hero h1 { font: 700 clamp(38px, 4.4vw, 62px)/1.02 var(--font-body); letter-spacing: -2px; margin: 0 0 20px; max-width: 14ch; }
.hero h1 em { font-style: normal; color: #ffb347; }
.hero .lede { font-size: 18px; color: #d4c3b8; margin: 0 0 28px; max-width: 520px; }
.hero .runs-on { justify-content: flex-start; margin-top: 30px; gap: 6px 8px; }
.hero .runs-on li { padding: 6px 10px; font-size: 12.5px; color: #a88f82; background: #1a100c; border-color: #33211b; }
.hero .runs-on .icon { width: 15px; height: 15px; }
/* The hero's numbers as a before and after: raw terraform, an arrow through tfui, what tfui hands back. */
.shift { display: flex; align-items: flex-start; gap: 16px; margin-top: 34px; padding-top: 26px; border-top: 1px solid #33211b; }
.shift-before { display: flex; flex-direction: column; flex: 0 1 112px; margin: 0; }
.shift-before b { font: 700 30px/1 var(--font-body); letter-spacing: -1px; color: #7d6156; }
.shift-before span { margin-top: 6px; font-size: 13px; line-height: 1.35; color: #8a6f63; }
.shift-via {
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; margin: 0;
  font: 600 11px/1 var(--font-mono); letter-spacing: 1px; color: #ffb347;
}
.shift-via .icon { width: 28px; height: 28px; animation: nudge 1.8s ease-in-out infinite; }
.hero .shift-after { flex: 1; min-width: 0; gap: 16px; margin: 0; }
.hero .shift-after li { flex: 1 1 0; min-width: 0; }
.hero .shift-after b { font-size: 30px; color: #ffb347; }
.hero .shift-after span { color: #b39a8d; font-size: 13px; line-height: 1.35; }
@keyframes nudge { 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .shift-via .icon { animation: none; } }

/* Section dots: a floating column on the right edge of the landing page, on a night capsule so they read over day
   and night sections alike. */
.dots {
  position: fixed; right: 20px; top: 50%; z-index: 40; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px;
  background: #0b0605b3; border: 1px solid #33211b; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px #0006;
  transition: opacity .3s;
}
.dots a { position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.dots a::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #a88f82;
  transition: width .25s, height .25s, background .25s, border-color .25s, box-shadow .25s;
}
.dots a:hover::before, .dots a:focus-visible::before { border-color: #ffb347; }
.dots a.on::before { width: 12px; height: 12px; border-color: #ffb347; background: #ffb347; box-shadow: 0 0 0 4px #ffb34726, 0 0 14px #ffb347aa; animation: float 2.6s ease-in-out infinite; }
.dots span {
  position: absolute; right: 32px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; pointer-events: none;
  padding: 5px 10px; font: 600 12px/1 var(--font-mono); letter-spacing: .5px; color: #f1e6dc;
  background: #1a100c; border: 1px solid #33211b; border-radius: 999px; opacity: 0; transition: opacity .2s, transform .2s;
}
.dots a:hover span, .dots a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.dots a:focus-visible { outline-offset: 0; }
body:has(.hero.drive) .dots { opacity: 0; pointer-events: none; }
@keyframes float { 50% { transform: translateY(-2px); } }
@media (max-width: 1279px) { .dots { display: none; } }
@media (min-width: 1280px) and (max-width: 1400px) { .hero-grid { padding-right: 76px; } }
@media (prefers-reduced-motion: reduce) { .dots a.on::before { animation: none; } }

/* Icon chips */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chips li {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 999px;
  font: 500 14px/1 var(--font-body); color: var(--text); background: var(--bg-raised); border: 1px solid var(--line);
}
.chips .icon { width: 18px; height: 18px; color: var(--dust); }
.trust { padding: 36px 0; border-bottom: 1px solid var(--line); }
.trust .kicker { text-align: center; color: var(--text-muted); }

/* See it work: a simulated tfui plan view (assets/tour.js) that plays six scenes and hands over the keys on focus.
   The stage fills whatever height the slide gives it; tour.js counts the rows that fit. */
.tour { min-width: 0; display: flex; flex-direction: column; text-align: center; }
.hero.drive .tour { width: 100%; max-width: 1120px; margin: 0 auto; }
.tour-caption { min-height: 2.6em; margin: 0 auto 14px; max-width: 640px; font-size: 16.5px; line-height: 1.5; color: #d4c3b8; }
.tour-caption kbd { margin-right: .5em; color: #1a0f0b; background: #ffb347; border-color: #ffb347; }
.stage {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; text-align: left;
  box-shadow: 0 0 0 1px #ffb3471f, 0 30px 80px #000c, 0 0 120px #ff7a3a1a; transition: box-shadow .4s;
}
.hero.drive .stage { box-shadow: 0 0 0 1px #ffb34755, 0 30px 80px #000c, 0 0 160px #ff7a3a33; }
.stage .shot-bar b { transition: color .2s; }
.stage .live { margin-left: auto; padding: 3px 9px; border-radius: 999px; font: 600 11px/1.4 var(--font-mono); font-style: normal; color: #1a0f0b; background: #4fd18b; }
.stage .leave {
  margin-left: 10px; padding: 3px 8px; font: 600 11px/1.4 var(--font-mono); color: #a88f82; cursor: pointer;
  background: #1a100c; border: 1px solid #553629; border-bottom-width: 2px; border-radius: 5px;
}
.stage .leave:hover { color: #f1e6dc; border-color: #ffb347; }
.stage .live[hidden], .stage .leave[hidden] { display: none; }
.terminal.stage pre {
  flex: 1 1 0; min-height: calc(12 * 1.55em + 28px); overflow: hidden; padding: 14px 16px; outline: none;
  transition: font-size .3s;
}
.hero.drive .stage pre { font-size: 15px; }
.stage pre:focus-visible { box-shadow: inset 0 0 0 2px #ffb347; }
.stage .ln { display: block; height: 1.55em; white-space: pre; overflow: hidden; }
.stage .ln.sel { background: #3b2a24; box-shadow: inset 3px 0 0 #ffb347; color: #fff; }
.stage .ln.foot { margin-top: 0; color: #a88f82; }
.stage .pinned { color: #4fd18b; font-weight: 700; }
.stage .part { color: #ffb347; font-weight: 700; }
.stage .chip { padding: 0 .4em; border-radius: 3px; color: #1a0f0b; background: #4fd18b; font-weight: 700; }
.stage .flt { color: #ffb347; }
.stage .caret { color: #ffb347; animation: caret 1s steps(1) infinite; }
.stage .r-low { color: #4fd18b; }
.stage .r-medium { color: #ffb347; }
.stage .r-high { color: #ff5c4d; font-weight: 700; }
.stage .r-critical { color: #ff79c6; font-weight: 700; text-shadow: 0 0 12px #ff79c699; }
.stage .hot .r-critical { animation: glow 1.6s ease-in-out infinite; }
.stage .pop .pinned { display: inline-block; animation: pop .35s ease-out; }
.stage pre.wall { color: #7d685d; }
.stage pre.wall .hit { color: #ff5c4d; }
.stage pre.swap { animation: swap .28s ease-out; }
.tour-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tour-steps li { position: relative; overflow: hidden; border-radius: 10px; background: #1a100c; border: 1px solid #33211b; }
.tour-steps button {
  width: 100%; padding: 10px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer;
  font: 600 13.5px/1.2 var(--font-body); color: #a88f82; background: none; border: 0;
}
.tour-steps button kbd { font-size: 11px; }
.tour-steps button:hover, .tour-steps button[aria-current="true"] { color: #f1e6dc; }
.tour-steps li:has([aria-current="true"]) { border-color: #ffb34766; }
.tour-steps button:focus-visible { outline: 2px solid #ffb347; outline-offset: -2px; }
.tour-steps .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #ffb347; transform: scaleX(0); transform-origin: left; }
.tour-steps li.done .bar { background: #ffb34766; }
.tour-hint { margin: 12px 0 0; font-size: 13.5px; color: #a88f82; }
.tour-hint .when-live, .hero.drive .tour-hint .when-idle { display: none; }
.hero.drive .tour-hint .when-live { display: inline; }
.tour-replay {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 4px 9px; cursor: pointer;
  font: 600 12px/1.2 var(--font-mono); color: #ffb347; background: #1a100c; border: 1px solid #553629; border-radius: 999px;
}
.tour-replay:hover { color: #1a0f0b; background: #ffb347; border-color: #ffb347; }
.tour-replay .icon { width: 13px; height: 13px; }
.tour:not(.js) .tour-steps, .tour:not(.js) .tour-hint { display: none; }
.tour:not(.js) .stage .ln { display: inline; }
/* The invitation to drive: a pill over the stage until the reader first takes the keys. */
.stage .take {
  position: absolute; left: 50%; bottom: 64px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px 11px 16px; cursor: pointer; white-space: nowrap;
  font: 600 14.5px/1 var(--font-body); color: #1a0f0b; background: #ffb347; border: 0; border-radius: 999px;
  box-shadow: 0 10px 30px #000a, 0 0 40px #ffb34766; transform: translateX(-50%);
  animation: bob 2.4s ease-in-out infinite;
}
.stage .take:hover { background: #ffc56e; animation-play-state: paused; }
.stage .take:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.stage .take kbd { font-size: 11px; color: #1a0f0b; background: #ffd089; border-color: #a65f00; }
.stage .take kbd:first-of-type { margin-left: 6px; }
.stage .take-ring { position: absolute; inset: 0; border-radius: inherit; border: 2px solid #ffb347; animation: ring 2.4s ease-out infinite; pointer-events: none; }
.stage .take-cursor {
  position: absolute; right: -14px; bottom: -16px; width: 22px; height: 22px; pointer-events: none;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3l14 7-6 2-2 6z' fill='%23fff' stroke='%231a0f0b' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 3px #000a); animation: tap 2.4s ease-in-out infinite;
}
.stage .take[hidden] { display: none; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
@keyframes ring { 0% { opacity: .8; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.25, 1.6); } }
@keyframes tap { 0%, 45%, 100% { transform: translate(8px, 8px); } 60% { transform: translate(0, 0); } 70% { transform: translate(0, 0) scale(.85); } 80% { transform: translate(0, 0); } }
@media (max-width: 980px) { .stage .take { display: none; } }

/* Short desktop screens: tighter spacing so the stage keeps the plan summary in view. */
@media (min-width: 981px) and (max-height: 860px) {
  .hero-grid { padding-top: 20px; }
  .tour { padding-top: 0; }
  .tour-caption { min-height: 0; margin-bottom: 10px; font-size: 15px; }
  .tour-steps { margin-top: 10px; }
  .tour-steps button { padding: 7px 6px 9px; gap: 4px; font-size: 12.5px; }
  .tour-hint { margin-top: 8px; }
  .terminal.stage pre { font-size: 13px; padding-top: 10px; padding-bottom: 10px; }
  .hero h1 { font-size: clamp(38px, 4vw, 54px); }
}
.terminal .crit, .stat b.crit { color: #ff79c6; font-weight: 700; }
.terminal .crit { background: #ff79c622; }
@keyframes caret { 50% { opacity: 0; } }
@keyframes glow { 50% { text-shadow: 0 0 18px #ff79c6, 0 0 4px #ff79c6; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Feature rows: image and text, alternating. */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 56px; align-items: center; }
.feature + .feature { margin-top: 88px; }
.feature:nth-of-type(even) > .feature-copy { order: 2; }
.feature-copy h3, .try-head h2 { font: 700 clamp(24px, 2.6vw, 30px)/1.15 var(--font-body); letter-spacing: -.6px; margin: 0 0 12px; }
.feature-copy p { color: var(--text-muted); font-size: 17px; margin: 0 0 14px; }
.feature-copy .kicker { display: inline-flex; align-items: center; gap: 8px; }
.feature-copy .kicker .icon { width: 16px; height: 16px; }
.feature-copy .more { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.feature-copy .more .icon { width: 16px; height: 16px; transition: transform .12s; }
.feature-copy .more:hover .icon { transform: translateX(3px); }
.shot { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--night-line); background: var(--night); box-shadow: 0 20px 50px #0008; }
.shot-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--night-raised); border-bottom: 1px solid var(--night-line); }
.shot-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a2620; }
.shot-bar span:nth-child(1) { background: #ff5c4d; }
.shot-bar span:nth-child(2) { background: #ffb347; }
.shot-bar span:nth-child(3) { background: #4fd18b; }
.shot-bar b { margin-left: 8px; font: 400 12px/1 var(--font-mono); color: #a88f82; }
.shot img { display: block; width: 100%; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.badge { font: 700 12px/1 var(--font-mono); padding: 6px 9px; border-radius: 4px; border: 1px solid currentColor; }
.badge.critical { color: #d6409f; background: color-mix(in srgb, #ff79c6 14%, transparent); }
.badge.high { color: var(--dust); }
.badge.medium { color: var(--change); }
.badge.low { color: var(--text-muted); }
.pair .badge { display: inline-block; padding: 3px 6px; vertical-align: 1px; }

/* Headless: steps and the terminal they produce. */
.cook { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; padding: 0 0 24px 54px; counter-increment: step; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  font: 700 14px/1 var(--font-mono); background: var(--bg-raised); border: 2px solid var(--accent); color: var(--link);
}
.step:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; border-left: 2px dashed var(--line-strong); }
.step h3 { margin: 5px 0 4px; font-size: 17px; font-weight: 600; }
.step p { margin: 0; color: var(--text-muted); font-size: 15px; }
.step code, .card code, .panel code, .feature-copy code, .section .lede code, .op code {
  font: .86em/1.5 var(--font-mono); background: var(--bg-code); border: 1px solid var(--line); border-radius: 4px; padding: .05em .3em; color: var(--text);
  overflow-wrap: anywhere;
}

.terminal { background: var(--night); border: 1px solid var(--night-line); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px #0008; color: #e6d9ce; }
.terminal pre { margin: 0; border: 0; border-radius: 0; background: none; font-size: 13.5px; color: #e6d9ce; }
.terminal .prompt { color: #ffb347; }
.terminal .add { color: #4fd18b; }
.terminal .del { color: #ff5c4d; }
.terminal .meta { color: #a88f82; }
.terminal .ok { color: #fff; font-weight: 600; }

.stat { display: flex; gap: 28px; margin: 28px 0 0; padding: 0; list-style: none; }
.stat li { display: flex; flex-direction: column; }
.stat b { font: 700 34px/1 var(--font-body); letter-spacing: -1px; color: var(--accent); }
.stat span { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.card > .icon { width: 26px; height: 26px; color: var(--dust); margin-bottom: 14px; display: block; }
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.card p { margin: 0; font-size: 15px; color: var(--text-muted); }

/* Compare */
.pairs { display: grid; gap: 12px; }
.pairs-head, .pair { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: stretch; }
.pairs-head { margin: 0 0 4px; font: 600 12.5px/1.2 var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase; }
.pairs-head span:first-child { color: var(--text-muted); }
.pairs-head span:last-child { grid-column: 3; color: var(--add); }
.pair p { margin: 0; padding: 16px 18px; border-radius: 12px; font-size: 15px; }
.pair .was { display: flex; align-items: flex-start; gap: 12px; color: var(--text-muted); border: 1px dashed var(--line-strong); background: var(--bg-sunken); }
.pair .was > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--destroy); }
.pair .to { display: grid; place-items: center; color: var(--line-strong); transition: color .2s, transform .2s; }
.pair .to .icon { width: 20px; height: 20px; }
.pair .now {
  display: flex; align-items: flex-start; gap: 12px; color: var(--text); font-weight: 500;
  background: var(--bg-raised); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--add);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.pair .now > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--add); }
.pair:hover .now { transform: translateX(3px); border-color: color-mix(in srgb, var(--add) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--add), 0 10px 24px color-mix(in srgb, var(--shadow) 18%, transparent); }
.pair:hover .to { color: var(--add); transform: translateX(3px); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Install */
.install { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.install > div { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.install h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.install h3 .icon { color: var(--dust); width: 20px; height: 20px; }
.install p { margin: 0 0 12px; color: var(--text-muted); font-size: 15px; }
.install .prose { max-width: none; }
.install .prose pre { margin: 0; }
.install .prose figure.highlight { margin: 0; }
.install.try { grid-template-columns: minmax(0, 1fr); }
.try-head { margin-bottom: 22px; }
.feature.try-body { align-items: start; }
.feature.try-body > .feature-copy { order: 0; }
.install.try .prose + p { margin: 12px 0 10px; }
.install.try > div > p:last-child { margin-bottom: 0; }

/* Docs map */
.map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.map a {
  display: block; padding: 20px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text);
  transition: transform .12s, border-color .12s;
}
.map a:hover { border-color: var(--accent); transform: translateY(-3px); color: var(--text); }
.map a > .icon { display: block; width: 24px; height: 24px; margin-bottom: 14px; color: var(--dome); }
.map strong { display: block; font: 700 17px/1.2 var(--font-body); color: var(--text); margin-bottom: 6px; }
.map span { font-size: 14px; color: var(--text-muted); }

.note { margin: 24px 0 0; font-size: 14.5px; color: var(--text-muted); }

/* Narrow screens */
@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: 230px minmax(0, 1fr); gap: 36px; }
  .toc { display: none; }
  .map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 48px; }
  .pitch { text-align: center; }
  .hero h1, .hero .lede { margin-left: auto; margin-right: auto; }
  .hero .runs-on { justify-content: center; }
  .shift { flex-direction: column; align-items: center; gap: 10px; max-width: 560px; margin-left: auto; margin-right: auto; }
  .shift-before { flex: none; align-items: center; }
  .shift-via { flex-direction: row; gap: 6px; }
  .shift-via .icon { transform: rotate(90deg); animation: none; }
  .hero .shift-after { width: 100%; }
  .terminal.stage pre { flex: none; height: calc(18 * 1.55em + 28px); }
  .cook, .feature { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .feature:nth-of-type(even) > .feature-copy { order: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { width: 200px; }
}
@media (max-width: 860px) {
  .docs-shell { display: block; padding: 0 16px; }
  .nav-toggle-label {
    display: flex; align-items: center; justify-content: space-between; margin: 14px 0 0; padding: 10px 14px; cursor: pointer; border-radius: 8px;
    background: var(--bg-raised); border: 1px solid var(--line); font: 600 12.5px/1 var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase;
  }
  .nav-toggle { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; }
  .nav-toggle:focus-visible + .nav-toggle-label { outline: 3px solid var(--accent); outline-offset: 2px; }
  .nav-toggle-label::after { content: "+"; font-size: 18px; color: var(--link); }
  .nav-toggle:checked + .nav-toggle-label::after { content: "−"; }
  .sidebar { display: none; position: static; max-height: none; padding: 10px 0 0; }
  .nav-toggle:checked ~ .sidebar { display: block; }
  .content { padding-top: 24px; }
  .prose h1 { font-size: 32px; }
  .prose h2 { font-size: 23px; }
  .prose .anchor { display: none; }
  .install, .shots { grid-template-columns: minmax(0, 1fr); }
  .search { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .topnav a { padding: 8px 6px; font-size: 14px; }
  .topnav .icon { display: none; }
  .wrap { padding: 0 16px; }
  .section { padding: 60px 0; }
  .hero-grid { padding: 40px 16px 40px; }
  .terminal.stage pre { font-size: 12px; padding: 12px 10px; }
  .hero h1 { letter-spacing: -1px; }
  .hero .lede { font-size: 17px; }
  .cards, .map { grid-template-columns: minmax(0, 1fr); }
  .stat { gap: 18px; }
  .tour-caption { font-size: 15.5px; min-height: 4.5em; }
  .tour-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tour-steps button { padding: 10px 4px 12px; font-size: 13px; }
  .stat b { font-size: 26px; }
  .pairs-head { display: none; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair .to { height: 30px; transform: rotate(90deg); }
  .pair:hover .to { transform: rotate(90deg) translateX(3px); }
  .pair p { padding: 12px 14px; font-size: 14px; }
}
@media (max-width: 420px) {
  .release { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

kbd {
  display: inline-block; min-width: 1.6em; padding: .05em .45em; text-align: center;
  font: 600 .82em/1.5 var(--font-mono); color: var(--text); background: var(--bg-raised);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
}
.hero kbd { color: #f1e6dc; background: #1a100c; border-color: #553629; }
.feature-copy h3 kbd { font-size: .62em; vertical-align: .25em; }

.terminal .chg { color: #ffb347; }
.terminal .badge-t.high { color: #e07b4e; }
.terminal .badge-t.medium { color: #ffb347; }
.terminal .del b, .terminal b { font-weight: 700; }
.terminal .del b { background: #ff5c4d22; padding: 0 .2em; }
.link-card { display: block; text-decoration: none; color: var(--text); transition: border-color .12s, transform .12s; }
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
