:root {
  color-scheme: dark;
  --ink: #11130f;
  --paper: #fffdf8;
  --muted: rgba(255, 253, 248, 0.68);
  --line: rgba(255, 253, 248, 0.16);
  --panel: rgba(255, 253, 248, 0.08);
  --panel-strong: rgba(255, 253, 248, 0.13);
  --citron: #dfff56;
  --aqua: #00b8a9;
  --blue: #3d7df2;
  --coral: #ff6b5f;
  --sun: #ffb000;
  --magenta: #e449a2;
  --prism: linear-gradient(90deg, #ff5a5f, #ffb000, #d7f64a, #00b8a9, #3d7df2, #8067f2, #e449a2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(115deg, rgba(255, 90, 95, 0.16), transparent 24%),
    linear-gradient(245deg, rgba(0, 184, 169, 0.16), transparent 30%),
    linear-gradient(180deg, #11130f 0%, #171812 54%, #10110d 100%);
  color: var(--paper);
  font-family: "Avenir Next", "Trebuchet MS", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 253, 248, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 253, 248, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body::after {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  height: 6px;
  content: "";
  background: var(--prism);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  transform: translateY(-150%);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar,
main {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(17, 19, 15, 0.74);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  min-width: max-content;
  gap: 10px;
  padding-left: 6px;
  font-weight: 650;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: var(--prism);
  color: #11130f;
  font-size: 0.72rem;
  font-weight: 800;
}

.brand-word {
  color: var(--paper);
  font-weight: 650;
}

.nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.nav a {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-radius: 8px;
  padding: 8px 11px;
  color: rgba(255, 253, 248, 0.72);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: rgba(255, 253, 248, 0.11);
  color: var(--paper);
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 46px;
  min-height: 520px;
  padding: 70px 0 48px;
}

.hero-copy p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.25rem;
}

.eyebrow,
.kicker {
  margin-bottom: 10px;
  color: var(--citron);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: 6.7rem;
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 2rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 15px;
  background: rgba(255, 253, 248, 0.08);
  color: var(--paper);
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 253, 248, 0.42);
  background: rgba(255, 253, 248, 0.14);
}

.button.primary {
  border: 0;
  background: var(--prism);
  color: #11130f;
  box-shadow: 0 18px 40px rgba(61, 125, 242, 0.22);
}

.hero-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  aspect-ratio: 1;
  width: min(100%, 410px);
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.14), rgba(255, 253, 248, 0.03)),
    rgba(17, 19, 15, 0.64);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

.tile {
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.09);
  color: rgba(255, 253, 248, 0.18);
  font-size: 3.2rem;
  font-weight: 950;
}

.tile.x {
  color: var(--coral);
}

.tile.o {
  color: var(--aqua);
}

.games-section {
  position: relative;
  z-index: 1;
  padding: 8px 0 38px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading.stacked {
  display: block;
  max-width: 820px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(17, 19, 15, 0.72);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.game-card p {
  color: var(--muted);
  font-size: 1rem;
}

.card-copy {
  min-width: 0;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  border: 1px solid rgba(255, 253, 248, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 253, 248, 0.055);
  color: rgba(255, 253, 248, 0.72);
  font-size: 0.78rem;
  font-weight: 850;
}

.game-visual {
  align-self: end;
  min-height: 190px;
  margin: 0;
  border: 1px solid rgba(255, 253, 248, 0.11);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.055);
}

.board-visual {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}

.board-visual span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.1);
  color: var(--paper);
  font-size: 1.7rem;
  font-weight: 950;
}

.board-visual span:nth-child(1),
.board-visual span:nth-child(5),
.board-visual span:nth-child(9) {
  color: var(--coral);
}

.board-visual span:nth-child(3),
.board-visual span:nth-child(7) {
  color: var(--aqua);
}

.logic-visual {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 10px;
}

.logic-visual svg {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.logic-line {
  fill: none;
  stroke-linecap: round;
}

.logic-line.main {
  stroke-width: 12;
}

.logic-line.secondary {
  stroke: rgba(255, 253, 248, 0.36);
  stroke-width: 2;
}

.logic-node circle {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 5;
}

.logic-node text {
  fill: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  font-weight: 950;
  text-anchor: middle;
}

.nerd-card .logic-visual svg {
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
}

.next-section {
  position: relative;
  z-index: 1;
  margin: 0 0 54px;
  border-top: 1px solid var(--line);
  padding: 24px 0 0;
  color: rgba(255, 253, 248, 0.58);
  font-size: 0.95rem;
  font-weight: 800;
}

.game-notes {
  position: relative;
  z-index: 1;
  margin-bottom: 58px;
  border-top: 1px solid var(--line);
  padding-top: 38px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.note-grid article {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(17, 19, 15, 0.62);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.note-grid p {
  color: var(--muted);
  font-size: 0.96rem;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 auto 28px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: rgba(255, 253, 248, 0.58);
  font-size: 0.84rem;
  font-weight: 800;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-links a {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 253, 248, 0.13);
  border-radius: 8px;
  padding: 7px 11px;
  color: rgba(255, 253, 248, 0.72);
  font-size: 0.76rem;
  font-weight: 900;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  border-color: rgba(255, 253, 248, 0.34);
  background: rgba(255, 253, 248, 0.08);
  color: var(--paper);
}

.policy-page {
  max-width: 900px;
  margin: 0 auto 58px;
  padding: 72px 0 0;
}

.policy-page h1 {
  margin-bottom: 12px;
}

.policy-updated {
  margin-bottom: 28px;
  color: rgba(255, 253, 248, 0.56);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.policy-page article {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 22px;
  background: rgba(17, 19, 15, 0.66);
}

.policy-page article h2 {
  margin-bottom: 10px;
  font-size: 1.7rem;
}

.policy-page article p {
  color: var(--muted);
}

.policy-page a {
  color: var(--citron);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 48px;
  }

  .hero-board {
    justify-self: start;
    width: min(100%, 340px);
  }

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

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

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

@media (max-width: 560px) {
  .topbar,
  main {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    margin-top: 12px;
  }

  .nav a {
    padding-inline: 8px;
    font-size: 0.78rem;
  }

  h1 {
    font-size: 4.1rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.55rem;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 1.05rem;
  }

  .tile {
    font-size: 2.2rem;
  }

  .game-card {
    padding: 18px;
  }
}
