/* HumanDiT website: calm near-black, one warm accent taken from the pixel town's firelight, Inter throughout. Motion on
   transform and opacity only (no backdrop blur, no animated filters), so the compositor carries every moving layer.
   Colour, type and easing are tokens; every animation has a reduced-motion final state at the end of this file. */

/* Fonts are served with the page (SIL Open Font License, fonts/OFL.txt): no third-party requests, and the page can be
   cross-origin isolated, which the AI's multi-threaded processor fallback needs. Latin subsets of variable fonts. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #0b0c0f;
  --bg-2: #0f1014;
  --panel: #121318;
  --panel-2: #17181e;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ececef;
  --dim: #9b9da6;
  --mute: #6b6d76;
  --soft: #74767f;
  --accent: #f2a65a; /* the firelight in the pixel town */
  --accent-2: #ffcf9a;
  /* older names, kept so every rule follows the new palette */
  --cyan: var(--accent);
  --magenta: #f87171;
  --violet: #8a8c96;
  --green: #4ade80;
  --amber: #f2a65a;
  --red: #f87171;
  --grad: var(--accent);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --nav-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
canvas,
video,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

strong {
  color: #fff;
  font-weight: 600;
}

em {
  font-style: normal;
  color: var(--cyan);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: rgba(242, 166, 90, 0.21);
  color: #fff;
}

.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--cyan);
  color: #0b0c0f;
  border-radius: 8px;
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

/* ------------------------------------------------------------------ type */
.display {
  margin: 0;
  color: #fff;
  font: 650 clamp(42px, 5.4vw, 74px) / 1.02 var(--display);
  letter-spacing: -0.042em;
}

.h2 {
  margin: 0;
  color: #fff;
  font: 650 clamp(30px, 3.6vw, 46px) / 1.08 var(--display);
  letter-spacing: -0.035em;
}

.h3 {
  margin: 0 0 6px;
  color: #fff;
  font: 600 18px/1.3 var(--display);
  letter-spacing: -0.012em;
}

.soft,
.neon {
  color: var(--soft);
}

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker .num {
  color: var(--mute);
}

.lede,
.section-lede {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--dim);
  font-size: clamp(16px, 1.2vw, 17.5px);
  line-height: 1.6;
}

.small {
  margin: 0;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.55;
}

.note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(242, 166, 90, 0.3);
  border-radius: 10px;
  background: rgba(242, 166, 90, 0.06);
  color: var(--accent-2);
  font-size: 13.5px;
}

.field-title,
legend {
  margin: 0 0 10px;
  padding: 0;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

/* split headings: each word rises out of its own mask */
[data-split] .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

[data-split] .w > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0s) + var(--i) * 40ms);
}

[data-split].in .w > span {
  transform: none;
}

/* reveal on view */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font: 550 15px/1 var(--body);
  letter-spacing: -0.005em;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s,
    opacity 0.2s;
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.btn-primary {
  border-color: #f4f4f5;
  background: #f4f4f5;
  color: #0b0c0f;
}

.btn-primary:hover {
  border-color: #fff;
  background: #fff;
}

.btn-primary:hover svg {
  transform: translateX(2px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

.btn-wide {
  width: 100%;
}

.btn[disabled],
.btn.busy {
  cursor: progress;
}

.btn.busy {
  opacity: 0.85;
}

.btn.busy::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 40%;
  background: currentColor;
  opacity: 0.55;
  animation: btnbar 1.1s var(--ease-io) infinite;
}

@keyframes btnbar {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

/* ------------------------------------------------------------------ layout helpers */
.section {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(88px, 12vh, 136px) var(--gutter) 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: clamp(18px, 2.2vw, 24px);
}

.corner,
.scanline {
  display: none;
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  overflow-x: clip; /* the glow behind the face may spread, but never widens the page */
  display: flex;
  flex-direction: column;
  max-width: var(--wrap);
  min-height: min(100svh, 940px);
  margin: 0 auto;
  padding: 26px var(--gutter) 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  color: #fff;
  font: 650 17px/1 var(--display);
  letter-spacing: -0.02em;
}

.wordmark-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(36px, 6vh, 72px) 0;
}

.hero-copy .lede {
  max-width: 31em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.gpu-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

.gpu-strip-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--accent);
}

