/* Swiss Night launch site. Brief: docs/site/BRIEF.md. */

:root {
  color-scheme: light dark;

  /* Light: a sheet of paper on a games table */
  --bg: #f6f1e7; /* paper */
  --surface: #fffcf5; /* card stock */
  --surface-sunken: #efe7d8;
  --ink: #1f1a14;
  --ink-muted: #5e5446;
  --border: #d9cfbd;
  --border-strong: #8c7f6b;
  --accent: #2f6b4f; /* felt green */
  --accent-ink: #ffffff;
  --accent-soft: #e3eee6;
  --felt: #1d4a36; /* the felt band behind the app showcase, both modes */
  --felt-deep: #10241b;
  --brass: #b7832f; /* token rims, the "1" on the trophy token; decorative only */
  --token-red: #b4462f; /* the second game token; decorative only */
  --shadow-card:
    0 1px 2px rgb(60 45 25 / 0.08), 0 4px 14px rgb(60 45 25 / 0.07);
  --shadow-raised:
    0 2px 4px rgb(60 45 25 / 0.1), 0 18px 40px rgb(60 45 25 / 0.16);

  /* Site-only helpers */
  --felt-text: #f3ecdf;
  --token-a-ink: #ffffff;
  --bezel: #0c1c15; /* the device frame around the live app */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  --grain-felt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");

  --font-display:
    "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body:
    "Nunito Sans", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pad-x: clamp(1.25rem, 5vw, 3rem);
  --section-gap: clamp(5rem, 12vw, 9rem);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark: the felt table under a lamp */
    --bg: #10241b;
    --surface: #183326;
    --surface-sunken: #0c1c15;
    --ink: #f3ecdf;
    --ink-muted: #c2b8a6;
    --border: #2d4a3c;
    --border-strong: #6b8c7b;
    --accent: #8fd1a9; /* pale mint */
    --accent-ink: #0e2117;
    --accent-soft: #1f4a35;
    --felt: #0c1c15;
    --felt-deep: #08130e;
    --bezel: #23402f;
    --brass: #d9a750;
    --token-red: #e07a62;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 14px rgb(0 0 0 / 0.35);
    --shadow-raised: 0 2px 4px rgb(0 0 0 / 0.45), 0 18px 40px rgb(0 0 0 / 0.5);

    /* White initials on pale mint are unreadable; dark ink instead. */
    --token-a-ink: #0e2117;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  }
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--grain);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings:
    "SOFT" 50,
    "WONK" 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ol,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  transform: translateY(-200%);
}

