/* ═══════════════════════════════════════════════════════════
   WatchDog — Landing Page
   Palette: OKLCH teal-tinted dark
   Type: Archivo (display) + Manrope (body)
   ═══════════════════════════════════════════════════════════ */

/* Fonts loaded via <link> in HTML for faster rendering (no @import chain) */

/* ── Tokens ───────────────────────────────────────────────── */

:root {
  /* Surfaces — teal-tinted neutrals (hue 195) */
  --bg-deep:     oklch(8% 0.015 195);
  --bg-base:     oklch(11% 0.015 195);
  --bg-raised:   oklch(15% 0.018 195);
  --bg-elevated: oklch(19% 0.02 195);
  --bg-hover:    oklch(23% 0.02 195);

  /* Borders */
  --border-subtle:  oklch(22% 0.015 195);
  --border-default: oklch(28% 0.018 195);
  --border-strong:  oklch(35% 0.02 195);

  /* Text */
  --text-primary:   oklch(88% 0.015 195);
  --text-secondary: oklch(65% 0.02 195);
  --text-tertiary:  oklch(58% 0.02 195);

  /* Accent — Persian Teal */
  --accent:         oklch(72% 0.14 180);
  --accent-hover:   oklch(62% 0.12 180);
  --accent-subtle:  oklch(72% 0.14 180 / 0.12);
  --accent-15:      oklch(72% 0.14 180 / 0.15);
  --accent-20:      oklch(72% 0.14 180 / 0.20);
  --accent-30:      oklch(72% 0.14 180 / 0.30);

  /* Warm accent — amber counterpoint */
  --warm:         oklch(75% 0.14 75);
  --warm-muted:   oklch(60% 0.10 75);

  /* Warm alpha variants (pre-release indicator, tags, badges) */
  --warm-6:   oklch(75% 0.14 75 / 0.06);
  --warm-10:  oklch(75% 0.14 75 / 0.10);
  --warm-12:  oklch(75% 0.14 75 / 0.12);
  --warm-15:  oklch(75% 0.14 75 / 0.15);
  --warm-22:  oklch(75% 0.14 75 / 0.22);
  --warm-40:  oklch(75% 0.14 75 / 0.40);

  /* Semantic */
  --success: oklch(68% 0.15 155);
  --code-bg: oklch(10% 0.01 195);

  /* Spacing — 4pt base */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  12px;
  --space-lg:  16px;
  --space-xl:  24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;
  --space-5xl: 96px;

  /* Type */
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --max-w: 1080px;
  --radius-sm: 6px;
  --radius-md: 10px;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-med:  300ms;
  --duration-slow: 600ms;
}

/* ── Scroll Progress Bar ─────────────────────────────────── */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 200;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  @keyframes scroll-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }

  .scroll-progress {
    animation: scroll-fill linear both;
    animation-timeline: scroll(root);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
}

/* ── Reset ────────────────────────────────────────────────── */

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

html {
  scroll-padding-top: 56px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-deep);
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}
a:hover { color: var(--text-primary); }

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--duration-fast) var(--ease-out-expo);
}

.skip-link:focus {
  top: var(--space-sm);
  color: var(--bg-deep);
}

/* Focus — visible for keyboard navigation only */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* High-contrast focus ring on accent-colored elements */
.btn--primary:focus-visible {
  outline-color: var(--text-primary);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

/* ── Layout ───────────────────────────────────────────────── */

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-5xl) 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

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

.section-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

/* Primary "sell" sections get a louder heading — creates visual rhythm */
.section-heading--primary {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  font-weight: 900;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 55ch;
  margin-bottom: var(--space-3xl);
}

/* ── Scroll Reveal — Cinematic Sequencing ─────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translate(0);
}

.reveal-stagger { transition-delay: calc(var(--i, 0) * 80ms); }

/* Cinematic entrance variants — override default translateY */

.feature-hero:nth-child(1) .reveal,
.feature-hero:nth-child(1).reveal { transform: translateX(-32px); opacity: 0; }