.gpu-strip-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.gpu-strip-text b {
  color: var(--text);
  font-weight: 600;
}

.gpu-strip-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 550;
  white-space: nowrap;
}

.gpu-strip-go svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.3s var(--ease);
}

.gpu-strip:hover .gpu-strip-go svg {
  transform: translateX(2px);
}

.is-live .gpu-strip-go {
  display: none;
}

.stage {
  position: relative;
  justify-self: end;
  width: min(100%, calc(100svh - 260px), 720px);
  min-width: min(100%, 420px);
  margin: 0;
}

/* the face's own colours, tiny and smoothed, as a soft light behind it */
.stage-glow {
  position: absolute;
  inset: -16% -16% 4%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
  mask-image: radial-gradient(closest-side, #000 30%, transparent);
}

.stage-amb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.6s var(--ease-io);
}

.stage-amb.on {
  opacity: 0.42;
}

.stage-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.stage-canvas {
  width: 100%;
  height: 100%;
  transition: transform 0.45s var(--ease-io);
}

/* while a face holds, it drifts closer, slowly */
.stage-frame.drift .stage-canvas {
  transform: scale(1.045);
  transition: transform 7s linear;
}

.stage-tag {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(11, 12, 15, 0.72);
  color: #fff;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.02em;
}

.stage-cap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.stage-who {
  min-height: 1.4em;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.4;
}

.stage-next {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 10px;
  height: 40px;
  padding: 0 16px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: 550 14px/1 var(--body);
  transition: background-color 0.2s, border-color 0.2s;
}

.stage-next:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.ring {
  width: 22px;
  height: 22px;
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-width: 2.4;
}

.ring .track {
  stroke: rgba(255, 255, 255, 0.14);
}

.ring .fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 56.55;
  stroke-dashoffset: 56.55;
}

/* the ring fills while the face holds: when it closes, the next person forms */
.stage-next.timing .ring .fill {
  animation: ring 6.5s linear forwards;
}

.stage-next.busy .ring {
  animation: spin 0.9s linear infinite;
}

.stage-next.busy .ring .fill {
  stroke-dashoffset: 38;
}

