/* polyxd.com landing page: one interface tells the whole story, on a dark drafting table.
   Layout for the pinned stage, the card, and every layer that appears around it. Starting
   states for motion live under `.motion` only, so without JS or with reduced motion the
   chapters stack as plain sections and nothing is hidden. The card's colours, type and radii
   come from the pack's own tokens (themes.css); nothing here names one. */

/* ---------- The landing page's own ground: the site's paper, graphite for the pencil, the
   brand's signal orange for intent. Everything the site shares (header, buttons, footer) stays
   as it is on the docs. ---------- */
.landing {
  --void: var(--ground);
  --panel: #faf8f3;
  --panel-2: #f1ede4;
  --hair: var(--line);
  --hair-2: #cfc9bb;
  --text: var(--ink);
  --dim: var(--ink-2);
  --faint: #8a887f;
  --ice: #3a3a3a;
  --ice-dim: rgb(58 58 58 / 0.4);
  --hand: "Architects Daughter", "Geist Mono", monospace;
  --shadow: 0 24px 60px rgb(20 20 20 / 0.16), 0 0 0 1px rgb(20 20 20 / 0.04);
}
.landing .eyebrow {
  color: var(--signal-ink);
}

/* ---------- The pinned stage ---------- */
.story {
  position: relative;
}
.story-pin {
  --rail: 72px; /* room for the chapter rail in the left gutter */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: 100svh;
  padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--rail));
  max-width: var(--max);
  margin: 0 auto;
}
.acts {
  position: relative;
  min-height: 60vh;
}
.act {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}
.act h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 5.4vw, 84px);
  line-height: 0.95;
  letter-spacing: -0.037em;
  text-wrap: balance;
}
.act h2 {
  margin: 0;
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1;
  text-wrap: balance;
}
.act p {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--dim);
  text-wrap: pretty;
}
.act .lede {
  font-size: clamp(18px, 1.5vw, 21px);
  max-width: 36ch;
}
.scroll-hint {
  font: 12px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.scroll-hint::before {
  content: "↓";
  display: inline-block;
  margin-right: 10px;
  color: var(--signal-ink);
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge {
  50% {
    transform: translateY(4px);
  }
}

/* Chapters. A list because the page really is a sequence: the same interface, in order. */
.rail {
  position: absolute;
  left: max(16px, calc(var(--gutter) - 48px));
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
}
.rail a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.rail a[aria-current] {
  color: var(--text);
}
.rail a[aria-current]::before {
  background: var(--signal);
  border-color: var(--signal);
  transform: scale(1.35);
}

/* ---------- The scene and its layers ---------- */
.scene {
  position: relative;
  height: min(74vh, 720px);
  border: 1px solid var(--hair);
  border-radius: 24px;
  background: var(--panel);
}
.scene > * {
  position: absolute;
}
/* Drafting paper: a fine dot grid that fades towards the edges. */
.grid {
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(var(--hair-2) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: 11px 11px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 78%);
}
/* The readout: what the model decided and what the verifier found, live. */
.hud {
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  padding: 12px 20px;
  border-top: 1px solid var(--hair);
  border-radius: 0 0 24px 24px;
  background: rgb(244 241 234 / 0.72);
  font: 11px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 3;
}
.hud span {
  display: flex;
  gap: 8px;
}
.hud b {
  font-weight: 400;
  color: var(--faint);
}
.hud i {
  font-style: normal;
  color: var(--ice);
  transition: color 0.25s;
}
.hud i[data-live] {
  color: var(--text);
}
.ask {
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 40px);
  min-height: 52px;
  padding: 0 20px;
  background: var(--void);
  border: 1px solid var(--hair-2);
  color: var(--text);
  border-radius: 999px;
  font-size: 17px;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgb(20 20 20 / 0.2);
  z-index: 3;
}
.ask-label {
  font: 11px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.caret {
  width: 2px;
  height: 20px;
  background: var(--signal);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
/* The design system's name, rolling past like a departures board while the card is rebuilt. */
.packname {
  top: 22px;
  left: 0;
  right: 0;
  height: 1.1em;
  overflow: hidden;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--text);
  opacity: 0;
}
.packname span {
  display: block;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* The card, and the plates it lifts into. */
.slot {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 48px));
}
.stack {
  position: relative;
  transform: rotateX(var(--rx, 0deg)) rotateZ(var(--rz, 0deg)) scale(calc(var(--s, 1) * var(--base, 1)));
  transform-style: preserve-3d;
}
.plate {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid var(--ice-dim);
  background: rgb(250 248 243 / 0.97);
  opacity: 0;
  pointer-events: none;
}
.plate-intent {
  background-color: rgb(241 237 228 / 0.97);
  background-image: radial-gradient(var(--ice-dim) 1px, transparent 1.2px);
  background-size: 20px 20px;
}
.plate-line {
  position: absolute;
  left: 20px;
  top: 16px;
  font: 11px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice);
}
.plate-foot {
  top: auto;
  bottom: 16px;
}
.plate-parts .box {
  position: absolute;
  border: 1.5px dashed var(--ice);
  border-radius: 6px;
}
.plate-parts .box i {
  position: absolute;
  left: 8px;
  top: -8px;
  padding: 0 6px;
  background: var(--panel);
  font: 9px var(--mono);
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ice);
  white-space: nowrap;
}
.plate-tokens {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}
.plate-tokens .sw {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 10px var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ice);
}
.plate-tokens .sw b {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgb(0 0 0 / 0.12);
}
.plate-tokens .type-sample {
  position: absolute;
  right: 20px;
  top: 16px;
  font-size: 22px;
  color: var(--text);
}
.plate-tokens .type-sample small {
  font: 12px var(--mono);
  color: var(--dim);
}
.plate-checks {
  border-style: dashed;
  background: rgb(58 58 58 / 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: center;
  justify-content: center;
  padding: 20px;
}
.plate-checks span {
  padding: 6px 10px;
  border: 1.5px solid var(--ice);
  border-radius: 999px;
  background: var(--panel);
  font: 10px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ice);
}
.stack.is-lifted .stage {
  transform-style: preserve-3d;
}
.layers {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 26px;
  z-index: 2;
}
.layers li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateX(10px);
}
.layers b {
  font: 11px var(--mono);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice);
}
.layers span {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}

