:root {
  color-scheme: dark;
  --page-bg: #0d1214;
  --page-bg-soft: #11191b;
  --surface: #151d20;
  --surface-raised: #1b2527;
  --surface-legal: #12191b;
  --text: #f1fbf4;
  --text-muted: #b8c9c0;
  --text-soft: #d7e7de;
  --brand: #6af7cd;
  --brand-strong: #a8f5c1;
  --brand-ink: #102018;
  --gold: #ead982;
  --gold-ink: #221c0d;
  --border: #2f403f;
  --border-strong: #4c6b61;
  --danger: #ffb4a7;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
  --max-width: 1120px;
  --legal-width: 880px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(17, 25, 27, 0.96), rgba(13, 18, 20, 1) 42%),
    var(--page-bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 1rem;
  font-kerning: normal;
  line-height: 1.65;
  letter-spacing: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 86%, white 14%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

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

.public-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(106, 247, 205, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 247, 205, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(168, 245, 193, 0.12);
  background: rgba(13, 18, 20, 0.9);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  display: flex;
  width: min(100% - 32px, var(--max-width));
  min-height: 68px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
}

.brand-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.brand-link img {
  width: 34px;
  height: 34px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
  color: var(--text-muted);
  font-size: 0.925rem;
  font-weight: 700;
}

.site-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(168, 245, 193, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.language-switcher a {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
}

.language-switcher a[aria-current="page"] {
  background: var(--brand);
  color: var(--brand-ink);
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(168, 245, 193, 0.12);
  background:
    linear-gradient(110deg, rgba(13, 18, 20, 0.96), rgba(14, 41, 34, 0.92) 58%, rgba(13, 18, 20, 0.96)),
    var(--page-bg-soft);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 18, 20, 0.94), rgba(13, 18, 20, 0.72) 46%, rgba(13, 18, 20, 0.22)),
    linear-gradient(180deg, transparent 74%, var(--page-bg) 100%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100% - 32px, var(--max-width));
  min-height: min(620px, calc(100svh - 96px));
  margin-inline: auto;
  align-items: center;
  padding-block: clamp(56px, 10vh, 88px);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--brand-strong);
  font-size: 0.875rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 3.2rem;
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: 0;
}

.hero__lead {
  max-width: 620px;
  margin-bottom: 16px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}

.hero__copy {
  max-width: 640px;
  margin-bottom: 28px;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.hero-actions,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button--primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.button--primary:hover {
  background: var(--brand-strong);
  color: var(--brand-ink);
}

.button--secondary {
  border-color: rgba(168, 245, 193, 0.32);
  background: rgba(168, 245, 193, 0.08);
  color: var(--text);
}

.button--secondary:hover {
  border-color: rgba(168, 245, 193, 0.55);
  background: rgba(168, 245, 193, 0.13);
  color: var(--text);
}

.button--gold {
  background: var(--gold);
  color: var(--gold-ink);
}

.button--gold:hover {
  background: #f4e8a7;
  color: var(--gold-ink);
}

.hero-preview {
  position: absolute;
  right: clamp(-220px, -10vw, -72px);
  top: 50%;
  z-index: 0;
  width: min(62vw, 610px);
  aspect-ratio: 1;
  transform: translateY(-50%) rotate(5deg);
  opacity: 0.5;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.2vw, 14px);
  width: 100%;
  height: 100%;
  padding: clamp(12px, 2vw, 24px);
  border: 1px solid rgba(168, 245, 193, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(27, 43, 41, 0.92), rgba(12, 18, 20, 0.9)),
    var(--surface);
  box-shadow: var(--shadow);
}

.puzzle-cell {
  border-radius: var(--radius);
  background: #377a6d;
}

.puzzle-cell--off {
  background: rgba(55, 122, 109, 0.16);
}

.puzzle-cell--path {
  position: relative;
  background: #3f9b82;
}

.puzzle-cell--path::after {
  content: "";
  position: absolute;
  inset: 42% -18%;
  border-radius: 999px;
  background: var(--brand);
}

.puzzle-cell--vertical::after {
  inset: -18% 42%;
}

.puzzle-cell--start::before,
.puzzle-cell--end::before {
  content: "";
  position: absolute;
  inset: 28%;
  z-index: 1;
  border-radius: 999px;
  background: #dffdf3;
}

