/* ===========================================================================
   cockpit · claude
   Paper on the outside, terminal on the inside. The page is the instrument
   housing; the panel is the instrument.

   Motion: ease-out by default, under 300ms for anything interactive, longer
   only for scroll reveals, which are explanatory rather than responsive.
   =========================================================================== */

:root {
  /* Three surfaces, three text levels, hairline rules. Depth comes from surface
     tint and a 1px border, never from a shadow: this is a developer tool, and a
     flat, dense surface reads as precision rather than as a floating card. */

  /* dark values live here once, referenced by both dark triggers below */
  --d-paper:     #0d0c0a;
  --d-surface:   #131210;
  --d-raised:    #191713;
  --d-ink:       #ece8dd;
  --d-muted:     #948e80;
  --d-faint:     #6b6659;
  --d-rule:      rgba(236, 232, 221, 0.12);
  --d-rule-soft: rgba(236, 232, 221, 0.06);
  --d-accent:    #dfa440;
  --d-accent-ink:#f0bb63;
  --d-hot:       #ef6a5c;
  --d-good:      #7fbf68;
  --d-term-bg:   #080806;

  --paper:      #f2f0e8;
  --surface:    #ebe8dd;
  --raised:     #f8f6f0;
  --ink:        #16150f;
  --muted:      #6b6658;
  --faint:      #a49d8c;
  --rule:       rgba(22, 21, 15, 0.10);
  --rule-soft:  rgba(22, 21, 15, 0.055);
  --accent:     #b5731a;
  --accent-ink: #8a5610;
  --hot:        #c0392b;
  --good:       #3f7a2c;

  /* One radius system, sharp end of the scale. Technical, not friendly. */
  --r-sm:  6px;
  --r:     8px;
  --r-lg:  12px;
  --r-pill: 999px;

  /* Content column. */
  --col:      1120px;
  --gutter:   clamp(20px, 5vw, 56px);

  /* the terminal keeps its own palette in both themes */
  --term-bg:    #17160f;
  --term-edge:  rgba(255, 246, 220, 0.10);
  --t-fg:       #e6e2d5;
  --t-dim:      rgba(230, 226, 213, 0.42);
  --t-gray:     #8f8a7d;
  --t-magenta:  #d68ad0;
  --t-cyan:     #56b8c4;
  --t-bcyan:    #85e7f2;
  --t-green:    #83cb6d;
  --t-yellow:   #ddc44a;
  --t-orange:   #ff8f2e;
  --t-red:      #f0655f;
  --t-gold:     #ffd233;

  /* strong ease-out for anything the user triggered */
  --ease:       cubic-bezier(0.23, 1, 0.32, 1);
  /* on-screen movement between two visible points */
  --ease-inout: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-exit:  cubic-bezier(0.4, 0, 1, 1);

  --t-press:    120ms;
  --t-fast:     160ms;
  --t-ui:       220ms;
  --t-reveal:   520ms;

  --font:       "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:       "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: var(--d-paper);           --surface: var(--d-surface);
    --raised: var(--d-raised);         --ink: var(--d-ink);
    --muted: var(--d-muted);
    --faint: var(--d-faint);           --rule: var(--d-rule);
    --rule-soft: var(--d-rule-soft);   --accent: var(--d-accent);
    --accent-ink: var(--d-accent-ink); --hot: var(--d-hot);
    --good: var(--d-good);             --term-bg: var(--d-term-bg);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: var(--d-paper);           --surface: var(--d-surface);
  --raised: var(--d-raised);         --ink: var(--d-ink);
  --muted: var(--d-muted);
  --faint: var(--d-faint);           --rule: var(--d-rule);
  --rule-soft: var(--d-rule-soft);   --accent: var(--d-accent);
  --accent-ink: var(--d-accent-ink); --hot: var(--d-hot);
  --good: var(--d-good);             --term-bg: var(--d-term-bg);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.skip { position: absolute; left: -9999px; background: var(--ink); color: var(--paper);
        padding: 10px 16px; border-radius: var(--r); z-index: 99; }
.skip:focus { left: 16px; top: 16px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mono { font-family: var(--mono); font-variant-ligatures: none; }
.dim  { color: var(--faint); }
.bold { font-weight: 700; }

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; }

:where(a, button, summary, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* --- scroll progress ------------------------------------------------------- */

.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: .85;
}

/* --- top bar --------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-ui) var(--ease);
}
.topbar.stuck { border-bottom-color: var(--rule-soft); }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-decoration: none;
}
.brand-sep, .brand-sub { color: var(--faint); font-weight: 400; }

.beacon {
  width: 9px; height: 9px; padding: 0; border: none; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-ui) var(--ease),
              background var(--t-ui) var(--ease);
}
@media (hover: hover) {
  .beacon:hover { transform: scale(1.35); box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 22%, transparent); }
}
.beacon:active { transform: scale(.9); transition-duration: var(--t-press); }
.beacon.armed { background: var(--hot); box-shadow: 0 0 0 6px color-mix(in oklab, var(--hot) 26%, transparent); }

.nav { display: flex; align-items: center; gap: clamp(12px, 1.9vw, 26px); }
.nav a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--muted); text-decoration: none;
  position: relative; padding: 4px 0;
  transition: color var(--t-fast) var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-ui) var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.nav a span { margin-left: 3px; font-size: 10px; opacity: .6; }
.nav .ghost::after { display: none; }
.nav .ghost {
  padding: 7px 13px; border: 1px solid var(--rule); border-radius: var(--r);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.nav .ghost:hover { border-color: color-mix(in oklab, var(--accent) 55%, var(--rule)); }
.nav .ghost:active { transform: scale(.97); transition-duration: var(--t-press); }

.theme {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border: 1px solid var(--rule); border-radius: var(--r);
  background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.theme:hover { color: var(--ink); border-color: color-mix(in oklab, var(--accent) 45%, var(--rule)); }
.theme:active { transform: scale(.97); transition-duration: var(--t-press); }
.theme-icon { font-size: 13px; display: inline-block; transition: transform var(--t-ui) var(--ease); }
.theme:hover .theme-icon { transform: rotate(180deg); }
.theme-name { min-width: 4.6em; text-align: left; }

@media (max-width: 900px) { .nav a:not(.ext), .theme-name { display: none; } .theme-name { display: none; } }
@media (max-width: 560px) { .theme { display: none; } }

/* --- sheet ----------------------------------------------------------------- */

/* --- layout ----------------------------------------------------------------
   Sections run edge to edge so a tinted band is a real horizontal stripe
   across the viewport. Content is centred by constraining the section's own
   children, which keeps the markup flat: no wrapper div per section. */

.sheet { max-width: none; margin: 0; padding: 0; background: none; border: 0; }

/* The content column is created by padding, not by a max-width on the children.
   Constraining the children would re-centre anything that carries its own
   max-width (the headings, the ledes) and knock it out of alignment with the
   rest of the section. */
.band,
.hero,
.footer {
  padding-inline: max(var(--gutter), (100% - var(--col)) / 2);
}

/* A tinted band is the only structural device on the page. Alternating it
   against the base surface is what separates one idea from the next. */
.band.tint {
  background: var(--surface);
  border-block: 1px solid var(--rule-soft);
}

/* --- hero ------------------------------------------------------------------ */

.hero {
  text-align: center;
  padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 88px);
}

