/* Offsider — the instruction booklet.
   Sky-blue pages on a stud grid, ink keylines on every part, brick red for the one new part
   in each step, yellow for parts held in the inventory, blue for controls and arrows. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/archivo-30e425c7.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/atkinson-next-7174b231.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/atkinson-next-italic-9b6b2f75.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/jetbrains-mono-3f516b04.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;

  --sky: #b9dcf6;
  --sky-light: #cfe7f9;
  --sky-stud: #9fcaec;
  --sky-rule: #7fb3dd;
  --ink: #111317;
  --ink-soft: #1d3446;
  --paper: #ffffff;
  --plate: #dde2e6;
  --plate-deep: #c6cdd3;
  --plate-ink: #6f7d89;
  --brick: #d23228;
  --brick-deep: #a8261e;
  --yellow: #ffcc00;
  --yellow-deep: #c99a00;
  --blue: #1470cc;
  --blue-deep: #0b4c8f;

  --keyline: 2.5px;
  --radius: 10px;
  --stud: 24px;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 70ch;

  --display: "Archivo", "Helvetica Neue", sans-serif;
  --text: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  font: 400 1.0625rem / 1.6 var(--text);
  color: var(--ink);
  background-color: var(--sky);
  background-image: radial-gradient(circle at center, var(--sky-stud) 0 2.4px, transparent 2.9px);
  background-size: var(--stud) var(--stud);
  background-position: calc(var(--stud) / 2) calc(var(--stud) / 2);
  accent-color: var(--blue);
  caret-color: var(--brick);
  scrollbar-color: var(--blue-deep) var(--sky-light);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

a {
  color: var(--blue-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--ink);
  text-decoration-color: var(--brick);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-stretch: 108%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

p {
  text-wrap: pretty;
}

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

:not(pre) > code {
  padding: 0.08em 0.36em;
  background: var(--paper);
  border: 1.5px solid #86a4bd;
  border-radius: 5px;
  white-space: nowrap;
}

pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  line-height: 1.55;
  font-size: 0.9rem;
  scrollbar-color: var(--plate-ink) transparent;
}
pre code {
  font-size: inherit;
}

svg {
  flex: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  font-weight: 700;
}
.skip:focus {
  top: 16px;
}

/* ─── Masthead ─────────────────────────────────────────────── */

.masthead {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 118%;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.brand:hover {
  color: var(--ink);
}
.mark {
  width: 40px;
  height: 32px;
  color: var(--ink);
}

.navbar {
  display: flex;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.navbar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
}
.navbar a + a {
  border-left: var(--keyline) solid var(--ink);
}
.navbar a:hover {
  background: var(--sky-light);
}
.navbar a[aria-current="page"] {
  background: var(--blue);
  color: var(--paper);
}
.navbar a:focus-visible {
  outline-offset: -5px;
  outline-color: var(--yellow);
}
.nav-short {
  display: none;
}
.navbar svg,
.button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Buttons ─────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px 4px;
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  font: 700 1.0625rem / 1 var(--display);
  font-stretch: 104%;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}
.button-primary {
  background: var(--blue);
  color: var(--paper);
  box-shadow: inset 0 -5px 0 var(--blue-deep);
}
.button-secondary {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 -5px 0 var(--plate);
}
.button:not(:disabled):hover {
  color: inherit;
  transform: translateY(-2px);
}
.button-primary:not(:disabled):hover {
  color: var(--paper);
  background: #0f63b8;
}
.button:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: inset 0 -1px 0 var(--blue-deep);
}
.button-secondary:active {
  box-shadow: inset 0 -1px 0 var(--plate);
}
.button:disabled {
  cursor: not-allowed;
  background: var(--plate);
  color: var(--ink-soft);
  border-style: dashed;
  border-color: var(--plate-ink);
  box-shadow: none;
  transform: none;
}

.download {
  display: grid;
  gap: 8px;
}
.actions .download {
  display: contents;
}
.actions .download-note {
  order: 3;
  flex-basis: 100%;
  margin-top: -4px;
}
.download-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ─── Parts: windows, folders, pieces ─────────────────────── */

.stage {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 4 / 3;
  --k: max(2px, 0.5cqw);
}

.stage > * {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w, 10) * 1%);
  height: calc(var(--h, 10) * 1%);
}

