/* ==========================================================================
   TGX Games Studio — Stylesheet
   ========================================================================== */

/* ---- Theme tokens ---- */
:root,
:root[data-theme="dark"] {
  --bg: #0a0b12;
  --bg-alt: #12141f;
  --bg-elevated: #171a28;
  --text: #f2f3f8;
  --text-muted: #a3a7bd;
  --border: #262a3d;
  --accent: #2563eb;
  --accent-2: #38bdf8;
  --accent-3: #f59e0b;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --success: #34d399;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --card-bg: #12141f;
  --header-bg: rgba(10, 11, 18, 0.8);
  --input-bg: #171a28;
  --scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fbfbfe;
  --bg-alt: #f2f2f9;
  --bg-elevated: #ffffff;
  --text: #171a28;
  --text-muted: #5b5f76;
  --border: #e3e4ef;
  --accent: #1d4ed8;
  --accent-2: #0284c7;
  --accent-3: #d97706;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --success: #059669;
  --shadow: 0 10px 30px rgba(23, 26, 40, 0.1);
  --card-bg: #ffffff;
  --header-bg: rgba(251, 251, 254, 0.8);
  --input-bg: #ffffff;
  --scheme: light;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: var(--scheme);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

button {
  font: inherit;
  cursor: pointer;
}

input, textarea, select {
  font: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 88px 0;
}

@media (max-width: 768px) {
  section {
    padding: 56px 0;
  }
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 12px;
}

.section-head p {
  font-size: 1.05rem;
}

.alt-bg {
  background: var(--bg-alt);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 55%, transparent);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.85rem;
}

