@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Press Start 2P"),
    url("../fonts/press-start-2p-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Courier Prime"),
    url("../fonts/courier-prime-regular-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Courier Prime Bold"), local("Courier Prime"),
    url("../fonts/courier-prime-bold-latin.woff2") format("woff2");
}

:root {
  /* Palette - Softer, Artistic, Gothic */
  --color-bg: #1a1025; /* Keep deep indigo base */
  --color-bg-dark: #120b1a; /* Darker, warmer */
  --color-primary: #b388eb; /* Soft Lavender (was Magenta) */
  --color-secondary: #8093f1; /* Periwinkle (was Neon Cyan) */
  --color-accent: #f7d794; /* Muted Gold/Parchment */
  --color-text: #f3e9dc; /* Warm Cream */
  --color-text-muted: #9a8c98; /* Dusty Purple/Grey */
  --color-hud: #72efdd; /* Soft Mint (was Neon Green) */

  /* Fonts */
  --font-display: "Press Start 2P", cursive;
  --font-body: "Courier Prime", monospace; /* Switched to Prime for better readability */

  /* Spacing */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;

  /* UI */
  --border-radius: 8px; /* Slightly softer corners */
  --border-width: 2px;
  --glow-primary: 0 4px 10px rgba(179, 136, 235, 0.3); /* Diffuse shadow */
  --glow-secondary: 0 4px 10px rgba(128, 147, 241, 0.3);

  /* Navigation */
  --nav-height: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --nav-offset: calc(var(--nav-height) + var(--safe-top));
  --hero-top-extra: 0px;
  scroll-padding-top: var(--nav-offset);
}

/* ===== STICKY NAVIGATION ===== */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-offset);
  background: rgba(18, 11, 26, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) var(--spacing-lg) 0 var(--spacing-lg);
  z-index: 9000;
  transition: transform 0.3s ease, background 0.3s ease;
}

.main-nav.hidden {
  transform: translateY(-100%);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #000;
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s, transform 0.2s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--color-secondary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--color-secondary);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-sm);
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered animations for grid items */
.scroll-reveal-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-reveal-stagger.revealed > *:nth-child(1) {
  transition-delay: 0.05s;
}
.scroll-reveal-stagger.revealed > *:nth-child(2) {
  transition-delay: 0.1s;
}
.scroll-reveal-stagger.revealed > *:nth-child(3) {
  transition-delay: 0.15s;
}
.scroll-reveal-stagger.revealed > *:nth-child(4) {
  transition-delay: 0.2s;
}
.scroll-reveal-stagger.revealed > *:nth-child(5) {
  transition-delay: 0.25s;
}
.scroll-reveal-stagger.revealed > *:nth-child(6) {
  transition-delay: 0.3s;
}
.scroll-reveal-stagger.revealed > *:nth-child(7) {
  transition-delay: 0.35s;
}
.scroll-reveal-stagger.revealed > *:nth-child(8) {
  transition-delay: 0.4s;
}

.scroll-reveal-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  /* Changed to a much subtler, darker gradient */
  background-image: linear-gradient(to bottom, #150d21, #0a0510);
  background-attachment: fixed;
  background-size: cover;
  position: relative; /* For sticker positioning */
}

/* Texture Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03; /* Reduced opacity for subtlety */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--spacing-md);
  color: var(--color-accent);
  text-shadow: 2px 2px 0 #000;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: all 0.15s;
}

a:hover {
  color: var(--color-primary);
  text-shadow: var(--glow-primary);
}

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
  scroll-snap-align: start;
}

.content-defer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 800px;
}

/* ... existing styles ... */

/* Stickers */
.sticker {
  position: absolute;
  pointer-events: none;
  z-index: 0; /* Behind content, above background */
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  mix-blend-mode: normal;
  width: 230px;
  height: auto;
  image-rendering: auto !important; /* Keep sticker art smooth */
}

.sticker-band {
  position: relative;
  min-height: 180px;
  margin-top: var(--spacing-lg);
}

.sticker-band--footer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  min-height: 0;
}

.sticker img,
.sticker-layer img {
  width: 100%;
  height: auto;
  display: block;
}

.sticker-layer {
  display: block;
  pointer-events: none;
}

.sticker-blink {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: purr-blink 2s linear infinite;
}

@media (max-width: 1000px) {
  .sticker {
    width: 110px;
  }

  .sticker-purr {
    left: -6px;
    bottom: 0;
  }

  .sticker-sybil {
    right: -6px;
    bottom: 0;
  }

  .sticker-band {
    min-height: 140px;
    margin-top: var(--spacing-md);
  }
}

