/* Signal: matte near-black canvas, mono display, one amber indicator. Dark is the default theme. */

/* ---- Fonts: IBM Plex, under the SIL Open Font License in fonts/OFL.txt */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --color-canvas: oklch(0.17 0.008 70);
  --color-surface: oklch(0.21 0.009 70);
  --color-surface-raised: oklch(0.26 0.01 70);
  --color-text: oklch(0.94 0.008 80);
  --color-text-muted: oklch(0.66 0.012 75);
  --color-line: oklch(0.30 0.01 70);
  --color-indicator: oklch(0.78 0.16 70);
  --color-indicator-echo: oklch(0.78 0.16 70 / 0.7);
  --color-on-indicator: oklch(0.17 0.01 70);

  --font-display: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-display: clamp(2rem, 1.2rem + 3vw, 3.25rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 68ch;
  --radius: 4px;
  --radius-float: 8px;
  --shadow-float: 0 12px 32px oklch(0 0 0 / 0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --color-canvas: oklch(0.985 0.005 85);
    --color-surface: oklch(0.955 0.008 85);
    --color-surface-raised: oklch(1 0 0);
    --color-text: oklch(0.2 0.012 70);
    --color-text-muted: oklch(0.45 0.014 70);
    --color-line: oklch(0.87 0.01 80);
    --color-indicator: oklch(0.64 0.16 62);
    --color-indicator-echo: oklch(0.64 0.16 62 / 0.55);
    --color-on-indicator: oklch(0.15 0.01 62);
  }
}

/* ---- Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: var(--text-display); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-color: var(--color-text-muted); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--color-indicator); }
:focus-visible { outline: 2px solid var(--color-indicator); outline-offset: 2px; }
code, pre, kbd { font-family: var(--font-display); font-size: 0.92em; }
img { max-width: 100%; }
ul, ol { margin: 0; padding-left: 1.25em; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; z-index: 1; left: -999px; top: var(--space-4); padding: var(--space-2) var(--space-3); background: var(--color-surface-raised); border-radius: var(--radius); }
.skip:focus { left: var(--space-4); }

/* A small label naming the object under it: an event line, a notification.
   It keeps its case, since it can quote an address. */
.indicator { display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--color-indicator); vertical-align: 0.05em; }
/* A dot the script will light stays dark until its first play. */
.unlit .indicator { background: var(--color-line); }

/* ---- Wordmark */
.wordmark { font-family: var(--font-display); font-weight: 500; font-size: 1.625rem; letter-spacing: -0.03em; text-decoration: none; display: inline-block; line-height: 1; padding-block: 0.1em 0.2em; white-space: nowrap; flex-shrink: 0; }
.wordmark.small { font-size: 1rem; }
.wordmark .i { position: relative; display: inline-block; }
.wordmark .dot { position: absolute; left: 50%; top: 0.08em; width: 0.17em; height: 0.17em; border-radius: 50%; background: var(--color-indicator); transform: translateX(-50%); }
.footer .wordmark { padding-block: 0; }

/* ---- Nav and footer */
.nav, .footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--gutter); }
.nav { border-bottom: 1px solid var(--color-line); }
.brand { display: flex; align-items: center; gap: var(--space-3); margin: 0; }
.tag { font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); padding: 0.1em var(--space-2); border: 1px solid var(--color-line); border-radius: var(--radius); line-height: 1.6; }
.footer { flex-wrap: wrap; border-top: 1px solid var(--color-line); margin-top: var(--space-16); color: var(--color-text-muted); font-size: var(--text-sm); }
.nav nav, .footer nav { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.nav nav a { font-family: var(--font-display); font-size: var(--text-sm); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--color-text-muted); }
.nav nav a:hover { color: var(--color-text); }
.footer nav a { text-decoration: none; }
.footer nav a:hover { color: var(--color-text); }
.install { font: inherit; color: var(--color-text); background: transparent; padding: var(--space-1) var(--space-2); border: 1px solid var(--color-line); border-radius: var(--radius); cursor: pointer; }
.install code { font-size: var(--text-sm); }
.install:hover { border-color: var(--color-text-muted); }

