/* ruggly.dev: night sky, a neon carpet, and the TUI's own boxes. Dark only. Tokens follow the app's atelier
   palette (plan §3.2): the lamp purple, the four inks, and gold for the embroidery. */

:root {
  --bg: #06040b;
  --panel: #0d0a15;
  --line: #2a2238;
  --rule: #3d3550;
  --text: #ece8f6;
  --muted: #a39cb5;
  --faint: #6f6882;
  --lamp: #9b7dff;
  --soft: #3a3068;
  --sel: #4c3a96;
  --gold: #f2d660;
  --gold-deep: #d49a24;
  --y: #f2d660;
  --r: #ff6e73;
  --g: #6ee296;
  --p: #b59bff;
  --clay: #d97757;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, .log-view:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .9em; color: var(--text); }
kbd {
  display: inline-block;
  padding: 0 .45em;
  font: 500 .82em/1.5 var(--mono);
  color: var(--text);
  background: #15101f;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 5px;
}
q { color: var(--gold); quotes: "\201C" "\201D"; }
b.y { color: var(--y); } b.r { color: var(--r); } b.g { color: var(--g); } b.p { color: var(--p); }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ── nav, floating over the sky ─────────────────────────────────────────────────────────── */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 600 17px var(--mono); letter-spacing: -.02em; color: var(--lamp); }
.wordmark .mini { display: block; height: 16px; width: auto; shape-rendering: crispEdges; filter: drop-shadow(0 0 6px rgba(155, 125, 255, .45)); }
.mark { width: 80px; height: 38px; display: block; image-rendering: pixelated; }
.nav-links { display: flex; gap: 28px; font: 13px var(--mono); }
.nav-links a { color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  font: 500 13px var(--mono);
  padding: 9px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: rgba(6, 4, 11, .55);
  transition: border-color .2s, box-shadow .2s;
}
.nav-cta span { color: var(--gold); margin-left: 4px; }
.nav-cta:hover { border-color: var(--lamp); box-shadow: 0 0 18px rgba(155, 125, 255, .35); }

/* ── hero ───────────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + clamp(8px, 4vh, 40px)) 0 clamp(96px, 16vh, 170px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  overflow: clip;
  text-align: center;
}
.sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 55% at 50% 0%, rgba(112, 52, 214, .34), transparent 70%),
    radial-gradient(ellipse 50% 35% at 50% 42%, rgba(155, 90, 255, .12), transparent 70%);
}
.stars { position: absolute; inset: 0; width: 100%; height: 100%; will-change: opacity; }
.stars:nth-child(1) { animation: twinkle 3.8s ease-in-out infinite alternate; }
.stars:nth-child(2) { animation: twinkle 5.3s ease-in-out -2s infinite alternate; }
.stars:nth-child(3) { animation: twinkle 7.1s ease-in-out -4s infinite alternate; }
@keyframes twinkle { from { opacity: .2; } to { opacity: 1; } }
.comet {
  position: absolute;
  top: 14%;
  left: 78%;
  width: clamp(70px, 10vw, 140px);
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff, rgba(181, 155, 255, .55) 30%, transparent);
  opacity: 0;
  transform: rotate(-24deg);
  animation: comet 12s ease-in 4s infinite;
}
@keyframes comet {
  0% { opacity: 0; transform: rotate(-24deg) translateX(0); }
  2% { opacity: 1; }
  8%, 100% { opacity: 0; transform: rotate(-24deg) translateX(-38vw); }
}
.moon {
  position: absolute;
  z-index: 0;
  top: calc(var(--nav-h) + 3%);
  right: 9%;
  width: clamp(40px, 6.5vw, 86px);
  fill: var(--gold);
  opacity: .92;
  filter: drop-shadow(0 0 18px rgba(242, 214, 96, .45));
}
.dunes {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 100%;
  height: clamp(90px, 17vh, 190px);
  pointer-events: none;
}
.dunes .far { fill: #110a20; stroke: rgba(181, 120, 255, .45); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.dunes .near { fill: var(--bg); stroke: rgba(242, 214, 96, .32); stroke-width: 1.2; vector-effect: non-scaling-stroke; }

/* ── the carpet: live pixel art on a canvas (assets/carpet-flap.js), pinned at its left corner. Nothing here may rotate
   or scale it, which would resample the blocks. The box has the canvas's ratio, so nothing jumps as it loads. ── */
