/* ============================================================
   VOGTOV — V1 "Orrery"
   A living star system. Dark, professional, a little magical.
   ============================================================ */

:root {
  --void: #05060e;
  --space: #12142b;
  --panel: #1b1e42;
  --ion: #7a6cff;
  --lavender: #a79cff;
  --gold: #ffc96b;
  --plasma: #ff7ac3;
  --text: #eae8f7;
  --muted: #9c97c0;
  --line: rgba(167, 156, 255, 0.16);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Schibsted Grotesk', system-ui, sans-serif;
  --font-mono: 'Fragment Mono', ui-monospace, monospace;
}

[hidden] { display: none !important; }

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

html { scroll-behavior: auto; }

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(122, 108, 255, 0.45); color: #fff; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- fixed layers ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.nebula-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(120% 90% at 70% 20%, #191533 0%, var(--void) 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

body.no-webgl #scene { display: none; }
body.no-webgl .nebula-fallback {
  opacity: 1;
  background-image: url('../assets/img/nebula.webp');
  background-size: cover;
  background-position: center;
}
body.no-webgl .nebula-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 14, 0.72);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 30;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(4) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

/* ---------- loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.8s ease, visibility 0.8s;
  /* JS removes it sooner; this is the no-JS/broken-JS backstop */
  animation: loader-away 0.8s ease 4s forwards;
}

.loader.done { opacity: 0; visibility: hidden; }

@keyframes loader-away {
  to { opacity: 0; visibility: hidden; }
}

.loader-mark { position: relative; width: 64px; height: 64px; }

.loader-sun {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 24px rgba(255, 201, 107, 0.8);
  animation: sun-breathe 2s ease-in-out infinite;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(167, 156, 255, 0.6);
  animation: ring-spin 6s linear infinite;
}

@keyframes sun-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes ring-spin { to { transform: rotate(360deg); } }

.loader-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
  background: rgba(5, 6, 14, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  text-decoration: none;
  color: var(--text);
  text-shadow: 0 0 18px rgba(122, 108, 255, 0.55);
  transition: text-shadow 0.35s ease;
}

.wordmark:hover { text-shadow: 0 0 26px rgba(122, 108, 255, 0.9), 0 0 60px rgba(255, 201, 107, 0.3); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--ion));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-contact {
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 999px;
}
.nav-contact::after { display: none; }
.nav-contact:hover { border-color: var(--lavender); }

@media (max-width: 640px) {
  .nav-links a:not(.nav-contact) { display: none; }
}

/* ---------- shared ---------- */

main { position: relative; z-index: 10; }

section, footer { position: relative; }

.mono { font-family: var(--font-mono); }

.panel-tag {
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lavender);
  margin-bottom: 18px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.platform-sub, .hero-sub, .manifesto-body { text-wrap: pretty; }

.world-coords span { white-space: nowrap; }

.panel {
  background: rgba(18, 20, 43, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234, 232, 247, 0.28), transparent);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in { opacity: 1; transform: none; }

/* ---------- hero ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 80px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 30px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 13vw, 10.5rem);
  line-height: 1;
  letter-spacing: 0.06em;
  background: linear-gradient(115deg, #fff 10%, var(--gold) 38%, var(--lavender) 72%, var(--ion) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(122, 108, 255, 0.35));
  margin-bottom: 36px;
}

.hero-letter { display: inline-block; }
.hero-letter:last-child { margin-right: -0.06em; }

.hero-slogan {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.hero-sub {
  max-width: 520px;
  color: var(--muted);
  font-size: 1rem;
}

.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.scroll-hint-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, transparent, var(--lavender));
  position: relative;
  overflow: hidden;
}

.scroll-hint-line::after {
  content: '';
  position: absolute;
  top: -30%;
  left: 0;
  width: 100%;
  height: 30%;
  background: var(--gold);
  animation: hint-fall 2.2s ease-in-out infinite;
}

@keyframes hint-fall {
  0% { top: -30%; }
  70%, 100% { top: 110%; }
}

.scroll-hint-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- manifesto ---------- */

.manifesto {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px clamp(20px, 5vw, 60px);
}

.manifesto-panel {
  max-width: 680px;
  padding: clamp(32px, 5vw, 56px);
}