.feature-hero:nth-child(2) .reveal,
.feature-hero:nth-child(2).reveal { transform: translateY(32px) scale(0.97); opacity: 0; }

.feature-hero:nth-child(3) .reveal,
.feature-hero:nth-child(3).reveal { transform: translateX(32px); opacity: 0; }

.feature-hero:nth-child(1).visible,
.feature-hero:nth-child(2).visible,
.feature-hero:nth-child(3).visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Screenshot gallery — depth assembly */
.screenshot--hero.reveal { transform: translateY(40px) scale(0.95); }
.screenshot--hero.visible { transform: translate(0) scale(1); }

.screenshot-row .screenshot:nth-child(1).reveal { transform: translateX(-24px) translateY(16px); }
.screenshot-row .screenshot:nth-child(2).reveal { transform: translateY(32px); }
.screenshot-row .screenshot:nth-child(3).reveal { transform: translateX(24px) translateY(16px); }
.screenshot-row .screenshot.visible { transform: translate(0); }

/* Section labels — subtle slide-in from left */
.section-label.reveal { transform: translateX(-16px); }
.section-label.visible { transform: translate(0); }

/* Steps — scale entrance */
.steps > .reveal { transform: translateY(24px) scale(0.96); }
.steps > .visible { transform: translate(0) scale(1); }

/* ── Scroll-Driven Animations (progressive enhancement) ──── */

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .features-hero {
      view-timeline-name: --features;
      view-timeline-axis: block;
    }

    @keyframes feature-slide-in {
      from { opacity: 0; transform: translateY(40px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .feature-hero {
      animation: feature-slide-in linear both;
      animation-timeline: --features;
      animation-range: entry 0% entry 40%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .feature-hero,
  .screenshot,
  .section-label,
  .steps > div {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   NAV
   ══════════════════════════════════════════════════════════ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  background: transparent;
  transition: background var(--duration-med) var(--ease-out-expo);
}

.site-nav.scrolled {
  background: color-mix(in oklch, var(--bg-deep), transparent 15%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  text-decoration: none;
}

.site-nav__logo picture { display: contents; }

.site-nav__logo img {
  border-radius: 4px;
}

.site-nav__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.site-nav__links {
  display: flex;
  gap: var(--space-xl);
}

.site-nav__links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  position: relative;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

.site-nav__links a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%) scale(0);
  opacity: 0;
  transition:
    transform var(--duration-med) var(--ease-out-expo),
    opacity var(--duration-med) var(--ease-out-expo);
}

.site-nav__links a.active::after {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.site-nav__links a.active {
  color: var(--text-primary);
}

.site-nav__links a:hover {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-md);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .site-nav__wordmark { display: none; }

  .nav-toggle { display: flex; }

  .site-nav__links {
    display: none;
    position: absolute;
    top: 100%;
    right: var(--space-xl);
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) 0;
    flex-direction: column;
    gap: 0;
    min-width: 140px;
  }

  .site-nav__links.open { display: flex; }

  .site-nav__links a {
    padding: var(--space-md) var(--space-xl);
    font-size: 0.85rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .site-nav__links a:hover {
    background: var(--bg-hover);
  }

  .site-nav__inner { position: relative; }
}

/* ══════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════ */

.hero {
  padding: var(--space-5xl) 0 var(--space-4xl);
  overflow: clip;
}

/* ── Scroll-driven parallax (overdrive) ───────────────────── */

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero {
      view-timeline-name: --hero;
      view-timeline-axis: block;
    }

    @keyframes hero-icon-drift {
      from { transform: translateY(0); opacity: 1; }
      to   { transform: translateY(-60px); opacity: 0.3; }
    }

    @keyframes hero-title-drift {
      from { transform: translateY(0); opacity: 1; }
      to   { transform: translateY(-30px); opacity: 0.5; }
    }

    @keyframes hero-games-drift {
      from { transform: translateY(0); opacity: 1; }
      to   { transform: translateY(20px); opacity: 0.2; }
    }

    .hero__icon {
      animation: hero-icon-drift linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 60%;
    }

    .hero__title {
      animation: hero-title-drift linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 60%;
    }

    .hero__games {
      animation: hero-games-drift linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 50%;
    }
  }
}

.hero__layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4xl);
  align-items: center;
}