.flight {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  --w: min(480px, 88vw);
  width: var(--w);
  aspect-ratio: 160 / 108;
  /* the canvas keeps room for the wave's swing; the margins take back what it never reaches */
  margin: calc(var(--w) * -.05) auto calc(clamp(10px, 3vw, 28px) - var(--w) * .036);
  translate: calc(var(--s, 0) * 26vw) calc(var(--s, 0) * -14vh);
}
.carpet-flap { display: block; image-rendering: pixelated; }

.hero-copy { position: relative; z-index: 3; margin-top: clamp(4px, 2vh, 24px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 14px;
  font: 500 11.5px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 4, 11, .6);
}
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--g); box-shadow: 0 0 10px var(--g); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 { margin: 26px 0 0; line-height: 0; }
/* The banner sits on a matte black plate, like the terminal's page: flat, no edge line, no sheen. */
h1 .plate {
  display: inline-block;
  padding: clamp(14px, 3vw, 22px) clamp(18px, 4vw, 30px);
  border-radius: 8px;
  background: #0a090d;
}
.banner {
  display: block;
  /* 450 px over a 50-unit viewBox = 9 px a pixel, a whole number, so no row lands half on a screen pixel */
  width: min(450px, 72vw);
  height: auto;
  overflow: visible;
  shape-rendering: crispEdges;
  /* no filter here: the glow is the still .halo layer inside the SVG */
}
@keyframes print { to { clip-path: inset(-30% -10% -30% -10%); } }
/* The TUI's ramp (Theme::ramp): accent → accent_soft, stopping at 0.6, one shade per terminal row. The rows
   never move or blink; main.js only lights spark copies over them. */
