/* The one stylesheet for every page: the landing page and the rendered docs.
   No web fonts: system faces load at once.
   Light and dark from prefers-color-scheme; colours are tokens here and nowhere else. */

:root {
  --bg: #f6f9fb;
  --bg-alt: #edf3f7;
  --surface: #ffffff;
  --surface-2: #f2f6f9;
  --border: #d9e3eb;
  --border-strong: #c3d1dc;
  --text: #0f1b26;
  --muted: #52677a;
  --accent: #0a7ea4;
  --accent-strong: #075f7c;
  --accent-soft: rgba(10, 126, 164, 0.1);
  --accent-text: #ffffff;
  --code-bg: #eef3f7;
  --term-bg: #0b141c;
  --term-bar: #111d27;
  --term-text: #d5e2ec;
  --term-border: #1c2b38;
  --water-top: #cfeaf6;
  --water-deep: #8cc6e0;
  --ice: #ffffff;
  --shadow: 0 1px 2px rgba(15, 27, 38, 0.05), 0 8px 24px rgba(15, 27, 38, 0.06);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 46rem;
  --wide: 72rem;
  --gutter: 16px;
  --radius: 14px;
  color-scheme: light dark;
}

/* Dark: when the system prefers it and the visitor has not picked light, or when they picked dark.
   The header's toggle sets data-theme on <html>; the same tokens serve both routes. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1016;
    --bg-alt: #0d151d;
    --surface: #111a23;
    --surface-2: #15212c;
    --border: #1f2d3a;
    --border-strong: #2b3d4e;
    --text: #e4ecf2;
    --muted: #8ea2b4;
    --accent: #6fd6f7;
    --accent-strong: #a6e9ff;
    --accent-soft: rgba(111, 214, 247, 0.1);
    --accent-text: #04131b;
    --code-bg: #131e28;
    --term-bg: #070d12;
    --term-bar: #0e1720;
    --term-text: #d5e2ec;
    --term-border: #1c2b38;
    --water-top: #0f3a50;
    --water-deep: #06202e;
    --ice: #dff4fc;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1016;
  --bg-alt: #0d151d;
  --surface: #111a23;
  --surface-2: #15212c;
  --border: #1f2d3a;
  --border-strong: #2b3d4e;
  --text: #e4ecf2;
  --muted: #8ea2b4;
  --accent: #6fd6f7;
  --accent-strong: #a6e9ff;
  --accent-soft: rgba(111, 214, 247, 0.1);
  --accent-text: #04131b;
  --code-bg: #131e28;
  --term-bg: #070d12;
  --term-bar: #0e1720;
  --term-text: #d5e2ec;
  --term-border: #1c2b38;
  --water-top: #0f3a50;
  --water-deep: #06202e;
  --ice: #dff4fc;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
/* `hidden` wins over any display a class sets (a .button is inline-flex). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* --- Header, shared by every page: <header class="site"><nav class="site-nav">…</nav></header> */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.site-nav {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
}

.site-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 700 1.1rem var(--mono);
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.mark { width: 1.6rem; height: 1.6rem; flex: none; }
.mark .tip { fill: var(--accent); }
.mark .below { fill: var(--accent); opacity: 0.35; }
.mark .line { stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.4rem;
}
.site-nav li + li { margin-top: 0; }
.site-nav ul a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { color: var(--text); }
.site-nav ul a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav ul a.pill {
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: none;
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* Show the theme a click would switch to: a sun in dark mode, a moon in light. */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.site-nav ul a.pill:hover { background: var(--accent-strong); color: var(--accent-text); }

/* --- Page body. <main> is a readable column; <main class="wide"> takes the wider one. */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--gutter) 4rem;
}
main.wide { max-width: var(--wide); }
main.landing { max-width: none; padding: 0; }

h1, h2, h3, h4 { line-height: 1.2; margin: 2rem 0 0.75rem; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 2.2rem; font-weight: 750; margin-top: 0.5rem; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
h4 { font-size: 1rem; }

p, ul, ol, blockquote, pre, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li > ul, li > ol { margin: 0.25rem 0 0; }
li + li { margin-top: 0.25rem; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

blockquote {
  margin-left: 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  background: var(--surface-2);
}
blockquote > :last-child { margin-bottom: 0; }

code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }

:not(pre) > code {
  padding: 0.12em 0.38em;
  border-radius: 5px;
  background: var(--code-bg);
  border: 1px solid var(--border);
}

/* A <pre> scrolls itself; the page never scrolls sideways. */
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  line-height: 1.5;
}
pre code { font-size: 0.85rem; }