@keyframes ring {
  to { stroke-dashoffset: 0; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
}

.stat dt {
  color: #fff;
  font: 650 clamp(26px, 2.6vw, 34px) / 1 var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat dt small {
  margin-left: 3px;
  color: var(--dim);
  font: 500 14px var(--body);
  letter-spacing: 0;
}

.stat dd {
  max-width: 26ch;
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.45;
}

/* the pixel town: a framed band of its own, with nothing over it */
.band {
  position: relative;
  height: clamp(240px, 30vw, 420px);
  border-block: 1px solid var(--line);
  overflow: hidden;
}

.how-frame {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.how-canvas {
  width: 100%;
  height: 100%;
  border-radius: 11px;
}

.how-hud {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font: 500 12px/1 var(--mono);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.how-hud b {
  color: #fff;
  font-weight: 600;
}

.how-rail {
  position: relative;
  flex: 1;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.how-rail i {
  position: absolute;
  inset: 0;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* ------------------------------------------------------------------ how it works */
.how {
  position: relative;
  height: 440vh;
  margin-top: clamp(40px, 8vh, 90px);
}

.how-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  padding: var(--nav-h) var(--gutter) 24px;
  overflow: hidden;
}

.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
}

.how-steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  counter-reset: step;
}

.how-steps li {
  position: relative;
  padding: 14px 0 14px 54px;
  counter-increment: step;
  opacity: 0.32;
  transition: opacity 0.5s var(--ease);
}

.how-steps li::before {
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 17px;
  font: 500 12px/1 var(--mono);
  color: var(--dim);
  letter-spacing: 0.1em;
}

.how-steps li::after {
  content: "";
  position: absolute;
  left: 36px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s var(--ease);
}

.how-steps li b {
  display: block;
  font: 700 clamp(18px, 1.7vw, 22px) / 1.2 var(--display);
  color: #fff;
}

.how-steps li span {
  display: block;
  max-width: 420px;
  margin-top: 4px;
  color: var(--dim);
  font-size: 15px;
}

.how-steps li.on {
  opacity: 1;
}

.how-steps li.on::after {
  transform: scaleY(1);
}

.how-stage {
  justify-self: center;
  width: min(100%, 72vh, 560px);
}

.how-tags {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.how-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(242, 166, 90, 0.28);
  border-radius: 999px;
  background: rgba(11, 12, 15, 0.86);
  font: 500 12px/1 var(--mono);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s var(--ease),
    transform 0.5s var(--ease);
}

.how-tag.on {
  opacity: 1;
  transform: none;
}

.how-tag b {
  color: var(--green);
  font-weight: 600;
}

.how-label {
  color: var(--cyan);
}

.how-guess {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 29%;
  margin: 0;
  padding: 5px 5px 7px;
  border: 1px solid rgba(242, 166, 90, 0.28);
  border-radius: 10px;
  background: rgba(11, 12, 15, 0.9);
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.45s var(--ease),
    transform 0.6s var(--ease);
}

.how-guess.on {
  opacity: 1;
  transform: none;
}

.how-guess canvas {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
}

.how-guess figcaption {
  margin-top: 6px;
  font: 500 10.5px/1.2 var(--mono);
  color: var(--dim);
  text-align: center;
}

/* ------------------------------------------------------------------ studio */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.controls {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}

.field {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.legend-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--mute);
  font: 400 12.5px/1.2 var(--body);
  letter-spacing: 0;
  text-transform: none;
}

.k {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-left: 6px;
}

.k-yes { background: var(--cyan); }
.k-no { background: var(--magenta); }

.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 12, 15, 0.6);
}

.seg button {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 10px 8px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--dim);
  transition: color 0.3s;
}

.seg button b {
  font-weight: 600;
  font-size: 14.5px;
}

.seg button small {
  font-size: 11.5px;
  color: var(--mute);
  transition: color 0.3s;
}

.seg button[aria-checked="true"] {
  color: #fff;
}

.seg button[aria-checked="true"] small {
  color: var(--dim);
}

.seg-count button {
  padding: 11px 0;
  font: 600 15px/1 var(--mono);
}

.seg-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--w, 0);
  border: 1px solid rgba(242, 166, 90, 0.35);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(242, 166, 90, 0.112), rgba(255, 255, 255, 0.048));
  transform: translateX(var(--x, 0));
  transition:
    transform 0.55s var(--ease),
    width 0.55s var(--ease);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 21, 27, 0.85);
  color: var(--text);
  font-size: 13.5px;
  transition:
    border-color 0.25s,
    background-color 0.25s,
    color 0.25s,
    transform 0.35s var(--ease);
}

.chip::before {
  content: "";
  width: 0;
  height: 12px;
  margin-left: -6px;
  background: currentColor;
  -webkit-mask: var(--icon) center / 12px 12px no-repeat;
  mask: var(--icon) center / 12px 12px no-repeat;
  transition:
    width 0.3s var(--ease),
    margin 0.3s var(--ease);
}

.chip:hover {
  border-color: var(--line-2);
}

.chip:active {
  transform: scale(0.95);
}

.chip[data-state="yes"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1v10M1 6h10' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  border-color: var(--cyan);
  background: rgba(242, 166, 90, 0.098);
  color: #fff;
}

.chip[data-state="no"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 6h10' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  border-color: var(--magenta);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  text-decoration: line-through;
  text-decoration-color: rgba(248, 113, 113, 0.7);
}