.win {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: var(--k) solid var(--ink);
  border-radius: 2cqw;
  font-size: var(--t, 2.3cqw);
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 0.9em;
  flex: none;
  height: 2.4em;
  padding: 0 1em;
  border-bottom: var(--k) solid var(--ink);
  background: var(--plate);
}
.win-bar i {
  flex: none;
  width: 0.85em;
  height: 0.85em;
  border: max(1.5px, 0.3cqw) solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}
.win-bar span {
  margin-left: 0.4em;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 110%;
}
.win-body {
  flex: 1;
  margin: 0;
  padding: 1em 1.1em;
  list-style: none;
}

.code-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}
.code-bars b {
  display: block;
  height: 0.55em;
  width: calc(var(--l) * 1%);
  margin-left: calc(var(--i, 0) * 1.6em);
  border-radius: 1em;
  background: var(--plate-ink);
}

.win-term {
  background: var(--ink);
}
.win-term .win-bar {
  background: #2a2f36;
}
.term-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  font-family: var(--mono);
  font-size: 0.92em;
  color: #e8eef3;
  white-space: nowrap;
}
.term-lines .hot {
  color: #ff8d84;
}

.check-lines {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  font-weight: 600;
}
.check-lines li {
  display: flex;
  align-items: center;
  gap: 0.65em;
  padding: 0.5em 0.2em;
  white-space: nowrap;
}
.check-lines li + li {
  border-top: max(1px, 0.2cqw) solid var(--plate);
}
.check-lines .box {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  border: max(1.5px, 0.35cqw) solid var(--ink);
  border-radius: 0.25em;
  background: var(--paper);
}
.check-lines .done {
  color: var(--plate-ink);
  text-decoration: line-through;
}
.check-lines .done .box {
  background:
    var(--blue)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 90% no-repeat;
}

/* The new part: brick red, lifted. */
.win-panel.is-new {
  box-shadow: 0 2cqw 3.5cqw -1.5cqw rgb(17 19 23 / 0.45);
}
.win-panel.is-new .win-bar {
  background: var(--brick);
  color: var(--paper);
}
.win-panel.is-new .win-bar i {
  background: #ff9c95;
}

/* Prior assembly: plate grey, dashed, receded. */
.is-ghost {
  border-style: dashed;
  border-color: var(--plate-ink);
  background: var(--plate);
  box-shadow: none;
}
.is-ghost .win-bar {
  background: var(--plate-deep);
  border-bottom-color: var(--plate-ink);
}
.is-ghost .win-bar i {
  border-color: var(--plate-ink);
  background: var(--plate);
}
.is-ghost.win-term {
  background: #bfc7ce;
}
.is-ghost .term-lines {
  color: #3a4854;
}
.is-ghost .term-lines .hot {
  color: var(--brick-deep);
  font-weight: 700;
}
.is-ghost .check-lines {
  color: #56636e;
}
.is-ghost .check-lines .box {
  border-color: var(--plate-ink);
  background: var(--plate);
}
.is-ghost .check-lines li + li {
  border-top-color: var(--plate-deep);
}
.is-ghost .check-lines .new-row {
  margin: 0 -0.4em;
  padding-inline: 0.6em;
  color: var(--ink);
  background: var(--paper);
  border: max(1.5px, 0.35cqw) solid var(--ink);
  border-radius: 0.5em;
  box-shadow: inset 0 -0.3em 0 var(--brick);
}
.is-ghost .check-lines .new-row .box {
  border-color: var(--ink);
  background: var(--paper);
}
.is-ghost .check-lines li.new-row + li.new-row {
  margin-top: 0.3em;
}

.seat {
  border: max(2px, 0.4cqw) dashed var(--blue);
  border-radius: 2cqw;
  background: rgb(20 112 204 / 0.1);
}

.drop-arrow,
.lift-arrow,
.side-arrow {
  overflow: visible;
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-dasharray: 9 5;
  vector-effect: non-scaling-stroke;
}
.drop-arrow,
.lift-arrow {
  width: max(16px, 4cqw);
  transform: translateX(-50%);
}
.side-arrow {
  height: 5cqw;
  transform: translateY(-50%);
}
.drop-arrow .head,
.lift-arrow .head,
.side-arrow .head {
  fill: var(--blue);
  stroke: none;
}