.hero__inner {
  display: grid;
  gap: var(--space-xl);
  max-width: 680px;
}

/* ── Supported Games (hero right column) ──────────────────── */

.hero__games {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-lg);
}

.hero__games-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero__games-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
  max-width: 240px;
}

a.game-pill { text-decoration: none; cursor: pointer; }

.game-pill {
  --pill-glow: 180; /* fallback to teal hue */
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  transition:
    border-color var(--duration-fast) var(--ease-out-expo),
    box-shadow var(--duration-med) var(--ease-out-expo),
    transform var(--duration-fast) var(--ease-out-expo);
}

.game-pill--cs2  { border-color: oklch(55% 0.12 60); color: oklch(75% 0.10 60); --pill-glow: 60; }
.game-pill--val  { border-color: oklch(55% 0.14 15); color: oklch(70% 0.12 15); --pill-glow: 15; }
.game-pill--ow2  { border-color: oklch(55% 0.10 50); color: oklch(75% 0.08 50); --pill-glow: 50; }
.game-pill--r6s  { border-color: oklch(55% 0.08 250); color: oklch(72% 0.06 250); --pill-glow: 250; }

.game-pill--ai  { border-color: var(--accent); color: var(--accent); --pill-glow: 180; }

.game-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px oklch(45% 0.12 var(--pill-glow) / 0.25);
  border-color: oklch(65% 0.14 var(--pill-glow));
}

.hero__games-note {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: right;
}

.hero__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
}

.hero__icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 5vw + 1rem, 4rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text-primary);
}

.hero__tagline {
  font-size: clamp(1.1rem, 1.5vw + 0.5rem, 1.35rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 48ch;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  margin-top: var(--space-xs);
}

.hero__meta .dot { opacity: 0.3; }

/* ── Pre-release indicator (overdrive) ────────────────────── */

/* Animatable custom property for the circuit trace gradient position */
@property --trace-pos {
  syntax: '<percentage>';
  initial-value: 0%;
  inherits: false;
}

.hero__prerelease-wrap {
  position: relative;
  width: fit-content;
  margin-top: var(--space-sm);
}

/* Circuit trace — thin line connecting download button to pre-release notice */
.hero__prerelease-wrap::before {
  content: '';
  position: absolute;
  left: 28px;
  top: -12px;
  width: 1px;
  height: 12px;
  background: linear-gradient(
    to bottom,
    oklch(75% 0.14 75 / 0) var(--trace-pos),
    oklch(75% 0.14 75 / 0.5) var(--trace-pos),
    oklch(75% 0.14 75 / 0) calc(var(--trace-pos) + 30%)
  );
  animation: trace-flow 2.4s ease-in-out infinite;
}

@keyframes trace-flow {
  0%   { --trace-pos: -30%; }
  100% { --trace-pos: 130%; }
}

.hero__prerelease {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--warm-muted);
  padding: var(--space-sm) var(--space-lg);
  background: var(--warm-6);
  border: 1px solid var(--warm-12);
  border-radius: var(--radius-sm);
  width: fit-content;
  animation: prerelease-fade-in var(--duration-slow) var(--ease-out-expo) both;
  transition:
    background var(--duration-med) var(--ease-out-expo),
    border-color var(--duration-med) var(--ease-out-expo);
  cursor: default;
}

.hero__prerelease-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Hover: expand to show release details */
.hero__prerelease:hover {
  background: var(--warm-10);
  border-color: var(--warm-22);
}

/* Hover echo: when pre-release is hovered, the download button glows.
   Applied via JS (data-prerelease-hover on parent) since DOM order
   prevents upward CSS sibling selectors. */
.hero__inner[data-prerelease-hover] .btn--primary {
  box-shadow: 0 0 20px var(--warm-15);
  transition: box-shadow var(--duration-med) var(--ease-out-expo);
}