/* ---- Buttons */
.button { display: inline-block; font-family: var(--font-display); font-size: var(--text-sm); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius); text-decoration: none; }
.button:hover { border-color: var(--color-text-muted); }
.button.primary { background: var(--color-indicator); color: var(--color-on-indicator); border-color: var(--color-indicator); font-weight: 500; }
.button.primary:hover { filter: brightness(1.08); }

/* ---- Landing */
main > section { padding: var(--space-16) var(--gutter); max-width: 1280px; margin-inline: auto; }
main > section + section { border-top: 1px solid var(--color-line); }

.hero { position: relative; overflow: clip; isolation: isolate; display: flex; flex-direction: column; justify-content: center; max-width: none; padding-inline: 0; padding-block: clamp(3rem, 7vw, 6rem); }
.hero-inner { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-6); width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.hero h1 { max-width: 25ch; font-size: clamp(2rem, 4.5vw, 4rem); line-height: 1.05; }
.hero h1 .l1, .hero h1 .l2 { display: inline-block; text-wrap: balance; }
@media (min-width: 1100px) { .hero h1 .l1, .hero h1 .l2 { white-space: nowrap; } }
.hero h1 .l2 { color: var(--color-text-muted); }
.hero-description { max-width: 58ch; color: var(--color-text-muted); font-size: var(--text-lg); }
.hero-actions { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.hero-actions .hero-more { margin-inline-start: var(--space-3); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); color: var(--color-text-muted); }
.facts li { text-wrap: pretty; }
.hero-more { font-family: var(--font-display); font-size: var(--text-sm); color: var(--color-text-muted); text-decoration: none; padding: var(--space-2) 0; }
.hero-more:hover { color: var(--color-text); }

/* Radio waves sit behind the content and never intercept clicks. JS places
   their origin at the active signal dot, including in the mobile layout. */
.radio-waves { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: clip; }
.radio-waves span { position: absolute; width: 3rem; height: 3rem; transform: translate(-50%, -50%); border: 1px solid var(--color-indicator-echo); border-radius: 50%; opacity: 0; }

/* The signal line: an event on the left becomes a notification on the right. */
.signal { position: relative; margin-top: var(--space-6); border-top: 1px solid var(--color-line); padding: var(--space-8) 0 var(--space-4); }
.stage { position: relative; display: grid; }
/* The event column takes its line's width and the wire fills the rest, so the
   wire starts one gap after the event and ends at the dot, one gap before the
   card. The card's column is a share of the width, so the card and the dot
   hold still as the examples change. */
.scene { position: relative; grid-area: 1 / 1; display: grid; grid-template-columns: auto minmax(7rem, 1fr) minmax(0, 30%); grid-template-rows: auto auto; align-items: center; align-content: center; gap: var(--space-3) var(--space-6); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.35s ease; }
.scene.active { opacity: 1; visibility: visible; pointer-events: auto; }
.sig-in, .sig-out { display: contents; }
.sig-label { font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); grid-row: 1; align-self: end; }
.sig-in .sig-label { grid-column: 1 / 3; }
.sig-out .sig-label { grid-column: 3; }
/* Below 965px the type shrinks just enough that the longest example stays on
   one line: a wrapped line fills its column, and the wire would start past
   its end. */
.sig-line { grid-column: 1; grid-row: 2; margin: 0; min-width: 0; font-family: var(--font-display); font-size: clamp(0.85rem, min(0.6rem + 0.6vw, 2.1vw - 0.33rem), 1.15rem); line-height: 1.5; color: var(--color-text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.sig-line .ev { color: var(--color-text); }
.sig-wire { grid-column: 2; grid-row: 2; position: relative; height: 1px; background: repeating-linear-gradient(90deg, var(--color-line) 0 6px, transparent 6px 12px); }
.sig-pulse { position: absolute; top: 50%; left: 0; width: 2.5rem; height: 2px; transform: translate(-100%, -50%); background: linear-gradient(90deg, transparent, var(--color-indicator)); opacity: 0; pointer-events: none; }
.sig-dot { position: absolute; left: 100%; top: 50%; transform: translate(-100%, -50%); display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--color-canvas); border: 1px solid var(--color-line); }
.sig-dot .indicator { width: 0.85rem; height: 0.85rem; }
.sig-out .toast { grid-column: 3; grid-row: 2; }
.scene-bar { display: flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-6); }
.scene-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.scene-bar button { font: var(--text-xs) var(--font-display); color: var(--color-text-muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius); padding: var(--space-2); cursor: pointer; }
.scene-bar button:hover { color: var(--color-text); border-color: var(--color-line); }
.scene-tabs [aria-selected="true"] { color: var(--color-text); border-color: var(--color-line); background: var(--color-surface); }
.scene-bar .cycle-toggle { margin-left: auto; flex: none; border-color: var(--color-line); }

