/* ==========================================================================
   Equationle website
   Colours match the app (src/theme.ts).
   ========================================================================== */

:root {
  --bg: #121213;
  --surface: #1a1a1c;
  --surface-line: #2a2a2d;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.64);
  --faint: rgba(255, 255, 255, 0.45);
  --border: #3a3a3c;
  --border-filled: #565758;
  --key: #818384;
  --green: #538d4e;
  --yellow: #b59f3b;
  --grey: #3a3a3c;
  --blue: #4f8cff;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 18, 19, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--green);
  border-radius: 7px;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.nav nav {
  display: flex;
  gap: 28px;
}
.nav nav a {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.15s;
}
.nav nav a:hover {
  color: var(--text);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 72px 0 40px;
}

/* The glow gets its own clipping layer. Clipping the whole hero instead made it a hidden
   scroll container: the "Play it right here" link scrolled the hero inside itself, and
   that can't be scrolled back by hand, so the text above the phone was stuck out of view. */
.hero-glow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-glow::before {
  /* Soft green and yellow glow behind the phone */
  content: '';
  position: absolute;
  inset: -20% -10% auto 35%;
  height: 120%;
  background:
    radial-gradient(closest-side at 62% 45%, rgba(83, 141, 78, 0.34), transparent 70%),
    radial-gradient(closest-side at 80% 70%, rgba(181, 159, 59, 0.18), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 48px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(46px, 6.4vw, 82px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 30ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 1.7vw, 21px);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 15px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}
.swatch.correct {
  background: var(--green);
}
.swatch.present {
  background: var(--yellow);
}
.swatch.absent {
  background: var(--grey);
  box-shadow: inset 0 0 0 1px #4a4a4d;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 36px;
}

.store-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 15px;
}

.text-link {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.text-link:hover {
  color: var(--text);
}
/* Only needed when the phone sits below the copy (see the 960px breakpoint). */
.play-link {
  display: none;
}

.hero-phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  scroll-margin-top: 90px;
}

.phone-hint {
  margin: 0;
  max-width: 300px;
  color: var(--faint);
  font-size: 14px;
  text-align: center;
}

/* ==========================================================================
   Phone mockup (same technique and values as edge.harsimar.dev)
   The screen is built at the real iPhone size, 390 × 844, with the app's real sizes.
   One unitless --s on .phone scales everything; never resize anything inside
   .phone-screen-inner for responsiveness, only change --s.
   ========================================================================== */

.phone {
  --s: 0.76;
  --bezel: calc(13px * var(--s) + 5px);
  --p-rgb: 255, 255, 255; /* screen foreground colour */
  --p-bg: #121213; /* screen background: the app's background */
  flex-shrink: 0;
  padding: var(--bezel);
  border-radius: calc(55px * var(--s) + var(--bezel));
  background: #0c0c0c;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 50px 90px -40px rgba(0, 0, 0, 0.55);
}

.phone-screen {
  position: relative;
  width: calc(390px * var(--s));
  height: calc(844px * var(--s));
  overflow: hidden;
  border-radius: calc(55px * var(--s));
  background: var(--p-bg);
}

.phone-screen-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 390px;
  height: 844px;
  overflow: hidden;
  transform: scale(var(--s));
  transform-origin: 0 0;
  background: var(--p-bg);
  color: rgb(var(--p-rgb));
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.3;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

/* Status bar and Dynamic Island */
.phone-status {
  position: absolute;
  inset: 0 0 auto;
  z-index: 30;
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 34px 0 52px;
  font-size: 17px;
  font-weight: 600;
  pointer-events: none;
}
.phone-island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 124px;
  height: 36px;
  margin-left: -62px;
  border-radius: 18px;
  background: #000;
}
.phone-sys {
  display: flex;
  align-items: center;
  gap: 7px;
}
.phone-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.phone-bars i {
  width: 3px;
  background: currentColor;
  border-radius: 1px;
}
.phone-bars i:nth-child(1) {
  height: 4px;
}
.phone-bars i:nth-child(2) {
  height: 6px;
}
.phone-bars i:nth-child(3) {
  height: 9px;
}
.phone-bars i:nth-child(4) {
  height: 12px;
}
.phone-batt {
  position: relative;
  width: 25px;
  height: 12px;
  border: 1px solid rgba(var(--p-rgb), 0.45);
  border-radius: 4px;
}
.phone-batt::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  right: 5px;
  border-radius: 2px;
  background: currentColor;
}
.phone-home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 30;
  width: 134px;
  height: 5px;
  margin-left: -67px;
  border-radius: 3px;
  background: rgb(var(--p-rgb));
  pointer-events: none;
}

