:root {
  --ink: #f5f7fa;
  --bg: #0b0e14;
  --accent: #7c5cff;     /* primary — nebula violet */
  --accent-2: #4fd8ff;   /* secondary — starlight cyan */
  --gold: #e8b34d;
}

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

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Rajdhani", system-ui, sans-serif;
  overflow-x: hidden;
}

/* ---------- Fixed HUD ---------- */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: rgba(244, 246, 251, 0.7);
  mix-blend-mode: difference;
}
.hud-brand .dim { color: var(--accent); margin: 0 2px; }
.hud-mid { color: var(--accent-2); }

.hud-nav {
  display: flex;
  gap: 26px;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
}
.hud-nav-link {
  color: rgba(244, 246, 251, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.hud-nav-link:hover,
.hud-nav-link:focus-visible {
  color: var(--accent-2);
}
@media (max-width: 900px) {
  .hud-nav { display: none; }
}

/* ---------- Shared pinned-section scaffolding ---------- */
.cinematic, .world, .parallax, .explore, .physics, .trail {
  position: relative;
}
.cinematic .sticky, .world .sticky, .parallax .sticky,
.explore .sticky, .physics .sticky, .trail .sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #0a0a12;
}
.cinematic .sticky canvas, .world .sticky canvas, .parallax .sticky canvas,
.explore .sticky canvas, .physics .sticky canvas, .trail .sticky canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(0,0,0,0.65) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.45) 0%, transparent 25%, transparent 70%, rgba(0,0,0,0.7) 100%);
}

/* ---------- scroll-world section ---------- */
.world { height: 400vh; }

/* ---------- Overlay copy ---------- */
.overlay {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 24px;
}
.reveal-line {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 90vw;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 8vw, 7rem);
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 35%, transparent);
  will-change: opacity, transform;
}
.reveal-line:last-child {
  color: var(--accent);
  text-shadow: 0 0 60px color-mix(in srgb, var(--accent) 60%, transparent);
}
.reveal-line.subline {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: 0.06em;
  color: rgba(244, 246, 251, 0.8);
  text-shadow: none;
  top: 62%;
}

.cta-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 28px;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 70%, white 10%);
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transition: background 0.2s, transform 0.2s;
}
.cta-btn:hover, .cta-btn:focus-visible {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateY(-2px);
}
.overlay-cta {
  position: absolute;
  left: 50%; top: 78%;
  transform: translateX(-50%);
  z-index: 11;
}

/* ---------- Scroll reveals + counters ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

.stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 48px;
  margin: 8px 0;
}
.stat { display: grid; gap: 6px; }
.stat-num {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--gold);
}
.stat-label {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(244, 246, 251, 0.5);
}

/* ---------- Progress / scroll hint ---------- */
.progress {
  position: absolute;
  left: 28px; right: 28px; bottom: 44px;
  height: 2px;
  background: rgba(255,255,255,0.12);
  z-index: 12;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px var(--accent);
}
.scroll-hint {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: rgba(244,246,251,0.6);
  animation: bob 1.8s ease-in-out infinite;
  transition: opacity 0.4s;
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ---------- Ticker strip ---------- */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ticker-track {
  display: inline-flex;
  gap: 24px;
  animation: ticker-scroll 26s linear infinite;
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(244,246,251,0.65);
}
.ticker-track span.sep { color: var(--accent-2); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- Editorial hybrid section ---------- */
.hybrid {
  padding: 120px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.hybrid-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hybrid-copy h2 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  letter-spacing: 0.05em;
  margin-bottom: 18px;
  color: var(--ink);
}
.hybrid-copy p {
  color: rgba(244, 246, 251, 0.72);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 46ch;
}
.hybrid-copy .stats {
  justify-content: flex-start;
  gap: 36px;
}
.hybrid-links { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 6px 0 8px;
}
.roster-member {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(244, 246, 251, 0.12);
}
.roster-name {
  font-family: "Orbitron", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--accent-2);
}
.roster-role {
  font-size: 0.85rem;
  color: rgba(244, 246, 251, 0.6);
}
@media (max-width: 480px) {
  .roster { grid-template-columns: 1fr; }
}
.hybrid-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,0.06), transparent 60%), #0a0a12;
}
.hybrid-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
@media (max-width: 800px) {
  .hybrid { padding: 72px 24px; }
  .hybrid-grid { grid-template-columns: 1fr; gap: 32px; }
  .hybrid-stage { max-width: 420px; margin: 0 auto; }
}