.stage {
  padding: clamp(18px, 2.2vw, 28px);
  border-radius: 20px;
  background: var(--pxd-color-surface-subtle);
  color: var(--pxd-color-text-default);
  font-family: var(--pxd-type-body-default-family);
  box-shadow: var(--shadow);
}
/* Pencil: the card as a hand would draw it, in the pack it wears right now. Drawn by story.js. */
.sketch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.sketch .stroke {
  fill: none;
  stroke: var(--ice);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sketch .faint {
  stroke-width: 1;
  opacity: 0.45;
}
.sketch .note {
  fill: var(--ice);
  font: 14px var(--hand);
}
.ghost {
  position: absolute;
  inset: 0;
  border: 1.5px dashed var(--ice-dim);
  border-radius: 20px;
  opacity: 0;
}
.when {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  font: 12px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice);
}
.when span {
  position: absolute;
  left: 0;
  white-space: nowrap;
  opacity: 0;
}

/* Every colour, size and face below is the pack's. */
.stage .card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--pxd-space-stack-loose);
  padding: var(--pxd-space-inset-comfortable);
  background: var(--pxd-color-surface-raised);
  border: var(--pxd-border-width-default) solid var(--pxd-color-border-default);
  border-radius: var(--pxd-radius-large);
  box-shadow: var(--pxd-shadow-raised);
}
.stage .t {
  font-family: var(--pxd-type-title-section-family);
  font-size: var(--pxd-type-title-section-size);
  font-weight: var(--pxd-type-title-section-weight);
  line-height: var(--pxd-type-title-section-line-height);
  color: var(--pxd-color-text-default);
}
.stage .d {
  font-size: var(--pxd-type-body-small-size);
  line-height: var(--pxd-type-body-small-line-height);
  color: var(--pxd-color-text-muted);
}
.stage .row {
  display: flex;
  justify-content: space-between;
  gap: var(--pxd-space-inline-default);
  padding: var(--pxd-space-stack-default) 0;
  border-bottom: var(--pxd-border-width-default) solid var(--pxd-color-border-default);
  font-size: var(--pxd-type-body-small-size);
}
.stage .row span:first-child {
  color: var(--pxd-color-text-muted);
}
/* The footer follows the pack's own layout variables, the same ones the renderer's dialog uses. */
.stage .acts-row {
  display: flex;
  justify-content: flex-end;
  gap: var(--pxd-layout-action-gap, var(--pxd-space-inline-default));
  margin: var(--pxd-layout-action-bleed, 0);
}
.stage .acts-row .b {
  flex: var(--pxd-layout-action-item, 0 0 auto);
  justify-content: center;
}
.stage .b {
  display: inline-flex;
  align-items: center;
  min-height: var(--pxd-size-target-min);
  padding: 0 var(--pxd-space-inset-default);
  border: var(--pxd-border-width-default) solid transparent;
  border-radius: var(--pxd-radius-control);
  font-family: var(--pxd-type-label-default-family);
  font-size: var(--pxd-type-label-default-size);
  font-weight: var(--pxd-type-label-default-weight);
}
.stage .b2 {
  background: var(--pxd-color-action-secondary-background);
  border-color: var(--pxd-color-action-secondary-border);
  color: var(--pxd-color-action-secondary-foreground);
}
.stage .b1 {
  background: var(--pxd-color-action-primary-background);
  color: var(--pxd-color-action-primary-foreground);
}