.banner { --b0: #9b7dff; --b1: #8c71e8; --b2: #7e66d2; --b3: #6f5abb; --b4: #614fa4; }
.banner .br:nth-of-type(1) { fill: var(--b0); }
.banner .br:nth-of-type(2) { fill: var(--b1); }
.banner .br:nth-of-type(3) { fill: var(--b2); }
.banner .br:nth-of-type(4) { fill: var(--b3); }
.banner .br:nth-of-type(5) { fill: var(--b4); }
/* A spark: a copy of a part of the word that swells in and eases back out to the shade underneath. */
/* Only the word's own shades: the lit colour is the ramp's top purple, the l's top (already that) dips deeper. */
.banner .spark path.deep { fill: var(--b3); }
/* main.js eases each one in and out (Web Animations), so no transition here */
.banner .spark path { fill: var(--b0); opacity: 0; pointer-events: none; }
.tagline { margin: 26px 0 0; font: 700 clamp(28px, 5.4vw, 56px)/1.06 var(--sans); letter-spacing: -.04em; }
.tagline em { font-style: normal; color: var(--lamp); text-shadow: 0 0 26px rgba(155, 125, 255, .55); }
.lede { max-width: 600px; margin: 18px auto 0; color: var(--muted); font-size: clamp(16px, 2.1vw, 18.5px); }
.install {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 30px auto 0;
  padding: 10px 10px 10px 18px;
  text-align: left;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #0d0a15;
  box-shadow: 0 0 0 1px rgba(155, 125, 255, .06), 0 12px 40px rgba(0, 0, 0, .45), 0 0 40px rgba(155, 125, 255, .1);
}
.sigil { color: var(--lamp); font-family: var(--mono); }
.cmd { flex: 1; min-width: 0; color: var(--g); font-size: 14.5px; line-height: 1.5; overflow-wrap: break-word; user-select: all; -webkit-user-select: all; }
.copy {
  flex: none;
  padding: 8px 13px;
  font: 500 12px var(--mono);
  color: var(--text);
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.copy:hover { border-color: var(--lamp); }
.copy.done { background: var(--g); color: #04150b; }
.fine { max-width: 560px; margin: 14px auto 0; color: var(--faint); font-size: 13.5px; }
.fine code { color: var(--muted); }
.cue { display: inline-block; margin-top: 30px; font: 13px var(--mono); color: var(--muted); transition: color .2s; }
.cue:hover { color: var(--text); }
.cue span { display: inline-block; color: var(--gold); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* ── sections ───────────────────────────────────────────────────────────────────────────── */
main > section:not(.hero) { padding-top: clamp(72px, 11vw, 128px); }
.label { margin: 0; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.label span { color: var(--gold); margin-right: 6px; }
h2 { margin: 16px 0 40px; font: 700 clamp(30px, 4.8vw, 50px)/1.06 var(--sans); letter-spacing: -.035em; }
h2 em { font-style: normal; color: var(--lamp); }

/* a tile is the TUI's box: its name sits in the top border, ┌─ name ───── key ─┐, and it lights purple when you're in it */
.tile {
  position: relative;
  padding: 26px 20px 20px;
  list-style: none;
  border: 1px solid var(--line);
  border-top: 0;
  background: linear-gradient(180deg, rgba(155, 125, 255, .05), transparent 70%);
  transition: border-color .25s, background-color .25s;
}
.tile p { margin: 0; color: var(--muted); font-size: 15.5px; }
.tile-head {
  position: absolute;
  top: 0; left: -1px; right: -1px;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  margin: 0;
  font: 500 13.5px/1.4 var(--mono);
  color: var(--text);
  transition: color .25s;
}
.tile-head::before, .tile-head::after, .tile-head i { content: ""; height: 1px; background: var(--line); transition: background-color .25s; }
.tile-head::before, .tile-head::after { flex: none; width: 10px; }
.tile-head i { flex: 1; }
.tile-head > span { padding: 0 8px; }
.tile-head kbd, .tile-head .tag { margin: 0 8px; font-size: 12px; }
.tile-head .tag { font: 12px var(--mono); color: var(--faint); }
.tile:hover { border-color: var(--lamp); background-color: rgba(155, 125, 255, .04); }
.tile:hover .tile-head { color: var(--lamp); }
.tile:hover .tile-head::before, .tile:hover .tile-head::after, .tile:hover .tile-head i { background: var(--lamp); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 20px; margin: 0; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 44px 20px; }

/* gold embroidery on the corners of the big frames */
.video-frame, .beta-card {
  --c: var(--gold);
  background-image:
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c));
  background-repeat: no-repeat;
  background-size: 34px 2px, 2px 34px, 34px 2px, 2px 34px, 34px 2px, 2px 34px, 34px 2px, 2px 34px;
  background-position:
    10px 10px, 10px 10px, calc(100% - 10px) 10px, calc(100% - 10px) 10px,
    10px calc(100% - 10px), 10px calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) calc(100% - 10px);
}

.video { max-width: 940px; margin: 64px auto 0; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background-color: #0b0714;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 70px rgba(155, 125, 255, .1);
}
.video-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 55%, rgba(130, 70, 230, .22), transparent 70%);
  pointer-events: none;
}
.video-frame video { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }
.video-soon { position: absolute; inset: 0; display: grid; place-content: center; gap: 16px; padding: 24px; text-align: center; color: var(--muted); }
.video-soon p { margin: 0; font-size: 15px; }
.video-soon strong { color: var(--text); font-weight: 600; }
/* the beta card's carpet: the hero's flap, small, and it stays where it is (no drift on scroll). The box is the
   canvas's ratio, 76 px of art with 16 px of swing room above and below; the margins take that room back, so the
   card's layout matches the still picture it replaces. */
.flap-mini { display: grid; place-items: center; width: 160px; aspect-ratio: 160 / 108; margin: -16px auto; }
.video figcaption { margin-top: 14px; text-align: center; font: 13px var(--mono); color: var(--faint); }

/* ── how it works: the one line that makes ruggly Claude Code's editor ─────────────────── */
.setup { margin-top: 48px; text-align: center; }
.setup .install { margin-top: 0; }
.setup .fine a, .under a { color: var(--lamp); border-bottom: 1px solid rgba(155, 125, 255, .4); }
.setup .fine a:hover, .under a:hover { border-bottom-color: var(--lamp); }