.chip[data-state="yes"]::before,
.chip[data-state="no"]::before {
  width: 12px;
  margin-left: -3px;
}

.chip[data-state="yes"]::before {
  color: var(--cyan);
}

.chip[data-state="no"]::before {
  color: var(--magenta);
}

.btn-make {
  margin-top: 6px;
  height: 58px;
  font-size: 16px;
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 28px;
  margin-bottom: 14px;
}

.results-status {
  flex: 1 1 260px;
  margin: 0;
  color: var(--dim);
  font-size: 15px;
}

.results-status b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.results-tag,
.tag {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: 500 11px/1.35 var(--mono);
  color: var(--dim);
  letter-spacing: 0.04em;
}

.results-tag:empty {
  display: none;
}

.results-tag.live {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--green);
}

.faces {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.faces[data-count="1"] { grid-template-columns: minmax(0, 420px); }
.faces[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.face {
  position: relative;
  margin: 0;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 0.6s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.face.in {
  opacity: 1;
  transform: none;
}

.face-img {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121318;
}

.face-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 1.4s var(--ease);
}

.face.dev .face-img img {
  transform: none;
}

.face:hover .face-img img {
  transform: scale(1.03);
}

/* static on top of each picture: one pre-made 6-frame strip, stepped by transform (no repaint) */
.static {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.1s var(--ease);
}

.static i {
  position: absolute;
  top: 0;
  left: 0;
  width: 600%;
  height: 100%;
  background-image: var(--static, none);
  background-size: 100% 100%;
  animation: static 0.42s steps(6) infinite;
  will-change: transform;
}

@keyframes static {
  to { transform: translateX(-100%); }
}

.face.dev .static,
.gone-static .static {
  opacity: 0;
}

.face.dev .static i {
  animation-play-state: paused;
}

.face-cap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
  margin-top: 9px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  font: 500 11.5px/1 var(--body);
  background: rgba(74, 222, 128, 0.1);
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.mark svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark.bad {
  background: rgba(255, 77, 109, 0.1);
  color: #ffb3c1;
  border-color: rgba(255, 77, 109, 0.35);
}

.mark.sees {
  background: none;
  border-color: var(--line);
  color: var(--dim);
}

.mark.label {
  padding-left: 0;
  border-color: transparent;
  background: none;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.face-dl {
  position: absolute;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(11, 12, 15, 0.82);
  color: #fff;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.3s,
    transform 0.4s var(--ease);
}

.face-dl svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.face:hover .face-dl,
.face-dl:focus-visible {
  opacity: 1;
  transform: none;
}

.face-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(11, 12, 15, 0.8);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ------------------------------------------------------------------ speed race */
.race-head,
.race-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.race-head {
  margin-bottom: 18px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.race-hw {
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--mute);
}

.race-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.race-foot .small {
  max-width: 560px;
}

.lane {
  display: grid;
  grid-template-columns: 72px 150px minmax(0, 1fr) 88px;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.064);
}

.lane:last-child {
  border-bottom: 0;
}

.lane-img {
  position: relative;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121318;
}

.lane-img img {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.15);
  transition:
    opacity 0.5s var(--ease),
    transform 0.8s var(--ease);
}

.lane.done .lane-img img {
  opacity: 1;
  transform: none;
}

.lane-name b {
  display: block;
  font: 700 17px/1.2 var(--display);
}

.lane-name span {
  font-size: 12.5px;
  color: var(--dim);
}

.lane-bars {
  display: grid;
  gap: 8px;
}

.track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.056);
}