@media (max-width: 600px) {
  .sticker {
    bottom: 10px;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--r, 0deg)) scale(var(--scale, 1));
  }
  50% {
    transform: translateY(-20px) rotate(var(--r, 5deg)) scale(var(--scale, 1));
  }
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes purr-blink {
  0%,
  84.9% {
    opacity: 0;
  }
  85%,
  100% {
    opacity: 1;
  }
}

.text-center {
  text-align: center;
}
.grid {
  display: grid;
  gap: var(--spacing-lg);
}
.flex {
  display: flex;
  gap: var(--spacing-md);
}
.flex-center {
  align-items: center;
  justify-content: center;
}

/* Global Pixel Art Rendering */
img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Hero Section */
.hero {
  height: calc(100vh - var(--nav-offset));
  min-height: calc(100vh - var(--nav-offset));
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: var(--spacing-lg) var(--spacing-md) var(--spacing-lg);
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero-bg-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  display: block;
}

.hero-bg-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95);
  image-rendering: auto !important;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 -2px -6px -2px; /* bleed past edges to avoid 1px seams */
  background: linear-gradient(
    to bottom,
    rgba(26, 16, 37, 0) 0%,
    rgba(26, 16, 37, 0.55) 55%,
    var(--color-bg) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 10;
  animation: fadeIn 0.6s ease-out;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  height: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: var(--spacing-lg);
  width: 100%;
  height: 100%;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  height: 100%;
}

.hero-logo {
  display: block;
  max-width: 100%;
  width: 1000px;
  height: auto;
  margin-bottom: var(--spacing-md);
  filter: drop-shadow(0 0 20px rgba(217, 0, 255, 0.5));
  animation: float-soft 6s ease-in-out infinite;
  image-rendering: auto !important; /* keep logo crisp, not pixelated */
}

.hero-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-tagline-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: auto;
  margin-bottom: var(--spacing-md);
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--color-text);
  margin: 0;
  text-shadow: 2px 2px 0 #000;
  padding: 0;
  background: transparent;
  display: inline-block;
  border-radius: 0;
  border: none;
}

.hero-model-chip {
  width: clamp(170px, 20vw, 280px);
  height: clamp(102px, 12vw, 170px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  position: relative;
  cursor: pointer;
  outline: none;
}

.hero-model-chip:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.chip-preview {
  width: 100%;
  height: 100%;
  pointer-events: none;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  --progress-bar-height: 0px;
  --progress-bar-display: none;
  background: transparent !important;
}

.hero-model-chip model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
  background: transparent;
}

.chip-preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border-radius: 4px;
}

@media (max-width: 540px) {
  .hero-model-chip {
    width: clamp(120px, 50vw, 190px);
    height: clamp(72px, 28vw, 120px);
  }
}

.hero-cta {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.hero-scroll {
  margin-top: var(--spacing-md);
  background: none;
  border: none;
  color: var(--color-text);
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.hero-scroll:hover {
  transform: translateY(4px);
  color: var(--color-secondary);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  cursor: default;
}

.hero-pill a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-pill a:hover {
  color: #fff;
  text-decoration-thickness: 2px;
}

.kick-inline {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
  font-size: 0.9rem;
  background: transparent;
  color: #05ce78;
  border-radius: 6px;
  border: none;
  box-shadow: none;
}

.hero-pill-primary {
  background: transparent;
  color: var(--color-text);
  border: none;
  text-shadow: none;
  pointer-events: none; /* not a link */
}

.hero-pill-ghost {
  background: transparent;
  color: var(--color-secondary);
  border: none;
  cursor: default;
  text-decoration: none;
}

.hero-pill-ghost:hover {
  transform: none;
  color: var(--color-secondary);
  text-decoration: none;
}

.hero-cta-secondary {
  width: auto;
  justify-content: center;
  margin-top: calc(var(--spacing-sm) * 0.35);
  text-align: center;
}

@media (max-width: 450px) {
  .hero-pill-primary {
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
  }

  .kick-inline {
    display: block;
  }
}

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

/* 3D modal */
.model-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 11000;
}

.model-modal.open {
  display: block;
}

.model-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
}

