/* Prenup keeps the Ordoverse base and swaps in its own blue-to-violet light. */
.prenup {
  --accent: #8b7bff;
  --glow: 125, 92, 255;
  --p-blue: #0071e3;
  --p-violet: #7d5cff;
  --p-pink: #bf5af2;
  --p-grad: linear-gradient(100deg, #3d8bff 0%, var(--p-violet) 55%, var(--p-pink) 100%);
  --ok: #4ade80;
  --bad: #ff6b6b;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .logo img { height: 22px; }

.by {
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  color: var(--faint);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.by:hover { color: var(--text); }

.grad {
  background: var(--p-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;
}

.lights {
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 30px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 15px 0 0 #febc2e, 30px 0 0 #28c840;
}

/* Hero */

.p-hero { padding: 112px 0 0; }

.p-hero::after { height: 260px; }

.aurora {
  position: absolute;
  inset: -20% -10% auto;
  height: 900px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(36% 44% at 28% 38%, rgba(0, 113, 227, 0.3), transparent 74%),
    radial-gradient(34% 42% at 72% 34%, rgba(191, 90, 242, 0.22), transparent 74%),
    radial-gradient(44% 54% at 50% 70%, rgba(125, 92, 255, 0.26), transparent 74%);
}

.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 50% 0 / 64px 64px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 50% 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(50% 45% at 50% 40%, #000, transparent);
  mask-image: radial-gradient(50% 45% at 50% 40%, #000, transparent);
}

/* The drift only runs on larger screens; on phones the glow stays still. */
@media (prefers-reduced-motion: no-preference) and (min-width: 761px) {
  .aurora { animation: drift 18s ease-in-out infinite alternate; }

  @keyframes drift {
    to { transform: translate3d(0, 30px, 0) scale(1.06) rotate(2deg); }
  }
}

.hero-stage {
  position: relative;
  z-index: 2;
  margin-top: 72px;
  perspective: 2000px;
}

/* Glow pooled under the screen: soft gradients instead of a live blur filter. */
.hero-stage::before {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 0;
  bottom: -12%;
  z-index: -1;
  background:
    radial-gradient(34% 46% at 26% 58%, rgba(0, 113, 227, 0.4), transparent 72%),
    radial-gradient(40% 50% at 50% 62%, rgba(125, 92, 255, 0.42), transparent 72%),
    radial-gradient(34% 46% at 76% 58%, rgba(191, 90, 242, 0.36), transparent 72%);
  opacity: 0.85;
}

.hero-shot {
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  /* --lay goes 0 → 1 as the page scrolls (set by prenup.js); the screen tips back, then lies flat. */
  transform: rotateX(calc((1 - var(--lay, 0.6)) * 24deg)) scale(calc(0.9 + var(--lay, 0.6) * 0.1));
  transform-origin: center top;
  will-change: transform;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 40px 100px -20px rgba(0, 0, 0, 0.8);
}

.hero-shot img { width: 100%; height: auto; }

.chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
  background: #ececef;
  border-bottom: 1px solid #dcdce1;
}

.url {
  flex: 0 1 320px;
  margin-inline: auto;
  padding: 4px 12px;
  border-radius: 8px;
  background: #fff;
  color: #6b6b75;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-22px);
}

/* Stats */

.stats {
  position: relative;
  z-index: 3;
  padding: 72px 0 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-grid li { padding: 34px 28px 32px; }

.stat-grid li + li { border-left: 1px solid var(--line); }

.stat-grid strong {
  display: block;
  font-size: clamp(42px, 5vw, 60px);
  font-weight: 560;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-grid strong span {
  background: var(--p-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-grid li > span {
  display: block;
  margin-top: 14px;
  max-width: 24ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* The run */

.stage-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: start;
  margin-top: 64px;
}

.stage-visual {
  position: sticky;
  top: calc(var(--header) + 20px);
  min-width: 0;
}

.boardwin {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #0b0b0e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 120px -20px rgba(var(--glow), 0.35);
}

.boardwin-top {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12.5px;
}

.boardwin-logo { height: 13px; width: auto; }

.boardwin-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.boardwin-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.boardwin-body {
  position: relative;
  height: 430px;
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(var(--glow), 0.09), transparent 70%),
    #0b0b0e;
}

/* Each scene: a fixed header, then its content centred in what is left. */
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 22px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.45;
}

.panel[hidden] { display: none; }

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.badge {
  overflow: hidden;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  padding-top: 14px;
}

.thread, .terms { display: grid; gap: 8px; }

.card, .term {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #16161b;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card strong,
.term strong { font-weight: 560; letter-spacing: -0.015em; }

.card p,
.term em,
.quiet {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.quiet { margin-top: 14px; text-align: center; }

.pid {
  color: #7fb2ff;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* Conflict: two companies reaching for one researcher. */
.versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.versus .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 132px;
}

.versus strong { margin-top: 6px; font-size: 15px; }

.versus .card p { margin-top: 0; }

.is-holder {
  border-color: rgba(61, 139, 255, 0.45);
  background: linear-gradient(180deg, rgba(61, 139, 255, 0.12), #16161b 70%);
}

.is-loser { border-color: rgba(255, 107, 107, 0.3); }

.chip {
  position: relative;
  padding: 5px 12px;
  border: 1px solid rgba(var(--glow), 0.5);
  border-radius: 999px;
  background: #1c1c22;
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: 0 0 24px rgba(var(--glow), 0.35);
}

.tag {
  margin-top: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 560;
}

.tag-ok { background: rgba(74, 222, 128, 0.12); color: var(--ok); }

.tag-bad { background: rgba(255, 107, 107, 0.12); color: var(--bad); }

.log {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  list-style: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.log li {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.8fr 14px;
  gap: 10px;
  padding: 3px 0;
}

.log li span:first-child { color: var(--soft); }

.log b { font-weight: 500; text-align: right; }

.log .yes { color: var(--ok); }

.log .no { color: var(--bad); }

/* Arbiter */
.verdict {
  border-color: rgba(var(--glow), 0.35);
  background: linear-gradient(180deg, rgba(var(--glow), 0.12), #16161b 70%);
}

.verdict h3 {
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.verdict > p:not(.kicker) { margin-top: 8px; }

.kicker {
  color: #b3a8ff !important;
  font-family: var(--mono);
  font-size: 11px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px 1fr 34px;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.bar-row i {
  height: 8px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, #3d8bff, var(--p-violet)) 0 0 / calc(var(--v) * 100%) 100% no-repeat,
    rgba(255, 255, 255, 0.06);
}

.bar-row b { color: var(--text); font-weight: 500; text-align: right; }

.checked {
  display: inline-flex;
  margin-top: 14px !important;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px !important;
}

.ok {
  margin-top: 14px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 520;
}

.ok::before { content: "✓ "; }

/* Negotiation */
.bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 16px;
}

.bubble p { font-size: 13.5px; line-height: 1.45; }

.from-co {
  justify-self: start;
  background: #1c1c22;
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}

.from-lab {
  justify-self: end;
  background: linear-gradient(135deg, #1677ff, #3d6bff);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.who {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.66;
}

.panel[data-panel="terms"] .ok { text-align: center; }

/* Decision */
.term {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.term > span {
  flex: none;
  width: 92px;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.6;
}

.term em { display: block; font-style: normal; }

.is-edited {
  border-color: rgba(61, 139, 255, 0.4);
  background: rgba(61, 139, 255, 0.1);
}

.is-refused {
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
}

.is-refused strong { text-decoration: line-through; text-decoration-color: rgba(255, 107, 107, 0.6); }

.is-refused em { color: #ffb4b4; }

.decide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 16px;
}

.approve,
.reject {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 560;
  transition: filter 0.2s ease, transform 0.2s var(--ease), background-color 0.2s ease;
}

.approve {
  border: 0;
  background: linear-gradient(135deg, #1677ff, var(--p-violet));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(61, 107, 255, 0.8);
}

.approve:hover { filter: brightness(1.1); }

.reject {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--soft);
}

.reject:hover { background: rgba(255, 255, 255, 0.05); }

.approve:active,
.reject:active { transform: scale(0.98); }

.decided {
  display: none;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 560;
}

.decided-approved { background: rgba(74, 222, 128, 0.12); color: var(--ok); }

.decided-rejected { background: rgba(255, 255, 255, 0.06); color: var(--soft); }

.decide.is-approved button,
.decide.is-rejected button { display: none; }

.decide.is-approved .decided-approved,
.decide.is-rejected .decided-rejected { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  .decided { animation: bubble-in 0.4s var(--ease) both; }
}

/* No match */
.flag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.12);
  color: var(--bad);
  font-size: 11.5px;
  font-weight: 560;
  white-space: nowrap;
}

.reason {
  margin-top: 10px;
  padding: 14px 16px;
  border-left: 2px solid rgba(var(--glow), 0.7);
  border-radius: 0 12px 12px 0;
  background: rgba(var(--glow), 0.07);
}

.reason p {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.5;
}

/* Scene entrances */
@media (prefers-reduced-motion: no-preference) {
  .panel.is-on .scene > * { animation: bubble-in 0.55s var(--ease) both; }
  .panel.is-on .scene > *:nth-child(2) { animation-delay: 0.12s; }
  .panel.is-on .scene > *:nth-child(3) { animation-delay: 0.24s; }
  .panel.is-on .appbar { animation: bubble-in 0.4s var(--ease) both; }

  .panel.is-on .versus .is-holder { animation: from-left 0.6s var(--ease) both; }
  .panel.is-on .versus .is-loser { animation: from-right 0.6s var(--ease) 0.25s both; }
  .panel.is-on .versus .tag-bad { animation: shake 0.45s ease 0.9s both; }
  .panel.is-on .log li:nth-child(2) { animation: bubble-in 0.4s var(--ease) 0.6s both; }

  .panel.is-on .bar-row i { animation: grow 1s var(--ease) 0.35s both; }

  .panel[data-panel="terms"].is-on .scene > * { animation: none; }
  .panel[data-panel="terms"].is-on .bubble { animation: bubble-in 0.5s var(--ease) both; }
  .panel[data-panel="terms"].is-on .bubble:nth-child(2) { animation-delay: 0.45s; }
  .panel[data-panel="terms"].is-on .bubble:nth-child(3) { animation-delay: 0.9s; }
  .panel[data-panel="terms"].is-on .bubble:nth-child(4) { animation-delay: 1.35s; }
  .panel[data-panel="terms"].is-on .ok { animation: bubble-in 0.5s var(--ease) 1.8s both; }

  @keyframes bubble-in {
    from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.98); }
  }

  @keyframes from-left {
    from { opacity: 0; transform: translate3d(-24px, 0, 0); }
  }

  @keyframes from-right {
    from { opacity: 0; transform: translate3d(24px, 0, 0); }
  }

  @keyframes shake {
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
  }

  @keyframes grow {
    from { background-size: 0 100%, auto; }
  }
}

/* Story-style progress: one segment per moment, filling while the run plays. */
.boardwin-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 16px 0 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.play {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  transition: transform 0.2s var(--ease);
}

.play:active { transform: scale(0.94); }

.play svg { width: 14px; height: 14px; }

.play .when-playing { display: none; }
.play[aria-pressed="true"] .when-paused { display: none; }
.play[aria-pressed="true"] .when-playing { display: block; }

.segs {
  display: flex;
  flex: 1;
  gap: 6px;
}

.seg {
  position: relative;
  flex: 1;
  height: 24px;
  border: 0;
  background: transparent;
}

.seg::before,
.seg::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.seg::after {
  background: var(--p-grad);
  background-size: 500% 100%;
  transform: scaleX(0);
  transform-origin: left;
}

.seg:nth-child(2)::after { background-position: 25% 0; }
.seg:nth-child(3)::after { background-position: 50% 0; }
.seg:nth-child(4)::after { background-position: 75% 0; }
.seg:nth-child(5)::after { background-position: 100% 0; }

.seg.is-past::after,
.seg[aria-selected="true"]::after { transform: scaleX(1); }

.is-playing .seg[aria-selected="true"]::after {
  animation: fill var(--dwell, 5000ms) linear both;
}

@keyframes fill { from { transform: scaleX(0); } }

.seg:hover::before { background: rgba(255, 255, 255, 0.24); }

.seg-count {
  flex: none;
  min-width: 28px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#seg-now { color: var(--text); }

/* Chapters */
.chapters {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.chapter {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  width: 100%;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--faint);
  text-align: left;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.chapter:hover { color: var(--text); }

.chapter-title {
  display: block;
  font-size: 15px;
  font-weight: 540;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.chapter-body {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  transition: max-height 0.45s var(--ease), opacity 0.3s ease, margin-top 0.45s var(--ease);
}

.chapter.is-current {
  border-color: rgba(var(--glow), 0.45);
  background: linear-gradient(180deg, rgba(var(--glow), 0.1), var(--surface) 80%);
  color: var(--text);
}

.chapter.is-current .chapter-body {
  max-height: 140px;
  margin-top: 6px;
  opacity: 1;
}

.idx {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
}

.chapter.is-current .idx { color: #b3a8ff; }

/* How it works: one rail down the page, filled as far as you have read. */

.flow {
  --node: 18px;
  --rail-top: 42px;
  position: relative;
  max-width: 920px;
  margin: 72px auto 0;
  list-style: none;
}

.flow::before,
.flow::after {
  content: "";
  position: absolute;
  left: calc(var(--node) / 2 - 1px);
  top: var(--rail-top);
  width: 2px;
  height: var(--rail-len, calc(100% - 2 * var(--rail-top)));
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

/* --fill is a 0–1 ratio from site.js; scaling (not resizing) keeps scroll off the layout path. */
.flow::after {
  background: linear-gradient(180deg, #3d8bff, var(--p-violet) 60%, var(--p-pink));
  box-shadow: 0 0 14px rgba(var(--glow), 0.6);
  transform: scaleY(var(--fill, 1));
  transform-origin: top;
  transition: transform 0.2s linear;
}

.flow li {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 210px;
  gap: 0 28px;
  align-items: start;
  padding: 30px 0 30px 54px;
}

.flow li + li { border-top: 1px solid var(--line); }

.flow li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--rail-top) - var(--node) / 2);
  z-index: 1;
  width: var(--node);
  height: var(--node);
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 2px, var(--accent) 3px 5px, var(--bg) 5.5px);
  box-shadow: 0 0 0 1px rgba(var(--glow), 0.8), 0 0 0 6px rgba(var(--glow), 0.12), 0 0 22px rgba(var(--glow), 0.55);
  transition: box-shadow 0.4s ease, background 0.4s ease;
}

.flow .num {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--p-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.5s ease;
}

.flow h3 { font-size: 21px; letter-spacing: -0.03em; }

.flow-text p {
  max-width: 46ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
  transition: color 0.5s ease;
}

.emit {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-top: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.emit code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(var(--glow), 0.35);
  border-radius: 999px;
  background: rgba(var(--glow), 0.1);
  color: #d2caff;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  transition: border-color 0.4s ease, background-color 0.4s ease, color 0.4s ease;
}

.emit code::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
}

/* Unreached rows wait in the dark until the rail gets to them. */
.is-tracking > li:not(.is-reached)::before {
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.is-tracking > li:not(.is-reached) .num { opacity: 0.18; }

.is-tracking > li:not(.is-reached) .flow-text p { color: var(--faint); }

.is-tracking > li:not(.is-reached) .emit code {
  border-color: var(--line);
  background: transparent;
  color: var(--faint);
}

.is-tracking > li:not(.is-reached) .emit code::before {
  background: var(--line-strong);
  box-shadow: none;
}

@media (prefers-reduced-motion: no-preference) {
  .is-tracking > li.is-reached .emit code::before { animation: ping 1.8s ease-out 1; }

  @keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.8); }
    100% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  }
}

.built {
  margin-top: 36px;
  color: var(--faint);
  font-size: 14px;
  text-align: center;
}

.built a { color: var(--soft); text-underline-offset: 3px; }

.built a:hover { color: var(--text); }

/* The Critic */

.critic { overflow-x: hidden; overflow-x: clip; }

/* Belt and braces: nothing on this page may widen it sideways. */
.prenup main { overflow-x: clip; }

.critic-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px;
  align-items: center;
}

.critic-copy .intro + .intro { margin-top: 14px; }

.kinds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 32px;
  list-style: none;
}

.kinds li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 14px;
}

.kinds b {
  color: var(--bad);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.critic-visual {
  position: relative;
  min-height: 460px;
  perspective: 1600px;
}

.shot-right {
  left: 4%;
  width: 860px;
  background: #000;
  transform: translateY(-50%) perspective(1600px) rotateY(-14deg) rotateX(3deg);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 60px 140px -40px rgba(255, 107, 107, 0.35);
}

.shot-right::after {
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.1), transparent 35%);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .shot-right {
      animation: settle-right linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 50%;
    }

    @keyframes settle-right {
      from { transform: translateY(-44%) perspective(1600px) rotateY(-30deg) rotateX(8deg) translateX(80px); }
    }
  }
}

/* Principles */

.principles { padding-top: 40px; padding-bottom: 24px; }

.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 56px;
  list-style: none;
}

.rules li {
  padding: 26px;
  border-top: 1px solid rgba(var(--glow), 0.5);
  background: linear-gradient(180deg, rgba(var(--glow), 0.06), transparent 70%);
  border-radius: 2px 2px 0 0;
}

.rules p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* Close */

.close { padding-bottom: 150px; }

.close::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: -1;
  width: min(1100px, 100vw);
  height: 520px;
  transform: translate(-50%, -10%);
  background:
    radial-gradient(40% 60% at 32% 50%, rgba(0, 113, 227, 0.22), transparent 72%),
    radial-gradient(44% 64% at 52% 50%, rgba(125, 92, 255, 0.24), transparent 72%),
    radial-gradient(40% 60% at 70% 50%, rgba(191, 90, 242, 0.2), transparent 72%);
}

.terminal {
  max-width: 560px;
  margin: 36px auto 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(13, 14, 17, 0.9);
  text-align: left;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

.terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--line);
}

.terminal .lights { width: 8px; height: 8px; box-shadow: 13px 0 0 #febc2e, 26px 0 0 #28c840; }

.copy {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.copy:hover { color: var(--text); }

.copy .when-copied { display: none; }
.copy.is-copied { color: var(--ok); border-color: rgba(74, 222, 128, 0.4); }
.copy.is-copied .when-idle { display: none; }
.copy.is-copied .when-copied { display: inline; }

.terminal pre {
  padding: 18px 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.5;
}

.prompt { color: #b3a8ff; margin-right: 8px; user-select: none; }

.close .actions { margin-top: 28px; }

.note {
  max-width: 34rem;
  margin: 22px auto 0;
  color: var(--faint);
  font-size: 13px;
}

.footer-inner > p a { color: var(--soft); }

.prenup .footer-mark {
  aspect-ratio: 934 / 154;
  margin-bottom: calc(min(var(--max), 100vw - 48px) * -0.05);
  -webkit-mask-image: url("logo.svg");
  mask-image: url("logo.svg");
  background: linear-gradient(180deg, rgba(var(--glow), 0.22), rgba(var(--glow), 0.02) 80%);
}

/* Responsive */

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .stat-grid li:nth-child(3) { border-left: 0; }

  .stat-grid li:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .stage-main { grid-template-columns: 1fr; gap: 20px; }

  .stage-visual { position: static; }

  .chapter-body { max-height: none; opacity: 1; margin-top: 6px; }

  .critic-grid { grid-template-columns: 1fr; gap: 24px; }

  .critic-visual { min-height: 0; aspect-ratio: 16 / 9; }

  .shot-right { width: 120%; left: 6%; }

  .rules { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .by { display: none; }

  .p-hero { padding-top: 64px; }

  .p-hero::after { height: 140px; }

  .hero-stage { margin-top: 48px; perspective: 900px; }

  .hero-shot { border-radius: 12px; }

  .chrome { height: 30px; padding: 0 10px; }

  .chrome .lights { width: 7px; height: 7px; margin-right: 22px; box-shadow: 11px 0 0 #febc2e, 22px 0 0 #28c840; }

  .url { font-size: 10px; padding: 2px 8px; transform: none; }

  .stats { padding-top: 48px; }

  .stat-grid li { padding: 24px 16px; }

  .stat-grid li > span { font-size: 13px; }

  .stage-main { margin-top: 44px; }

  .boardwin-body { height: 500px; }

  .panel { padding: 16px; }

  .versus { grid-template-columns: 1fr; }

  .versus .card { min-height: 0; }

  .versus .tag { margin-top: 8px; }

  .chip { justify-self: center; }

  .log li { grid-template-columns: 1fr 1fr 14px; }

  .log li span:nth-child(3) { display: none; }

  .badge { max-width: 55%; }

  .term { flex-direction: column; gap: 2px; }

  .term > span { width: auto; }

  .flow { margin-top: 44px; }

  .flow li {
    grid-template-columns: 1fr;
    padding: 26px 0 26px 40px;
  }

  .flow .num { font-size: 34px; }

  .flow h3 { margin-top: 12px; font-size: 19px; }

  .emit {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    margin-top: 16px;
    padding-top: 0;
  }

  .kinds { grid-template-columns: 1fr; }

  .critic-visual { aspect-ratio: 4 / 3; }

  .shot-right { width: 150%; border-radius: 12px; }

  .rules { margin-top: 40px; }

  .rules li { padding: 22px 4px; }

  .terminal pre { font-size: 12px; }

  .prenup .footer-mark { margin-bottom: calc((100vw - 32px) * -0.05); }
}