.track i {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.track.gap {
  height: 5px;
}

.track.gap i {
  background: linear-gradient(90deg, #6b6d76, #9b9da6);
}

.track.gap.best i {
  background: linear-gradient(90deg, #22c55e, var(--green));
}

.lane-nums {
  text-align: right;
  font: 600 16px/1.25 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lane-nums small {
  display: block;
  font: 500 11.5px/1.3 var(--mono);
  color: var(--dim);
}

/* ------------------------------------------------------------------ AI check */
.check-grid {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.drop {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px dashed rgba(242, 166, 90, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 32px 32px,
    #0e0f12;
  cursor: pointer;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.drop:hover,
.drop.over {
  border-color: var(--cyan);
}

.drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.drop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0e0f12;
}

.drop-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 14px;
}

.drop-empty b {
  color: #fff;
  font-size: 17px;
}

.drop-empty svg {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(242, 166, 90, 0.084) 1px, transparent 1px) 0 0 / 100% 16px;
  transition: opacity 0.3s;
}

.scan i {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--cyan);
 166, 90, 0.49),
    0 0 60px 16px rgba(242, 166, 90, 0.175);
}

.drop.scanning .scan {
  opacity: 1;
}

.drop.scanning .scan i {
  animation: laser 1.3s var(--ease-io) infinite alternate;
}

@keyframes laser {
  from { transform: translateY(0); }
  to { transform: translateY(var(--h, 440px)); }
}

.stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 12px 18px;
  border: 3px solid currentColor;
  border-radius: 10px;
  background: rgba(11, 12, 15, 0.82);
  font: 800 clamp(16px, 2.2vw, 24px) / 1.1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-8deg) scale(1.8);
  pointer-events: none;
}

.stamp.yes {
  color: var(--green);
}

.stamp.no {
  color: var(--red);
}

.stamp.show {
  animation: stamp 0.5s var(--ease) forwards;
}

@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1.8); }
  60% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(0.94); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
}

.examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.example {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(20, 21, 27, 0.8);
  text-align: left;
  font-size: 13px;
  color: var(--dim);
  transition:
    border-color 0.25s,
    transform 0.4s var(--ease);
}

.example img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.example:hover {
  border-color: var(--cyan);
  transform: translateY(-3px);
}

.verdict {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 12, 15, 0.5);
  transition:
    border-color 0.4s,
    background-color 0.4s;
}

.verdict-title {
  margin: 0 0 6px;
  font: 700 19px/1.3 var(--display);
}

.verdict.yes {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.06);
}

.verdict.yes .verdict-title {
  color: var(--green);
}

.verdict.no {
  border-color: rgba(255, 77, 109, 0.5);
  background: rgba(255, 77, 109, 0.06);
}

.verdict.no .verdict-title {
  color: var(--red);
}

/* ------------------------------------------------------------------ numbers */
.arch {
  margin-bottom: 20px;
  overflow-x: auto;
}

.arch-svg {
  width: 100%;
  min-width: 720px;
  height: auto;
}

.arch-lines path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s var(--ease);
  transition-delay: calc(0.4s + var(--i, 0) * 0.18s);
}

.arch.in .arch-lines path {
  stroke-dashoffset: 0;
}

.arch-nodes rect {
  fill: rgba(18, 19, 24, 0.95);
  stroke: rgba(242, 166, 90, 0.315);
  stroke-width: 1;
}

.arch-nodes rect.ghost {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-dasharray: 4 4;
}

.arch-nodes text {
  fill: #fff;
  font: 700 15px var(--display);
  text-anchor: middle;
}

.arch-nodes text.sub {
  fill: var(--dim);
  font: 500 11.5px var(--mono);
}

.arch-nodes g {
  opacity: 0;
  transition: opacity 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.15s);
}

.arch.in .arch-nodes g {
  opacity: 1;
}

.numbers-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 20px;
  align-items: start;
}

.score-rows {
  margin-top: 18px;
}

.srow {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr) 60px;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
}

.srow-name {
  font-size: 14px;
  line-height: 1.3;
}

.srow-name small {
  display: block;
  color: var(--mute);
  font: 500 11px/1.4 var(--mono);
}

.srow-name em {
  display: inline-block;
  white-space: nowrap;
  font: 500 10.5px/1 var(--mono);
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(242, 166, 90, 0.28);
  border-radius: 999px;
}