/* Tokens arriving: chips that fly in from the edges along leaders that draw themselves. */
.leaders {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}
.leaders path {
  fill: none;
  stroke: var(--ice);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: 0.75;
}
.leaders circle {
  fill: var(--ice);
}
.chips {
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.chip {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 10px;
  background: var(--paper);
  border: 1px solid var(--ice);
  border-radius: 6px;
  font: 10px var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ice);
  white-space: nowrap;
  box-shadow: 0 6px 20px rgb(20 20 20 / 0.15);
  opacity: 0;
}
.chip b {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgb(0 0 0 / 0.12);
}

.cursor {
  position: absolute;
  left: -12px;
  top: 100%;
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(255 90 31 / 0.18), 0 0 24px rgb(255 90 31 / 0.5);
  opacity: 0;
  z-index: 3;
}
.stamps {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.stamp {
  position: absolute;
  padding: 8px 14px;
  border: 1.5px solid var(--ice);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ice);
  font: 600 12px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgb(20 20 20 / 0.18);
  opacity: 0;
}
.stamp:nth-child(1) {
  top: -16px;
  right: -22px;
  rotate: -6deg;
}
.stamp:nth-child(2) {
  bottom: -16px;
  right: -18px;
  rotate: 4deg;
}
.stamp:nth-child(3) {
  top: -16px;
  left: -22px;
  rotate: -4deg;
}
.stamp-signal {
  bottom: 30%;
  left: -56px;
  rotate: -5deg;
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
  box-shadow: 0 10px 30px rgb(20 20 20 / 0.18);
}
.tree {
  left: 16px;
  right: 16px;
  bottom: 52px;
  margin: 0;
  padding: clamp(14px, 1.8vw, 22px);
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 16px;
  font: clamp(11px, 0.95vw, 13px) / 1.75 var(--mono);
  color: #d9d5ca;
  white-space: pre;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  box-shadow: 0 20px 50px rgb(20 20 20 / 0.25);
  z-index: 4;
}
.tree .c {
  color: #8f8c84;
}
.tree .s {
  color: var(--code-string);
}
.tree .ok {
  color: var(--ok);
}
.tree .agent-line {
  display: block;
  opacity: 0;
}
.same {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 16px);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.same li {
  padding: 5px 10px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  font: 11px var(--mono);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
}
.same li::after {
  content: " ✓";
  color: var(--ok);
}

