/* ============================================
   Moonrift — Official Website Styles
   ============================================ */

:root {
  --bg-deep: #05070B;
  --bg-mid: #0D1118;
  --bg-surface: #141A26;
  --accent: #6FA8FF;
  --accent-soft: #A9CFFF;
  --accent-light: #D6E8FF;
  --text-primary: #D6E8FF;
  --text-muted: rgba(214, 232, 255, 0.55);
  --text-faint: rgba(214, 232, 255, 0.3);
  --border: rgba(111, 168, 255, 0.12);
  --glow: rgba(111, 168, 255, 0.25);

  --font-heading: 'Cinzel', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --ease-slow: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --nav-height: 72px;
  --section-pad: clamp(80px, 12vw, 140px);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.75;
  letter-spacing: 0.02em;
  overflow-x: hidden;
  cursor: auto;
}

::selection {
  background: rgba(111, 168, 255, 0.25);
  color: var(--accent-light);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* ---- Layout ---- */
.container {
  width: min(1200px, 90vw);
  margin: 0 auto;
}

.container-narrow {
  width: min(720px, 90vw);
  margin: 0 auto;
}

.section {
  padding: var(--section-pad) 0;
  position: relative;
}

.section-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.3;
  color: var(--accent-light);
}

.section-header {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background 0.6s var(--ease-slow), backdrop-filter 0.6s, transform 0.3s var(--ease-out);
  transform: translateY(0);
}

.nav.is-hidden {
  transform: translateY(-100%);
}

.nav.is-scrolled {
  background: rgba(5, 7, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: min(1200px, 90vw);
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--accent-light);
  transition: color 0.3s;
}

.nav-logo:hover { color: var(--accent); }

.logo-svg text { fill: currentColor; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out);
}

.nav-links a:hover {
  color: var(--accent-light);
}

.nav-links a:hover::after { width: 100%; }

.nav-download {
  color: var(--accent) !important;
  border: 1px solid rgba(111, 168, 255, 0.3);
  padding: 0.5rem 1.25rem;
}

.nav-download::after { display: none; }

.nav-download:hover {
  border-color: var(--accent);
  background: rgba(111, 168, 255, 0.08);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--accent-light);
  transition: transform 0.3s, opacity 0.3s;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 2rem;
  transition: all 0.4s var(--ease-out);
  position: relative;
}

.btn-primary {
  background: transparent;
  border: 1px solid rgba(111, 168, 255, 0.4);
  color: var(--accent-light);
}

.btn-primary:hover {
  border-color: var(--accent);
  background: rgba(111, 168, 255, 0.1);
  box-shadow: 0 0 24px rgba(111, 168, 255, 0.15);
}

.btn-secondary {
  border: 1px solid transparent;
  color: var(--text-muted);
}

.btn-secondary:hover {
  color: var(--accent-light);
}

.btn-large {
  padding: 1.25rem 3rem;
  font-size: 0.8rem;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 60%, var(--bg-surface) 100%);
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  background: url('../assets/images/hero/hero-moonfall.png') center top / cover no-repeat;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
}

.hero-stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent-light);
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--duration, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.7; }
}

.hero-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  background: radial-gradient(ellipse, rgba(20, 26, 38, 0.6) 0%, transparent 70%);
  filter: blur(20px);
  animation: drift linear infinite;
}

.cloud-1 {
  width: 600px;
  height: 120px;
  top: 20%;
  left: -10%;
  animation-duration: 120s;
}

.cloud-2 {
  width: 400px;
  height: 80px;
  top: 35%;
  right: -5%;
  animation-duration: 90s;
  animation-direction: reverse;
}

.cloud-3 {
  width: 500px;
  height: 100px;
  top: 55%;
  left: 30%;
  animation-duration: 150s;
  opacity: 0.5;
}

@keyframes drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(15vw); }
}

.hero-moon-wrap {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  will-change: transform;
}