.puzzle-cell--end::before {
  background: var(--gold);
}

.main-content {
  width: min(100% - 32px, var(--max-width));
  margin-inline: auto;
  padding-block: clamp(44px, 7vw, 84px);
}

.main-content--legal {
  width: min(100% - 32px, var(--legal-width));
}

.section {
  margin-bottom: clamp(44px, 7vw, 76px);
}

.section:last-child {
  margin-bottom: 0;
}

.section h2,
.legal-section h2 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.05;
}

.section p,
.legal-section p,
.content-card p {
  color: var(--text-muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.feature-card,
.content-card,
.toc {
  border: 1px solid rgba(168, 245, 193, 0.14);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 90%, black 10%);
}

.feature-card {
  padding: 18px;
}

.feature-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.05rem;
}

.feature-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.content-card {
  padding: clamp(20px, 4vw, 34px);
}

.legal-hero {
  border-bottom: 1px solid rgba(168, 245, 193, 0.12);
  background:
    linear-gradient(135deg, rgba(17, 25, 27, 0.98), rgba(22, 45, 38, 0.9)),
    var(--page-bg-soft);
}

.legal-hero--gold {
  background:
    linear-gradient(135deg, rgba(17, 25, 27, 0.98), rgba(48, 43, 26, 0.86)),
    var(--page-bg-soft);
}

.legal-hero__inner {
  width: min(100% - 32px, var(--legal-width));
  margin-inline: auto;
  padding-block: clamp(48px, 9vw, 88px);
}

.legal-hero h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: 2.35rem;
}

.legal-hero p {
  max-width: 720px;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.meta-line {
  display: inline-flex;
  margin-bottom: 18px;
  border: 1px solid rgba(168, 245, 193, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--brand-strong);
  font-size: 0.875rem;
  font-weight: 800;
}

.legal-page-layout {
  display: grid;
  gap: 20px;
}

.toc {
  padding: 18px;
}

.toc strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
}

.toc ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.toc a {
  text-decoration: none;
}

.legal-section {
  padding-block: 26px;
  border-bottom: 1px solid rgba(168, 245, 193, 0.12);
  scroll-margin-top: 92px;
}

.legal-section:first-child {
  padding-top: 0;
}

.legal-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.legal-section h2 {
  font-size: 1.35rem;
}

.legal-section ul {
  margin-block: 0 12px;
  padding-left: 22px;
  color: var(--text-muted);
}

.legal-section li {
  margin-bottom: 8px;
}

.site-footer {
  border-top: 1px solid rgba(168, 245, 193, 0.12);
  background: rgba(10, 14, 16, 0.86);
}

.site-footer__inner {
  display: flex;
  width: min(100% - 32px, var(--max-width));
  margin-inline: auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 26px;
  color: var(--text-muted);
  font-size: 0.925rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

@media (max-width: 720px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .language-switcher {
    width: 100%;
  }

  .language-switcher a {
    flex: 1;
    justify-content: center;
  }

  .hero::after {
    background:
      linear-gradient(180deg, rgba(13, 18, 20, 0.76), rgba(13, 18, 20, 0.94) 62%, var(--page-bg)),
      linear-gradient(90deg, rgba(13, 18, 20, 0.82), transparent);
  }

  .hero-preview {
    right: -42%;
    top: 46%;
    width: min(104vw, 440px);
    opacity: 0.3;
  }

  .hero-actions,
  .link-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

@media (min-width: 760px) {
  h1 {
    font-size: 5rem;
  }

  .hero__lead {
    font-size: 1.45rem;
  }

  .section h2,
  .legal-section h2 {
    font-size: 2.1rem;
  }

  .legal-hero h1 {
    font-size: 3.4rem;
  }

  .legal-section h2 {
    font-size: 1.7rem;
  }
}

@media (min-width: 980px) {
  h1 {
    font-size: 6.8rem;
  }

  .hero__lead {
    font-size: 1.6rem;
  }

  .section h2,
  .legal-section h2 {
    font-size: 2.45rem;
  }

  .legal-hero h1 {
    font-size: 4.4rem;
  }

  .legal-section h2 {
    font-size: 1.9rem;
  }

  .legal-page-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 92px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