.eyebrow {
  display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 9px;
  margin: 0 0 30px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .2em; color: var(--faint);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: beat 3.4s var(--ease) infinite;
}
.eyebrow .sep { opacity: .5; }
@keyframes beat {
  0%, 72%, 100% { opacity: 1; transform: scale(1); }
  80%           { opacity: .45; transform: scale(.7); }
}
.oss-chip {
  margin-left: 4px; padding: 4px 9px; border-radius: var(--r-pill);
  border: 1px solid color-mix(in oklab, var(--good) 40%, transparent);
  color: var(--good); text-decoration: none; font-size: 10px; letter-spacing: .16em;
  transition: background var(--t-fast) var(--ease);
}
.oss-chip:hover { background: color-mix(in oklab, var(--good) 12%, transparent); }

h1 {
  margin: 0 auto 26px; max-width: 15ch;
  font-size: clamp(2.6rem, 7.4vw, 5.05rem);
  font-weight: 700; line-height: 0.99; letter-spacing: -0.043em;
}

.lede { margin: 0 auto; max-width: 60ch;
        font-size: clamp(1rem, 1.9vw, 1.16rem); color: var(--muted); text-wrap: pretty; }
.lede em { color: var(--ink); font-style: normal; font-weight: 600; }

/* --- the panel ------------------------------------------------------------- */