/* ---------- Studio: for design and product teams ---------- */
.studio {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 120px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  border-top: 1px solid var(--hair);
}
.studio-words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.studio-words h2 {
  margin: 0;
  font-size: clamp(34px, 3.4vw, 52px);
  line-height: 1;
  text-wrap: balance;
}
.studio-words p {
  margin: 0;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.55;
  color: var(--dim);
  text-wrap: pretty;
}
/* The screen is Studio's Review page, on paper, the way the tool itself is drawn. */
.studio-shell {
  --st-ground: #f4f1ea;
  --st-paper: #fff;
  --st-ink: #141414;
  --st-ink2: #3f3e3a;
  --st-muted: #6b6a63;
  --st-faint: #9a988f;
  --st-line: #ddd8cc;
  --st-soft: #ece8de;
  --st-ok: #1f7a3f;
  --st-okbg: #e6f4ea;
  --st-warnbg: #fff1ea;
  --st-sigink: #b8350a;
  background: var(--st-ground);
  color: var(--st-ink);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgb(20 20 20 / 0.2), 0 0 0 1px rgb(20 20 20 / 0.06);
  font-size: 12px;
  line-height: 1.4;
}
.st-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 16px;
  background: var(--st-paper);
  border-bottom: 1px solid var(--st-line);
}
.st-brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
}
.st-dir {
  padding: 4px 8px;
  border: 1px solid var(--st-line);
  border-radius: 6px;
  font-weight: 600;
}
.st-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--st-line);
  border-radius: 999px;
  font: 10px var(--mono);
}
.st-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
}
.st-publish {
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--st-ink);
  color: #fff;
  font-weight: 600;
}
.st-body {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 210px;
  min-height: 420px;
}
.st-nav {
  padding: 12px 8px;
  border-right: 1px solid var(--st-line);
  background: var(--st-paper);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-nav span {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--st-ink2);
  font-weight: 500;
}
.st-nav .on {
  background: var(--st-soft);
  color: var(--st-ink);
  font-weight: 600;
}
.st-nav em {
  font: 10px var(--mono);
  color: var(--st-sigink);
}
.st-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--st-line);
  padding: 0;
}
.st-main {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.st-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.st-head div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.st-head strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-head span {
  font: 9px var(--mono);
  color: var(--st-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--st-soft);
  border-radius: 7px;
  flex: none;
}
.st-seg > * {
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--st-ink2);
}
.st-seg b {
  background: var(--st-paper);
  color: var(--st-ink);
}
.st-surface {
  display: flex;
  justify-content: center;
  padding: 18px;
  background: var(--st-soft);
  border-radius: 12px;
}
.st-phone {
  width: 250px;
  padding: 14px 10px 18px;
  border-radius: 24px;
  background: #fdf7ff;
  box-shadow: 0 12px 30px rgb(20 20 20 / 0.12);
}
.st-phone .stage {
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
}
.st-phone .card {
  gap: 8px;
  padding: 14px;
}
.st-phone .t {
  font-size: 15px;
}
.st-phone .d,
.st-phone .row {
  font-size: 11px;
}
.st-phone .b {
  min-height: 30px;
  font-size: 11px;
}
.st-flagline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.st-flagline mark {
  background: rgb(255 90 31 / 0.28);
  border-bottom: 2px solid var(--signal);
  color: inherit;
}
.st-pin {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--signal);
  color: #fff;
  font: 9px var(--mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px rgb(255 90 31 / 0.2);
}
.st-actions {
  display: flex;
  gap: 6px;
}
.st-btn {
  white-space: nowrap;
  padding: 7px 11px;
  border: 1px solid var(--st-line);
  border-radius: 999px;
  background: var(--st-paper);
  font-weight: 600;
}
.st-btn-ink {
  background: var(--st-ink);
  border-color: var(--st-ink);
  color: #fff;
}
.st-side {
  padding: 14px 12px;
  border-left: 1px solid var(--st-line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.st-panel {
  padding: 10px 12px;
  background: var(--st-paper);
  border: 1px solid var(--st-line);
  border-radius: 10px;
}
.st-panel h3 {
  margin: 0 0 6px;
  font-size: 12px;
}
.st-check {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--st-soft);
  font-size: 11px;
}
.st-check i {
  font: 9px var(--mono);
  font-style: normal;
  padding: 2px 6px;
  border-radius: 999px;
}
.st-check .ok {
  background: var(--st-okbg);
  color: var(--st-ok);
}
.st-check .warn {
  background: var(--st-warnbg);
  color: var(--st-sigink);
}
.st-flag {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgb(255 90 31 / 0.5);
  background: var(--st-warnbg);
  border-radius: 8px;
  font-size: 11px;
}
.st-flag em {
  color: var(--st-muted);
  font-style: normal;
}
.st-suggest {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--st-line);
  border-radius: 8px;
  font-size: 11px;
  color: var(--st-ink2);
}
.st-suggest b {
  color: var(--st-ink);
}
.st-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}
.st-metrics div {
  display: flex;
  flex-direction: column;
}
.st-metrics b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.st-metrics .up {
  color: var(--st-ok);
}
.st-metrics span {
  font: 9px var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--st-faint);
}