.hero-moon {
  position: relative;
  width: clamp(180px, 28vw, 320px);
  height: clamp(180px, 28vw, 320px);
}

.moon-body {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    #e8f0ff 0%,
    #c8d8f0 20%,
    #8aa8cc 50%,
    #4a6080 80%,
    #2a3548 100%
  );
  box-shadow:
    0 0 60px rgba(111, 168, 255, 0.2),
    0 0 120px rgba(111, 168, 255, 0.08),
    inset -20px -10px 40px rgba(5, 7, 11, 0.4);
}

.moon-crack {
  position: absolute;
  top: 10%;
  left: 45%;
  width: 4px;
  height: 80%;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 15%,
    #fff 50%,
    var(--accent) 85%,
    transparent 100%
  );
  transform: rotate(-8deg);
  filter: blur(0.5px);
  box-shadow:
    0 0 20px var(--accent),
    0 0 40px rgba(111, 168, 255, 0.5);
  animation: crackPulse 6s ease-in-out infinite;
}

.moon-crack::before,
.moon-crack::after {
  content: '';
  position: absolute;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.moon-crack::before {
  top: 30%;
  left: -8px;
  width: 20px;
  height: 2px;
  transform: rotate(25deg);
}

.moon-crack::after {
  top: 60%;
  right: -6px;
  width: 16px;
  height: 2px;
  transform: rotate(-20deg);
}

@keyframes crackPulse {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 20px var(--accent), 0 0 40px rgba(111, 168, 255, 0.3); }
  50% { opacity: 1; box-shadow: 0 0 30px var(--accent), 0 0 60px rgba(111, 168, 255, 0.5); }
}

.moon-glow {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 168, 255, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--nav-height) 1.5rem 4rem;
  margin-top: clamp(120px, 20vh, 200px);
}

.hero-logo-text {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.25em;
  color: var(--accent-light);
  text-shadow: 0 0 40px rgba(111, 168, 255, 0.2);
  display: block;
  margin-bottom: 2rem;
}

.hero-tagline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: 3rem;
}

.hero-tagline-accent {
  color: var(--accent-soft);
  margin-top: 0.5rem;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.4;
  animation: scrollFade 3s ease-in-out infinite;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.scroll-text {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

@keyframes scrollFade {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.6; transform: translateX(-50%) translateY(6px); }
}

/* ---- Story ---- */
.story {
  background: var(--bg-mid);
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: center;
}

.story-art-frame {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
}

.story-art-image {
  width: 100%;
  height: 100%;
  background: url('../assets/images/story/story-fall-of-lunaris.png') center / cover no-repeat;
}

.story-art-overlay {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  pointer-events: none;
}

.story-art-overlay::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  border: 1px solid rgba(111, 168, 255, 0.06);
}

.story-body p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.story-body em {
  color: var(--accent-soft);
  font-style: normal;
}

.story-body strong {
  color: var(--accent-light);
  font-weight: 400;
}

.story-list {
  list-style: none;
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.story-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.35rem 0;
  padding-left: 0.75rem;
}

.story-closing {
  color: var(--accent-soft) !important;
  font-style: italic;
}

/* ---- World ---- */
.world {
  background: var(--bg-deep);
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}

.world-card {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-mid);
  cursor: default;
  min-width: 0;
}

.world-card-wide {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 8;
  min-height: 200px;
}

.world-card-bg {
  position: absolute;
  inset: 0;
  transition: transform 8s var(--ease-slow), filter 0.6s;
}

.world-card:hover .world-card-bg {
  transform: scale(1.06);
  filter: brightness(1.15);
}

.world-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
  background: linear-gradient(0deg, rgba(5, 7, 11, 0.9) 0%, transparent 60%);
  transition: background 0.5s;
}

.world-card:hover .world-card-content {
  background: linear-gradient(0deg, rgba(5, 7, 11, 0.95) 0%, rgba(5, 7, 11, 0.2) 70%);
}

.world-card-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  transform: translateY(8px);
  transition: transform 0.5s var(--ease-out);
}