.srow .track i {
  background: linear-gradient(90deg, #3a3c44, #6b6d76);
  transition: transform 1.3s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.srow.live .track i {
  background: var(--grad);
}

.srow.best .track i {
  background: linear-gradient(90deg, #22c55e, var(--green));
}

.srow b {
  text-align: right;
  font: 600 14px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.srow.best b {
  color: var(--green);
}

.fact-list {
  display: grid;
  gap: 0;
  margin: 16px 0 22px;
}

.fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.056);
}

.fact dt {
  color: var(--dim);
  font-size: 14px;
}

.fact dd {
  margin: 0;
  font: 600 16px/1 var(--mono);
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.links {
  display: grid;
  gap: 8px;
}

.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  transition:
    border-color 0.25s,
    transform 0.4s var(--ease);
}

.link::after {
  content: "";
  width: 8px;
  height: 8px;
  border: solid var(--cyan);
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
}

.link:hover {
  border-color: var(--cyan);
  transform: translateX(3px);
}

/* ------------------------------------------------------------------ footer */
.footer {
  margin-top: clamp(110px, 16vh, 180px);
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(60px, 10vh, 110px) var(--gutter) 48px;
}

.footer-big {
  margin: 0 0 24px;
  color: #fff;
  font: 650 clamp(36px, 5.4vw, 72px) / 1.02 var(--display);
  letter-spacing: -0.042em;
}

.footer .small {
  max-width: 760px;
}

.footer-meta {
  margin-top: 26px !important;
  font-family: var(--mono) !important;
  color: var(--mute) !important;
}

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  max-width: min(560px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid rgba(255, 194, 75, 0.45);
  border-radius: 12px;
  background: rgba(24, 20, 14, 0.96);
  color: #ffcf9a;
  font-size: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 0);
  animation: toast-in 0.5s var(--ease);
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
}

/* ------------------------------------------------------------------ pixel-art scenes (js/pixel.js) */
.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #08090b;
  pointer-events: none;
}

/* whole-number scaling with nearest-neighbour sampling: every art pixel stays a crisp square */
.pixel-canvas {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.footer {
  position: relative;
  overflow: hidden;
}

/* the page ends on the town: a full-width street under the footer's words */
.footer-town {
  position: relative;
  height: min(78svh, 760px);
  min-height: 420px;
}

.footer-town::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 45%;
  background: linear-gradient(to bottom, var(--bg), transparent);
  pointer-events: none;
}

/* ------------------------------------------------------------------ live mode: the floating status */
.live-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 6px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: rgba(14, 15, 19, 0.94);
  box-shadow: 0 16px 44px -14px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--dim);
  font: 500 13px/1 var(--body);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease), border-color 0.3s;
}

.live-pill.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.live-pill:hover {
  border-color: rgba(242, 166, 90, 0.35);
  color: #fff;
}

.engine-text {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engine-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
}

.engine-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
}

[data-state="loading"] > .engine-dot {
  background: var(--amber);
  color: var(--amber);
}

[data-state="ready"] > .engine-dot {
  background: var(--green);
  color: var(--green);
}

[data-state="busy"] > .engine-dot {
  background: var(--cyan);
  color: var(--cyan);
}

[data-state="loading"] > .engine-dot::after,
[data-state="busy"] > .engine-dot::after {
  animation: ping 1.4s var(--ease) infinite;
}

@keyframes ping {
  from { transform: scale(0.6); opacity: 0.9; }
  to { transform: scale(2); opacity: 0; }
}

.live-pill-go {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px 0 10px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--grad);
  color: #0b0c0f;
  font-weight: 650;
}

.is-live .live-pill-go,
.is-live .nudge,
.is-live .live-go-only {
  display: none;
}

