:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #1b2433;
  --muted: #5a6578;
  --accent: #3b6cff;
  --accent-dark: #254edb;
  --accent-soft: #e8efff;
  --success: #0f9d58;
  --error: #d93025;
  --tile-bg: #fff;
  --tile-border: #d8e0ef;
  --tile-shadow: 0 4px 0 #c5d0e4;
  --header-bg: #1b2433;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  --header-height: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(59, 108, 255, 0.08), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(59, 108, 255, 0.06), transparent 35%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 600;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.logo:hover {
  color: #fff;
  opacity: 0.92;
}

.logo-tiles {
  display: flex;
  gap: 0.25rem;
}

.logo-tiles span {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: linear-gradient(180deg, #5b84ff, #3b6cff);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 #254edb;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: #fff;
}

/* Hero + game */

.hero {
  padding: 3rem 0 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 42ch;
}

.hero-cta {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--accent-dark);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hero-cta:hover {
  color: #fff;
  transform: translateY(1px);
  box-shadow: 0 3px 0 var(--accent-dark);
}

.word-game {
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(27, 36, 51, 0.08);
}

.game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.game-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.game-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.game-stats strong {
  color: var(--ink);
  font-family: var(--mono);
}

.game-prompt {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.game-hint {
  min-height: 1.5rem;
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--accent-dark);
  font-weight: 600;
}

.answer-slots,
.letter-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.answer-slots {
  min-height: 3.25rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--accent-soft);
  border-radius: 12px;
}

.letter-pool {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.tile {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--tile-border);
  border-radius: 10px;
  background: var(--tile-bg);
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--tile-shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

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

.tile:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c5d0e4;
}

.slot-tile {
  background: #fff;
}

.slot-tile:not(.filled) {
  border-style: dashed;
  color: transparent;
  box-shadow: none;
  cursor: default;
}

.slot-tile:not(.filled):hover {
  transform: none;
}

.pool-tile {
  background: linear-gradient(180deg, #fff, #f8faff);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.btn {
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

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

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 0 var(--accent-dark);
}

.btn-secondary {
  background: #eef2f8;
  color: var(--ink);
}

.game-feedback {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.game-feedback.success {
  color: var(--success);
}

.game-feedback.error {
  color: var(--error);
}

/* Policy */

.policy {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 1rem 0 4rem;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  align-self: start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius);
}

.toc-title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.toc li {
  margin-bottom: 0.35rem;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.toc a:hover {
  color: var(--accent-dark);
}

.policy-section {
  margin-bottom: 2rem;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.policy-section h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
}

.section-num {
  color: var(--accent);
  font-family: var(--mono);
}

.policy-section h3 {
  margin: 1.5rem 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

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

.policy-section p + p {
  margin-top: 1rem;
}

/* Footer */

.site-footer {
  padding: 2rem 0;
  background: var(--header-bg);
  color: rgba(255, 255, 255, 0.65);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.footer-brand,
.footer-meta,
.footer-contact {
  margin: 0;
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.footer-contact a:hover {
  color: #fff;
}

/* Responsive */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

  .toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-block: 0.75rem;
  }

  .site-header {
    position: static;
  }

  html {
    scroll-padding-top: 0;
  }

  .policy-section {
    padding: 1.25rem;
  }

  .tile {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}