.model-modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 760px);
  height: min(70vh, 520px);
  background: radial-gradient(
      circle at 25% 20%,
      rgba(179, 136, 235, 0.12),
      transparent 55%
    ),
    radial-gradient(circle at 80% 70%, rgba(5, 206, 120, 0.12), transparent 50%),
    rgba(10, 5, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(128, 147, 241, 0.14);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

.model-modal-dialog model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  --progress-bar-height: 0px;
  --progress-bar-display: none;
  background: radial-gradient(
    circle at 50% 35%,
    rgba(255, 255, 255, 0.05),
    rgba(0, 0, 0, 0)
  );
  position: relative;
  z-index: 1;
}

.model-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(
      circle at 50% 45%,
      rgba(255, 255, 255, 0.06),
      transparent 55%
    ),
    rgba(10, 5, 16, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
  z-index: 2;
}

.model-spinner.visible {
  opacity: 1;
}

.spinner-frame {
  border: 3px solid #f7d794;
  padding: 14px 18px;
  background: #120b1a;
  box-shadow: 0 0 0 3px #1a1025, 0 0 24px rgba(247, 215, 148, 0.35);
  display: grid;
  gap: 4px;
  justify-items: center;
  animation: pulse-frame 1s infinite steps(2);
}

.spinner-text {
  font-family: var(--font-display);
  color: #f7d794;
  letter-spacing: 2px;
  font-size: 0.75rem;
}

@keyframes pulse-frame {
  0% {
    box-shadow: 0 0 0 3px #1a1025, 0 0 16px rgba(247, 215, 148, 0.15);
  }
  100% {
    box-shadow: 0 0 0 3px #1a1025, 0 0 24px rgba(247, 215, 148, 0.4);
  }
}

.model-tip {
  position: absolute;
  right: 16px;
  bottom: 12px;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

.model-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.model-close:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.12);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .hero-tagline {
    font-size: 1rem;
  }
}

/* Story Video */
.story-video-block {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.story-video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 22 / 15; /* matches 176x120 art x4 */
  background: radial-gradient(
      circle at 20% 20%,
      rgba(179, 136, 235, 0.08),
      transparent 40%
    ),
    radial-gradient(circle at 80% 60%, rgba(5, 206, 120, 0.06), transparent 42%),
    #000;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  isolation: isolate;
  filter: saturate(1.2) contrast(1.2) brightness(0.94);
}

.story-video-shell::after {
  content: "";
  position: absolute;
  inset: -12%;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0.35) 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
  filter: blur(2px);
  opacity: 0.6;
  z-index: 2;
}

.story-video {
  position: absolute;
  image-rendering: pixelated;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
  box-shadow: 0 0 18px rgba(0, 255, 170, 0.12), 0 0 28px rgba(255, 80, 200, 0.1);
  z-index: 1;
}

.story-crt-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.story-video-hidden {
  opacity: 0;
}

.story-video-hidden {
  opacity: 0;
}

.story-caption-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.story-caption-list p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-start;
}

.story-caption-list p.active {
  color: var(--color-secondary);
}

.story-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--color-secondary);
  color: #0b0c0f;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(5, 206, 120, 0.35);
}

.story-caption-live {
  position: absolute;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: var(--spacing-sm);
  padding: clamp(0.3rem, 0.28rem + 0.32vw, 0.65rem)
    clamp(0.55rem, 0.5rem + 0.5vw, 1.05rem);
  margin: 0;
  width: clamp(240px, 64%, 720px);
  background: rgba(0, 0, 0, 0.9);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: clamp(0.58rem, 0.48rem + 0.35vw, 0.96rem);
  line-height: 1.38;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

@media (max-width: 540px) {
  .story-caption-live {
    bottom: var(--spacing-sm);
    letter-spacing: 0.02em;
    width: clamp(220px, 90%, 320px);
  }
}

@media (max-width: 768px) {
  .story-video-shell {
    aspect-ratio: 22 / 15;
  }

  .story-caption-list {
    grid-template-columns: 1fr;
  }
}

/* Sprite Logic (used across sections) */
.sprite-wrapper {
  position: relative;
  overflow: hidden;
}

.sprite-track-y {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--rows) * 100%);
  animation: sprite-slide-y var(--duration-total) steps(calc(var(--rows) - 1))
    infinite;
  will-change: transform;
}

.sprite-track-x {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--cols) * 100%);
  height: 100%;
  image-rendering: pixelated;
  will-change: transform;
  animation: sprite-slide-x var(--duration-row) steps(calc(var(--cols) - 1))
    infinite;
}