.folder {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.6em;
  padding: 1.2em;
  font-size: var(--t, 2.3cqw);
  background: var(--brick);
  border: var(--k) solid var(--ink);
  border-radius: 0 1.6cqw 1.6cqw 1.6cqw;
  box-shadow:
    inset 0 -1.2cqw 0 var(--brick-deep),
    0 2cqw 3.5cqw -1.5cqw rgb(17 19 23 / 0.45);
}
.folder-tab {
  position: absolute;
  left: calc(-1 * var(--k));
  bottom: 100%;
  padding: 0.25em 0.9em 0.1em;
  background: var(--brick);
  border: var(--k) solid var(--ink);
  border-bottom: 0;
  border-radius: 1.2cqw 1.2cqw 0 0;
  font-family: var(--display);
  font-weight: 800;
  color: var(--paper);
}
.folder .file {
  padding: 0.55em 0.8em;
  background: var(--paper);
  border: max(1.5px, 0.35cqw) solid var(--ink);
  border-radius: 0.5em;
  font-family: var(--mono);
  font-weight: 700;
}

.consent {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  padding: 1.4em 1.5em;
  font-size: var(--t, 2.3cqw);
  background: var(--paper);
  border: var(--k) solid var(--ink);
  border-top: 1.6cqw solid var(--brick);
  border-radius: 2cqw;
  box-shadow: 0 2.5cqw 4cqw -1.5cqw rgb(17 19 23 / 0.5);
}
.consent-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25em;
}
.consent dl {
  display: grid;
  gap: 0.6em;
  margin: 0;
}
.consent dt {
  font-weight: 700;
  font-size: 0.85em;
  color: var(--ink-soft);
}
.consent dd {
  margin: 0.1em 0 0;
  font-family: var(--mono);
}
.consent-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.7em;
  margin: auto 0 0;
}
.consent-buttons span {
  padding: 0.45em 1em;
  border: max(1.5px, 0.35cqw) solid var(--ink);
  border-radius: 0.5em;
  font-weight: 700;
}
.consent-buttons .allow {
  background: var(--blue);
  color: var(--paper);
}

/* Inventory pieces: authored SVG parts. */
.piece {
  width: 34px;
  height: 34px;
}

/* ─── Home: cover ─────────────────────────────────────────── */

.cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "copy inventory"
    "copy stage";
  align-items: start;
  gap: 32px clamp(24px, 4vw, 64px);
  padding: clamp(24px, 5vw, 64px) 0 clamp(48px, 7vw, 96px);
}
.cover-copy {
  grid-area: copy;
  align-self: center;
}
.cover h1 {
  font-weight: 900;
  font-size: clamp(2.75rem, 5.6vw, 5.5rem);
  font-stretch: 106%;
  line-height: 0.96;
  letter-spacing: -0.035em;
  max-width: 11ch;
}
.lede {
  margin: 28px 0 36px;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.4vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
}
.stage-cover {
  grid-area: stage;
  margin: 0;
  --k: max(2.5px, 0.45cqw);
}

.inventory {
  grid-area: inventory;
  justify-self: end;
  width: min(100%, 440px);
  overflow: hidden;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
}
.inventory h2 {
  padding: 10px 16px 9px;
  background: var(--yellow);
  border-bottom: var(--keyline) solid var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: 0;
}
.inventory ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin: 0;
  padding: 14px 16px 16px;
  list-style: none;
}
.inventory li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
.inventory .piece {
  width: 30px;
  height: 30px;
}
.inventory b {
  font-family: var(--display);
  font-weight: 800;
}

/* ─── Home: the build ─────────────────────────────────────── */

.build {
  padding-bottom: clamp(56px, 8vw, 120px);
}
.build-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 16px 48px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: var(--keyline) solid var(--ink);
}
.build-head h2,
.agent h2,
.finish h2 {
  font-weight: 900;
  font-size: clamp(2.25rem, 4.4vw, 4rem);
  letter-spacing: -0.03em;
}
.build-head p {
  margin: 0;
  max-width: 36rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 88px) clamp(24px, 3vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-width: 0;
  gap: 24px;
  scroll-margin-top: 24px;
}
.step-close .stage {
  aspect-ratio: 16 / 7;
}
.step-wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  gap: 24px clamp(24px, 4vw, 64px);
}