/* Smaller step on phones */
@media (max-width: 420px) {
  .phone {
    --s: 0.68;
  }
}

/* ==========================================================================
   The app screen inside the phone, at real size (values from App.tsx and
   the components: safe area 59 top / 34 bottom on a 390 × 844 iPhone)
   ========================================================================== */

.phone-screen-inner button {
  font-family: inherit;
  color: inherit;
  touch-action: manipulation;
}

.app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 59px 0 calc(34px + 12px);
  transform-origin: 50% 55%;
  transition:
    transform 460ms cubic-bezier(0.2, 1, 0.3, 1),
    opacity 460ms cubic-bezier(0.2, 1, 0.3, 1);
}
.sheet-open .app {
  transform: scale(0.92);
  opacity: 0.75;
}
.sheet-closing .app {
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1);
}

.app-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.app-heading {
  flex: 1;
  text-align: center;
}
.app-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.2;
}
.app-sub {
  margin-top: 4px;
  color: #a0a0a0;
  font-size: 13px;
}
.app-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.app-icon:active {
  opacity: 0.6;
}
.app-info {
  border: 2px solid var(--key);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
}
.app-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  margin-left: 6px; /* the app's header sides are 36 wide */
}
.app-info {
  margin-right: 6px;
}
.app-menu span {
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
}