/* Heartbeat dot — double-pulse rhythm like a build status monitor */
.hero__prerelease-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warm);
  flex-shrink: 0;
  animation: heartbeat 2s ease-in-out infinite;
  box-shadow: 0 0 4px var(--warm-40);
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); opacity: 1; }
  14%      { transform: scale(1.5); opacity: 1; }
  28%      { transform: scale(1); opacity: 0.8; }
  42%      { transform: scale(1.3); opacity: 1; }
  56%      { transform: scale(1); opacity: 0.6; }
}

/* Release details — revealed on hover */
.hero__prerelease-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-med) var(--ease-out-expo);
  overflow: hidden;
}

.hero__prerelease:hover .hero__prerelease-details {
  grid-template-rows: 1fr;
}

.hero__prerelease-details-inner {
  overflow: hidden;
  min-height: 0;
}

.hero__prerelease-changelog {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--warm-10);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.6;
  max-width: 35ch;
}

.hero__prerelease-date {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  opacity: 0.7;
  margin-left: auto;
  white-space: nowrap;
}

.hero__prerelease-link {
  color: var(--warm);
  font-weight: 600;
  text-decoration: none;
  margin-left: var(--space-xs);
  transition: color var(--duration-fast) var(--ease-out-expo);
}

.hero__prerelease-link:hover {
  color: var(--text-primary);
}

@keyframes prerelease-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__prerelease-dot { animation: none; }
  .hero__prerelease-wrap::before { animation: none; opacity: 0.3; }
  .hero__prerelease { animation: none; opacity: 1; }
}

/* Badges now inline within .hero__meta row — kept for backwards compatibility */
.hero__badges {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

/* When badges appear inside meta row, tighten spacing */
.hero__meta .badge {
  margin-left: var(--space-xs);
}

.badge {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  transition:
    border-color var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo);
}

.badge:hover {
  border-color: var(--accent);
  color: var(--text-secondary);
}

/* ── "New" Tag ───────────────────────────────────────────── */

.tag-new {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--warm);
  color: var(--bg-deep);
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1.4;
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-fast) var(--ease-out-expo),
    box-shadow var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo),
    transform 100ms;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg-deep);
  padding: var(--space-md) var(--space-xl);
  font-size: 0.95rem;
  box-shadow: 0 2px 8px var(--accent-20);
}
.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--bg-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-30);
}
.btn--primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 1px 4px var(--accent-15);
  transition-duration: 80ms;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-md) var(--space-lg);
  font-size: 0.85rem;
  border: 1px solid var(--border-default);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.btn--ghost:active {
  transform: translateY(1px) scale(0.98);
  transition-duration: 80ms;
}

/* ══════════════════════════════════════════════════════════
   FEATURES — Hero tier (top 3 differentiators)
   ══════════════════════════════════════════════════════════ */

.features-hero {
  display: grid;
  gap: var(--space-lg);
}

.feature-hero {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xl);
  padding: var(--space-2xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  transition:
    border-color var(--duration-fast) var(--ease-out-expo),
    background var(--duration-fast) var(--ease-out-expo);
}

.feature-hero:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.feature-hero__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  flex-shrink: 0;
}

.feature-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.feature-hero__desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 55ch;
}

.feature-hero--ai {
  position: relative;
  overflow: hidden;
}

.waveform-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.22;
  z-index: 0;
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
}

.feature-hero--ai .feature-hero__icon,
.feature-hero--ai .feature-hero__body {
  position: relative;
  z-index: 1;
}

.feature-hero__icon--ai {
  background: var(--warm-12);
  color: var(--warm);
}

/* Feature icon hover animations — CSS-only, subtle */

.feature-hero__icon svg {
  transition: transform var(--duration-med) var(--ease-out-expo);
}

.feature-hero:nth-child(1):hover .feature-hero__icon svg {
  /* Replay Buffer — clock tick */
  transform: rotate(30deg);
}

.feature-hero:nth-child(2):hover .feature-hero__icon svg {
  /* Highlight Detection — bolt pulse */
  transform: scale(1.15);
}