.world-card-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s, transform 0.5s var(--ease-out);
}

.world-card:hover .world-card-content h3 { transform: translateY(0); }
.world-card:hover .world-card-content p { opacity: 1; transform: translateY(0); }

/* World backgrounds */
.world-bg-forest {
  background: url('../assets/images/world/world-whispering-forest.png') center / cover no-repeat;
}

.world-bg-cathedral {
  background: url('../assets/images/world/world-frozen-cathedral.png') center / cover no-repeat;
}

.world-bg-crystal {
  background: url('../assets/images/world/world-crystal-caverns.png') center / cover no-repeat;
}

.world-bg-ashen {
  background: url('../assets/images/world/world-ashen-highlands.png') center / cover no-repeat;
}

.world-bg-kingdom {
  background: url('../assets/images/world/world-forgotten-kingdom.png') center / cover no-repeat;
}

.world-bg-temple {
  background: url('../assets/images/world/world-moon-temple.png') center / cover no-repeat;
}

.world-bg-abyss {
  background: url('../assets/images/world/world-hollow-abyss.png') center / cover no-repeat;
}

/* Ambient particles on hover */
.world-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(214, 232, 255, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 70%, rgba(214, 232, 255, 0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 20%, rgba(214, 232, 255, 0.25) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.8s;
  z-index: 1;
  pointer-events: none;
}

.world-card:hover::before { opacity: 1; }

/* ---- Features ---- */
.features {
  background: var(--bg-mid);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem 2rem;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.feature-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.7;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-body {
  min-width: 0;
  width: 100%;
}

.feature h3 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  color: var(--accent-light);
  line-height: 1.4;
  white-space: normal;
  word-break: normal;
}

.feature p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 100%;
}

/* ---- Gallery ---- */
.gallery {
  background: var(--bg-deep);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 220px;
  gap: 4px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: default;
  margin: 0;
}

.gallery-tall { grid-row: span 2; }
.gallery-wide { grid-column: span 2; }

.gallery-image {
  width: 100%;
  height: 100%;
  transition: transform 6s var(--ease-slow);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.08);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 11, 0.4);
  transition: background 0.5s;
}

.gallery-item:hover::after {
  background: rgba(5, 7, 11, 0.15);
}

.gallery-item figcaption {
  position: absolute;
  bottom: 1rem;
  left: 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--accent-light);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s, transform 0.5s var(--ease-out);
  z-index: 1;
}

.gallery-item:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

.gi-1 { background: url('../assets/images/gallery/gallery-moonlit-ruins.png') center / cover no-repeat; }
.gi-2 { background: url('../assets/images/gallery/gallery-the-rift.png') center / cover no-repeat; }
.gi-3 { background: url('../assets/images/gallery/gallery-whispering-depths.png') center / cover no-repeat; }
.gi-4 { background: url('../assets/images/gallery/gallery-frozen-cathedral.png') center / cover no-repeat; }
.gi-5 { background: url('../assets/images/gallery/gallery-crystal-light.png') center / cover no-repeat; }
.gi-6 { background: url('../assets/images/gallery/gallery-the-wanderer.png') center / cover no-repeat; }

.gallery-image { position: relative; }