/* ── the live sketch: ruggly and an agent side by side, like two tmux panes ────────────── */
.run-copy { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 0 clamp(32px, 6vw, 72px); align-items: end; margin: 16px 0 36px; }
.run-copy h2 { margin-bottom: 18px; }
.run-copy .say { margin: 0; color: var(--muted); max-width: 52ch; }
.run-copy .acts { margin-top: 0; }
/* One of each per tab in one grid cell: the cell keeps the tallest's height, so a switch only crossfades. */
.stack { display: grid; }
.stack > * { grid-area: 1 / 1; transition: opacity .25s ease, visibility 0s linear .25s; }
.stack > :not(.on) { opacity: 0; visibility: hidden; }
.stack > .on { transition-delay: 0s; }
.acts { list-style: none; counter-reset: act; display: grid; gap: 8px; margin: 28px 0 0; padding: 0; }
.acts li {
  position: relative;
  padding: 9px 14px 9px 38px;
  color: var(--faint);
  border-left: 2px solid var(--line);
  transition: color .35s, border-color .35s, background-color .35s;
}
.acts li::before { position: absolute; left: 14px; top: 11px; counter-increment: act; content: counter(act); font: 12px/1.6 var(--mono); color: var(--faint); }
.acts li.now { color: var(--text); border-left-color: var(--lamp); background: rgba(155, 125, 255, .08); }
.acts li.now::before { color: var(--lamp); }