.feature-hero:nth-child(3):hover .feature-hero__icon svg {
  /* Discord Sharing — nudge right */
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .feature-hero__icon svg { transition: none; }
  .feature-hero:hover .feature-hero__icon svg { transform: none; }
}

/* ── Features — Compact tier (supporting 6) ───────────────── */

.features-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg) var(--space-2xl);
  margin-top: var(--space-lg);
}

.feature-sm {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.feature-sm__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent-subtle);
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-sm__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.feature-sm__desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════
   SCREENSHOTS
   ══════════════════════════════════════════════════════════ */

.screenshots {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.screenshot {
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  transition:
    border-color var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-med) var(--ease-out-expo);
}

.screenshot:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

/* picture wrapper inherits screenshot layout without extra box */
.screenshot picture { display: contents; }

.screenshot__caption {
  display: block;
  padding: var(--space-md) var(--space-lg);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-raised);
}

.screenshot-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
}

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

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

/* ══════════════════════════════════════════════════════════
   QUICK START
   ══════════════════════════════════════════════════════════ */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
}

.step__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  color: var(--warm);
  line-height: 1;
  margin-bottom: var(--space-lg);
}

.step__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.step__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.steps-note {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  max-width: 60ch;
  line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════
   GAME SETUP
   ══════════════════════════════════════════════════════════ */

.setup-grid {
  display: grid;
  gap: var(--space-lg);
  max-width: 720px;
}

.setup-card {
  padding: var(--space-xl);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.setup-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.setup-card__text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.setup-card__text:last-child { margin-bottom: 0; }

.setup-card pre {
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.pre-wrapper {
  position: relative;
}

/* Right-fade indicating scrollable overflow */
.pre-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--code-bg));
  pointer-events: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

/* Show fade when pre is scrollable (JS adds this class) */
.pre-wrapper--scrollable::after {
  opacity: 1;
}

.copy-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo);
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
}

.copy-btn.copied {
  color: var(--warm);
  border-color: var(--warm-muted);
}

.copy-check {
  display: block;
}

.copy-check polyline {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: check-draw 300ms var(--ease-out-expo) forwards;
}

@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}

.setup-auto {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.setup-auto__check {
  color: var(--warm);
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.6;
}

.setup-auto__text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════
   RELEASES
   ══════════════════════════════════════════════════════════ */

.releases {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 680px;
}

/* Hero release card — latest or pre-release */
.release-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-2xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.release-hero--prerelease {
  border-color: var(--warm-muted);
}

.release-hero--stable {
  border-color: var(--accent-hover);
}

.release-hero__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.release-hero__top {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.release-hero__version {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.release-hero__date {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.release-badge {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  line-height: 1.4;
}

.release-badge--prerelease {
  background: var(--warm);
  color: var(--bg-deep);
}

.release-badge--latest {
  background: var(--accent);
  color: var(--bg-deep);
}

.release-hero .btn--primary {
  flex-shrink: 0;
}

/* Compact release rows */
.release-compact-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.release-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-raised);
  transition: background var(--duration-fast) var(--ease-out-expo);
}

.release-row:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.release-row:hover {
  background: var(--bg-elevated);
}

.release-row__info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

.release-row__version {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.release-row__date {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.release-row__dl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition:
    color var(--duration-fast) var(--ease-out-expo),
    background var(--duration-fast) var(--ease-out-expo);
  flex-shrink: 0;
}

.release-row__dl:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

.releases-fallback {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.releases-footer {
  margin-top: var(--space-xl);
  font-size: 0.85rem;
}

/* Timeline connector + pulse */

.releases {
  position: relative;
}

.releases::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 32px;
  bottom: 32px;
  width: 1px;
  background: var(--border-subtle);
}

.release-hero,
.release-row {
  position: relative;
}

.release-hero::before,
.release-row::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-default);
  transform: translateY(-50%);
}

.release-hero::before {
  width: 8px;
  height: 8px;
  left: -13px;
}

.release-hero--prerelease::before {
  background: var(--warm);
}

.release-hero--stable::before {
  background: var(--accent);
}

/* Amber pulse on pre-release hero border */
@property --pulse-alpha {
  syntax: '<number>';
  inherits: false;
  initial-value: 0.4;
}

@keyframes border-pulse {
  0%, 100% { --pulse-alpha: 0.4; }
  50%      { --pulse-alpha: 0.9; }
}

.release-hero--prerelease {
  border-color: oklch(60% 0.10 75 / var(--pulse-alpha));
  animation: border-pulse 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .release-hero--prerelease {
    animation: none;
    border-color: var(--warm-muted);
  }
  .releases::before { display: none; }
  .release-hero::before,
  .release-row::before { display: none; }
}

/* Timeline needs left padding */
.releases {
  padding-left: 32px;
}

@media (max-width: 768px) {
  .release-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .releases { padding-left: 24px; }
}

/* ══════════════════════════════════════════════════════════
   FAQ
   ══════════════════════════════════════════════════════════ */

.faq-list {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out-expo);
}

