:root {
  --bg: #0E1014;
  --surface: #181B22;
  --raised: #232733;
  --ink: #F2F3F5;
  --muted: #9AA1AE;
  --amber: #FFB42E;
  --stop: #FF3B30;
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--text);
}

a { color: var(--amber); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.wordmark {
  font: 800 1.6rem/1 var(--rounded);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark span { color: var(--amber); }

.site-nav { display: flex; gap: 20px; font-weight: 600; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* Landing hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding-block: clamp(32px, 7vw, 88px);
}

.hero h1 {
  font: 800 clamp(2.6rem, 6vw, 4.4rem)/1.02 var(--rounded);
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34ch;
  margin: 0 0 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--raised);
  font: 700 1rem/1 var(--rounded);
}

.app-store-badge {
  display: inline-block;
  margin-top: 1.25rem;
}
.app-store-badge img {
  display: block;
  height: 48px;
  width: auto;
}


/* The playable board */

.board {
  background: var(--surface);
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 30px 80px -40px rgba(124, 77, 255, 0.45);
}

.board-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 8px 10px;
  font: 700 1rem/1.2 var(--rounded);
  color: var(--muted);
}

.board-status .playing { color: var(--ink); }
.board-status time { font-variant-numeric: tabular-nums; color: var(--muted); }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tile {
  position: relative;
  aspect-ratio: 5 / 4;
  border: 0;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: flex-end;
  text-align: left;
  font: 800 clamp(1rem, 2.1vw, 1.45rem)/1.05 var(--rounded);
  color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c));
  cursor: pointer;
  transition: transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.tile.dark-text { color: #111; }
.tile:active { transform: scale(0.96); }

.tile[aria-pressed="true"] {
  box-shadow: 0 0 0 4px #fff, 0 0 32px -2px var(--c);
}

.tile .left {
  position: absolute;
  top: 12px;
  right: 12px;
  font: 700 0.9rem/1 var(--rounded);
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.25);
  padding: 5px 9px;
  border-radius: 999px;
}

.tile .left:empty { display: none; }

.toolbar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.toolbar span {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0 6px;
  text-align: center;
  min-height: 48px;
  border-radius: 14px;
  font: 700 0.95rem/1 var(--rounded);
  background: var(--raised);
}

.toolbar .fade { background: var(--amber); color: #111; }
.toolbar .stop { background: var(--stop); }

.board-hint {
  margin: 12px 4px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Facts */

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  padding-block: 32px 72px;
  border-top: 1px solid var(--raised);
}

.facts h2 {
  font: 800 1.3rem/1.2 var(--rounded);
  margin: 28px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.facts h2::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: var(--c);
  flex: none;
}

.facts p { margin: 0; color: var(--muted); }

/* Text pages */

.page {
  max-width: 68ch;
  padding-block: 24px 80px;
}

.page h1 {
  font: 800 clamp(2.2rem, 5vw, 3.2rem)/1.05 var(--rounded);
  letter-spacing: -0.02em;
  margin: 24px 0 12px;
}

.page .lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 40px; }

.page h2 {
  font: 800 1.45rem/1.2 var(--rounded);
  margin: 48px 0 12px;
}

.page h3 { font: 700 1.1rem/1.3 var(--rounded); margin: 28px 0 6px; }

.page p, .page li { color: #D6D9DF; }
.page ul { padding-left: 1.2em; }
.page li + li { margin-top: 6px; }

.updated { color: var(--muted); font-size: 0.95rem; }

details {
  background: var(--surface);
  border-radius: 16px;
  padding: 0 20px;
  margin-bottom: 10px;
}

summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font: 700 1.1rem/1.3 var(--rounded);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  color: var(--amber);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 150ms ease;
}

details[open] summary::after { transform: rotate(45deg); }
details > *:last-child { padding-bottom: 18px; margin-bottom: 0; }
details p:first-of-type { margin-top: 0; }

.contact {
  margin-top: 48px;
  padding: 24px;
  border-radius: 20px;
  background: var(--raised);
}

.contact h2 { margin-top: 0; }

.english {
  margin-top: 64px;
  padding-top: 8px;
  border-top: 1px solid var(--raised);
}

/* Footer */

.site-footer {
  padding-block: 28px 40px;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--raised);
}

.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; }
  .toolbar span { font-size: 0.74rem; padding: 0 4px; }
  .site-nav { gap: 14px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, summary::after { transition: none; }
}