/* ---------- Click-navigate section ---------- */
.explore { height: 150vh; }
.explore-caption {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  text-align: center;
  max-width: 480px;
  padding: 0 24px;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
  color: rgba(244, 246, 251, 0.85);
}
.explore-heading {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  text-align: center;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: 0.08em;
  color: var(--accent);
}
.hotspots {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}
.hotspot {
  position: absolute;
  left: var(--hx, 50%);
  top: var(--hy, 50%);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  background: rgba(79, 216, 255, 0.25);
  color: transparent;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.hotspot::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(79, 216, 255, 0.4);
  animation: hotspot-pulse 2.2s ease-out infinite;
}
.hotspot:hover, .hotspot:focus-visible, .hotspot.active {
  background: var(--accent-2);
  transform: translate(-50%, -50%) scale(1.25);
}
@keyframes hotspot-pulse {
  0% { opacity: 0.6; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.6); }
}
@media (prefers-reduced-motion: reduce) {
  .explore { height: 100vh; }
  .explore .sticky { position: relative; }
  .hotspot::after { animation: none; }
}

/* ---------- Physics-play section ---------- */
.physics { height: 400vh; }
.physics .sticky { touch-action: none; }
.physics .sticky canvas { cursor: grab; }
.physics .sticky canvas:active { cursor: grabbing; }
.physics-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: rgba(244, 246, 251, 0.5);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .physics { height: 100vh; }
  .physics .sticky { position: relative; }
  .physics-hint { display: none; }
}

/* ---------- Cursor-trail section ---------- */
.trail { height: 400vh; }
.trail .sticky { background: #05070d; }
@media (prefers-reduced-motion: reduce) {
  .trail { height: 100vh; }
  .trail .sticky { position: relative; }
}

/* ---------- Section accent overrides ---------- */
#terralith { --accent: #34d399; }
#incendium { --accent: #ff6b35; }
#structory { --accent: #e8b34d; }
#downloads .hybrid-stage { --accent: #e8b34d; }
#team .hybrid-stage { --accent: #4fd8ff; }
#community { --accent: #7c5cff; }
#contact { --accent: #4fd8ff; }

/* ---------- Outro / footer ---------- */
.outro {
  min-height: 60vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 18px;
  padding: 60px 40px;
  background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--bg);
}
.outro h2 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  letter-spacing: 0.2em;
  color: var(--accent-2);
}
.outro p { color: rgba(244,246,251,0.65); font-size: 1.1rem; line-height: 1.7; }
.outro code { color: var(--gold); font-family: "Orbitron", monospace; }
.footer-socials {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 6px;
}
.footer-socials a {
  color: rgba(244,246,251,0.6);
  text-decoration: none;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  transition: color 0.2s;
}
.footer-socials a:hover, .footer-socials a:focus-visible { color: var(--accent-2); }
.footer-copy {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(244,246,251,0.35);
}

/* ---------- Mobile polish ---------- */
@media (max-width: 600px) {
  .hud { padding: 14px 16px; font-size: 10px; letter-spacing: 0.18em; }
  .hud-mid { display: none; }
  .progress { left: 16px; right: 16px; }
  .stats { gap: 28px; }
  .ticker-track { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cinematic { height: 100vh; }
  .sticky { position: relative; }
  .reveal-line:not(:first-child) { display: none; }
}

.preloader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #02030a;
  transition: opacity 0.4s ease;
}
.preloader.done { opacity: 0; pointer-events: none; }
.preloader-bar { width: 240px; height: 2px; background: rgba(255,255,255,0.15); }
.preloader-fill { height: 100%; width: 0%; background: var(--accent-2); transition: width 0.15s linear; }
.preloader-text {
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: rgba(244,246,251,0.6);
}