.toast { width: 100%; max-width: 24rem; display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); background: var(--color-surface-raised); border: 1px solid var(--color-line); border-radius: var(--radius-float); box-shadow: var(--shadow-float); font-family: var(--font-body); font-size: var(--text-sm); line-height: 1.35; }
/* The dapp's icon, its initial: the wire's dot stays the only light. */
.toast-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--radius); background: var(--color-canvas); font-family: var(--font-display); font-weight: 500; text-transform: uppercase; color: var(--color-text-muted); }
.toast-text { display: flex; flex-direction: column; gap: var(--space-1); }
.toast-text b { font-weight: 600; }
.toast-text span, .toast-text small { color: var(--color-text-muted); }
.toast-text small { font-size: var(--text-xs); }
@media (prefers-color-scheme: light) { .toast-icon { background: var(--color-surface); } }

.flow-section { position: relative; display: flex; flex-direction: column; gap: var(--space-8); }
.flow-section > h2 { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); }
/* Leave a little space above the section when following the hero link. */
#how { scroll-margin-top: var(--space-4); }
#how:focus:not(:focus-visible) { outline: none; }
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); }
.node { position: relative; padding: var(--space-4); border: 1px solid var(--color-text-muted); border-radius: var(--radius); display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.node.dashed { border-style: dashed; }
.node b { font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); overflow-wrap: anywhere; }
.node span { font-size: var(--text-xs); color: var(--color-text-muted); }
.node + .node::before { content: "→"; position: absolute; left: calc(-1 * var(--space-4)); top: 50%; width: var(--space-4); text-align: center; transform: translate(0, -50%); color: var(--color-text-muted); font-family: var(--font-display); }
.flow-note { color: var(--color-text-muted); max-width: var(--measure); }
.flow-note + .flow-note { margin-top: var(--space-2); }
.architecture { margin-top: var(--space-4); }
.architecture summary { cursor: pointer; color: var(--color-text-muted); font-size: var(--text-sm); }
.architecture .flow { margin-block: var(--space-6); }

/* The path: the signal line turned downward. A dashed wire joins three
   stations, from the event the realm emits to the notification the browser
   shows, where the dot lights. */
.path { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-12); }
.station { position: relative; display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-8); align-items: start; }
.station:not(:last-child)::after { content: ""; position: absolute; left: 1.5rem; top: 3rem; bottom: calc(-1 * var(--space-12)); width: 1px; background: repeating-linear-gradient(180deg, var(--color-line) 0 6px, transparent 6px 12px); }
.station-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--color-canvas); border: 1px solid var(--color-line); }
.station-dot .indicator { width: 0.85rem; height: 0.85rem; }
/* The script lights step 1's dot and keeps step 3's unlit until the reader
   reaches step 3; then the light leaves step 1, the pulse runs down the wire,
   under the dots, and step 3's dot comes on. */
.path-pulse { position: absolute; width: 2px; height: var(--space-8); transform: translate(-50%, -100%); background: linear-gradient(180deg, transparent, var(--color-indicator)); opacity: 0; pointer-events: none; }
.station-text { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); }
.station-text p { color: var(--color-text-muted); }
.station-text code { overflow-wrap: anywhere; }
.station-code { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }

.closing { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.self-host { color: var(--color-text-muted); max-width: var(--measure); }

/* ---- Code blocks */
.code { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.code-head { display: flex; align-items: center; gap: var(--space-3); min-height: 2rem; padding: 0 var(--space-1) 0 var(--space-3); border-bottom: 1px solid var(--color-line); font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
.code-head .copy { margin-left: auto; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: var(--radius); padding: var(--space-1) var(--space-2); cursor: pointer; }
.code-head .copy:hover { color: var(--color-text); border-color: var(--color-line); }
/* The code scrolls sideways under its head; a shade at either edge shows
   that more of it lies past that edge. */
.code pre { margin: 0; padding: var(--space-3) var(--space-4); font-size: var(--text-sm); line-height: 1.6; tab-size: 4; overflow-x: auto;
  background:
    linear-gradient(to right, var(--color-surface) 30%, transparent) left / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--color-surface) 30%, transparent) right / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in oklch, var(--color-text-muted) 45%, transparent), transparent) left / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in oklch, var(--color-text-muted) 45%, transparent), transparent) right / 0.75rem 100% no-repeat scroll,
    var(--color-surface); }