.live-pill svg,
.nudge svg,
.live-device-icon svg,
.ladder-go svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nudge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 13px;
  border: 1px dashed rgba(242, 166, 90, 0.266);
  border-radius: 10px;
  background: rgba(242, 166, 90, 0.035);
  color: var(--cyan);
  font: 500 13px/1 var(--body);
  transition: background 0.3s, border-color 0.3s;
}

.nudge:hover {
  border-style: solid;
  background: rgba(242, 166, 90, 0.07);
}

/* ------------------------------------------------------------------ the speed ladder: faces a minute, per device */
.ladder {
  margin-top: 22px;
  padding: clamp(20px, 3vw, 30px);
}

.ladder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.ladder-head .small {
  max-width: 560px;
  margin-top: 6px;
}

.ladder-go {
  flex: none;
}

.ladder-rows {
  display: grid;
  gap: 14px;
}

.lrow {
  display: grid;
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr) 118px;
  align-items: center;
  gap: 16px;
}

.lrow-name b {
  display: block;
  color: #fff;
  font: 600 14px/1.3 var(--body);
}

.lrow-name small {
  color: var(--dim);
  font-size: 12px;
}

.lrow-track {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.048);
}

.lrow-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--ease);
}

.lrow-num {
  text-align: right;
  color: #fff;
  font: 600 16px/1.1 var(--mono);
}

.lrow-num small {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font: 400 11px/1 var(--mono);
}

.lrow.you .lrow-name b {
  color: var(--green);
}

.lrow.you .lrow-track {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
}

.lrow.you .lrow-track i {
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

/* ------------------------------------------------------------------ the live-mode dialog */
dialog.live {
  width: min(660px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100% - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

dialog.live::backdrop {
  background: rgba(5, 5, 7, 0.82);
}

.live-box {
  position: relative;
  max-height: calc(100svh - 24px);
  overflow: auto;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.128);
  border-radius: 20px;
  background: linear-gradient(180deg, #15161b, #101115);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

dialog.live[open] .live-box {
  animation: pop 0.55s var(--ease);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
}

.live-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--dim);
}

.live-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.live-close:hover {
  color: #fff;
  border-color: var(--line-2);
}

.live-title {
  margin: 8px 0 10px;
  color: #fff;
  font: 800 clamp(24px, 3.6vw, 34px) / 1.05 var(--display);
}

.live-lede {
  margin: 0;
  color: var(--dim);
}

.live-lede b {
  color: #fff;
}

.live-device {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 19, 24, 0.7);
}

.live-device-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(242, 166, 90, 0.07);
  color: var(--cyan);
}

.live-device-icon svg {
  width: 24px;
  height: 24px;
}

.live-device-name {
  margin: 0;
  color: #fff;
  font-weight: 600;
}

.live-device-note {
  margin: 4px 0 0;
}

.live-ladder .lrow {
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 100px;
  gap: 12px;
}

.live-wait {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(242, 166, 90, 0.196);
  border-radius: 14px;
  background: rgba(242, 166, 90, 0.028);
}

.live-wait-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #fff;
  font-weight: 700;
}

.live-wait-clock {
  margin-left: auto;
  color: var(--dim);
  font: 500 13px var(--mono);
}

.spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(242, 166, 90, 0.175);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.live-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.live-steps li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 14px;
}

.ls-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line-2);
  border-radius: 50%;
}

.live-steps li[data-state="doing"] {
  color: #fff;
}

.live-steps li[data-state="doing"] .ls-dot {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(242, 166, 90, 0.105);
  animation: breathe 1.2s ease-in-out infinite;
}

.live-steps li[data-state="done"] .ls-dot {
  border-color: #4ade80;
  background: #4ade80;
}

@keyframes breathe {
  50% { box-shadow: 0 0 0 7px rgba(242, 166, 90, 0.035); }
}

.ls-info {
  font: 500 12.5px var(--mono);
  color: var(--dim);
}

.live-tip {
  margin: -8px 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 194, 75, 0.35);
  border-radius: 14px;
  background: rgba(255, 194, 75, 0.05);
}