.panel-wrap {
  margin: clamp(34px, 5vw, 56px) 0 0;
  border-radius: var(--r-lg);
  background: var(--term-bg);
  border: 1px solid var(--term-edge);
  overflow: hidden;
  text-align: left;
  transition: border-color 400ms var(--ease), box-shadow 400ms var(--ease);
}
/* The one place a glow is allowed: it is a state change the user is meant to
   notice, not decoration. */
.panel-wrap.hot {
  border-color: color-mix(in oklab, var(--t-red) 55%, transparent);
  box-shadow: 0 0 32px -8px color-mix(in oklab, var(--t-red) 45%, transparent);
}

.panel-chrome {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 246, 220, 0.07);
}
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(230,226,213,.17); }
.tl-title { margin-left: 8px; font-family: var(--mono); font-size: 11px;
            color: var(--t-dim); letter-spacing: .05em; }
.live-tag {
  margin-left: auto; font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .16em; color: var(--t-green);
  display: inline-flex; align-items: center; gap: 5px;
}
.live-tag::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; animation: pulse 2s ease-in-out infinite;
}
.live-tag.paused { color: var(--t-dim); }
.live-tag.paused::before { animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.panel {
  padding: 18px clamp(14px, 2.2vw, 22px) 18px;
  font-family: var(--mono);
  font-size: clamp(10px, 1.32vw, 13.5px);
  line-height: 1.95;
  color: var(--t-fg);
  white-space: pre;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(230,226,213,.2) transparent;
}
.panel::-webkit-scrollbar { height: 6px; }
.panel::-webkit-scrollbar-thumb { background: rgba(230,226,213,.18); border-radius: 3px; }

/* --- transport ------------------------------------------------------------- */

.transport {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(255, 246, 220, 0.07);
}
.tp-btn {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--term-edge); border-radius: var(--r);
  background: rgba(255, 246, 220, 0.05); color: var(--t-fg);
  font-size: 10px; cursor: pointer;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.tp-btn:hover { background: rgba(255, 246, 220, 0.12); }
.tp-btn:active { transform: scale(.94); transition-duration: var(--t-press); }
.tp-scrub { flex: 1; display: block; }
.tp-clock { flex: none; font-size: 11px; color: var(--t-dim); letter-spacing: .04em; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 18px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(to right,
    var(--t-orange) 0 var(--fill, 0%), rgba(230,226,213,.16) var(--fill, 0%) 100%);
}
input[type="range"]::-moz-range-track {
  height: 3px; border-radius: 2px; background: rgba(230,226,213,.16);
}
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--t-orange); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%;
  background: var(--t-fg); border: none;
  transition: transform var(--t-fast) var(--ease);
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--t-fg); border: none;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.25); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.4); }

/* ANSI-equivalent classes, shared by the panel and the inline examples */
.c-magenta { color: var(--t-magenta); }
.c-cyan    { color: var(--t-cyan); }
.c-bcyan   { color: var(--t-bcyan); }
.c-green   { color: var(--t-green); }
.c-yellow  { color: var(--t-yellow); }
.c-orange  { color: var(--t-orange); }
.c-red     { color: var(--t-red); }
.c-gold    { color: var(--t-gold); }
.c-gray    { color: var(--t-gray); }
.c-dim     { color: var(--t-dim); }

.seg { border-radius: 4px; transition: background var(--t-ui) var(--ease), opacity var(--t-ui) var(--ease); }
.panel.inspecting .seg { opacity: .3; }
.panel.inspecting .seg.on {
  opacity: 1; background: rgba(255, 246, 220, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 246, 220, 0.1);
}
#staticPanel .seg { cursor: pointer; }

.narration {
  margin: 16px 2px 0; min-height: 1.5em;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  text-align: left;
  transition: opacity var(--t-fast) var(--ease);
}
.narration.swap { opacity: 0; }
.narration b { color: var(--ink); font-weight: 500; }

/* --- install --------------------------------------------------------------- */

.install { margin-top: clamp(30px, 4.4vw, 46px); }

.cmd {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 auto;
  padding: 15px 15px 15px 20px;
  background: var(--term-bg); border: 1px solid var(--term-edge); border-radius: var(--r-lg);
  cursor: pointer; font-family: var(--mono); font-size: clamp(13px, 1.7vw, 15.5px);
  color: var(--t-fg);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-ui) var(--ease);
}
.cmd:hover { transform: translateY(-2px); border-color: rgba(255, 246, 220, 0.26); }
.cmd:active { transform: translateY(0) scale(.97); transition-duration: var(--t-press); }
.cmd .prompt { color: var(--t-green); }