/* Terminal-looking output: <pre class="term">, alone or inside a .window */
pre.term {
  background: var(--term-bg);
  color: var(--term-text);
  border-color: var(--term-border);
  font-size: 0.78rem;
}
pre.term .dim { color: #7f93a3; }
pre.term .hot { color: #f5d67f; }

.table-scroll { max-width: 100%; overflow-x: auto; margin: 0 0 1rem; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; font-size: 0.92rem; width: 100%; }
.table-scroll table { margin: 0; }
th, td { border-bottom: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: var(--surface-2); font-weight: 600; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.42em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  line-height: 1.5;
}

.muted { color: var(--muted); }

/* --- Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: 600 1rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.button:hover { background: var(--accent-strong); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.button.ghost:hover { background: var(--surface-2); }

/* --- Landing page */

.section { padding: 5rem var(--gutter); }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.inner { max-width: var(--wide); margin: 0 auto; }
.inner.narrow { max-width: var(--measure); }
.section h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 750; margin: 0 0 0.75rem; }
.section .intro { color: var(--muted); font-size: 1.1rem; max-width: 40rem; margin-bottom: 2.5rem; }
.eyebrow {
  display: inline-block;
  font: 600 0.8rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong); /* small text: --accent is 4.4:1 on the light page */
  margin-bottom: 0.75rem;
}

.hero {
  position: relative;
  padding: 3.75rem var(--gutter) 0;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(60rem 28rem at 50% -6rem, var(--accent-soft), transparent 70%),
    var(--bg);
}
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 auto 1.25rem;
  max-width: 12ch;
}
.hero .lede { font-size: clamp(1.05rem, 2.2vw, 1.22rem); color: var(--muted); max-width: 40rem; margin: 0 auto 1.75rem; }
.hero .lede strong { color: var(--text); font-weight: 600; }
/* The two reasons to use it, side by side under the lede. */
.hero .uses {
  list-style: none; padding: 0; margin: -0.5rem auto 2rem; max-width: 52rem; text-align: left;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.75rem 1.5rem;
  color: var(--muted); font-size: 0.98rem;
}
.hero .uses li { margin: 0; padding: 0.9rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; }
.hero .uses b { display: block; color: var(--text); margin-bottom: 0.2rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-bottom: 1rem; }
.hero .fine { font-size: 0.88rem; color: var(--muted); margin-bottom: 3.5rem; }

/* The iceberg: what a query sees above the waterline, and the layers icelens opens below it. */
.berg { --berg: 44rem; text-align: left; }
.berg .tip {
  width: min(22rem, 70%);
  margin: 0 auto;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--ice);
  color: #0f1b26;
  font: 0.85rem/1.5 var(--mono);
  box-shadow: var(--shadow);
}
.berg .tip span { display: block; color: #52677a; }
.berg .waterline {
  position: relative;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 2px dashed var(--accent);
  margin: 0 calc(50% - 50vw); /* the water runs the page's full width */
  background: linear-gradient(var(--water-top), var(--water-top));
}
.berg .waterline span {
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.depths {
  list-style: none;
  margin: 0 calc(50% - 50vw);
  padding: 0.5rem var(--gutter) 3.5rem;
  background: linear-gradient(var(--water-top), var(--water-deep));
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}
.depths li {
  width: min(100%, calc(var(--w) * var(--berg)));
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) calc(var(--o) * 100%), transparent);
  border: 1px solid color-mix(in srgb, var(--ice) 22%, transparent);
  color: var(--text);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ice) 10%, transparent) inset;
}
.depths b { font: 600 0.9rem var(--mono); white-space: nowrap; }
.depths span { font-size: 0.88rem; opacity: 0.8; flex: 1; }
.depths kbd { flex: none; }

/* Feature cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card {
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card.span2 { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center; }
.card h3 { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.5rem; font-size: 1.05rem; }
.card p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.card p + p { margin-top: 0.6rem; }
.icon {
  width: 2rem;
  height: 2rem;
  flex: none;
  padding: 0.38rem;
  border-radius: 8px;
  background: var(--accent-soft);
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card pre.term { margin: 0; font-size: 0.74rem; }

/* Text beside a terminal window, alternating sides */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: center; }
.split + .split { margin-top: 5rem; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.flip .copy { order: 2; }
.split h3 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.75rem; }
.split p { color: var(--muted); }

