@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/source-serif-4-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/source-serif-4-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/lora-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/lora-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --teal: #2dd4bf;
  --teal-dim: #0d9488;
  --teal-glow: rgba(45, 212, 191, 0.15);
  --teal-deep: #134e4a;
  --navy: #0c1222;
  --navy-mid: #131b2e;
  --navy-light: #1a2540;
  --slate: #94a3b8;
  --slate-dim: #64748b;
  --warm: #faf8f5;
  --warm-mid: #f1ede8;
  --warm-dark: #e8e2da;
  --text: #1e293b;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --white: #ffffff;
  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-accent: 'Lora', Georgia, serif;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-4xl: 6rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 12px 32px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--warm);
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--teal);
  color: var(--navy);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus { top: var(--space-md); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ── Header ─────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  background: rgba(12, 18, 34, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(45, 212, 191, 0.08);
  transition: box-shadow var(--transition);
}
.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.header-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.header-brand span { color: var(--teal); }

.header-nav {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}
.header-nav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}
.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--teal);
  transition: width 0.25s ease, left 0.25s ease;
  border-radius: 1px;
}
.header-nav a:hover { color: var(--white); }
.header-nav a:hover::after { width: 100%; left: 0; }

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

/* ── Hero ───────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--navy);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 40%, rgba(45, 212, 191, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(45, 212, 191, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 212, 191, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
}

.hero-pulse {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(45, 212, 191, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 4s ease-out infinite;
}
.hero-pulse:nth-child(2) { animation-delay: 1.3s; width: 500px; height: 500px; }
.hero-pulse:nth-child(3) { animation-delay: 2.6s; width: 700px; height: 700px; }

@keyframes pulse-ring {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.8); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: var(--space-4xl) 0;
}
.hero-kicker {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--teal);
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fade-up 0.8s 0.2s ease forwards;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fade-up 0.8s 0.35s ease forwards;
}
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--teal), #5eead4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--slate);
  margin-bottom: var(--space-2xl);
  max-width: 520px;
  opacity: 0;
  animation: fade-up 0.8s 0.5s ease forwards;
}
.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  opacity: 0;
  animation: fade-up 0.8s 0.65s ease forwards;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--teal);
  color: var(--navy);
}
.btn-primary:hover {
  background: #5eead4;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.25);
}
.btn-outline {
  background: transparent;
  color: var(--slate);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
}
.btn-outline:hover {
  color: var(--white);
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(255,255,255,0.04);
}
.btn[disabled], .btn.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.btn svg { width: 18px; height: 18px; }

/* ── Wave Dividers ──────────────────────────────── */

.wave-divider {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -1px;
}
.wave-divider-flip {
  transform: scaleY(-1);
  margin-bottom: -1px;
  margin-top: 0;
}

/* ── Sections ───────────────────────────────────── */

.section {
  padding: var(--space-3xl) 0;
}
.section-dark {
  background: var(--navy);
  color: var(--white);
}
.section-warm {
  background: var(--warm);
}
.section-mid {
  background: var(--warm-mid);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}
.section-dark .section-header h2 { color: var(--white); }
.section-header .section-lead {
  font-size: 1.0625rem;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto;
}
.section-dark .section-header .section-lead { color: var(--slate); }

/* ── Feature Cards ──────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--teal-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 1.5rem;
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text);
}
.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ── Steps ──────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-xl);
  counter-reset: step-counter;
}
.step {
  position: relative;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-dim));
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  box-shadow: 0 4px 16px rgba(45, 212, 191, 0.2);
}
.step h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--white);
}
.step p {
  font-size: 0.9375rem;
  color: var(--slate);
  line-height: 1.7;
}
.step-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 42px;
    right: -16px;
    width: 32px;
    height: 2px;
    background: linear-gradient(90deg, var(--teal-dim), transparent);
  }
}

/* ── Games Grid ─────────────────────────────────── */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}
.game-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.game-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.game-card-body {
  padding: var(--space-lg);
}
.game-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}
.game-card-body p {
  font-size: 0.9375rem;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ── Hardware Specs ─────────────────────────────── */

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}
.spec-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--navy-light);
  border-radius: var(--radius-md);
  border: 1px solid rgba(45, 212, 191, 0.08);
  transition: border-color var(--transition);
}
.spec-item:hover {
  border-color: rgba(45, 212, 191, 0.2);
}
.spec-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--teal-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.spec-item h3 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}
.spec-item p {
  font-size: 0.8125rem;
  color: var(--slate-dim);
  line-height: 1.5;
}
.spec-item.has-photo {
  position: relative;
}
.spec-photo {
  display: none;
  position: absolute;
  top: -10px;
  right: -10px;
  width: 240px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 2px solid var(--teal);
  z-index: 10;
  transform: rotate(3deg);
}
.spec-item.has-photo:hover .spec-photo {
  display: block;
}
@media (max-width: 768px) {
  .spec-photo { display: none !important; }
}

/* ── Open Source CTA ────────────────────────────── */

.oss-banner {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow-card);
  max-width: 640px;
  margin: 0 auto;
}
.oss-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}
.oss-banner h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.oss-banner p {
  color: var(--text-mid);
  margin-bottom: var(--space-xl);
  font-size: 1.0625rem;
}
.btn-github {
  background: var(--text);
  color: var(--white);
}
.btn-github:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ── Footer ─────────────────────────────────────── */

.site-footer {
  background: var(--navy);
  color: var(--slate-dim);
  padding: var(--space-2xl) 0 var(--space-xl);
  border-top: 1px solid rgba(45, 212, 191, 0.06);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
}
.footer-brand span { color: var(--teal); }
.footer-heart {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--slate-dim);
}
.footer-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  font-size: 0.8125rem;
}
.footer-links a {
  color: var(--slate-dim);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--teal); }
.footer-copy {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.4);
  margin-top: var(--space-sm);
}

/* ── Scroll Reveal ──────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* Base: all children become visible (no matter how many) */
.reveal-stagger.visible > * { opacity: 1; transform: translateY(0); transition-delay: 0.26s; }
/* Stagger the first few for visual effect */
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-kicker, .hero h1, .hero-subtitle, .hero-actions {
    opacity: 1;
    animation: none;
  }
  .hero-pulse { animation: none; opacity: 0; }
}