.board-area {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board-wrap {
  position: relative;
  width: 358px; /* min(width − 32, 468) in App.tsx */
  display: flex;
  justify-content: center;
}
.board {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.board-row {
  display: flex;
  justify-content: center;
  gap: var(--gap);
}

.cell {
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  padding: 0;
  border: 2px solid var(--border);
  background: transparent;
  font-size: calc(var(--cell) * 0.5);
  font-weight: 700;
  line-height: 1;
  cursor: default;
}
.cell:not(:disabled) {
  cursor: pointer;
}
.cell.filled {
  border-color: var(--border-filled);
}
.cell.selected {
  border: 3px solid var(--blue);
}
.cell.correct,
.tile.correct,
.key.correct {
  --c: var(--green);
}
.cell.present,
.tile.present,
.key.present {
  --c: var(--yellow);
}
.cell.absent,
.tile.absent,
.key.absent {
  --c: var(--grey);
}
.cell.correct,
.cell.present,
.cell.absent {
  background: var(--c);
  border-color: var(--c);
}

/* Tile flip on reveal: the colour swaps in while the tile is edge-on. */
.cell.reveal {
  animation: flip 350ms ease-in-out both;
  animation-delay: calc(var(--i) * 200ms);
}
@keyframes flip {
  0% {
    transform: scaleY(1);
    background: transparent;
    border-color: var(--border-filled);
  }
  49.9% {
    transform: scaleY(0);
    background: transparent;
    border-color: var(--border-filled);
  }
  50% {
    transform: scaleY(0);
    background: var(--c);
    border-color: var(--c);
  }
  100% {
    transform: scaleY(1);
    background: var(--c);
    border-color: var(--c);
  }
}

.cell.pop {
  animation: pop 180ms cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes pop {
  from {
    transform: scale(1.15);
  }
  to {
    transform: scale(1);
  }
}

.cell.bounce {
  animation: bounce 560ms both;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes bounce {
  0% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.3, 0, 0.6, 1);
  }
  30% {
    transform: translateY(-45%);
    animation-timing-function: cubic-bezier(0.4, 0, 0.7, 1);
  }
  55% {
    transform: translateY(0);
  }
  72% {
    transform: translateY(-10%);
  }
  100% {
    transform: translateY(0);
  }
}

.board-row.shake {
  animation: shake 300ms linear;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  17% {
    transform: translateX(10px);
  }
  33% {
    transform: translateX(-10px);
  }
  50% {
    transform: translateX(8px);
  }
  67% {
    transform: translateX(-8px);
  }
  83% {
    transform: translateX(4px);
  }
}

/* Result floats above the grid so the grid never moves. */
.result {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.result-text {
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.result-button {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.result-button:active {
  opacity: 0.8;
}
.fade-in {
  animation: fade-in 250ms ease-out both;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.toast {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 2;
  padding: 10px 14px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.toast.show {
  animation: toast 1800ms ease both;
}
@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  10%,
  88% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
}

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 6px;
}
.key-row {
  display: flex;
  gap: 5px;
}
.key {
  flex: 1;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--key);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}
.key.correct,
.key.present,
.key.absent {
  background: var(--c);
}
.key-wide {
  flex: 1.6;
}
.key-action {
  font-size: 12px;
}
.key:active,
.key.pressed {
  opacity: 0.6;
}

/* ---------- Bottom sheets (match the app's Sheet: spring up, blur and dim behind) ---------- */

.sheet-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 19, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 220ms ease-out;
}
.sheet-open .scrim {
  opacity: 1;
}

.sheet {
  --overshoot: 48px; /* reaches past the edge so the spring's overshoot never shows a gap */
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--overshoot));
  display: flex;
  flex-direction: column;
  /* Top gap: safe area (59) + the app's FAR_EDGE_GAP (64) */
  max-height: calc(100% - 123px + var(--overshoot));
  padding-bottom: var(--overshoot);
  border-top: 2px solid var(--text);
  background: var(--bg);
  transform: translateY(105%);
  transition: transform 460ms cubic-bezier(0.22, 1.18, 0.36, 1);
}
.sheet-open .sheet {
  transform: translateY(0);
}
.sheet-closing .sheet {
  transition: transform 220ms cubic-bezier(0.55, 0, 1, 0.45);
}

.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 24px 14px;
}
.sheet-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.sheet-close {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 13px;
  cursor: pointer;
}
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 0 24px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.sheet-body::-webkit-scrollbar {
  display: none;
}
.sheet-lead {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.015em;
}
.sheet-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 22px;
}
.sheet-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 18px;
}
.sheet-example {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sheet-bullets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 22px;
}
.sheet .tile-row {
  --t: 34px;
}
.sheet-foot {
  padding: 14px 24px calc(28px + 34px);
}
.sheet-primary {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: var(--text);
  color: var(--bg) !important;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.sheet-primary:active {
  opacity: 0.8;
}

.sheet-intro {
  margin-bottom: -14px;
}
.mode-list {
  display: flex;
  flex-direction: column;
  margin: 0 -24px;
  padding-bottom: calc(20px + 34px);
}
.mode-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 16px 24px 16px 21px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 3px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
}
.mode-row:active {
  opacity: 0.7;
}
.mode-row.selected {
  border-left-color: var(--green);
  background: rgba(255, 255, 255, 0.04);
}
.mode-row-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mode-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.mode-spacer {
  flex: 1;
}
.mode-playing {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mode-desc {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}
.mode-row .tile-row {
  --t: 24px;
}
.mode-row .bars {
  gap: 3px;
}
.mode-row .bars i {
  width: 5px;
}

/* ---------- Static tiles and difficulty bars (page and sheets) ---------- */

.tile-row {
  --t: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tile {
  display: grid;
  place-items: center;
  width: var(--t);
  height: var(--t);
  border: 2px solid var(--border);
  font-size: calc(var(--t) * 0.5);
  font-weight: 700;
  line-height: 1;
}
.tile.filled {
  border-color: var(--border-filled);
}
.tile.correct,
.tile.present,
.tile.absent {
  background: var(--c);
  border-color: var(--c);
}

.bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}
.bars i {
  width: 4px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.18);
}
.bars i.on {
  background: var(--text);
}