.term {
  --t-bg: #0d0a15;
  --tfs: clamp(11px, 3vw, 13.5px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--t-bg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 70px rgba(155, 125, 255, .1);
  font: 400 var(--tfs)/1.55 var(--mono);
  text-align: left;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: #120d1d; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 11px; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.keycap { min-width: 2.2em; margin-left: auto; text-align: center; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s, box-shadow .15s; }
.keycap.on { opacity: 1; transform: none; border-color: var(--lamp); color: var(--lamp); box-shadow: 0 0 14px rgba(155, 125, 255, .55); }
/* the scenes are the terminal's own tabs: a click plays that scene */
.wins { display: flex; gap: 4px; min-width: 0; margin-left: 10px; overflow: hidden; }
.win { flex: none; padding: 1px 10px; font: 12px/1.6 var(--mono); color: var(--muted); white-space: nowrap; background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; transition: color .2s, background-color .2s, border-color .2s; }
.win b { font-weight: 400; color: var(--faint); }
.win:not(.on):hover { color: var(--text); border-color: var(--line); }
.win.on { color: var(--text); background: var(--soft); border-color: var(--rule); }
.win.on b { color: var(--lamp); }
.win:focus-visible { outline: 1px solid var(--lamp); outline-offset: 1px; }
.panes { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.pane { min-width: 0; padding: 10px 12px; transition: opacity .35s; }
.tabs { display: flex; gap: 2px; margin-bottom: 14px; overflow: hidden; white-space: nowrap; }
.tab { padding: 0 10px; color: var(--muted); transition: color .2s, background-color .2s; }
.tab.on { color: var(--text); background: var(--soft); box-shadow: inset 2px 0 var(--lamp); }
.tab.add { color: var(--lamp); }
.tab i { font-style: normal; }
.tab .x { display: none; }
.tab.on .x { display: inline; }
.box { position: relative; border: 1px solid var(--rule); }
.box-title { position: absolute; padding: 0 6px; font-family: var(--mono); line-height: 1.3; background: var(--box-bg, var(--bg)); }
.loom-box .box-title, .log-box .box-title { font-size: 13.5px; }
.box-title { top: 0; left: 10px; translate: 0 -50%; color: var(--lamp); }
.page { --box-bg: var(--t-bg); padding: 14px 14px 18px; border-color: var(--lamp); }
.note { position: relative; overflow: hidden; }
.note p { margin: 0; }
.note .md-h1, .note .md-h2 { color: #fff; font-weight: 700; }
.note .md-h2 { margin-top: .6em; }
.note.task .md-h1 + p, .note.lab p + p { margin-top: .5em; }
/* the task: the lines you type, each with its own caret */
.note .caret { vertical-align: text-bottom; }
.me.typing .note .typing .caret { display: inline-block; }
.note.task .next-line { visibility: hidden; }
.me.next .note.task .next-line { visibility: visible; }
/* the prompt lab: a field, its chips, and the three takes that land under it */
.note .field { padding: 0 2px; border-radius: 2px; color: var(--p); background: rgba(155, 125, 255, .12); }
.me.filling .field { box-shadow: inset 0 -1px var(--lamp); }
.me.filling .field .caret { display: inline-block; vertical-align: text-bottom; }
.note .chip { padding: 0 3px; border-radius: 3px; color: var(--muted); background: rgba(255, 255, 255, .05); }
.take-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 1.3em; }
.take {
  --box-bg: var(--t-bg);
  padding: .95em .6em .45em;
  font-size: .9em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .3s, border-color .3s, box-shadow .3s;
  transition-delay: calc(var(--i, 0) * .12s);
}
.take .box-title { left: 6px; }
.take p { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.take u { text-decoration: none; }
.me.takes .take { opacity: 1; transform: none; }
.me.differ .take u { text-decoration: underline; text-decoration-color: var(--lamp); text-underline-offset: 3px; }
.me.kept .take { transition-delay: 0s; }
.me.kept .take:not(.kept) { opacity: .35; }
.take.kept { border-color: var(--lamp); box-shadow: 0 0 16px rgba(155, 125, 255, .22); }
.note::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(155, 125, 255, .25) 45%, rgba(242, 214, 96, .2) 52%, transparent 66%);
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}
.working .note::after, .running .note::after { opacity: 1; animation: sweep 1s ease-in-out infinite; }
@keyframes sweep { to { transform: translateX(100%); } }
/* the ✦ field and the status line. ruggly runs twice in the sketch (its own pane, and in Claude's for ctrl+g),
   so main.js sets asking and working on the one that's busy, not on the whole sketch */
.ebar { display: flex; align-items: center; gap: 8px; min-height: 2.3em; margin-top: 14px; padding: 4px 10px; border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s; }
.asking .ebar { border-color: var(--lamp); box-shadow: 0 0 0 1px rgba(155, 125, 255, .2), 0 0 18px rgba(155, 125, 255, .15); }
.spark { color: var(--lamp); }
.typed { color: var(--text); white-space: pre; }
.hint { color: var(--faint); }
.asking .hint { display: none; }
.caret { display: none; width: .55em; height: 1.1em; background: var(--lamp); animation: blink 1s steps(1) infinite; }
.asking .ebar .caret { display: inline-block; vertical-align: text-bottom; }
.working .ebar .caret { display: none; }
.working .typed::after { content: "  · working"; color: var(--faint); animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.status { display: flex; align-items: center; gap: 12px; margin-top: 8px; overflow: hidden; white-space: nowrap; color: var(--faint); }
.mode { flex: none; padding: 0 8px; color: var(--text); background: var(--soft); transition: background-color .2s, color .2s; }
.asking .mode { color: #0b0716; background: var(--lamp); }
.toast { overflow: hidden; text-overflow: ellipsis; color: var(--g); opacity: 0; transition: opacity .3s; }
.toast.on { opacity: 1; }
.toast.soft { color: var(--lamp); }
.meter { flex: none; margin-left: auto; }

/* the agent's pane: what lands there, its spinner, its plan, and ruggly opening in it on ctrl+g */
.me.dim { opacity: .45; }
.agent { display: flex; flex-direction: column; color: var(--muted); border-left: 1px solid var(--line); transition: border-color .3s; }
.agent.focus { border-left-color: var(--lamp); }
.agent p { margin: 0; }
.agent .agent-head { display: flex; gap: 8px; margin-bottom: 14px; white-space: nowrap; overflow: hidden; color: var(--faint); }
.agent-head .star { color: var(--clay); }
.agent-head .who { color: var(--text); }
.agent.editing .agent-head .star { display: none; }
.agent.editing .agent-head .who { color: var(--lamp); }
.feed { min-width: 0; }
.msg { padding: 4px 8px; color: var(--text); background: rgba(255, 255, 255, .045); }
.msg p + p { color: var(--muted); }
.agent .tool { margin-top: .6em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tool b { margin-right: 4px; font-weight: 400; color: var(--g); }
/* the pane carries the same names as flags, so these only ever reach inside it */
.agent .msg, .agent .t1, .agent .t2 { opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.agent.got .msg, .agent.t1 .t1, .agent.t2 .t2 { opacity: 1; transform: none; }
.flip { display: grid; }
.flip > * { grid-area: 1 / 1; min-width: 0; transition: opacity .25s, visibility 0s linear .25s; }
.agent.editing .cc, .agent:not(.editing) .edit { opacity: 0; visibility: hidden; }
.cc-title { font-weight: 700; color: var(--text); }
.cc-plan { margin: .4em 0 .8em; padding-left: 2.4ch; }
.agent:not(.added) .added { display: none; }
.agent.added .added { animation: land .5s ease-out; }
@keyframes land { from { opacity: 0; transform: translateY(3px); } }
.cc-ask { color: var(--text); }
.opt { white-space: pre; }
.opt.on { color: var(--clay); }
.agent .g-hint { margin-top: .6em; color: var(--faint); }
.agent.approved .cc-ask, .agent.approved .opt, .agent.approved .g-hint { display: none; }
.edit { color: var(--text); }
.edit .page { margin-top: 4px; }
.agent .spin { display: none; margin: .8em 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--clay); }
.agent.spinning .spin { display: block; }
.spin .secs { color: var(--faint); }
/* Claude Code's spinner: six glyphs in one cell, each lit for a sixth of the turn */
.gl { display: inline-grid; width: 1ch; }
.gl i { grid-area: 1 / 1; font-style: normal; opacity: 0; animation: glyph 1.2s linear calc(var(--k, 0) * .2s - 1.2s) infinite; }
@keyframes glyph { 0%, 16.6% { opacity: 1; } 16.7%, 100% { opacity: 0; } }
.agent .prompt { margin-top: auto; padding-top: 5px; border-top: 1px solid var(--line); color: var(--faint); }
.prompt .caret { display: inline-block; vertical-align: text-bottom; background: var(--faint); }
.agent.editing .prompt { visibility: hidden; }

/* ── prompts: the tiles, a smaller heading for the plain-words ones, and the notes line ─── */
.sub { margin: clamp(56px, 8vw, 88px) 0 40px; font: 700 clamp(24px, 3.4vw, 34px)/1.1 var(--sans); letter-spacing: -.03em; }
.sub em { font-style: normal; color: var(--lamp); }
.under { max-width: 72ch; margin: 48px 0 0; color: var(--muted); }

/* ── on the loom ────────────────────────────────────────────────────────────────────────── */
.loom-box { padding-top: 14px; }
.loom-box .box-title { color: var(--gold); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid;
  grid-template-columns: 17ch 1fr;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  transition: background-color .2s;
}
.rows li b { font: 500 14px/1.6 var(--mono); color: var(--text); white-space: nowrap; transition: color .2s; }
.rows li b::before { content: "◇ "; color: var(--gold); }
.rows li:hover { background: rgba(155, 125, 255, .06); }
.rows li:hover b { color: var(--lamp); }
.rows li:hover b::before { content: "◆ "; }
.weave { display: grid; grid-template-columns: repeat(48, 1fr); gap: 2px; padding: 16px 20px 18px; }
.weave i { height: 8px; border-radius: 1px; background: var(--p); opacity: .1; animation: weave 9.6s steps(1) calc(var(--k, 0) * .2s) infinite; }
.weave i:nth-child(6n + 2) { background: var(--y); }
.weave i:nth-child(6n + 4) { background: var(--g); }
.weave i:nth-child(12n + 6) { background: var(--r); }
@keyframes weave { 0% { opacity: .1; } 3%, 92% { opacity: .9; } 100% { opacity: .1; } }

/* ── the log ────────────────────────────────────────────────────────────────────────────── */
.stats { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: -18px 0 36px; font: 14px var(--mono); color: var(--muted); }
.stats b { margin-right: 6px; color: var(--gold); font-weight: 600; }
.log-box { padding-top: 16px; }
.log-view { height: 380px; overflow: auto; -webkit-mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); }
.log-view.looping { overflow: hidden; }
.log-view.looping .log-track { animation: crawl 110s linear infinite; }
.log-view.looping:hover .log-track, .log-view.looping:focus .log-track { animation-play-state: paused; }
@keyframes crawl { to { transform: translateY(-50%); } }
.log-list { list-style: none; margin: 0; padding: 14px 20px; font: 13.5px/1.45 var(--mono); }
.log-list li { display: grid; grid-template-columns: auto auto 1fr; gap: 14px; padding: 7px 0; }
.log-list code { color: var(--gold); font-size: 1em; }
.log-list b { width: 3ch; font-weight: 500; }
.log-list b.add { color: var(--g); }
.log-list b.fix { color: var(--p); }

/* ── privacy, beta, footer ──────────────────────────────────────────────────────────────── */
.more { margin: 28px 0 0; font: 14px var(--mono); }
.more a { color: var(--lamp); }
.more a:hover { text-decoration: underline; text-underline-offset: 4px; }
.beta-card {
  position: relative;
  padding: clamp(44px, 7vw, 80px) clamp(18px, 5vw, 64px);
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background-color: #0b0714;
  box-shadow: 0 0 90px rgba(155, 125, 255, .12);
}
.beta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(155, 125, 255, .2), transparent 70%);
  pointer-events: none;
}
.beta-card > * { position: relative; }
.beta-card h2 { margin: 18px 0 12px; }
.beta-card > p { max-width: 520px; margin: 0 auto; color: var(--muted); }
.beta-card .ask { margin-top: 22px; }
.ask a { color: var(--lamp); border-bottom: 1px solid rgba(155, 125, 255, .4); }
.ask a:hover { border-bottom-color: var(--lamp); }
.beta-card .fine { margin-top: 18px; }
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px 24px;
  margin-top: clamp(80px, 10vw, 120px);
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  font: 12.5px var(--mono);
  color: var(--faint);
}
.foot > :first-child { margin-right: auto; }
.foot a:hover { color: var(--text); }
.woven span { color: var(--gold); }

/* ── reveal on scroll (only when main.js runs, so the page reads fine without it) ────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease var(--lag, 0s), transform .7s cubic-bezier(.2, .7, .2, 1) var(--lag, 0s);
}
.js .tile.reveal {
  transition: opacity .7s ease var(--lag, 0s), transform .7s cubic-bezier(.2, .7, .2, 1) var(--lag, 0s),
    border-color .25s, background-color .25s;
}
.js .reveal.in { opacity: 1; transform: none; }

/* off screen, nothing animates */
.still *, .still *::after { animation-play-state: paused !important; }

/* ── small screens ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .run-copy { grid-template-columns: 1fr; }
  .run-copy .acts { margin-top: 24px; }
}
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
}
/* the panes stack, and while you work in Claude's pane ruggly's steps aside */
@media (max-width: 760px) {
  .panes { grid-template-columns: 1fr; }
  .agent { border-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .agent.focus { border-top-color: var(--lamp); }
  .me.dim { display: none; }
  .me.dim + .agent { border-top: 0; }
}
@media (max-width: 720px) {
  :root { --nav-h: 64px; }
  .nav-links { display: none; }
  .moon { display: none; } /* on a narrow screen the carpet's free end would swing through it */
}
@media (max-width: 560px) {
  .eyebrow { gap: 8px; padding: 6px 12px; font-size: 10.5px; letter-spacing: .06em; }
  .install { flex-wrap: wrap; gap: 8px 10px; padding: 12px 12px 12px 14px; }
  .cmd { flex-basis: calc(100% - 24px); font-size: 13.5px; }
  .copy { margin-left: auto; }
  .rows li { grid-template-columns: 1fr; gap: 2px; padding: 12px 16px; }
  .log-list { padding: 12px 14px; font-size: 12.5px; }
  .log-list li { gap: 10px; }
  .me .meter { display: none; }
  .tile p { font-size: 15px; }
  .tab { padding: 0 6px; }
  .term-bar > i { display: none; }
  .wins { margin-left: 0; }
  .win { padding: 1px 7px; }
  .win b { display: none; }
}

/* ── reduced motion: the carpet lies still, each scene shows its last frame ─────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .banner { clip-path: none; }
  .comet { display: none; }
  .weave i { opacity: .85; }
  .js .reveal { opacity: 1; transform: none; }
  .gl i:nth-child(5) { opacity: 1; }
}

/* ── the docs page: the home page's boxes and rows, on a plain night, with a list of sections ── */
.docs-nav { position: relative; }
.docs-wide { width: min(1320px, 100% - 32px); }
.docs { min-width: 0; padding-top: 24px; }
.docs h1 { margin: 24px 0 8px; font: 700 clamp(34px, 6vw, 60px)/1.04 var(--sans); letter-spacing: -.04em; }
.docs h1 em { font-style: normal; color: var(--lamp); }
.docs .lede { margin: 0; max-width: 640px; text-align: left; }
main.docs > section { padding-top: clamp(56px, 8vw, 96px); scroll-margin-top: 16px; }
.docs [data-toc] { scroll-margin-top: 24px; }

/* three columns: the sections on the left, the one on screen in the middle, its parts on the right. main.js
   shows one section at a time (.paged); without it the page reads top to bottom as before. */
.docs-shell {
  width: min(1320px, 100% - 32px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: 56px;
  align-items: start;
}
.docs-side, .docs-toc {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 32px 0 24px;
}
.side-toggle { display: none; }
.side-nav { font: 14px/1.4 var(--sans); }
.side-nav details { margin: 0 0 20px; }
.side-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 6px 12px;
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  cursor: pointer;
  list-style: none;
}
.side-nav summary::-webkit-details-marker { display: none; }
.side-nav summary::after { content: "›"; font: 14px/1 var(--mono); letter-spacing: 0; transition: transform .2s; }
.side-nav details[open] > summary::after { transform: rotate(90deg); }
.side-nav summary:hover { color: var(--muted); }
.side-nav a {
  display: block;
  margin: 1px 0;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  transition: color .2s, background-color .2s;
}
.side-nav a:hover { color: var(--text); background: rgba(155, 125, 255, .06); }
.side-nav a[aria-current] { color: var(--text); border-left-color: var(--lamp); background: rgba(155, 125, 255, .08); }
.side-nav .side-folder { margin: 0; }
.side-folder > summary { padding: 6px 10px 6px 12px; font: 14px/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
.side-folder > summary:hover { color: var(--text); }
.side-folder > a { padding-left: 26px; }

.toc-title { margin: 0 0 10px; font: 500 11.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.docs-toc { font: 13px/1.4 var(--sans); }
.docs-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.docs-toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 1px solid transparent; color: var(--muted); transition: color .2s; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.on { color: var(--lamp); border-left-color: var(--lamp); }
.docs-toc:not(.has) { visibility: hidden; }

/* one section on screen: the others hide (until-found, so the browser's find still reaches them) */
.docs.paged > section { padding-top: 32px; }
.docs.paged > .docs-intro:not([hidden]) + section { padding-top: clamp(56px, 8vw, 96px); }
.docs.paged > section[hidden] { padding: 0; }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font: 500 14px var(--mono);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.docs-pager a small { font: 12px var(--mono); color: var(--faint); }
.docs-pager a i { font-style: normal; color: var(--gold); }
.docs-pager a:hover { border-color: var(--lamp); box-shadow: 0 0 18px rgba(155, 125, 255, .35); }
.docs-pager .next { grid-column: 2; align-items: flex-end; text-align: right; }

@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}
/* a phone: one column, and the sections fold into a menu above the page */
@media (max-width: 760px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-side { position: static; max-height: none; overflow: visible; padding: 8px 0 0; }
  .js .side-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font: 500 13px var(--mono);
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    cursor: pointer;
  }
  .js .side-toggle span:last-child { color: var(--gold); }
  .js .side-nav { margin-top: 8px; padding: 14px 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
  .js .docs-side:not(.open) .side-nav { display: none; }
  .docs-pager a { padding: 10px 12px; font-size: 13px; }
}
.docs h2 { margin-bottom: 24px; }
.docs .prose p, .docs .prose li { max-width: 72ch; }
.docs .prose p { margin: 0 0 14px; color: var(--muted); }
.docs .prose p strong, .docs .prose li strong { color: var(--text); font-weight: 600; }
.docs .prose ul { margin: 0 0 14px; padding-left: 1.2em; color: var(--muted); }
.docs .prose li { margin-bottom: 6px; }
.docs .install { margin: 0 0 18px; max-width: 640px; }
.docs .box { margin: 18px 0 22px; padding-top: 14px; }
.docs .rows li { grid-template-columns: 20ch 1fr; }
.docs .rows li b::before { content: none; }
.docs .rows li:hover b::before { content: none; }
.docs .rows code { color: var(--g); }
.docs .grid { margin-top: 8px; }
.docs pre { margin: 0 0 16px; padding: 12px 16px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); font: 13.5px/1.55 var(--mono); }
.docs pre code { color: var(--g); }
.docs .prose a, .docs .rows a, .docs .lede a { color: var(--lamp); border-bottom: 1px solid rgba(155, 125, 255, .4); }
.docs .prose a:hover, .docs .rows a:hover, .docs .lede a:hover { border-bottom-color: var(--lamp); }
.docs .note-line { padding: 10px 14px; border-left: 2px solid var(--gold); background: rgba(242, 214, 96, .05); color: var(--muted); }
@media (max-width: 560px) {
  .docs .rows li { grid-template-columns: 1fr; gap: 2px; padding: 12px 16px; }
}