@keyframes sprite-slide-x {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% + (100% / var(--cols))));
  }
}

@keyframes sprite-slide-y {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(-100% + (100% / var(--rows))));
  }
}

/* Pillars Section */
.pillars-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pillar-card {
  transition: transform 0.2s, box-shadow 0.2s;
  background: linear-gradient(
    135deg,
    rgba(26, 16, 37, 0.5),
    rgba(15, 8, 22, 0.6)
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: var(--spacing-lg) var(--spacing-lg);
  gap: var(--spacing-sm);
}

.pillar-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: var(--color-secondary);
}

.pillar-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--spacing-md);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.pillar-card p {
  margin-top: var(--spacing-sm);
  line-height: 1.7;
}

.pillar-card h3 {
  color: var(--color-secondary);
  font-size: 1rem;
}

/* Worlds Accordion */
.worlds-accordion {
  display: flex;
  width: 100%;
  height: 300px;
  overflow: hidden;
  gap: 0;
}

.world-slice {
  --slice-i: 0;
  flex: 1;
  position: relative;
  transition: flex 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease,
    transform 0.45s ease;
  overflow: hidden;
  cursor: pointer;
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  background: #000;
}

.world-slice:last-child {
  border-right: none;
}

.world-slice:hover,
.world-slice.active {
  flex: 5;
}

.worlds-accordion.is-animatable .world-slice {
  opacity: 0;
  transform: translateY(18px);
}

.worlds-accordion.is-animatable.revealed .world-slice {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--slice-i, 0) * 80ms);
}

.world-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 3.5s ease;
  opacity: 0.6;
  overflow: hidden;
}

/* Medusa sprite: preserve sheet aspect (2 cols x 4 rows, 160x192) even when cards shrink */
.sprite-medusa {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 5 / 3; /* rows/cols * native ratio = 4/2 * 160/192 ≈ 1.67 */
  margin: 0 auto;
  position: relative;
}

.world-bg picture,
.world-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto !important;
}

.world-slice:hover .world-bg {
  transform: scale(1.1);
  opacity: 1;
}

.worlds-accordion .world-slice:nth-child(1) {
  --slice-i: 0;
}
.worlds-accordion .world-slice:nth-child(2) {
  --slice-i: 1;
}
.worlds-accordion .world-slice:nth-child(3) {
  --slice-i: 2;
}
.worlds-accordion .world-slice:nth-child(4) {
  --slice-i: 3;
}
.worlds-accordion .world-slice:nth-child(5) {
  --slice-i: 4;
}
.worlds-accordion .world-slice:nth-child(6) {
  --slice-i: 5;
}
.worlds-accordion .world-slice:nth-child(7) {
  --slice-i: 6;
}
.worlds-accordion .world-slice:nth-child(8) {
  --slice-i: 7;
}

.world-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--spacing-xl);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease 0.05s;
}

.world-slice:hover .world-content {
  opacity: 1;
  transform: translateY(0);
}

.world-content h3 {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  color: var(--color-accent);
}

.world-content p {
  font-size: 1rem;
  max-width: 400px;
}

.world-label {
  position: absolute;
  bottom: var(--spacing-lg);
  right: var(--spacing-md);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  transition: opacity 0.2s;
}

.world-slice:hover .world-label {
  opacity: 0;
}

@media (max-width: 768px) {
  .worlds-accordion {
    flex-direction: column;
    height: auto;
  }
  .world-slice {
    height: 90px;
    width: 100%;
    flex: none;
  }
  .world-slice:hover,
  .world-slice.active {
    height: 220px;
    flex: none;
  }
  .world-label {
    writing-mode: horizontal-tb;
    transform: none;
    left: var(--spacing-md);
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  .worlds-hint {
    display: block;
    margin: -0.5rem 0 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
  }
}

.worlds-hint {
  display: none;
}

/* Boss Gallery */
.boss-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  justify-content: center;
}

.boss-card {
  background: rgba(26, 16, 37, 0.5);
  border: 1px solid rgba(179, 136, 235, 0.3);
  padding: var(--spacing-md);
  width: 220px;
  text-align: center;
  position: relative;
  transition: transform 0.2s;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
}

.boss-card:hover {
  transform: translateY(-5px);
  z-index: 5;
  box-shadow: 0 10px 25px rgba(179, 136, 235, 0.2);
  border-color: var(--color-primary);
}