.frame {
  position: relative;
  margin: 0;
  padding: clamp(84px, 10vw, 128px) clamp(16px, 2.4vw, 28px) clamp(16px, 2.4vw, 28px);
  background: var(--sky-light);
  border: 2px solid var(--blue-deep);
  border-radius: 16px;
}
.frame .stage {
  width: 100%;
}
.step-num {
  position: absolute;
  top: clamp(8px, 1.5vw, 16px);
  left: clamp(14px, 2vw, 24px);
  font: 900 clamp(4rem, 8vw, 6rem) / 1 var(--display);
  font-stretch: 112%;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.callout {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  background: var(--paper);
  border: var(--keyline) solid var(--blue-deep);
  border-radius: var(--radius);
}
.callout b {
  font: 800 1.35rem / 1 var(--display);
}
.callout-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.callout-label.is-path {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
}
.callout-sep {
  width: 2px;
  height: 26px;
  margin: 0 4px;
  background: var(--plate);
}
.callout .piece {
  width: 30px;
  height: 30px;
}
.stage > .callout-stage {
  top: 0;
  right: auto;
  width: auto;
  height: auto;
  padding: 6px 12px 6px 8px;
}

.caption,
.frame,
.cover-copy,
.doc,
.changelog {
  min-width: 0;
}
.caption h3 {
  font-weight: 800;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  letter-spacing: -0.02em;
}
.caption p {
  margin: 12px 0 18px;
  max-width: 38rem;
}

/* Step 3: the live demo. */
.frame-live {
  padding-bottom: clamp(20px, 3vw, 36px);
}
.demo-label {
  position: absolute;
  top: clamp(24px, 3vw, 36px);
  left: clamp(96px, 12vw, 150px);
  right: 180px;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
}
.demo-label span {
  display: block;
  font-family: var(--text);
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.live {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 64px minmax(0, 1.6fr);
  align-items: center;
}
.live-panel,
.live-term {
  overflow: hidden;
  border: var(--keyline) solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 16px 28px -14px rgb(17 19 23 / 0.45);
}
.live-panel {
  background: var(--paper);
}
.live-panel .win-bar,
.live-term .win-bar {
  font-size: 0.9rem;
  border-bottom-width: var(--keyline);
}
.live-panel .win-bar {
  background: var(--brick);
  color: var(--paper);
}
.live-panel .win-bar i {
  background: #ff9c95;
  border-width: 2px;
}
.live-panel fieldset {
  margin: 0;
  padding: 10px 12px 14px;
  border: 0;
}
.live-panel label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.live-panel label + label {
  border-top: 1.5px solid var(--plate);
}
.live-panel label:hover {
  background: var(--sky-light);
}
.live-panel input {
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  transition: background-color 140ms var(--ease-out);
}
.live-panel input::after {
  content: "";
  width: 13px;
  height: 7px;
  margin-top: -3px;
  border: solid var(--paper);
  border-width: 0 0 3px 3px;
  transform: rotate(-45deg) scale(0);
  transition: transform 180ms var(--ease-out);
}
.live-panel input:checked {
  background: var(--blue);
}
.live-panel input:checked::after {
  transform: rotate(-45deg) scale(1);
}
.live-panel input:checked + span {
  color: #5b6874;
  text-decoration: line-through;
}
.live-arrow {
  width: 100%;
  height: 20px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-dasharray: 9 5;
}
.live-arrow .head {
  fill: var(--blue);
  stroke: none;
}
.live-term {
  background: var(--ink);
  color: #e8eef3;
}
.live-term .win-bar {
  background: #2a2f36;
  color: #b9c4cd;
  border-bottom-color: var(--ink);
}
.live-term .win-bar i {
  border-color: #5c6873;
  background: #2a2f36;
  border-width: 2px;
}
.live-term .win-bar span {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8rem;
}
.event-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  min-height: 132px;
  margin: 0;
  padding: 16px 18px;
  list-style: none;
  font: 0.8rem / 1.5 var(--mono);
  overflow-wrap: anywhere;
}
.event-log li {
  color: #9fb0bd;
}
.event-log::after {
  content: "";
  width: 9px;
  height: 1.1em;
  margin-top: 2px;
  flex: none;
  background: #e8eef3;
}
.event-log li.is-new {
  color: #ff9c95;
  animation: line-drop 520ms var(--ease-out);
}
.event-log li.is-new::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  vertical-align: 1px;
  border-radius: 2px;
  background: var(--brick);
}

/* ─── Home: agent + finish ────────────────────────────────── */