/* ---------- Already built: real examples, drifting past ---------- */
.built {
  padding: clamp(72px, 9vw, 120px) 0 clamp(56px, 6vw, 80px);
  border-top: 1px solid var(--hair);
  overflow: hidden;
}
.built-head {
  max-width: var(--max);
  margin: 0 auto clamp(36px, 4vw, 56px);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(20px, 5vw, 64px);
  align-items: end;
}
.built-head h2 {
  margin: 12px 0 0;
  font-size: clamp(34px, 4vw, 60px);
  text-wrap: balance;
}
.built-head p {
  margin: 0;
  font-size: clamp(17px, 1.3vw, 19px);
  color: var(--dim);
}
.specimens {
  list-style: none;
  margin: 0;
  padding: 0 var(--gutter);
  display: flex;
  gap: 24px;
  width: max-content;
}
.specimen {
  flex: none;
  width: min(var(--w), 86vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.specimen-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  font-size: 15px;
}
.specimen-link:hover .specimen-ask {
  color: var(--signal-ink);
}
.specimen-ask::before {
  content: "“";
}
.specimen-ask::after {
  content: "”";
}
.specimen-pack {
  font: 11px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.specimen-frame {
  height: 400px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--pxd-color-surface-default);
  box-shadow: var(--shadow);
  -webkit-mask-image: linear-gradient(#000 78%, transparent);
  mask-image: linear-gradient(#000 78%, transparent);
}
.specimen-frame .pxd-surface {
  min-height: 100%;
}
.built-note {
  max-width: var(--max);
  margin: clamp(28px, 3vw, 40px) auto 0;
  padding: 0 var(--gutter);
  font-size: 15px;
}
.built-note a {
  color: var(--dim);
  text-decoration: none;
}
.built-note a:hover {
  color: var(--signal-ink);
}
.motion .specimens {
  animation: drift var(--drift-time, 90s) linear infinite;
}
.motion .specimens:hover,
.motion .specimens:focus-within {
  animation-play-state: paused;
}
@keyframes drift {
  to {
    transform: translateX(calc(-1 * var(--drift, 0px)));
  }
}
html:not(.motion) .specimens {
  width: auto;
  overflow-x: auto;
  padding-bottom: 16px;
}

/* ---------- Starting states, only when motion will run ---------- */
.motion .act > * {
  opacity: 0;
  transform: translateY(14px);
}
.motion .act h1 {
  opacity: 1;
  transform: none; /* its words are animated individually */
}
.motion .act:not(.is-current) {
  position: absolute;
  inset: 0;
  justify-content: center;
  opacity: 0;
}
.motion .act.is-current {
  position: relative;
  min-height: 60vh;
  justify-content: center;
}
.motion .studio-words > *,
.motion .studio-shell,
.motion .stat,
.motion .built-head > *,
.motion .cta > div,
.motion .waitlist {
  opacity: 0;
  transform: translateY(16px);
}
.motion {
  scroll-behavior: auto; /* Lenis owns the scroll. */
}
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-stopped {
  overflow: clip;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* ---------- Without motion: the chapters stack, the card sits once at the top ---------- */
html:not(.motion) .story-pin {
  display: block;
  padding-block: clamp(40px, 6vw, 80px);
}
html:not(.motion) .rail,
html:not(.motion) .scroll-hint,
html:not(.motion) .packname,
html:not(.motion) .plate,
html:not(.motion) .layers,
html:not(.motion) .sketch,
html:not(.motion) .leaders,
html:not(.motion) .chips,
html:not(.motion) .ghost,
html:not(.motion) .when,
html:not(.motion) .cursor,
html:not(.motion) .stamps,
html:not(.motion) .tree,
html:not(.motion) .same,
html:not(.motion) .agent-line {
  display: none;
}
html:not(.motion) .act {
  padding-block: clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--hair);
}
html:not(.motion) .act:last-child {
  border-bottom: 0;
}
html:not(.motion) .scene {
  position: relative;
  height: auto;
  padding: 24px 24px 64px;
  margin-bottom: 24px;
}
html:not(.motion) .scene > * {
  position: static;
  transform: none;
}
html:not(.motion) .scene .grid,
html:not(.motion) .scene .hud {
  position: absolute;
}
html:not(.motion) .ask {
  display: inline-flex;
  margin-bottom: 20px;
}
html:not(.motion) .slot {
  position: relative;
  width: min(440px, 100%);
  margin: 0 auto;
}

/* ---------- Narrow screens: scene on top, words below, chapters along the bottom ---------- */
@media (max-width: 1100px) {
  .layers {
    display: none;
  }
}
@media (max-width: 1200px) {
  .studio {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .story-pin {
    --rail: 0px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: stretch;
    padding-top: 12px;
    padding-bottom: 56px;
  }
  .scene {
    order: -1;
    height: 52svh;
    min-height: 320px;
  }
  .stack {
    --base: 0.86;
  }
  .st-state {
    display: none;
  }
  .hud {
    gap: 4px 14px;
    padding: 10px 14px;
    font-size: 10px;
  }
  .hud span:nth-child(n + 4) {
    display: none;
  }
  .slot {
    top: 52%;
    width: min(440px, calc(100% - 32px));
  }
  .stage {
    padding: 12px;
  }
  .layers {
    display: none;
  }
  .acts,
  .motion .act.is-current {
    min-height: 0;
  }
  .act {
    gap: 14px;
    padding-bottom: 8px;
  }
  .act h1 {
    font-size: clamp(34px, 9.5vw, 44px);
  }
  .act h2 {
    font-size: clamp(26px, 7vw, 34px);
  }
  .act p,
  .act .lede {
    font-size: 16px;
  }
  .scroll-hint {
    display: none;
  }
  .rail {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: 18px;
    transform: none;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
  }
  .rail a {
    font-size: 10px;
    gap: 6px;
  }
  .ask {
    top: 14px;
    font-size: 14px;
    min-height: 42px;
    padding: 0 14px;
  }
  .packname {
    top: 16px;
    font-size: 24px;
  }
  .stamp {
    font-size: 10px;
    padding: 6px 10px;
  }
  .stamp:nth-child(1),
  .stamp:nth-child(2) {
    right: -6px;
  }
  .stamp:nth-child(3) {
    left: -6px;
  }
  .stamp-signal {
    left: -8px;
  }
  .tree {
    left: 10px;
    right: 10px;
    bottom: 44px;
    font-size: 10px;
    padding: 10px 12px;
  }
  .studio {
    grid-template-columns: 1fr;
  }
  .st-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .st-nav,
  .st-side {
    display: none;
  }
  .built-head {
    grid-template-columns: 1fr;
  }
  .specimen-frame {
    height: 320px;
  }
}
