/* ============================================================
   Mistvale — style.css
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0e0d15;
  --bg2:        #131120;
  --bg3:        #1a1828;
  --border:     #2a2638;
  --accent:     #c87aff;
  --accent2:    #7b5ea7;
  --gold:       #ffb454;
  --text:       #e2dff0;
  --text-muted: #8b86a0;
  --green:      #57f287;
  --radius:     16px;
  --radius-sm:  10px;
  --nav-h:      70px;
  --shadow:     0 8px 32px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

/* ── Typography ── */
.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 48px;
  font-style: italic;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 20px rgba(200, 122, 255, 0.4);
}
.btn-primary:hover { box-shadow: 0 8px 32px rgba(200, 122, 255, 0.6); }

.btn-secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Navbar ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(14, 13, 21, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.2s;
  border-radius: 2px;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-nav-download {
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}
.btn-nav-download:hover { color: var(--text); border-color: var(--accent); }

.btn-nav-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.85rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-nav-play:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,122,255,0.5); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ── Section ── */
.section {
  padding: 100px 0;
  position: relative;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(14,13,21,0) 0%, rgba(14,13,21,0.3) 70%, rgba(14,13,21,0.8) 100%),
    url('../assets/images/sperio_hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    transparent 50%,
    rgba(14,13,21,0.6) 80%,
    #0e0d15 100%
  );
}

/* Fireflies */
.fireflies-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.firefly {
  position: absolute;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  box-shadow: 0 0 6px 2px rgba(255, 180, 84, 0.6);
  animation: fireflyFloat linear infinite;
}

@keyframes fireflyFloat {
  0%   { opacity: 0; transform: translate(0, 0); }
  15%  { opacity: 0.8; }
  50%  { opacity: 0.4; transform: translate(calc(var(--dx, 30px)), calc(var(--dy, -40px))); }
  85%  { opacity: 0.7; }
  100% { opacity: 0; transform: translate(calc(var(--dx2, -20px)), calc(var(--dy2, -80px))); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding-top: var(--nav-h);
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.hero-copy {
  max-width: 640px;
}

.hero-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.4rem, 4vw, 2.8rem);
  color: #fff;
  line-height: 1.4;
  margin-bottom: 20px;
  text-shadow: 0 0 40px rgba(200,122,255,0.4);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 40px;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Story ── */
.story { background: var(--bg2); }

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.chapter {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: border-color 0.3s, transform 0.3s;
}
.chapter:hover {
  border-color: var(--accent2);
  transform: translateY(-4px);
}

.chapter-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.25;
  position: absolute;
  top: 20px; right: 24px;
}

.chapter-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
}

.chapter-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ── Download ── */
.download { background: var(--bg); }

.download-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 600px;
  transition: border-color 0.3s;
}
.download-card:hover { border-color: var(--accent2); }

.download-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.download-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.download-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.download-note {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.download-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dl-chip {
  padding: 5px 14px;
  border-radius: 50px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ── Worlds ── */
.worlds { background: var(--bg2); }

.worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.world-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
}
.world-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent2);
}

.world-media {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg3);
}
.world-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.world-card:hover .world-media img { transform: scale(1.05); }

/* Placeholder gradient when image missing */
.world-media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

.world-card:nth-child(1) .world-media::before {
  background: linear-gradient(135deg, #4a6b44 0%, #5B7B55 50%, #6b8b65 100%);
}
.world-card:nth-child(2) .world-media::before {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 50%, #3d5a8f 100%);
}
.world-card:nth-child(3) .world-media::before {
  background: linear-gradient(135deg, #6b4a3a 0%, #8b6a5a 50%, #ab8a7a 100%);
}

.world-media img { 
  position: relative; 
  z-index: 1;
}

.world-media-tag {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  background: rgba(14,13,21,0.8);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  backdrop-filter: blur(8px);
}

.world-body {
  padding: 24px;
}
.world-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-style: italic;
}
.world-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 12px;
}
.world-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Companions ── */
.companions { background: var(--bg); }

.companions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.companion-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}
.companion-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent2);
}

.companion-portrait {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  overflow: hidden;
}

.pixel-art {
  width: 54px; height: 54px;
  image-rendering: pixelated;
}

.companion-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.companion-role {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.companion-bio {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}
.companion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.companion-tags span {
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* ── Features ── */
.features { background: var(--bg2); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: transform 0.3s, border-color 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent2);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}
.feature-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 10px;
}
.feature-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Roadmap ── */
.roadmap { background: var(--bg); }

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}

.timeline-item {
  display: flex;
  gap: 24px;
  position: relative;
  padding-bottom: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: 0.3s;
}

.timeline-item.done .timeline-marker {
  background: var(--green);
  border-color: var(--green);
  color: #0e0d15;
  box-shadow: 0 0 16px rgba(87,242,135,0.4);
}
.timeline-item.active .timeline-marker {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0d15;
  box-shadow: 0 0 16px rgba(200,122,255,0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(200,122,255,0.5); }
  50%       { box-shadow: 0 0 28px rgba(200,122,255,0.9); }
}

.timeline-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  flex: 1;
  margin-top: 0;
}
.timeline-item.active .timeline-card { border-color: var(--accent2); }
.timeline-item.done .timeline-card   { border-color: rgba(87,242,135,0.3); }

.timeline-phase {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.timeline-item.done  .timeline-phase { color: var(--green); }
.timeline-item.active .timeline-phase { color: var(--accent); }

.timeline-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  margin: 6px 0;
}
.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── FAQ ── */
.faq { background: var(--bg2); }

.faq-list {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.3s;
}
.faq-item.open { border-color: var(--accent2); }

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  gap: 16px;
  transition: color 0.2s;
}
.faq-question:hover { color: var(--accent); }

.faq-toggle {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.3s, color 0.3s;
  flex-shrink: 0;
}
.faq-item.open .faq-toggle {
  transform: rotate(45deg);
  color: var(--accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s;
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 20px;
}
.faq-answer p {
  padding: 0 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ── Footer ── */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: var(--accent);
}
.logo-dot { color: var(--gold); }

.footer-tag {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--accent2);
  color: var(--accent);
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 700;
  z-index: 9999;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.4s ease;
  white-space: nowrap;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.lightbox-close:hover { color: var(--text); }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: var(--text-muted);
  padding: 8px 16px;
  transition: color 0.2s;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { color: var(--text); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta .btn-nav-download { display: none; }

  .hero-title { font-size: clamp(1.1rem, 6vw, 1.8rem); }
  .hero-actions { flex-direction: column; align-items: flex-start; }

  .section { padding: 70px 0; }

  .story-grid,
  .worlds-grid,
  .companions-grid,
  .feature-grid { grid-template-columns: 1fr; }

  .download-card { padding: 24px 20px; }

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

  .timeline::before { display: none; }
  .timeline-item { flex-direction: column; gap: 12px; }
  .timeline-marker { width: 32px; height: 32px; font-size: 0.875rem; }
}

@media (max-width: 480px) {
  .btn { padding: 12px 20px; font-size: 0.875rem; }
  .section-title { font-size: 0.9rem; }
  .chapter { padding: 24px 20px; }
  .companion-portrait { width: 70px; height: 70px; }
}