.boss-img-container {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  background: radial-gradient(
    circle,
    rgba(179, 136, 235, 0.1) 0%,
    rgba(0, 0, 0, 0) 70%
  );
}

.boss-img {
  max-height: 100%;
  max-width: 100%;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
}

.boss-card h3 {
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
  font-size: 1rem;
}

.boss-card .role {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Art Grid */
.art-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  padding: var(--spacing-lg) 0;
  max-width: 1050px;
  margin: 0 auto;
}

.art-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
  background: #000;
  height: 100%;
}

/* Art Grid - Masonry Layout
.art-grid {
  column-count: 3;
  column-gap: var(--spacing-md);
  padding: var(--spacing-lg) 0;
  max-width: 1050px;
  margin: 0 auto;
}

.art-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
  background: #000;
  break-inside: avoid;
  margin-bottom: var(--spacing-md);
} */

.art-item:hover {
  transform: scale(1.05) rotate(2deg);
  z-index: 10;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border-color: var(--color-secondary);
}

.art-item picture {
  display: block;
  width: 100%;
  height: 100%;
}

.art-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: auto !important; /* Override global pixelated rendering just for concept art */
}

.art-item.portrait {
  aspect-ratio: 3 / 4;
}

.art-item.landscape {
  aspect-ratio: 16 / 9;
}

.art-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--spacing-sm);
  background: rgba(0, 0, 0, 0.8);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.art-item:hover .art-caption {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  z-index: 10000;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  border: 4px solid #fff;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  image-rendering: auto !important; /* keep full-res art smooth in modal */
}

.lightbox-close {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.lightbox-close:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.1);
}

/* Footer */
footer {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.footer-text {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.kickstarter-text {
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: pulse 1.2s infinite;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .kickstarter-text {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 0.35rem;
  }
}

@media (max-width: 768px) {
  footer {
    padding-bottom: calc(var(--spacing-lg) + 90px);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 10px var(--color-accent);
  }
  100% {
    opacity: 0.8;
  }
}

/* Footer */
.footer {
  background: var(--color-bg-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: var(--spacing-xl);
}

/* ===== TABLET RESPONSIVE (768px - 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
  :root {
    --hero-top-extra: var(--spacing-sm);
  }

  .hero-grid {
    align-items: center;
  }

  .hero-copy {
    height: auto;
    justify-content: center;
  }

  .hero-logo {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-tagline-row {
    margin-top: var(--spacing-sm);
  }

  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .worlds-accordion {
    height: 350px;
  }

  .world-slice:hover,
  .world-slice.active {
    flex: 4;
  }

  .boss-gallery {
    gap: var(--spacing-md);
  }

  .boss-card {
    width: 180px;
    padding: var(--spacing-sm);
  }

  .art-grid {
    column-count: 2;
  }

  .nav-links {
    gap: var(--spacing-md);
  }

  .nav-links a {
    font-size: 0.55rem;
  }
}

/* ===== MOBILE RESPONSIVE (max 768px) ===== */
@media (max-width: 768px) {
  :root {
    --hero-top-extra: var(--spacing-lg);
  }

  /* Mobile Navigation */
  .nav-links {
    position: fixed;
    top: var(--nav-offset);
    left: 0;
    right: 0;
    background: rgba(18, 11, 26, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: var(--spacing-lg);
    gap: var(--spacing-md);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Robust mobile centering: Use full width with padding */
  .container {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .hero-content {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 0.75rem;
    padding: var(--spacing-sm) 0;
    text-align: center;
  }

  .nav-toggle {
    display: block;
  }

  .nav-logo {
    font-size: 0.7rem;
  }

  /* Hero adjustments */
  .hero {
    height: calc(100vh - var(--nav-offset));
    min-height: calc(100vh - var(--nav-offset));
    padding-bottom: var(--spacing-lg);
  }

  /* Explicitly center background on mobile to avoid any shift */
  .hero-bg-media img {
    object-position: 50% 50% !important;
  }

  .hero-grid {
    align-items: center;
  }

  .hero-copy {
    height: auto;
    justify-content: center;
  }

  .hero-logo {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-tagline-row {
    margin-top: var(--spacing-sm);
  }

  .hero-scroll {
    margin-top: var(--spacing-lg);
  }

  /* Art grid to single column on mobile */
  .art-grid {
    column-count: 1;
  }
}

/* ===== BODY PADDING FOR FIXED NAV ===== */
body {
  padding-top: var(--nav-offset);
}

.hero {
  margin-top: 0;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}