/* ---- Header / Nav ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.logo-img {
  display: block;
  height: 40px;
  width: auto;
}

.logo-img-lg {
  height: 88px;
}

/* Show the light-colored logo on light backgrounds, the white knockout on dark */
.logo-img-dark { display: block; }
.logo-img-light { display: none; }
:root[data-theme="light"] .logo-img-dark { display: none; }
:root[data-theme="light"] .logo-img-light { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 20px;
    gap: 2px;
    transform: translateY(-130%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.25s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-links a {
    padding: 14px 12px;
    border-radius: 8px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 168px 0 110px;
  overflow: hidden;
  text-align: center;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  width: 420px;
  height: 420px;
  background: var(--accent);
  top: -140px;
  left: -100px;
}

.hero::after {
  width: 380px;
  height: 380px;
  background: var(--accent-2);
  bottom: -160px;
  right: -100px;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
  max-width: 880px;
  margin: 0 auto 20px;
}

.hero .lead {
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  max-width: 620px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 780px;
  margin: 0 auto;
}

.hero-stat {
  padding: 20px 10px;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.hero-stat strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .hero {
    padding: 140px 0 70px;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Page header (inner pages) ---- */
.page-hero {
  padding: 150px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.22;
  filter: blur(110px);
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero .eyebrow {
  margin-bottom: 16px;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  margin-bottom: 14px;
}

.page-hero p {
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

/* ---- Cards / grid ---- */
.grid {
  display: grid;
  gap: 26px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

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

@media (max-width: 960px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  color: #fff;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

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

/* ---- Game cards ---- */
.game-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.game-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 2.6rem;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.game-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 55%);
}

.game-cover span {
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.game-cover-photo {
  display: none;
}

.game-cover-photo[src] {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.game-cover-photo[src] ~ span:not(.game-genre) {
  display: none;
}

.game-genre {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(10, 11, 18, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.game-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.game-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0;
}

.game-body p {
  font-size: 0.9rem;
  margin-bottom: 0;
  flex: 1;
}

.game-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #f59e0b;
  font-weight: 600;
}

.rating svg {
  width: 14px;
  height: 14px;
}

.platform-badges {
  display: flex;
  gap: 8px;
}

.platform-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-badge svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.game-actions {
  margin-top: 6px;
}

/* Cover color variants */
.cover-1 { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.cover-2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.cover-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.cover-4 { background: linear-gradient(135deg, #22c55e, #06b6d4); }
.cover-5 { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.cover-6 { background: linear-gradient(135deg, #ec4899, #f97316); }

/* ---- Filters ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}

.filter-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

/* ---- Team ---- */
.team-card {
  text-align: center;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 auto 16px;
}

.team-card h3 {
  margin-bottom: 4px;
}

.role {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.team-social {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.team-social a {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.team-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.team-social svg {
  width: 15px;
  height: 15px;
}

/* ---- Timeline ---- */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 32px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -39px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gradient);
  border: 3px solid var(--bg);
}

.timeline-item .year {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.timeline-item h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.timeline-item p {
  margin-bottom: 0;
}

/* ---- Values / features ---- */
.value-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.value-icon svg {
  width: 24px;
  height: 24px;
}

/* ---- CTA banner ---- */
.cta-banner {
  border-radius: 24px;
  padding: 64px 40px;
  text-align: center;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
}

.cta-banner h2 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  margin-bottom: 12px;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 520px;
  margin: 0 auto 28px;
}

.cta-banner .btn-primary {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.cta-banner .btn-outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.cta-banner .btn-outline:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.cta-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.form-group .required {
  color: var(--accent-3);
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

textarea.form-control {
  resize: vertical;
  min-height: 130px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 620px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.form-status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.form-status.show {
  display: block;
}

.form-status.success {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}

.form-status.error {
  background: color-mix(in srgb, #ef4444 15%, transparent);
  color: #ef4444;
  border: 1px solid color-mix(in srgb, #ef4444 35%, transparent);
}

/* ---- Contact info cards ---- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 860px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-info-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.contact-info-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-card .icon svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.contact-info-card h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.contact-info-card p,
.contact-info-card a {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-info-card a:hover {
  color: var(--accent);
}

.social-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.social-row a {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.social-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.social-row svg {
  width: 18px;
  height: 18px;
}

/* ---- Legal / doc pages ---- */
.doc-page {
  padding-top: 150px;
  padding-bottom: 80px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

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

.doc-toc {
  position: sticky;
  top: 100px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.doc-toc h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.doc-toc a {
  display: block;
  padding: 7px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.doc-toc a:last-child {
  border-bottom: none;
}

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

.doc-content h2 {
  font-size: 1.4rem;
  margin-top: 40px;
  padding-top: 16px;
  scroll-margin-top: 100px;
}

.doc-content h2:first-child {
  margin-top: 0;
}

.doc-content h3 {
  font-size: 1.1rem;
  margin-top: 24px;
}

.doc-content p,
.doc-content li {
  color: var(--text-muted);
  font-size: 0.97rem;
}

.doc-content ul {
  list-style: disc;
  padding-left: 22px;
  margin-bottom: 1em;
}

.doc-content li {
  margin-bottom: 6px;
}

.doc-content strong {
  color: var(--text);
}

.doc-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 420px;
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.doc-table th {
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc-table td {
  color: var(--text-muted);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table td code {
  font-family: "Space Grotesk", monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.doc-callout {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 32px;
  font-size: 0.92rem;
}

.doc-callout strong {
  color: var(--text);
}

.updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 64px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

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

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

.footer-brand p {
  font-size: 0.9rem;
  max-width: 280px;
  margin-top: 14px;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
  color: var(--text);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 6px 0;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom .social-row a {
  width: 36px;
  height: 36px;
}

/* ---- 404 ---- */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 60px;
}

.error-code {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 8px;
}

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 900;
  border: none;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Game detail modal ---- */
.game-card {
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

.game-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(5, 6, 12, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.game-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.game-modal {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 48px;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.game-modal-overlay.open .game-modal {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.modal-phone {
  flex-shrink: 0;
  width: 220px;
  margin: 0 auto;
}

.modal-phone-frame {
  position: relative;
  aspect-ratio: 9 / 19;
  border-radius: 34px;
  border: 10px solid #12141f;
  background: #12141f;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.modal-phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.modal-phone-home {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.modal-phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 55%);
}

.modal-phone-screen span {
  position: relative;
  z-index: 1;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 2.6rem;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.02em;
}

.modal-phone-video {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.modal-phone-screen.has-video span,
.modal-phone-screen.has-video::after {
  display: none;
}

.modal-phone-screen.has-video .modal-phone-video {
  display: block;
}

.modal-phone-photo {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.modal-phone-screen.has-photo span,
.modal-phone-screen.has-photo::after {
  display: none;
}

.modal-phone-screen.has-photo .modal-phone-photo {
  display: block;
}

.modal-info {
  flex: 1;
  min-width: 0;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.modal-badge-published {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}

.modal-badge-genre {
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  margin-bottom: 14px;
}

.modal-emoji {
  font-size: 1.7rem;
  line-height: 1;
}

.modal-description {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 18px;
}

.modal-info .game-meta {
  margin-bottom: 6px;
}

.modal-tech-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 22px 0 10px;
}

.modal-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.modal-tech-chip {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 760px) {
  .game-modal {
    padding: 32px 22px;
  }

  .modal-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .modal-phone {
    width: 170px;
  }

  .modal-badges,
  .modal-title,
  .modal-info .game-meta {
    justify-content: center;
  }

  .modal-tech-stack {
    justify-content: center;
  }
}

/* ---- Misc ---- */
.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: 48px;
}