.copy-label {
  min-width: 74px; padding: 7px 12px; border-radius: var(--r-sm);
  background: rgba(255, 246, 220, 0.09);
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em; color: var(--t-dim);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.cmd:hover .copy-label { color: var(--t-fg); }
.copy-label.done { background: color-mix(in oklab, var(--t-green) 22%, transparent); color: var(--t-green); }

.fineprint { margin: 18px auto 0; max-width: 58ch; font-size: 13.5px; color: var(--muted); line-height: 1.65; }
.fineprint code, .snippet code {
  font-family: var(--mono); font-size: .92em; padding: 1px 5px; border-radius: 4px;
  background: var(--rule-soft);
}

/* --- spec strip ------------------------------------------------------------ */

.specs {
  list-style: none; margin: clamp(30px, 4vw, 44px) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
}
.specs li {
  display: flex; align-items: baseline; gap: 7px;
  padding: 9px 16px; border: 1px solid var(--rule); border-radius: var(--r-pill);
  transition: border-color var(--t-ui) var(--ease), transform var(--t-ui) var(--ease);
}
.specs li:hover { border-color: color-mix(in oklab, var(--accent) 50%, var(--rule)); transform: translateY(-2px); }
.spec-v { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.spec-k { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }

/* --- sections -------------------------------------------------------------- */

.band {
  scroll-margin-top: 68px;
  padding-block: clamp(64px, 9vw, 108px);
}
/* Consecutive untinted bands still need a seam, but a tinted one already has
   its own border and would otherwise double up. */
.band + .band:not(.tint) { border-top: 1px solid var(--rule-soft); }
.band.tint + .band:not(.tint) { border-top: 0; }

.kicker { margin: 0 0 16px; font-family: var(--mono); font-size: 11px; font-weight: 500;
          letter-spacing: .2em; color: var(--faint); }

h2 { margin: 0 0 18px; max-width: 20ch;
     font-size: clamp(1.85rem, 4.4vw, 2.85rem);
     font-weight: 700; line-height: 1.05; letter-spacing: -0.032em; }

h3 { margin: 0 0 10px; font-size: 1.12rem; font-weight: 600; letter-spacing: -0.012em; }
h4 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; }

.section-lede { margin: 0 0 clamp(32px, 5vw, 48px); max-width: 60ch; color: var(--muted); text-wrap: pretty; }
.section-lede em { color: var(--ink); font-style: normal; font-weight: 600; }

/* --- differentiators ------------------------------------------------------- */

.diffs { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(28px, 4vw, 44px); }
.diff { display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 3vw, 30px); align-items: start; }
/* Grid and flex children default to min-width:auto, so a pre-formatted terminal
   block inside one pushes the whole track wider than the viewport. Everything
   wide scrolls inside its own box; the page itself never scrolls sideways. */
.diff, .diff-body, .card, .panel-wrap, .inspector > *, .footer > *,
.ledger-col, .pane, .showcase-card, .steps li > div { min-width: 0; }

.diff-n { font-family: var(--mono); font-size: 12px; font-weight: 700;
          letter-spacing: .1em; color: var(--accent); padding-top: 6px; }
.diff-body p { margin: 0; color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.diff-body p em { color: var(--ink); font-style: normal; font-weight: 600; }
.diff-body .mono { font-family: var(--mono); font-size: .93em; color: var(--ink); }

.mini {
  margin-top: 18px; padding: 14px 16px;
  background: var(--term-bg); border: 1px solid var(--term-edge); border-radius: var(--r-lg);
  font-size: clamp(10.5px, 1.25vw, 12.5px); line-height: 2; color: var(--t-fg);
  overflow-x: auto;
}
.mini-row { display: flex; align-items: baseline; gap: 12px; white-space: pre; }
.mini-label { min-width: 58px; color: var(--t-dim); }
.mini-note { color: var(--t-dim); font-style: italic; margin-left: 4px; }
.mini .dim { color: var(--t-dim); }

/* --- inspector ------------------------------------------------------------- */

.inspector { display: grid; gap: 20px; }
.panel-wrap.static { margin-top: 0; }

.detail {
  min-height: 132px; padding: 22px 24px;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--raised);
}
.detail-idle { margin: 0; color: var(--faint); font-family: var(--mono); font-size: 13px; }
.detail-name { margin: 0 0 4px; font-family: var(--mono); font-size: 12px; font-weight: 700;
               letter-spacing: .13em; text-transform: uppercase; color: var(--accent-ink); }