.agent {
  padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 56px);
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: 16px;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(24px, 3vw, 48px);
  margin: 40px 0 32px;
}
.agent-grid > div {
  padding-top: 20px;
  border-top: var(--keyline) solid var(--ink);
}
.agent-grid h3 {
  font-size: 1.3rem;
  font-weight: 800;
}
.agent-grid h3 code {
  font-size: 0.8em;
  white-space: nowrap;
}
.agent-grid p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}
.arrow-icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.12em;
}
.docs-pager a[rel="next"] span {
  justify-content: flex-end;
}
.text-link {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.125rem;
}
.agent > p:last-child {
  margin: 0;
}

.finish {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(72px, 10vw, 140px) 0;
  text-align: center;
}
.finish-mark .mark {
  width: 88px;
  height: 70px;
}
.finish p {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: var(--ink-soft);
}
.finish .actions {
  justify-content: center;
  text-align: left;
}

/* ─── Footer ──────────────────────────────────────────────── */

.colophon {
  width: 100%;
  margin-top: clamp(48px, 6vw, 80px);
  padding: 28px var(--gutter) 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  background: var(--ink);
  color: #c8d6e0;
  font-size: 0.95rem;
}
.page-home .colophon {
  margin-top: 0;
}
.colophon p {
  margin: 0;
}
.colophon-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 118%;
  font-size: 1.2rem;
  color: var(--paper);
}
.colophon .mark {
  color: var(--ink);
}
.colophon nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.colophon a {
  color: var(--paper);
}
.colophon a:hover {
  color: var(--yellow);
  text-decoration-color: var(--yellow);
}
.colophon :focus-visible {
  outline-color: var(--yellow);
}

/* ─── Docs ────────────────────────────────────────────────── */

.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(32px, 4vw, 64px);
  padding: clamp(16px, 3vw, 40px) 0 0;
}

.docs-nav {
  position: sticky;
  top: 24px;
  display: grid;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  counter-reset: page;
}
.docs-nav h2 {
  padding: 14px 16px 12px;
  font-size: 0.95rem;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: 0;
  border-bottom: var(--keyline) solid var(--ink);
  background: var(--yellow);
}
.docs-nav a {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  counter-increment: page;
}
.docs-nav a + a {
  border-top: 1.5px solid var(--plate);
}
.docs-nav a::before {
  content: counter(page);
  display: grid;
  place-items: center;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  font: 800 0.8rem / 1 var(--display);
  font-variant-numeric: tabular-nums;
}
.docs-nav a:hover {
  background: var(--sky-light);
}
.docs-nav a[aria-current="page"] {
  background: var(--blue);
  color: var(--paper);
}
.docs-nav a[aria-current="page"]::before {
  background: var(--paper);
  color: var(--blue-deep);
  border-color: var(--ink);
}
.docs-nav a:focus-visible {
  outline-offset: -5px;
  outline-color: var(--yellow);
}

.doc {
  position: relative;
  min-width: 0;
  max-width: 820px;
}
.doc-page {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink-soft);
}
.doc-page b {
  font-size: clamp(3.5rem, 7vw, 5.5rem);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.doc-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: var(--keyline) solid var(--ink);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.doc-footer p {
  margin: 0;
}

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.docs-pager a {
  display: grid;
  gap: 2px;
  min-height: 72px;
  padding: 12px 18px 16px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 -5px 0 var(--plate);
  transition: transform 160ms var(--ease-out);
}
.docs-pager a span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.docs-pager a b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
}
.docs-pager a:hover {
  transform: translateY(-2px);
}
.docs-pager a[rel="next"] {
  grid-column: 2;
  text-align: right;
  background: var(--blue);
  color: var(--paper);
  box-shadow: inset 0 -5px 0 var(--blue-deep);
}
.docs-pager a[rel="next"] span {
  color: var(--paper);
}

/* ─── Prose: docs and changelog Markdown ──────────────────── */