.window {
  min-width: 0;
  border: 1px solid var(--term-border);
  border-radius: 12px;
  background: var(--term-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.window .bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  background: var(--term-bar);
  border-bottom: 1px solid var(--term-border);
  color: var(--bar-ink, #7f93a3);
  font: 0.78rem var(--mono);
}
.window .bar i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--bar-dot, #2a3a48); flex: none; }
.window .bar .title { margin-left: 0.5rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.window pre.term { margin: 0; border: 0; border-radius: 0; }
.window figcaption { padding: 0.65rem 1rem; color: #8ea2b4; background: var(--term-bar); border-top: 1px solid var(--term-border); margin: 0; }
figure { margin: 0 0 1.5rem; }
figcaption { font-size: 0.88rem; color: var(--muted); }

/* The ten panes, as keycaps */
.panes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.75rem; }
.panes li {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--muted);
}
.panes li b { display: flex; align-items: center; gap: 0.55rem; color: var(--text); font-size: 1rem; margin-bottom: 0.3rem; }

/* Install */
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.steps .card pre { margin: 0.75rem 0 0; }
.steps .card h3 { margin-bottom: 0.25rem; }

.final { text-align: center; }
.final h2 { margin-bottom: 0.75rem; }
.final p { color: var(--muted); max-width: 34rem; margin: 0 auto 1.75rem; }

/* --- Footer */

footer.site {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 3rem var(--gutter) 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
footer.site .cols { max-width: calc(var(--wide) - 2 * var(--gutter)); margin: 0 auto; display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; }
footer.site h2 { margin: 0 0 0.6rem; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li + li { margin-top: 0.35rem; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--text); }
footer.site .brand { display: inline-flex; align-items: center; gap: 0.5rem; font: 700 1rem var(--mono); color: var(--text); margin-bottom: 0.5rem; }
footer.site .legal { max-width: calc(var(--wide) - 2 * var(--gutter)); margin: 2.5rem auto 0; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: 0.8rem; }

/* --- Rendered docs: a sidebar beside the article on wide screens */

main.doc {
  max-width: var(--wide);
  display: grid;
  grid-template-columns: 13rem minmax(0, var(--measure));
  gap: 3.5rem;
  justify-content: center;
  align-items: start;
}
.doc-nav { position: sticky; top: 5rem; }
.doc-nav::before {
  content: "Documentation";
  display: block;
  margin-bottom: 0.6rem;
  font: 600 0.75rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-nav ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.doc-nav li + li { margin-top: 0; }
.doc-nav a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
}
.doc-nav a:hover { color: var(--text); }
.doc-nav a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.doc .source { grid-column: 2; }
.prose h1:first-child { margin-top: 0; font-size: 2.4rem; }
.prose h2 { padding-top: 1rem; border-top: 1px solid var(--border); margin-top: 2.5rem; }
.prose h2[id], .prose h3[id] { scroll-margin-top: 5rem; }
.source { font-size: 0.85rem; color: var(--muted); }

/* The home page's walk-through: a terminal of 120 columns. Its font is sized to the box (1ch is
   0.6em in these fonts, so 120ch is 72em), and each label sits at the row and column of the text
   it points at, in the same character units. It is drawn in the page's theme: both are captured. */
.shot { --shot-bg: #f6f9fb; --shot-ink: #0f1b26; --pin: #0a7ea4; --pin-ink: #ffffff; --term-bg: #f6f9fb; --term-bar: #e6eef4; --term-border: #c3d1dc; --bar-ink: #52677a; --bar-dot: #c3d1dc; max-width: var(--wide); margin: 0 auto; text-align: left; }
.shot-scroll { overflow-x: auto; }
.shot-screen { position: relative; container-type: inline-size; min-width: 40rem; background: var(--shot-bg); color: var(--shot-ink); }
.shot-screen pre.t-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot { --shot-bg: #0b141c; --shot-ink: #e4ecf2; --pin: #6fd6f7; --pin-ink: #0b141c; --term-bg: #0b141c; --term-bar: #0e1720; --term-border: #1c2b38; --bar-ink: #7f93a3; --bar-dot: #2a3a48; }
  :root:not([data-theme="light"]) .shot-screen pre.t-dark { display: block; }
  :root:not([data-theme="light"]) .shot-screen pre.t-light { display: none; }
}
:root[data-theme="dark"] .shot { --shot-bg: #0b141c; --shot-ink: #e4ecf2; --pin: #6fd6f7; --pin-ink: #0b141c; --term-bg: #0b141c; --term-bar: #0e1720; --term-border: #1c2b38; --bar-ink: #7f93a3; --bar-dot: #2a3a48; }
:root[data-theme="dark"] .shot-screen pre.t-dark { display: block; }
:root[data-theme="dark"] .shot-screen pre.t-light { display: none; }
.shot-screen:focus { outline: none; }
.shot .window:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.shot-screen pre, .shot-screen .pins, .shot-screen .pin {
  font-family: var(--mono); font-size: 1.36cqw; line-height: 1.2; letter-spacing: 0;
}
.shot-screen pre { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; white-space: pre; overflow: hidden; cursor: pointer; }
.shot-screen .pins { position: absolute; inset: 0; pointer-events: none; }
.shot-screen .pin { position: absolute; left: calc(var(--col) * 1ch); top: calc((var(--row) + 0.5) * 1.2em); }
.shot-screen .pin b {
  position: absolute; transform: translate(-50%, -50%);
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--pin); color: var(--pin-ink); box-shadow: 0 0 0 2px var(--shot-bg), 0 2px 6px rgba(0, 0, 0, 0.35);
  font: 700 0.78rem/1.4rem var(--sans); text-align: center;
  pointer-events: auto; cursor: default; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shot-screen .pin.on b { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 0 2px var(--shot-bg), 0 0 0 6px color-mix(in srgb, var(--pin) 35%, transparent); }
.shot.live .pin b { animation: pin-in 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.2s + var(--i) * 0.2s); }
@keyframes pin-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.2); } }

/* What the page says about itself - a key or a click it does not follow - outside the screen,
   so it is never mistaken for the app's own toasts, which are drawn in the screen. */
.walk-hint { margin: 0.6rem 0 0; font-size: 0.88rem; color: var(--muted); text-align: center; }
.walk-hint[hidden] { display: none; }
/* Until the first key or click: where to start. */
.try-chip {
  margin-left: auto; padding: 0.15rem 0.6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: 600 0.72rem var(--sans); white-space: nowrap;
}
.try-chip + .pressed { margin-left: 0.5rem; }
.shot:not(.live) .try-chip, .shot.used .try-chip { display: none; }

/* The keys just pressed, in the window's title bar: how the tour got where it is. */
.window .bar .pressed { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem; min-height: 1.3rem; }
.window .bar .pressed kbd { font-size: 0.75rem; animation: key-in 0.25s ease both; }
@keyframes key-in { from { opacity: 0; transform: translateY(-0.4rem); } }

/* Keys to tap, for a screen with no keyboard. */
.keypad { display: none; }
.shot.live .keypad { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin: 0.8rem 0 0; }
.keypad button {
  min-width: 2.6rem; padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface, transparent); color: var(--text); font: 600 0.85rem var(--mono); cursor: pointer;
}
.keypad button:hover { border-color: var(--accent); }