.faq-item:hover {
  border-color: var(--border-default);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

.faq-chevron {
  transition: transform 200ms var(--ease-out-expo);
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-left: var(--space-lg);
}

.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-med) var(--ease-out-expo);
}

.faq-item.open .faq-a { grid-template-rows: 1fr; }

.faq-a__inner {
  overflow: hidden;
}

.faq-a__content {
  padding: 0 var(--space-xl) var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ══════════════════════════════════════════════════════════
   BACK TO TOP
   ══════════════════════════════════════════════════════════ */

.back-to-top {
  position: fixed;
  bottom: var(--space-2xl);
  right: var(--space-2xl);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--duration-med) var(--ease-out-expo),
    transform var(--duration-med) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo);
}

.back-to-top:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.back-to-top[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}

/* ══════════════════════════════════════════════════════════
   SCREENSHOT LIGHTBOX
   ══════════════════════════════════════════════════════════ */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: zoom-out;
  padding: var(--space-xl);
  opacity: 1;
}

.lightbox::backdrop {
  background: color-mix(in oklch, var(--bg-deep), transparent 10%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox:not([open]) { display: none; }

/* Entry animation */
@starting-style {
  .lightbox[open] {
    opacity: 0;
  }

  .lightbox[open] .lightbox__img {
    transform: scale(0.85);
  }
}

.lightbox {
  transition:
    opacity var(--duration-med) var(--ease-out-expo),
    display var(--duration-med) allow-discrete;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: transform var(--duration-med) var(--ease-out-expo);
}

.lightbox__close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out-expo);
}

.lightbox__close:hover { color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox__img {
    transition: none;
  }
}

/* ══════════════════════════════════════════════════════════
   CLOSING CTA
   ══════════════════════════════════════════════════════════ */

.closing-cta {
  text-align: center;
  padding: var(--space-4xl) 0;
}

.closing-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.closing-cta__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.closing-cta__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */

.footer {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border-subtle);
}

.footer__inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

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

.footer__dot { opacity: 0.3; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .section { padding: var(--space-4xl) 0; }
  .hero { padding: var(--space-4xl) 0 var(--space-3xl); }
  .hero__layout { grid-template-columns: 1fr; gap: var(--space-2xl); }
  .hero__games { align-items: flex-start; }
  .hero__games-list { justify-content: flex-start; }
  .hero__games-note { text-align: left; }

  .features-compact { grid-template-columns: 1fr; }
  .feature-hero { flex-direction: column; gap: var(--space-lg); }
  .steps { grid-template-columns: 1fr; gap: var(--space-2xl); }

  .hero__actions { flex-direction: column; align-items: flex-start; }

  /* Copy button above code on mobile */
  .pre-wrapper { display: flex; flex-direction: column-reverse; }
  .copy-btn {
    position: static;
    align-self: flex-end;
    margin-bottom: var(--space-xs);
  }

  /* Touch targets — 44px minimum on mobile */
  .footer__inner { gap: var(--space-sm); }
  .footer a,
  .footer span {
    padding: var(--space-sm) var(--space-xs);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .footer__dot { min-height: auto; padding: 0; }

  .skip-link { padding: var(--space-md) var(--space-lg); }
}