/* Code that scrolls takes focus, and .code clips anything outside it. */
.code pre:focus-visible { outline-offset: -2px; }
/* highlight.css paints its own background; the code keeps the page's surface. */
.code .chroma { background-color: var(--color-surface); }
.content :not(pre) > code { padding: 0.1em 0.35em; background: var(--color-surface); border-radius: var(--radius); overflow-wrap: anywhere; }

/* ---- Docs */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: var(--space-12); padding: var(--space-8) var(--gutter); max-width: 1280px; margin-inline: auto; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: var(--space-4); font-size: var(--text-sm); }
.sidebar ul, .toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
/* A section's pages hang from a line under its title; the current page marks
   its stretch of that line. */
.sidebar ul { margin-left: var(--space-3); border-left: 1px solid var(--color-line); }
.sidebar li a { display: block; margin-left: -1px; padding: var(--space-2) var(--space-3); border-left: 1px solid transparent; border-radius: 0 var(--radius) var(--radius) 0; text-decoration: none; color: var(--color-text-muted); }
.sidebar li a:hover { color: var(--color-text); }
.sidebar li a[aria-current="page"] { color: var(--color-text); background: var(--color-surface); border-left-color: var(--color-text); }
.sidebar-menu { display: none; }
.sidebar-title { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text); padding: 0 var(--space-3); margin-bottom: var(--space-2); }
.sidebar ul + .sidebar-title { margin-top: var(--space-6); }
.sidebar-foot { font-family: var(--font-display); font-size: var(--text-xs); color: var(--color-text-muted); padding: 0 var(--space-3); }

.content { min-width: 0; max-width: var(--measure); display: flex; flex-direction: column; gap: var(--space-4); }
.content h1 { margin-bottom: var(--space-2); }
/* The paragraph under the title says what the page is for. */
.content h1 + p { font-size: var(--text-lg); }
.content h2 { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--color-line); }
.content h3 { margin-top: var(--space-4); }
.content ul, .content ol { display: flex; flex-direction: column; gap: var(--space-1); }
.content table { border-collapse: collapse; font-size: var(--text-sm); display: block; overflow-x: auto; }
.content th, .content td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-line); vertical-align: top; }
/* A table's first column names the row, so its code breaks only between
   words; the other columns keep room for a few words a line. */
.content td:first-child code { overflow-wrap: normal; }
.content td:not(:first-child) { min-width: 10rem; }
.content th { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xs); letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-muted); }
.content .diagram { margin: var(--space-4) 0; align-self: center; width: 100%; max-width: 27.5rem; }
.diagram svg { display: block; width: 100%; height: auto; }
.content blockquote { margin: 0; padding-left: var(--space-4); border-left: 1px solid var(--color-line); color: var(--color-text-muted); }
/* A callout sets a caveat beside the steps; its title names its kind, so a
   warning reads as one without a color of its own. */
.content .callout { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius); color: var(--color-text); }
.callout-title { font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
.callout-warning .callout-title, .callout-caution .callout-title { color: var(--color-text); }

.toc { font-size: var(--text-sm); }
.toc-title { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text); margin-bottom: var(--space-3); }
.toc ul { border-left: 1px solid var(--color-line); }
.toc a { text-decoration: none; color: var(--color-text-muted); display: block; padding: var(--space-1) 0 var(--space-1) var(--space-3); }
.toc a:hover { color: var(--color-text); }
.toc .level-3 { padding-left: var(--space-4); }
.toc-rail { position: sticky; top: var(--space-8); }
.toc-inline { display: none; }
.toc-inline summary, .sidebar-menu summary { cursor: pointer; font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius); }
.toc-inline ul { margin: var(--space-3) var(--space-4) 0; }