.detail-sample { margin: 0 0 12px; font-family: var(--mono); font-size: 15px;
                 padding: 9px 13px; border-radius: var(--r);
                 background: var(--term-bg); color: var(--t-fg);
                 display: inline-block; white-space: pre; max-width: 100%; overflow-x: auto; }
.detail-text { margin: 0; color: var(--muted); max-width: 64ch; text-wrap: pretty; }
.detail-in { animation: detail-in var(--t-ui) var(--ease) both; }
@keyframes detail-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* --- recording -------------------------------------------------------------- */

/* preload="none" means nothing downloads until play is pressed, so the poster
   carries the whole first impression. Reserving the aspect ratio keeps it from
   shifting the page once the metadata arrives. */
.recording {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--term-edge);
  border-radius: var(--r-lg);
  background: var(--term-bg);
}

/* --- trade-off ledger ------------------------------------------------------ */

.ledger { display: grid; gap: 16px; }
@media (min-width: 820px) { .ledger { grid-template-columns: 1fr 1fr; } }

.ledger-col {
  padding: 24px 24px 26px;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--raised);
  position: relative; overflow: hidden;
}
.ledger-col::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--good);
}
.ledger-col.con::before { background: var(--hot); }

.ledger-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
               font-family: var(--mono); font-size: 12px; font-weight: 700;
               letter-spacing: .16em; text-transform: uppercase; color: var(--good); }
.ledger-col.con .ledger-head { color: var(--hot); }
.ledger-sign {
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--r-sm);
  background: color-mix(in oklab, currentColor 16%, transparent);
  font-size: 13px; line-height: 1;
}

.ledger-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.ledger-list li {
  position: relative; padding-left: 20px;
  font-size: 14.6px; line-height: 1.55; color: var(--muted); text-wrap: pretty;
}
.ledger-list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 1px; background: var(--faint);
}
.ledger-list b { color: var(--ink); font-weight: 600; }
.ledger-list .mono { font-family: var(--mono); font-size: .9em; color: var(--ink); }

/* --- the real-estate figure ------------------------------------------------ */

.estate { margin: clamp(28px, 4vw, 40px) 0 0; padding: 0;
          display: grid; gap: 14px; align-items: center; }
@media (min-width: 760px) { .estate { grid-template-columns: auto 1fr; gap: 24px; } }

.estate-term {
  display: grid; gap: 3px; padding: 12px;
  width: max-content;
  border: 1px solid var(--term-edge); border-radius: var(--r); background: var(--term-bg);
}
.estate-row { width: 168px; height: 3px; border-radius: 2px; background: rgba(230,226,213,.12); }
.estate-row.used { background: var(--t-orange); }
.estate-row.used.r2 { width: 168px; }
.estate-row.used.r1 { width: 140px; }
.estate-row.used.r3 { width: 152px; }
.estate-row.used.r4 { width: 96px; }
.estate figcaption { margin: 0; font-size: 14px; color: var(--ink); text-wrap: pretty; }

/* --- roadmap --------------------------------------------------------------- */

.roadmap { margin-top: clamp(44px, 6vw, 64px); }
.roadmap-head { font-family: var(--mono); font-size: 12px; font-weight: 700;
                letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink);
                margin-bottom: 10px; }
.roadmap-lede { margin: 0 0 24px; max-width: 58ch; color: var(--muted); }

.road-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 8px; }
.road {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: transparent;
  text-decoration: none;
  transition: border-color var(--t-ui) var(--ease), background var(--t-ui) var(--ease),
              transform var(--t-ui) var(--ease);
}
.road:hover {
  border-color: color-mix(in oklab, var(--accent) 50%, var(--rule));
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  transform: translateX(3px);
}
.road-box { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.road-body h4 { margin: 0 0 3px; font-size: 15px; font-weight: 600; }
.road-body p { margin: 0; font-size: 13.6px; color: var(--muted); }
.road-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  padding: 4px 9px; border-radius: var(--r-pill); white-space: nowrap;
  border: 1px solid var(--rule); color: var(--muted);
}
.road-tag.help { color: var(--good); border-color: color-mix(in oklab, var(--good) 40%, transparent); }
@media (max-width: 640px) { .road { grid-template-columns: auto 1fr; } .road-tag { grid-column: 2; justify-self: start; } }