.manifesto h2 { margin-bottom: 26px; }

.manifesto-body {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.manifesto-body:last-of-type { margin-bottom: 30px; }

.transmission-meta {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: rgba(156, 151, 192, 0.6);
}

/* ---------- worlds ---------- */

.worlds { padding-top: 10vh; }

.worlds-heading {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
}

.world-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 60px clamp(20px, 6vw, 90px);
}

/* dormant worlds pass a little quicker — keeps the flight's pacing tight */
.world-panel[data-world='heppy'], .world-panel[data-world='vintage'] { min-height: 92vh; }

.world-card {
  max-width: 460px;
  padding: clamp(26px, 4vw, 40px);
}

.world-card.side-left { margin-right: auto; }
.world-card.side-right { margin-left: auto; }

@media (max-width: 768px) {
  .world-panel { align-items: flex-end; padding-bottom: 9vh; }
  .world-card.side-left, .world-card.side-right { margin: 0 auto; }
  .world-view { aspect-ratio: 16 / 9; }
}

.world-view {
  margin: -6px -6px 22px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  position: relative;
}

.world-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.world-card:hover .world-view img { transform: scale(1.1); }

.world-view::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(18, 20, 43, 0.85));
  pointer-events: none;
}

.dormant-card .world-view img { filter: saturate(0.35) brightness(0.75); transition: filter 1.2s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
.dormant-card:hover .world-view img { filter: saturate(0.6) brightness(0.9); }

.world-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.world-status.live { color: var(--gold); }
.world-status.dormant { color: var(--muted); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.world-status.live .status-dot {
  box-shadow: 0 0 0 0 rgba(255, 201, 107, 0.7);
  animation: dot-pulse 2.4s ease-out infinite;
}

@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 201, 107, 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(255, 201, 107, 0); }
}

.world-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
  margin-bottom: 14px;
  color: var(--world-accent, var(--text));
  text-shadow: 0 0 30px color-mix(in srgb, var(--world-accent, #fff) 35%, transparent);
}

.world-desc { color: var(--muted); margin-bottom: 18px; }

.world-coords {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(156, 151, 192, 0.55);
  margin-bottom: 26px;
}

.world-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.world-link:hover {
  border-color: var(--lavender);
  box-shadow: 0 0 24px rgba(122, 108, 255, 0.25);
  transform: translateY(-2px);
}

.world-link:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 0.1s;
}

/* reveal fade must coexist with the snappy hover transitions */
.world-link.reveal {
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.link-arrow { transition: transform 0.3s ease; }
.world-link:hover .link-arrow { transform: translateX(4px); }

.revive-btn:hover .link-arrow { transform: rotate(180deg) scale(1.2); }

.revive-btn.pulsing {
  border-color: var(--gold);
  box-shadow: 0 0 34px rgba(255, 201, 107, 0.35);
}

/* ---------- platform ---------- */

.platform {
  min-height: 120vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px clamp(20px, 5vw, 60px);
  gap: 54px;
}

.platform-heading {
  max-width: 720px;
  text-align: center;
}

.platform-heading h2 { margin-bottom: 20px; }

.platform-sub { color: var(--muted); }

.law-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 1080px;
  width: 100%;
}

@media (max-width: 900px) {
  .law-grid { grid-template-columns: 1fr; max-width: 520px; }
}

.law-card { padding: 34px 30px; }

.law-num {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.law-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 14px;
}

.law-card p { color: var(--muted); font-size: 0.97rem; }

/* while revealing: slow entrance transition; once .in: snappy hover */
.law-card.in {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.45s ease, box-shadow 0.45s ease;
}

.law-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 201, 107, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(122, 108, 255, 0.12);
}

/* ---------- footer / signal ---------- */

.signal {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 60px;
  gap: 8px;
}

.signal-title {
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 22px;
}

.signal-mail {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.08em;
  color: var(--gold);
  text-decoration: none;
  position: relative;
  padding-bottom: 6px;
}

.signal-mail::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--plasma));
  transform: scaleX(0.25);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.signal-mail:hover::after { transform: scaleX(1); }

.footer-meta {
  margin-top: 90px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 34px;
  font-size: 0.8rem;
  color: rgba(156, 151, 192, 0.65);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .loader { display: none; }
}