.pager { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--color-line); }
.pager a { text-decoration: none; display: flex; flex-direction: column; gap: var(--space-1); font-family: var(--font-display); font-size: var(--text-sm); }
.pager a[rel="next"] { text-align: right; margin-left: auto; }
.pager small { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }

/* ---- Narrow screens */
@media (max-width: 900px) {
  .station { grid-template-columns: 2rem minmax(0, 1fr); gap: var(--space-4); }
  .station:not(:last-child)::after { left: 1rem; top: 2rem; }
  .station-dot { width: 2rem; height: 2rem; }
  .station-dot .indicator { width: 0.6rem; height: 0.6rem; }
  .station-text { padding-top: var(--space-1); }
  .station-code { grid-column: 2; }
  .scene { grid-template-columns: 1fr; grid-template-rows: none; gap: var(--space-4); justify-items: center; text-align: center; }
  .sig-in, .sig-out { display: block; width: 100%; min-width: 0; }
  .sig-label, .sig-line, .sig-wire, .sig-out .toast { grid-column: auto; grid-row: auto; }
  .sig-label { display: block; margin-bottom: var(--space-3); }
  .sig-line { font-size: 0.95rem; text-wrap-style: balance; }
  .sig-wire { height: calc(var(--space-12) + 3rem); width: 1px; background: repeating-linear-gradient(180deg, var(--color-line) 0 6px, transparent 6px 12px); }
  .sig-pulse { left: 50%; top: 0; width: 2px; height: var(--space-6); transform: translate(-50%, -100%); background: linear-gradient(180deg, transparent, var(--color-indicator)); }
  .sig-dot { left: 50%; top: 100%; transform: translate(-50%, -100%); }
  .sig-out .toast { margin-inline: auto; text-align: left; }
  .flow { grid-template-columns: 1fr; }
  .node + .node::before { content: "↓"; left: var(--space-4); top: calc(-1 * var(--space-4)); width: auto; transform: translate(0, -50%); }
  .docs { grid-template-columns: 1fr; gap: var(--space-6); }
  .sidebar .sidebar-list { display: none; }
  .sidebar-menu { display: block; }
  .sidebar-menu summary + .sidebar-title { margin-top: var(--space-4); }
  .toc-rail { display: none; }
  .toc-inline { display: block; }
}
@media (max-width: 600px) {
  .install { display: none; }
  .actions, .actions .button { width: 100%; text-align: center; }
  .hero-actions .hero-more { margin-inline-start: 0; }
  .nav { flex-wrap: wrap; }
  .nav nav { gap: var(--space-4); }
  .nav nav a { font-size: var(--text-xs); }
  /* A table shows each row as a block: its first cell names the row, and
     every other cell sits under its column's name. */
  .content table, .content tbody, .content tr, .content td { display: block; }
  .content thead { display: none; }
  .content tbody { border-top: 1px solid var(--color-line); }
  .content tr { display: flex; flex-direction: column; gap: var(--space-2); padding-block: var(--space-3); border-bottom: 1px solid var(--color-line); }
  .content td { padding: 0; border: 0; min-width: 0; }
  .content td:empty { display: none; }
  .content td:first-child code { overflow-wrap: anywhere; }
  .content td + td::before { content: attr(data-label); display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--text-xs); letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-muted); }
}
/* Touch and phone widths: every control keeps a 44px target, whatever its
   drawn size. */
@media (pointer: coarse), (max-width: 600px) {
  .nav nav a, .footer nav a, .hero-more, .scene-bar button, .code-head .copy, .station-text a { display: inline-flex; align-items: center; min-height: 44px; }
  .nav .wordmark { padding-block: 0.35em; }
  .sidebar li a, .toc a { display: flex; align-items: center; min-height: 44px; }
  .architecture summary { padding-block: var(--space-3); }
}
/* A short window trims the hero's air, so the signal line stays in the
   first screen. */
@media (max-height: 820px) and (min-width: 901px) {
  .hero { padding-block: var(--space-6); }
  .hero-inner { gap: var(--space-4); }
  .hero-description { max-width: 70ch; }
  .signal { margin-top: var(--space-4); padding-top: var(--space-6); }
}
@media (prefers-reduced-motion: reduce) {
  .radio-waves, .sig-pulse { display: none; }
  .scene { transition: none; }
}
