:root {
  --bg: #14120c;
  --bg-raised: #1c1a14;
  --bg-sunk: #0e0d09;
  --line: #4a4330;
  --text: #ece8dc;
  --muted: #a39d8c;
  --accent: #d9a33c;
  --accent-ink: #14120c;
  --radius: 6px;
  --mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', 'Liberation Mono', monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', 'Roboto', sans-serif;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0%, #3a3324 0%, var(--bg) 60%) no-repeat, var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--mono);
  line-height: 1.2;
  text-wrap: balance;
}

h2 {
  font-size: 1.4rem;
  margin: 0 0 1.25rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1em 0.45em;
  font-family: var(--mono);
  font-size: 0.85em;
  text-align: center;
  color: var(--text);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: 0.9rem;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
}

.topbar nav a:hover,
.topbar nav a:focus-visible {
  color: var(--text);
}

/* Layout */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 3.5rem 0 0;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0 1rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  max-width: 34rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

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

.btn-primary:hover {
  background: #e8b54f;
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line);
  background: var(--bg-raised);
}

.note {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 34rem;
}

.hero-shot,
.gallery figure {
  margin: 0;
}

.hero-shot img,
.gallery img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgb(0 0 0 / 45%);
}

/* Features */
.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.features li {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr 0.5625fr;
  gap: 1rem;
  align-items: start;
}

.gallery figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* How to play + controls */
.how {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 2.5rem;
  align-items: start;
}

.steps {
  margin: 0;
  padding-left: 1.4rem;
}

.steps li {
  margin-bottom: 0.6rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.controls {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.controls th,
.controls td {
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.controls th {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-raised);
}

.controls tbody tr:last-child td {
  border-bottom: 0;
}

.controls td:first-child {
  white-space: nowrap;
}

.closer {
  text-align: center;
  padding-bottom: 1rem;
}

.footer {
  max-width: 1120px;
  margin: 3.5rem auto 0;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (width <= 860px) {
  .hero,
  .how {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .gallery figure:last-child {
    grid-column: 1 / -1;
    max-width: 360px;
  }
}

@media (width <= 560px) {
  .features,
  .gallery {
    grid-template-columns: 1fr;
  }

  .topbar nav a:not(:last-child) {
    display: none;
  }

  .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }
}