.prose {
  font-size: 1.0625rem;
  line-height: 1.65;
}
.prose > * {
  max-width: var(--measure);
}
.prose h1 {
  font-weight: 900;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  margin: 0 0 24px;
}
.prose h2 {
  margin: 56px 0 14px;
  padding-top: 20px;
  border-top: var(--keyline) solid var(--ink);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  scroll-margin-top: 24px;
}
.prose h3 {
  margin: 36px 0 10px;
  font-weight: 800;
  font-size: 1.3rem;
  scroll-margin-top: 24px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 18px;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li {
  margin: 6px 0;
}
.prose ul > li::marker {
  content: "■  ";
  color: var(--brick);
  font-size: 0.8em;
}
.prose ol > li::marker {
  font-family: var(--display);
  font-weight: 800;
}
.prose strong {
  font-weight: 700;
}
.prose pre {
  max-width: none;
  margin: 0 0 24px;
  position: relative;
}
.prose pre:has(> code[class*="language-"]) {
  padding-top: 38px;
}
.prose pre:has(> code[class*="language-"])::before {
  position: absolute;
  top: 0;
  right: 14px;
  padding: 3px 10px 4px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  font: 700 0.72rem / 1.2 var(--mono);
  color: var(--ink);
}
.prose pre:has(> .language-sh)::before,
.prose pre:has(> .language-bash)::before {
  content: "shell";
}
.prose pre:has(> .language-json)::before {
  content: "json";
}
.prose pre:has(> .language-js)::before,
.prose pre:has(> .language-javascript)::before {
  content: "javascript";
}
.prose pre:has(> .language-html)::before {
  content: "html";
}
.prose pre:has(> .language-css)::before {
  content: "css";
}
.prose pre:has(> .language-ruby)::before {
  content: "ruby";
}
.prose pre:has(> .language-python)::before {
  content: "python";
}
.prose pre:has(> .language-swift)::before {
  content: "swift";
}
.prose table {
  display: block;
  max-width: 100%;
  width: max-content;
  overflow-x: auto;
  margin: 0 0 24px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.prose th,
.prose td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--plate);
  border-bottom: var(--keyline) solid var(--ink);
  font-family: var(--display);
  font-weight: 800;
}
.prose tr + tr td {
  border-top: 1.5px solid var(--plate);
}
.prose td + td,
.prose th + th {
  border-left: 1.5px solid var(--plate);
}
.prose :is(h1, h2, h3) code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.86em;
}
.prose td:first-child code {
  white-space: nowrap;
}
.prose code {
  overflow-wrap: anywhere;
  white-space: normal;
}
.prose pre code {
  overflow-wrap: normal;
  white-space: pre;
}
.prose blockquote {
  margin: 0 0 24px;
  padding: 14px 18px;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
}
.prose blockquote > :last-child {
  margin-bottom: 0;
}
.prose hr {
  border: 0;
  border-top: var(--keyline) dashed var(--sky-rule);
  margin: 40px 0;
}
.prose img {
  max-width: 100%;
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
}

/* ─── Changelog ───────────────────────────────────────────── */

.changelog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "notes aside";
  align-items: start;
  gap: clamp(32px, 5vw, 80px);
  padding: clamp(16px, 3vw, 40px) 0 0;
}
.changelog {
  grid-area: notes;
  counter-reset: release;
}
.changelog h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  counter-increment: release;
}
.changelog h2::before {
  content: "";
  flex: none;
  width: 36px;
  height: 28px;
  border: var(--keyline) solid var(--ink);
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 50%, var(--ink) 0 1.5px, transparent 2px),
    radial-gradient(circle at 30% 50%, var(--brick-deep) 0 6px, transparent 6.5px),
    radial-gradient(circle at 70% 50%, var(--ink) 0 1.5px, transparent 2px),
    radial-gradient(circle at 70% 50%, var(--brick-deep) 0 6px, transparent 6.5px), var(--brick);
}
.changelog-aside {
  grid-area: aside;
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
}
.changelog-aside h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0;
}
.changelog-aside p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.changelog-aside .button {
  width: 100%;
}
.status-note {
  padding: 12px 16px;
  background: var(--yellow);
  border: var(--keyline) solid var(--ink);
  border-radius: var(--radius);
  font-weight: 600;
}

/* ─── Unavailable ─────────────────────────────────────────── */

.notice {
  max-width: 640px;
  margin: clamp(32px, 8vw, 96px) auto;
  padding: clamp(28px, 5vw, 48px);
  background: var(--paper);
  border: var(--keyline) solid var(--ink);
  border-radius: 16px;
}
.notice h1 {
  font-weight: 900;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
}
.notice p {
  margin: 16px 0 0;
  color: var(--ink-soft);
}
.notice .actions {
  margin-top: 28px;
}