/* ==========================================================================
   Page sections
   ========================================================================== */

.section {
  padding: 104px 0;
  scroll-margin-top: 40px;
}
/* Sits right under the phone, which already has space around it. */
#how {
  padding-top: 64px;
}
.section-alt {
  background: #161618;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
h2 {
  max-width: 22ch;
  font-size: clamp(32px, 4.2vw, 50px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-lede {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  background: var(--surface);
}
.step p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}
.step .tile-row {
  --t: 30px;
  margin-top: 8px;
}
.step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(83, 141, 78, 0.18);
  color: #7cc076;
  font-size: 14px;
  font-weight: 800;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin-top: 56px;
}
.rule {
  padding: 22px 0;
  border-top: 1px solid var(--surface-line);
}
.rule p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}
code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88em;
  white-space: nowrap;
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  background: var(--surface);
}
.mode-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mode-top h3 {
  font-size: 22px;
}
.mode-meta {
  flex: 1;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15px;
}
.mode-card .tile-row {
  --t: 26px;
  gap: 3px;
}
.mode-card .bars i {
  width: 5px;
}

.closing {
  text-align: center;
}
.closing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.closing h2 {
  margin-top: 36px;
}
.tiles-big .tile-row {
  --t: 56px;
  justify-content: center;
  gap: 6px;
}
.button {
  display: inline-block;
  margin-top: 32px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--green);
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.15s;
}
.button:hover {
  filter: brightness(1.1);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 36px 0 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--faint);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.footer-inner nav {
  display: flex;
  gap: 22px;
}
.footer-inner a {
  text-decoration: none;
}
.footer-inner a:hover {
  color: var(--text);
}

/* ---------- Simple text pages (privacy, support) ---------- */

.doc {
  max-width: 720px;
  padding: 72px 24px 104px;
}
.doc h1 {
  font-size: clamp(38px, 5vw, 56px);
}
.doc h2 {
  margin-top: 44px;
  font-size: 24px;
  letter-spacing: -0.015em;
}
.doc p,
.doc li {
  color: var(--muted);
}
.doc .updated {
  margin-top: 12px;
  color: var(--faint);
  font-size: 15px;
}
.doc a {
  color: var(--text);
}
.faq {
  margin-top: 16px;
  border-top: 1px solid var(--surface-line);
}
.faq details {
  padding: 18px 0;
  border-bottom: 1px solid var(--surface-line);
}
.faq summary {
  font-weight: 700;
  cursor: pointer;
}
.faq details p {
  margin: 10px 0 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .hero {
    padding-top: 48px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero-copy {
    text-align: center;
  }
  .lede,
  .hero-copy h1 {
    margin-left: auto;
    margin-right: auto;
  }
  .legend,
  .cta-row {
    justify-content: center;
  }
  .play-link {
    display: inline;
  }
  .hero-glow::before {
    inset: 30% -30% auto -30%;
  }
  .steps,
  .modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .nav nav {
    gap: 18px;
  }
  .nav nav a:not(:last-child) {
    display: none;
  }
  .section {
    padding: 72px 0;
  }
  .steps,
  .modes,
  .rules-grid {
    grid-template-columns: 1fr;
  }
  .tiles-big .tile-row {
    --t: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cell.reveal,
  .cell.pop,
  .cell.bounce,
  .board-row.shake,
  .fade-in {
    animation: none;
  }
  .app,
  .sheet-open .app {
    transform: none;
    transition: opacity 150ms;
  }
  .sheet,
  .sheet-open .sheet,
  .sheet-closing .sheet {
    transform: none;
    opacity: 0;
    transition: opacity 150ms;
  }
  .sheet-open .sheet {
    opacity: 1;
  }
}