.skip:focus-visible {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: calc(72rem + 2 * var(--pad-x));
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.caps {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fine-print {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.section {
  margin-top: var(--section-gap);
}

section {
  scroll-margin-top: 80px;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.section-lead {
  margin-top: 1rem;
  max-width: 40rem;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  color: var(--ink-muted);
}

/* Logo */

.mark {
  flex: none;
  overflow: visible;
}

.mark-a {
  fill: var(--accent);
}

.mark-b {
  fill: var(--token-red);
}

.mark-cut {
  fill: var(--bg);
}

.mark-ring {
  fill: none;
  stroke-width: 1.5;
}

.mark-ring-a {
  stroke: var(--accent-ink);
  stroke-opacity: 0.3;
}

.mark-ring-b {
  stroke: #ffffff;
  stroke-opacity: 0.3;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  font-variation-settings:
    "SOFT" 50,
    "WONK" 0;
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
  border-radius: 10px;
}

/* Buttons and links */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 1.5rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 160ms var(--ease),
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    transform 160ms var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-card);
}

.btn-primary:hover {
  background: color-mix(in oklab, var(--accent) 86%, var(--ink));
  box-shadow: var(--shadow-raised);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--ink);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-small {
  min-height: 44px;
  padding: 0 1rem;
  font-size: 0.9375rem;
}

.btn-large {
  min-height: 56px;
  padding: 0 32px;
  font-size: 1.0625rem;
}

/* Header */

.site-header {
  position: relative;
  z-index: 20;
  height: var(--header-h);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: none;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition:
    color 160ms var(--ease),
    background-color 160ms var(--ease);
}

.nav-link:hover {
  color: var(--ink);
  background: var(--surface-sunken);
}

.nav-link:active {
  background: var(--border);
}

.brand:hover .wordmark {
  color: var(--accent);
}

.brand:active {
  transform: translateY(1px);
}

@media (min-width: 600px) {
  .nav-link {
    display: inline-flex;
  }

  .header-nav .btn-small {
    margin-left: 0.5rem;
  }
}

@media (min-width: 768px) {
  .site-header {
    position: sticky;
    top: 0;
  }

  .site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* 1. Hero */

.hero {
  padding-top: clamp(2rem, 6vw, 5rem);
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  gap: 3rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  min-width: 0;
}

.hero h1 {
  font-size: clamp(2.75rem, 8vw, 6.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.lead {
  max-width: 32ch;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  color: var(--ink-muted);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
}

@media (min-width: 600px) {
  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
  }
}

.hero-visual {
  position: relative;
  min-width: 0;
  --drift-x: 0px;
  --drift-y: 0px;
}

.hero-token {
  position: absolute;
  z-index: 0;
  opacity: 0.12;
  pointer-events: none;
  translate: var(--drift-x) var(--drift-y);
  transition: translate 300ms var(--ease);
}

.hero-token-big {
  width: 220px;
  height: 220px;
  top: -70px;
  right: -60px;
}

.hero-token-small {
  width: 140px;
  height: 140px;
  bottom: -50px;
  left: -50px;
  translate: calc(var(--drift-x) * 0.6) calc(var(--drift-y) * 0.6);
}

.pair-board {
  position: relative;
  z-index: 1;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.pb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pb-tables {
  display: grid;
  gap: 0.5rem;
}

.pb-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: var(--bg);
}

.pb-row-extra {
  display: none;
}

.pb-table {
  font-size: 0.6875rem;
  min-width: 3.75rem;
}

.pb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9375rem;
}

.pb-chip-right {
  flex-direction: row-reverse;
  justify-self: end;
}

.pb-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-chip.won .name {
  color: var(--ink);
}

.pb-chip.lost .name {
  color: var(--ink-muted);
}

.pb-vs {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.token {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--token-a-ink);
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow:
    inset 0 0 0 3px rgb(255 255 255 / 0.18),
    0 1px 2px rgb(0 0 0 / 0.18);
}

.token.tone-b,
.tone-b > .token {
  background: var(--token-red);
  color: #ffffff;
}

.pb-bye {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-sunken);
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

@media (min-width: 600px) {
  .pb-row-extra {
    display: grid;
  }
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
    gap: 4rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 5vw, 5.5rem);
  }

  .h1-line {
    display: block;
    white-space: nowrap;
  }

  .pair-board {
    padding: 1.5rem;
    transform: rotate(-2deg);
  }
}

/* Hero load: the card rises, the chips slide from a pile to their seats, the bye appears. */

@media (prefers-reduced-motion: no-preference) {
  .pair-board {
    animation: card-rise 400ms var(--ease) both;
  }

  .pb-chip {
    animation: seat 360ms var(--ease) both;
    animation-delay: calc(100ms + var(--i) * 60ms);
  }

  .pb-bye {
    animation: fade-in 220ms var(--ease) 680ms both;
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    translate: 0 16px;
  }
}

@keyframes seat {
  from {
    transform: translate(var(--from-x), var(--from-y)) rotate(var(--from-r));
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* Reveal on scroll: only when main.js runs and motion is allowed. */

@media (prefers-reduced-motion: no-preference) {
  .js-motion .how-card,
  .js-motion .feature,
  .js-motion .device {
    transition:
      opacity 500ms var(--ease),
      translate 500ms var(--ease);
  }

  .js-motion .how-row:not(.is-in) .how-card,
  .js-motion .bento:not(.is-in) .feature {
    opacity: 0;
    translate: 0 12px;
  }

  .js-motion .how-card {
    transition-delay: calc(var(--i) * 100ms);
  }

  .js-motion .feature {
    transition-delay: calc(var(--i) * 70ms);
  }

  .js-motion .device:not(.is-in) {
    opacity: 0;
    translate: 0 24px;
  }

  .js-motion .how-row:not(.is-in) .how-draw {
    stroke-dashoffset: 1;
  }

  .js-motion .how-draw {
    transition: stroke-dashoffset 800ms var(--ease) 150ms;
  }

  .js-motion .closing-mark:not(.is-in) .tok-a {
    transform: translateX(-11px);
  }

  .js-motion .closing-mark:not(.is-in) .tok-b {
    transform: translateX(11px);
  }

  .js-motion .closing-mark g {
    transition: transform 500ms var(--ease);
  }
}

/* 2. How it works */

.how-row {
  position: relative;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.how-steps {
  display: grid;
  gap: 1rem;
}

.how-card {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  column-gap: 0.75rem;
  align-items: baseline;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.how-num {
  position: relative;
  z-index: 2;
  grid-row: span 2;
  align-self: start;
  justify-self: start;
  padding-right: 0.25rem;
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--accent);
  font-variation-settings:
    "SOFT" 50,
    "WONK" 0;
}

.how-card h3 {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.how-card p {
  grid-column: 2;
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

.how-line {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.how-dash {
  stroke: var(--border-strong);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
}

.how-draw {
  stroke: #ffffff;
  stroke-width: 6;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.how-line-h {
  display: none;
}

/* Phone: the line runs down the left edge, through the numerals. */
.how-line-v {
  top: 3rem;
  bottom: 3rem;
  left: calc(1.5rem + 0.6rem);
  width: 4px;
  height: calc(100% - 6rem);
}

@media (min-width: 960px) {
  .how-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .how-card {
    display: block;
    padding: 1.75rem;
  }

  .how-num {
    display: inline-block;
    font-size: 4.5rem;
    margin-bottom: 1rem;
  }

  .how-card p {
    margin-top: 0.75rem;
  }

  .how-line-v {
    display: none;
  }

  .how-line-h {
    display: block;
    top: calc(1.75rem + 2.25rem - 2px);
    left: 1.75rem;
    width: calc(100% - 1.75rem - ((100% - 3rem) / 3 - 1.75rem));
    height: 4px;
  }
}

/* 3. The scroll section: watch round 2 pair itself */

.stage {
  display: none;
}

.steps {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2rem, 5vw, 3rem);
}

.step {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.step .caps {
  font-size: 0.75rem;
}

.cap-title {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variation-settings:
    "SOFT" 50,
    "WONK" 0;
}

.cap-line {
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

.step .board {
  margin-top: 1.25rem;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: 1fr 1fr;
  }
}

/* Board: positions come from per-chip custom properties (row, column, group, table, side). */

.board {
  container: board / inline-size;
}

.board-field {
  /* Phone layout: standings above, tables below. */
  --chip: 28px;
  --label-h: 22px;
  --line-h: 34px;
  --group-gap: 28px;
  --tables-top: 304px;
  --slot-h: 48px;
  --slot-step: 58px;
  position: relative;
  height: calc(var(--tables-top) + 4 * var(--slot-step) + var(--slot-h) + 2px);
  font-size: 0.8125rem;
  font-weight: 600;
}

.group-label,
.slot-label,
.board-pill,
.clash-pill {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.group-label {
  position: absolute;
  left: 0;
  top: calc(var(--g) * var(--group-gap) + var(--l) * var(--line-h));
  line-height: var(--label-h);
}

.chip {
  --x0: calc(var(--c) * 50cqw);
  --y0: calc(
    var(--g) * var(--group-gap) + var(--label-h) + (var(--r) - var(--c)) / 2 *
      var(--line-h)
  );
  --x1: calc(10px + var(--s) * 50cqw);
  --y1: calc(
    var(--tables-top) + (var(--t) - 1) * var(--slot-step) +
      (var(--slot-h) - var(--chip)) / 2
  );
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transform: translate(var(--x0), var(--y0));
}

.chip .token {
  width: var(--chip);
  height: var(--chip);
}

.board-pill {
  position: absolute;
  left: 0;
  top: calc(var(--tables-top) - 34px);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  opacity: 0;
}

.slot {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--tables-top) + (var(--t) - 1) * var(--slot-step));
  height: var(--slot-h);
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
}

/* The solid card that replaces the dashed outline once the pair is seated. */
.slot::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  opacity: 0;
}

/* The 4 px status edge from the app, shown when the round is paired. */
.slot::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -1.5px;
  left: -1.5px;
  right: -1.5px;
  height: 4px;
  border-radius: 12px 12px 0 0;
  background: var(--accent);
  opacity: 0;
}

.slot-label {
  position: absolute;
  z-index: 2;
  top: -0.6rem;
  left: 10px;
  padding: 0 4px;
  background: var(--surface);
  line-height: 1.1rem;
  font-size: 0.625rem;
}

.clash {
  position: absolute;
  z-index: 2;
  /* Phone: a horizontal line from Jonah to Nell on the same line. */
  left: 5.75rem;
  top: calc(
    var(--group-gap) + var(--label-h) + 2 * var(--line-h) + var(--chip) / 2 -
      2px
  );
  width: calc(50cqw - 5.75rem - 6px);
  height: 4px;
  opacity: 0;
}

.clash-line {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.clash-path {
  fill: none;
  stroke: var(--token-red);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.clash-draw {
  fill: none;
  stroke: #ffffff;
  stroke-width: 6;
  stroke-dasharray: 1;
}

.clash-v {
  display: none;
}

.clash-x {
  position: absolute;
  left: calc(50% - 10px);
  top: calc(50% - 10px);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--token-red);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1;
}

.clash-pill {
  position: absolute;
  z-index: 2;
  left: 3.5rem;
  top: calc(var(--group-gap) + 2 * var(--line-h) + 1px);
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--token-red);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.1rem;
  opacity: 0;
}

/* Wide board: standings on the left, tables on the right. */
@container board (min-width: 400px) {
  .board-field {
    --chip: 32px;
    --label-h: 24px;
    --row-h: 38px;
    --group-gap: 30px;
    --tables-top: 44px;
    --slot-h: 56px;
    --slot-step: 68px;
    --tables-x: 46cqw;
    height: calc(
      2 * var(--group-gap) + var(--label-h) + 9 * var(--row-h) + var(--chip) +
        2px
    );
    font-size: 0.875rem;
  }

  .group-label {
    top: calc(var(--g) * var(--group-gap) + var(--r) * var(--row-h));
  }

  .chip {
    --x0: 0px;
    --y0: calc(
      var(--g) * var(--group-gap) + var(--label-h) + var(--r) * var(--row-h)
    );
    --x1: calc(var(--tables-x) + 12px + var(--s) * 27cqw);
  }

  .slot {
    left: var(--tables-x);
  }

  .board-pill {
    left: var(--tables-x);
    top: 4px;
  }

  .clash {
    left: 6.25rem;
    top: calc(
      var(--group-gap) + var(--label-h) + 4 * var(--row-h) + var(--chip) / 2 -
        1px
    );
    width: 24px;
    height: 40px;
  }

  .clash-v {
    display: inline;
  }

  .clash-h {
    display: none;
  }

  .clash-x {
    left: 4px;
  }

  .clash-pill {
    top: calc(var(--group-gap) + 4 * var(--row-h) + 2px);
  }
}

/* Board states, driven by data-step. */

/* data-step sits on a static board, or on the sticky stage around the animated one.
   Tables 4 and 5 (data-at="3b") seat during step 3 on the stage, but the static
   step 3 card shows its end state with only Tables 1 to 3 seated. */
:is([data-step="2"], [data-step="3"], [data-step="4"]) .chip[data-at="2"],
:is([data-step="3"], [data-step="4"]) .chip[data-at="3"],
:is([data-step="4"], .stage[data-step="3"]) .chip[data-at="3b"] {
  transform: translate(var(--x1), var(--y1));
}

:is([data-step="2"], [data-step="3"], [data-step="4"])
  .slot[data-at="2"]::after,
:is([data-step="3"], [data-step="4"]) .slot[data-at="3"]::after,
:is([data-step="4"], .stage[data-step="3"]) .slot[data-at="3b"]::after {
  opacity: 1;
}

[data-step="3"] .clash,
[data-step="3"] .clash-pill,
[data-step="4"] .board-pill,
[data-step="4"] .slot::before {
  opacity: 1;
}

/* Narrow static cards show only what their step is about. */
@container board (max-width: 399.98px) {
  /* Step 1: the standings alone, without five empty tables. */
  .step .board[data-step="1"] .slot,
  .step .board[data-step="1"] .board-pill {
    display: none;
  }

  .step .board[data-step="1"] .board-field {
    height: 250px;
  }

  /* Step 4: the filled tables alone, without empty group labels above them. */
  .step .board[data-step="4"] .group-label {
    display: none;
  }

  .step .board[data-step="4"] .board-field {
    --tables-top: 40px;
  }
}

/* 3b. The sticky, scroll-driven version (wide screens with motion only; main.js adds .is-scrolly). */

.is-scrolly {
  position: relative;
  height: 320vh;
}

.is-scrolly .stage {
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  height: 100vh;
  padding-top: var(--header-h);
}

.is-scrolly .steps {
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
  pointer-events: none;
}

.is-scrolly .step {
  height: 80vh;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

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

.is-scrolly .step .board {
  display: none;
}

.stage-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: center;
  gap: 3rem;
}

.stage-caps {
  display: grid;
}

.stage-cap {
  grid-area: 1 / 1;
  opacity: 0;
  translate: 0 8px;
  transition:
    opacity 300ms var(--ease),
    translate 300ms var(--ease);
}

.stage:is([data-step="1"]) .stage-cap[data-for="1"],
.stage:is([data-step="2"]) .stage-cap[data-for="2"],
.stage:is([data-step="3"]) .stage-cap[data-for="3"],
.stage:is([data-step="4"]) .stage-cap[data-for="4"] {
  opacity: 1;
  translate: none;
}

.stage .cap-title {
  font-size: 2rem;
}

.dots {
  display: flex;
  gap: 10px;
  margin-top: 1.75rem;
}

.dots li {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  transition:
    background-color 300ms var(--ease),
    border-color 300ms var(--ease);
}

.stage[data-step="1"] .dots [data-for="1"],
.stage[data-step="2"] .dots [data-for="2"],
.stage[data-step="3"] .dots [data-for="3"],
.stage[data-step="4"] .dots [data-for="4"] {
  background: var(--accent);
  border-color: var(--accent);
}

.board-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.stage .chip {
  transition: transform 450ms var(--ease);
}

.stage .slot::after {
  transition: opacity 300ms var(--ease);
}

.stage .slot::before {
  transition: opacity 300ms var(--ease);
}

.stage .board-pill {
  transition: opacity 300ms var(--ease);
}

.stage[data-step="2"] [data-at="2"],
.stage[data-step="2"] [data-at="2"]::after {
  transition-delay: calc((var(--t) - 1) * 150ms);
}

.stage[data-step="3"] :is([data-at="3"], [data-at="3b"]),
.stage[data-step="3"] :is([data-at="3"], [data-at="3b"])::after {
  transition-delay: calc(900ms + (var(--t) - 3) * 150ms);
}

.stage[data-step="4"] .slot::before {
  transition-delay: calc((var(--t) - 1) * 60ms);
}

.stage[data-step="4"] .board-pill {
  transition-delay: 300ms;
}

/* The peak: the line draws (300 ms), holds, fades (200 ms) before Jonah takes Kofi. */
.stage[data-step="3"] .clash,
.stage[data-step="3"] .clash-pill {
  animation: clash-life 900ms linear both;
}

.stage[data-step="3"] .clash-draw {
  animation: clash-draw 300ms var(--ease) both;
}

.stage[data-step="3"] .clash-x,
.stage[data-step="3"] .clash-pill {
  animation: clash-life-late 900ms linear both;
}

@keyframes clash-life {
  0%,
  77.7% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes clash-life-late {
  0%,
  30% {
    opacity: 0;
  }
  33.3%,
  77.7% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes clash-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* 4. Features */

.bento {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.feature h3 {
  margin-top: 0.75rem;
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.feature p {
  color: var(--ink-muted);
}

@media (hover: hover) and (pointer: fine) {
  .feature {
    transition:
      transform 200ms var(--ease),
      box-shadow 200ms var(--ease),
      opacity 500ms var(--ease),
      translate 500ms var(--ease);
  }

  .feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-raised);
  }
}

@media (min-width: 600px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-wide {
    grid-column: span 2;
  }
}

@media (min-width: 960px) {
  .bento {
    grid-template-columns: repeat(3, 1fr);
  }
}

.art {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
}

.mini-standings {
  width: 100%;
  max-width: 30rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.mini-standings th {
  padding: 0.4rem 0.5rem;
  background: var(--surface-sunken);
  color: var(--ink-muted);
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: right;
}

.mini-standings td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.mini-standings :is(th, td):nth-child(2) {
  text-align: left;
  width: 100%;
}

.mini-standings :is(th, td):first-child {
  text-align: center;
}

.mini-standings th:first-child {
  border-radius: 8px 0 0 8px;
}

.mini-standings th:last-child {
  border-radius: 0 8px 8px 0;
}

.mini-standings .pts {
  font-weight: 800;
}

.mini-standings .shared {
  background: var(--accent-soft);
  font-weight: 800;
}

.art-token,
.art-chip::before {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    inset 0 0 0 3px var(--brass),
    inset 0 0 0 9px rgb(255 255 255 / 0.18);
}

.art-badge {
  position: absolute;
  top: -6px;
  left: 26px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brass);
  color: #1f1a14;
  font-size: 0.75rem;
  font-weight: 800;
}

.art-slip {
  width: 72px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background:
    linear-gradient(var(--border) 0 0) 10px 10px / 30px 2px no-repeat,
    linear-gradient(var(--border) 0 0) 10px 18px / 44px 2px no-repeat,
    linear-gradient(var(--border) 0 0) 10px 26px / 20px 2px no-repeat,
    var(--surface);
}

.slip-cut {
  position: absolute;
  inset: -6px;
  border: 1.5px dashed var(--ink-muted);
  border-radius: 6px;
}

.slip-scissors {
  position: absolute;
  top: -0.7rem;
  right: 6px;
  padding: 0 2px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.2rem;
}

.art-withdrawn {
  gap: 0.5rem;
}

.art-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.art-chip::before {
  content: "";
  width: 28px;
  height: 28px;
  background: var(--token-red);
  box-shadow: none;
  opacity: 0.55;
}

.art-tag {
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--ink-muted);
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.save-arrow {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 5. The real app, on the felt */

.felt-band {
  margin-top: var(--section-gap);
  padding-block: clamp(4rem, 9vw, 7rem);
  background-color: var(--felt);
  background-image: var(--grain-felt);
  box-shadow:
    inset 0 1px 0 var(--felt-deep),
    inset 0 -1px 0 var(--felt-deep);
  color: var(--felt-text);
  overflow-x: clip;
}

.felt-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.felt-band .section-lead {
  color: var(--felt-text);
  opacity: 0.88;
}

.felt-band :focus-visible {
  outline-color: var(--felt-text);
}

.device {
  /* Phone frame below 960 px. */
  display: flex;
  flex-direction: column;
  width: min(360px, 100% - 2rem);
  aspect-ratio: 1 / 2;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding: 10px;
  border-radius: 40px;
  background: var(--bezel);
  box-shadow:
    inset 0 0 0 1px rgb(243 236 223 / 0.08),
    var(--shadow-raised),
    0 0 60px rgb(47 107 79 / 0.45);
}

.device-bar {
  display: none;
}

.device-screen {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 30px;
  background: var(--surface);
}

@media (min-width: 960px) {
  .device {
    width: min(1040px, 100%);
    aspect-ratio: auto;
    border-radius: 16px;
  }

  .device-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding-left: 8px;
  }

  .device-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2d4a3c;
  }

  .device-screen {
    flex: none;
    height: 680px;
    border-radius: 8px;
  }
}

.tips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
  margin-top: 2rem;
  font-size: 0.9375rem;
}

.tips .caps {
  margin-right: 0.4rem;
  color: var(--felt-text);
  opacity: 0.75;
}

.felt-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 1rem;
  padding: 0 0.75rem;
  border-radius: 10px;
  color: var(--felt-text);
  font-weight: 800;
  text-underline-offset: 4px;
  transition:
    background-color 160ms var(--ease),
    text-decoration-thickness 160ms var(--ease);
}

.felt-link:hover {
  background: rgb(243 236 223 / 0.1);
  text-decoration-thickness: 2px;
}

.felt-link:active {
  background: rgb(243 236 223 / 0.18);
}

/* 6. Closing call to action */

.closing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.closing .section-lead {
  margin-top: 0;
}

.closing .btn-large {
  margin-top: 0.75rem;
}

/* 7. Footer */

.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--border);
}

.footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-block: 1.5rem;
  text-align: center;
}

.footer-note {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

@media (min-width: 600px) {
  .footer-row {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Phones: full-width buttons, a flat board. */

@media (max-width: 599.98px) {
  .hero-actions .btn,
  .closing .btn-large {
    width: 100%;
    white-space: normal;
  }

  .pair-board {
    padding: 1rem;
  }

  .pb-row {
    padding: 0.5rem;
    gap: 0.375rem;
  }

  .pb-table {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .header-nav .btn-small {
    padding: 0 0.75rem;
    font-size: 0.875rem;
  }
}