.live-tip-title {
  margin: 0 0 6px;
  color: #ffcf9a;
  font-weight: 600;
}

.live-tip p.small {
  margin: 0;
}

.live-tip ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

.live-tip li + li {
  margin-top: 4px;
}

.live-tip b {
  color: #fff;
  font-weight: 600;
}

.live-store {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.live-store .field-title {
  margin: 0 0 6px;
}

.live-store-what,
.live-store-how {
  margin: 0;
}

.live-path {
  display: block;
  margin: 10px 0;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 11, 14, 0.8);
  color: #e4e4e7;
  font: 500 12.5px / 1.5 var(--mono);
  user-select: all;
}

.live-remove {
  margin-top: 14px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: #fff;
}

.live-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.live-bar i {
  display: block;
  height: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s linear;
}

.live-progress-text {
  margin: 10px 0 0;
}

.live-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.live-size {
  margin: 0;
}

/* the browser flag that moves a laptop onto its graphics card, ready to copy */
.flag {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.flag code {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 5, 7, 0.6);
  color: #fff;
  font: 500 12px/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.flag-copy {
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: 550 12px/1.4 var(--body);
}

/* a phone without WebGPU: no live-mode invitations it can't take up */
.no-live .live-pill-go,
.no-live .gpu-strip-go,
.no-live .nudge,
.no-live .ladder-go {
  display: none;
}

/* a button that cancels while the AI works */
.btn.cancelling {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.btn.cancelling svg {
  width: 13px;
  height: 13px;
}

/* the not-found page */
.missing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding-bottom: 80px;
}

.missing .wordmark {
  margin-bottom: 48px;
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .hero-grid,
  .how-grid,
  .studio-grid,
  .check-grid,
  .numbers-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* phones and tablets: the face first, as large as the screen allows */
  .hero {
    min-height: 0;
  }

  .hero-grid {
    gap: 28px;
    padding-top: 22px;
  }

  .stage {
    order: -1;
    justify-self: center;
    width: min(100%, 560px);
    min-width: 0;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .how-sticky {
    align-items: flex-start;
    padding-top: calc(var(--nav-h) + 12px);
  }

  .how-copy .h2 {
    font-size: clamp(26px, 6vw, 40px);
  }

  .how-steps {
    margin-top: 16px;
  }

  .how-steps li {
    display: none;
    padding: 6px 0 0 44px;
  }

  .how-steps li.on {
    display: block;
  }

  .how-steps li::after {
    left: 30px;
  }

  .how-stage {
    width: min(100%, 52vh, 440px);
  }

  .controls {
    position: static;
  }

}

@media (max-width: 640px) {
  .live-pill .engine-text {
    max-width: 120px;
  }

  /* on a phone the pill is one small button until the AI is starting or running */
  .live-pill[data-state="saved"] .engine-dot,
  .live-pill[data-state="saved"] .engine-text {
    display: none;
  }

  .gpu-strip-go {
    display: none;
  }

  .lrow,
  .live-ladder .lrow {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .lrow-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .ladder-head {
    flex-direction: column;
  }

  .faces,
  .faces[data-count="8"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faces[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .lane {
    grid-template-columns: 56px minmax(0, 1fr) 76px;
    gap: 12px;
  }

  .lane-img {
    width: 56px;
    height: 56px;
  }

  .lane-nums {
    font-size: 14px;
  }

  .lane-bars {
    grid-column: 1 / -1;
  }

  .srow {
    grid-template-columns: minmax(0, 1fr) 56px;
  }

  .srow .track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .scroll-cue {
    display: none;
  }
}

/* ------------------------------------------------------------------ reduced motion: every final state, still */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }

  [data-reveal],
  [data-split] .w > span,
  .face {
    opacity: 1;
    transform: none;
  }

  .intro,
  .grain,
  .scanline,
  .scroll-cue {
    display: none;
  }

  .ticker-track {
    animation: none !important;
  }
}