/* ─── Motion: parts drop along their arrows ───────────────── */

@keyframes line-drop {
  from {
    transform: translateY(-10px);
    opacity: 0.2;
  }
}

/* Parts rest in their seats; the drop only plays once a step is on screen. */
@keyframes part-drop {
  from {
    transform: translateY(-14%);
  }
}
@keyframes row-slide {
  from {
    transform: translateX(-14%);
  }
}
@keyframes part-lift {
  from {
    transform: translateY(18%);
  }
}
.is-built .drops {
  animation: part-drop 900ms var(--ease-out) 150ms backwards;
}
.is-built .new-row.drops {
  animation-name: row-slide;
}
.is-built .new-row.drops:last-child {
  animation-delay: 300ms;
}
.is-built .lifts {
  animation: part-lift 900ms var(--ease-out) 150ms backwards;
}

@media (prefers-reduced-motion: reduce) {
  .event-log li.is-new,
  .is-built .drops,
  .is-built .lifts {
    animation: none;
  }
  .button,
  .docs-pager a,
  .live-panel input,
  .live-panel input::after {
    transition: none;
  }
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 1080px) {
  .live {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .live-arrow {
    width: 20px;
    height: 44px;
    justify-self: center;
    transform: rotate(90deg);
  }
  .step-wide {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  .cover {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "copy"
      "stage"
      "inventory";
  }
  .cover h1 {
    max-width: 13ch;
  }
  .inventory {
    justify-self: stretch;
    width: 100%;
  }
  .steps,
  .build-head,
  .agent-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-layout,
  .changelog-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "aside" "notes";
  }
  .docs-nav,
  .changelog-aside {
    position: static;
  }
  .docs-nav {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
  .docs-nav h2 {
    grid-column: 1 / -1;
  }
  .docs-nav a + a {
    border-top: 0;
  }
  .docs-nav a {
    border-bottom: 1.5px solid var(--plate);
  }
}

@media (max-width: 560px) {
  :root {
    font-size: 1rem;
  }
  .masthead {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .brand {
    font-size: 1.25rem;
    gap: 8px;
  }
  .brand .mark {
    width: 34px;
    height: 27px;
  }
  .navbar a {
    padding: 0 12px;
  }
  .navbar svg,
  .nav-long {
    display: none;
  }
  .nav-short {
    display: inline;
  }
  .stage {
    aspect-ratio: 1 / 1;
    --t: 3.5cqw;
  }
  .step-close .stage {
    aspect-ratio: 1 / 1;
  }
  .stage > .callout-stage {
    display: none;
  }
  .stage-cover {
    --t: 3.2cqw;
  }
  .stage > .c-editor {
    width: 52%;
  }
  .stage > .c-term {
    left: 4%;
    width: 50%;
  }
  .stage > .c-panel {
    left: 57%;
    width: 42%;
  }
  .stage > .c-arrow {
    left: 78%;
  }
  .stage .term-lines {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .stage > .s6-term {
    width: 48%;
  }
  .stage > .s6-panel {
    left: 55%;
    width: 42%;
  }
  .stage > .s6-arrow {
    left: 98%;
  }
  .stage > .s1-term {
    width: 40%;
  }
  .stage > .s1-arrow {
    left: 45%;
    width: 8%;
  }
  .stage > .s1-folder {
    left: 55%;
    width: 42%;
  }
  .stage > .s2-editor {
    width: 46%;
  }
  .stage > .s2-term {
    left: 4%;
    width: 46%;
  }
  .stage > .s2-panel {
    left: 55%;
    width: 43%;
  }
  .stage > .s2-arrow {
    left: 76.5%;
  }
  .stage > .s4-term {
    width: 38%;
  }
  .stage > .s4-arrow {
    left: 42%;
  }
  .stage > .s4-panel {
    left: 48%;
    width: 50%;
  }
  .actions,
  .actions .download,
  .actions .button {
    width: 100%;
  }
  .demo-label {
    position: static;
    margin: 0 0 16px;
    padding-top: 8px;
  }
  .frame-live {
    padding-top: clamp(84px, 10vw, 128px);
  }
  .callout {
    top: 12px;
    right: 12px;
  }
  .docs-pager {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-pager a[rel="next"] {
    grid-column: 1;
  }
}

.finish .download-note {
  text-align: center;
}