/* ---- Characters ---- */
.characters {
  background: var(--bg-mid);
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.character-card {
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  transition: background 0.4s;
  min-width: 0;
}

.character-card:hover {
  background: rgba(20, 26, 38, 0.8);
}

.character-main {
  grid-column: 1 / -1;
  flex-direction: row;
}

.character-portrait-wrap {
  display: flex;
  flex-direction: column;
}

.character-portrait {
  aspect-ratio: 3/4;
  min-height: 200px;
  background: var(--bg-mid);
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center top;
}

.character-main .character-portrait-wrap {
  width: 280px;
  flex-shrink: 0;
}

.character-main .character-portrait {
  aspect-ratio: auto;
  height: 100%;
  min-height: 280px;
}

.character-info {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.character-role {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.character-info h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  color: var(--accent-light);
}

.character-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Character portraits */
.cp-wanderer { background-image: url('../assets/images/characters/char-wanderer.png'); }
.cp-hollow { background-image: url('../assets/images/characters/char-first-hollow.png'); }
.cp-guardians { background-image: url('../assets/images/characters/char-moon-guardians.png'); }
.cp-eclipse { background-image: url('../assets/images/characters/char-eclipse-order.png'); }
.cp-spirits { background-image: url('../assets/images/characters/char-ancient-spirits.png'); }

.ai-note {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  opacity: 0.55;
  margin-top: 0.4rem;
  line-height: 1.3;
}

.story-art .ai-note,
.character-portrait-wrap .ai-note {
  padding-left: 2px;
}

.gallery-item .ai-note {
  position: absolute;
  bottom: 0.5rem;
  right: 0.65rem;
  margin: 0;
  z-index: 2;
  text-align: right;
  max-width: 55%;
  pointer-events: none;
}

/* ---- Timeline ---- */
.timeline-section {
  background: var(--bg-deep);
}

.timeline {
  list-style: none;
  position: relative;
  padding-left: 2rem;
  max-width: 560px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border) 10%, var(--border) 90%, transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}

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

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 13px;
  height: 13px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-deep);
  transition: border-color 0.4s, box-shadow 0.4s;
}

.timeline-item-active .timeline-dot {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(111, 168, 255, 0.3);
  background: rgba(111, 168, 255, 0.15);
}

.timeline-content time {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.timeline-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- FAQ ---- */
.faq {
  background: var(--bg-mid);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  padding: 1.5rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent-light);
  transition: color 0.3s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:hover { color: var(--accent); }

.faq-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 1.5rem;
  line-height: 1.7;
}

/* ---- Download ---- */
.download {
  background: var(--bg-deep);
  text-align: center;
  border-top: 1px solid var(--border);
}

.download-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.12em;
  font-weight: 400;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.download-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Footer ---- */
.footer {
  position: relative;
  padding: 0 0 2.5rem;
  background: var(--bg-deep);
  overflow: hidden;
}

.footer-rift-edge {
  height: 48px;
  background: var(--bg-deep);
  clip-path: polygon(
    0% 100%, 0% 60%,
    4% 35%, 8% 55%, 12% 25%, 16% 50%, 20% 30%, 24% 48%,
    28% 20%, 32% 42%, 36% 28%, 40% 45%, 44% 22%, 48% 40%,
    50% 15%, 52% 40%, 56% 22%, 60% 45%, 64% 28%, 68% 42%,
    72% 20%, 76% 48%, 80% 30%, 84% 50%, 88% 25%, 92% 55%,
    96% 35%, 100% 60%, 100% 100%
  );
  margin-bottom: -1px;
}

.footer-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(214, 232, 255, 0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(214, 232, 255, 0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 30%, rgba(214, 232, 255, 0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(214, 232, 255, 0.08) 0%, transparent 100%);
  animation: footerStars 20s linear infinite;
  pointer-events: none;
}

@keyframes footerStars {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.footer-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.footer-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.75rem 2.5rem 2rem;
  margin-bottom: 0.5rem;
  background:
    linear-gradient(180deg, rgba(20, 26, 38, 0.9) 0%, rgba(13, 17, 24, 0.95) 100%);
  border: 1px solid rgba(111, 168, 255, 0.18);
  clip-path: polygon(
    12px 0%, calc(100% - 12px) 0%,
    100% 12px, 100% calc(100% - 12px),
    calc(100% - 12px) 100%, 12px 100%,
    0% calc(100% - 12px), 0% 12px
  );
  box-shadow:
    0 0 40px rgba(111, 168, 255, 0.06),
    inset 0 1px 0 rgba(214, 232, 255, 0.06);
  max-width: 480px;
  width: 100%;
}

.footer-banner::before,
.footer-banner::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(111, 168, 255, 0.35);
  border-style: solid;
  pointer-events: none;
}