.callouts { margin-top: 1.25rem; }
.callouts li { transition: color 0.15s ease; }
.callouts li.on { color: var(--text); }
.callouts.free { display: block; }
.callouts .free-note { padding-left: 0; }
.callouts .free-note::before { content: none; }

/* With the script: chapters of the tour, chosen from the strip above the terminal. */
.scenes { display: none; }
.shot.live .scenes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 0.9rem; }
.scenes [role="tablist"] { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.scenes [role="tab"], .tour-toggle {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.85rem; border: 1px solid var(--border); border-radius: 999px; background: none;
  color: var(--muted); font: 500 0.88rem var(--sans); cursor: pointer;
}
.scenes [role="tab"] .n { font: 700 0.78rem var(--mono); color: var(--accent); }
.scenes [role="tab"][aria-selected="true"] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.scenes [role="tab"]:hover, .tour-toggle:hover { color: var(--text); }
.tour-toggle { font-size: 0.8rem; padding: 0.3rem 0.75rem; }
/* How long until the next chapter: fills while the tour plays. */
.scenes .progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.shot.playing [aria-selected="true"] .progress { animation: tour-fill 9s linear forwards; }
@keyframes tour-fill { to { transform: scaleX(1); } }
.callouts {
  counter-reset: callout; list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.85rem 1.75rem;
  font-size: 0.92rem; color: var(--muted);
}
.callouts li { counter-increment: callout; position: relative; padding-left: 2.1rem; margin: 0; }
.callouts li::before {
  content: counter(callout); position: absolute; left: 0; top: 0.05rem;
  width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  font: 700 0.78rem/1.4rem var(--sans); text-align: center;
}
.hero .after-demo { margin: 2rem 0 4.5rem; }
.waterline-section { padding-bottom: 0; overflow: hidden; }
.center { text-align: center; }

/* --- Narrow screens */

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card.span2 { grid-template-columns: 1fr; }
  .split, .split.flip { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .split.flip .copy { order: 0; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
  main.doc { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .doc-nav { position: static; }
  .doc-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; border-left: 0; }
  .doc-nav a { padding: 0.2rem 0; border-left: 0; margin: 0; }
  .doc .source { grid-column: 1; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card.span2 { grid-column: auto; }
  .section { padding: 3.5rem var(--gutter); }
  .hero { padding-top: 3.5rem; }
  .site-nav { gap: 0.4rem 1rem; }
  .site-nav ul { gap: 0.25rem 0.9rem; }
  .depths li { width: 100% !important; flex-wrap: wrap; gap: 0.2rem 0.6rem; }
  .depths span { flex-basis: 100%; order: 3; }
  .berg .tip { width: 85%; }
  pre.term { font-size: 0.7rem; }
  footer.site .cols { grid-template-columns: minmax(0, 1fr); }
}

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

/* On paper the buttons are white on white. */
@media print {
  header.site, .theme-toggle, .actions { display: none !important; }
  body { background: #fff; color: #000; }
}