/* --- cards ----------------------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; }
.card {
  padding: 22px 22px 24px;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--raised);
  transition: transform var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 45%, var(--rule)); }
.card-n { display: block; margin-bottom: 14px; font-family: var(--mono);
          font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.card .mono, .ledger-list .mono, .pane .mono, .qa-body .mono {
  font-family: var(--mono); font-size: .92em; color: var(--ink);
}

/* --- code block ------------------------------------------------------------ */

.code-block { border: 1px solid var(--term-edge); border-radius: var(--r-lg); overflow: hidden; background: var(--term-bg); }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px 9px 18px;
  border-bottom: 1px solid rgba(255, 246, 220, 0.07);
  font-size: 11.5px; color: var(--t-dim); letter-spacing: .05em;
}
.code-copy, .snip-copy {
  border: 1px solid var(--term-edge); border-radius: var(--r-sm);
  background: rgba(255, 246, 220, 0.06); color: var(--t-dim);
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em;
  padding: 6px 11px; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.code-copy:hover, .snip-copy:hover { background: rgba(255, 246, 220, 0.14); color: var(--t-fg); }
.code-copy:active, .snip-copy:active { transform: scale(.95); transition-duration: var(--t-press); }
.code-copy.done, .snip-copy.done { color: var(--t-green); border-color: color-mix(in oklab, var(--t-green) 45%, transparent); }

.code-block pre { margin: 0; padding: 20px clamp(14px, 2.4vw, 24px); overflow-x: auto;
                  font-size: clamp(11.5px, 1.4vw, 13.5px); line-height: 1.85; color: var(--t-fg); }
.t-k { color: var(--t-bcyan); } .t-s { color: var(--t-green); }
.t-n { color: var(--t-gold); }  .t-b { color: var(--t-orange); }
.t-p { color: var(--t-dim); }

/* --- tabs ------------------------------------------------------------------ */

.tabs { margin-bottom: 26px; }
.tabs-rail {
  position: relative; display: inline-flex; gap: 2px; padding: 4px;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--raised);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs-rail::-webkit-scrollbar { display: none; }
.tab {
  position: relative; z-index: 1;
  border: none; background: transparent; cursor: pointer;
  padding: 9px 18px; border-radius: var(--r); white-space: nowrap;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .05em;
  color: var(--muted);
  transition: color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--paper); }
.tabs-pill {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0;
  border-radius: var(--r); background: var(--ink);
  transform: translateX(var(--x, 0)); width: var(--w, 0);
  transition: transform var(--t-ui) var(--ease-inout), width var(--t-ui) var(--ease-inout);
}
.tabs-pill.instant { transition: none; }

.pane { animation: pane-in var(--t-ui) var(--ease) both; }
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pane[hidden] { display: none; }
.pane-lede { margin: 0 0 24px; max-width: 62ch; color: var(--muted); }
.pane-lede b { color: var(--ink); font-weight: 600; }

/* --- discussion fallback --------------------------------------------------- */

.giscus-fallback {
  padding: 34px 26px; text-align: center;
  border: 1px dashed var(--rule); border-radius: var(--r-lg);
  background: var(--raised);
}
.giscus-fallback h4 { margin-bottom: 8px; }
.giscus-fallback p { margin: 0 auto 20px; max-width: 48ch; color: var(--muted); font-size: 14.5px; }

/* --- showcase -------------------------------------------------------------- */

.showcase { display: grid; gap: 14px; }
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.showcase-card {
  display: block; padding: 20px 22px 22px;
  border: 1px solid var(--rule); border-radius: var(--r-lg); text-decoration: none;
  background: var(--raised);
  transition: transform var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease);
}
.showcase-card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 50%, var(--rule)); }
.showcase-kind { font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
                 text-transform: uppercase; color: var(--accent-ink); }
.showcase-card h4 { margin: 10px 0 6px; }
.showcase-card p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.showcase-by { font-family: var(--mono); font-size: 12px; color: var(--faint); }

.empty {
  display: grid; justify-items: center; gap: 6px;
  padding: 52px 26px 46px; text-align: center;
  border: 1px dashed var(--rule); border-radius: var(--r-lg);
}
.empty-art { display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
             font-family: var(--mono); font-size: 13px; color: var(--faint); }