.footer-banner::before {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}

.footer-banner::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1px 1px 0;
}

.footer-banner-svg {
  width: min(320px, 80vw);
  height: auto;
  opacity: 0.9;
}

.footer-banner-logo {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  letter-spacing: 0.28em;
  color: var(--accent-light);
  text-shadow: 0 0 24px rgba(111, 168, 255, 0.25);
  margin-top: -0.25rem;
  transition: color 0.3s;
}

.footer-banner-logo:hover {
  color: var(--accent);
}

.footer-banner-tagline {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  max-width: 340px;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color 0.3s;
}

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

.footer-social {
  display: flex;
  gap: 1.25rem;
}

.footer-social a {
  width: 20px;
  height: 20px;
  color: var(--text-faint);
  transition: color 0.3s;
}

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

.footer-social svg { width: 100%; height: 100%; }

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* ---- Modals ---- */
.modal, .lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
}

.modal::backdrop, .lightbox::backdrop {
  background: rgba(5, 7, 11, 0.92);
  backdrop-filter: blur(8px);
}

.modal-inner {
  position: relative;
  width: min(800px, 92vw);
  background: var(--bg-mid);
  border: 1px solid var(--border);
}

.modal-close, .lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  color: var(--text-muted);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.modal-close:hover, .lightbox-close:hover { color: var(--accent-light); }

.modal-image {
  aspect-ratio: 16/9;
  background: var(--bg-surface);
}

.modal-body {
  padding: 2rem;
}

.modal-body h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  color: var(--accent-light);
}

.modal-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.modal-trailer .modal-inner { width: min(900px, 92vw); }

.trailer-placeholder {
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.15em;
}

.lightbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox-image {
  width: min(900px, 90vw);
  aspect-ratio: 16/10;
  background: var(--bg-surface);
}

.lightbox-caption {
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
}

/* ---- Reveal animations ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Dust particles (global subtle) ---- */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 45%, rgba(214, 232, 255, 0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 75%, rgba(214, 232, 255, 0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 35%, rgba(214, 232, 255, 0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 65%, rgba(214, 232, 255, 0.08) 0%, transparent 100%);
  animation: dustFloat 30s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

@keyframes dustFloat {
  0% { transform: translateY(0); opacity: 0.5; }
  100% { transform: translateY(-20px); opacity: 0.8; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .story-grid {
    grid-template-columns: 1fr;
  }

  .story-art-frame {
    aspect-ratio: 16/9;
    max-height: 360px;
  }

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

  .world-card-wide {
    grid-column: 1 / -1;
    aspect-ratio: 21 / 9;
  }

  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }

  .gallery-wide { grid-column: span 2; }

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

  .character-main {
    grid-column: 1 / -1;
    flex-direction: column;
  }

  .character-main .character-portrait-wrap {
    width: 100%;
  }

  .character-main .character-portrait {
    aspect-ratio: 16/9;
    min-height: auto;
  }
}

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

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(5, 7, 11, 0.97);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.4s var(--ease-out), opacity 0.4s;
    pointer-events: none;
  }

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

  .nav-toggle.is-open span:first-child {
    transform: rotate(45deg) translate(3px, 3px);
  }

  .nav-toggle.is-open span:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
  }

  .hero-logo-text {
    letter-spacing: 0.15em;
  }

  .world-grid {
    grid-template-columns: 1fr;
  }

  .world-card-wide {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
  }

  .footer-banner {
    padding: 1.25rem 1.5rem 1.5rem;
    clip-path: none;
    border-radius: 0;
  }

  .footer-banner-tagline {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .hero-content {
    margin-top: clamp(80px, 15vh, 140px);
  }

  .nav-download {
    padding: 0.45rem 1rem;
    font-size: 0.7rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }

  .gallery-tall, .gallery-wide {
    grid-row: span 1;
    grid-column: span 1;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn { width: 100%; max-width: 280px; }

  .characters-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