.empty-box {
  width: 46px; height: 30px; border: 1px dashed var(--rule); border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--faint);
}
.empty-arrow { animation: nudge 1.8s var(--ease-inout) infinite; color: var(--accent); }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
.empty h4 { margin: 0; font-size: 1.05rem; }
.empty p { margin: 0 0 18px; max-width: 46ch; color: var(--muted); font-size: 14.5px; }

/* --- steps ----------------------------------------------------------------- */

.steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 22px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.step-n { font-family: var(--mono); font-size: 12px; font-weight: 700;
          letter-spacing: .1em; color: var(--accent); padding-top: 3px; }
.steps p { margin: 0; color: var(--muted); font-size: 14.6px; max-width: 62ch; }

.snippet {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 10px 10px 10px 16px;
  border: 1px solid var(--term-edge); border-radius: var(--r); background: var(--term-bg);
  overflow-x: auto;
}
.snippet code { color: var(--t-fg); font-size: 12.5px; white-space: pre; background: none; padding: 0; }

/* --- FAQ accordion --------------------------------------------------------- */

.faq { display: grid; gap: 8px; }
.qa { border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
      background: var(--raised); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 20px; cursor: pointer; list-style: none;
  font-size: 15.5px; font-weight: 500;
  transition: background var(--t-fast) var(--ease);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { background: color-mix(in oklab, var(--accent) 5%, transparent); }
.chev { font-family: var(--mono); font-size: 15px; color: var(--faint);
        transition: transform var(--t-ui) var(--ease); flex: none; }
.qa[open] .chev { transform: rotate(45deg); }
.qa-body { padding: 0 20px 19px; }
.qa-body p { margin: 0; color: var(--muted); font-size: 14.8px; max-width: 68ch; text-wrap: pretty; }
.qa-body a { color: var(--accent-ink); }
.qa[open] .qa-body { animation: qa-in var(--t-ui) var(--ease) both; }
@keyframes qa-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* --- CTAs + footer --------------------------------------------------------- */

.cta-stack { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.cta {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 22px; border: 1px solid var(--rule); border-radius: var(--r-lg);
  font-family: var(--mono); font-size: 13.5px; text-decoration: none;
  transition: transform var(--t-ui) var(--ease), border-color var(--t-ui) var(--ease),
              background var(--t-ui) var(--ease);
}
.cta:hover {
  transform: translateX(4px);
  border-color: color-mix(in oklab, var(--accent) 55%, var(--rule));
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.cta:active { transform: translateX(4px) scale(.98); transition-duration: var(--t-press); }
.cta span { transition: transform var(--t-ui) var(--ease); }
.cta:hover span { transform: translate(2px, -2px); }
.cta.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cta.primary:hover { background: var(--ink); opacity: .9; }

.footer {
  padding-block: 40px;
  border-top: 1px solid var(--rule-soft);
  background: var(--surface);
  font-size: 12.5px; color: var(--muted);
}
.foot-inner {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 20px;
}
.footer p { margin: 0; }
.footer strong { color: var(--ink); font-weight: 500; }
.foot-made { display: grid; gap: 7px; }
.byline { font-size: 13px; }
.byline a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid transparent;
            transition: border-color var(--t-fast) var(--ease); }
.byline a:hover { border-bottom-color: currentColor; }
.footer .mono a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-nav a { color: var(--muted); text-decoration: none; border: none !important;
              transition: color var(--t-fast) var(--ease); }
.foot-nav a:hover { color: var(--ink); }
.foot-nav a span { margin-left: 3px; font-size: 10px; opacity: .6; }

kbd { font-family: var(--mono); font-size: .82em; padding: 2px 6px; border-radius: 5px;
      border: 1px solid var(--rule); border-bottom-width: 2px; background: var(--raised); color: var(--ink); }

/* --- toast ----------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 70;
  padding: 12px 20px; border-radius: var(--r-lg);
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.6);
  transform: translate(-50%, 12px) scale(.96); opacity: 0;
  transition: transform var(--t-ui) var(--ease), opacity var(--t-ui) var(--ease);
  pointer-events: none;
}
.toast.on { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* --- entrance -------------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(12px); }
.reveal.shown {
  opacity: 1; transform: none;
  transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
