/* ── style.css ─────────────────────────────────────────── */

:root {
  --bg:             #050510;
  --text-primary:   #E8E8FF;
  --text-secondary: #A0A8D0;
  --cyan:           #4DFFEE;
  --violet:         #7B4FFF;
  --orange:         #FF6B35;
  --gold:           #FFD54F;
  --blue-bright:    #6B8CFF;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--cyan);
  color: var(--bg);
  font-family: 'Space Mono', monospace;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.2s;
}
.skip-link:focus-visible {
  top: 16px;
}

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

body {
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  font-family: 'Space Mono', monospace;
}

/* ── LOADER (hidden after scene warmup) ──────────────────── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.loader-inner {
  text-align: center;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border: 2px solid rgba(77, 255, 238, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: loader-spin 0.9s linear infinite;
}

.loader-text {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

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

/* ── CANVAS ─────────────────────────────────────────────── */
canvas#bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
}

/* ── VIGNETTE ───────────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 35%,
    rgba(5, 5, 16, 0.75) 100%);
}

.vignette::before,
.vignette::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 28vh;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.vignette::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(5, 5, 16, 1) 0%, transparent 100%);
}

.vignette::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(5, 5, 16, 1) 0%, transparent 100%);
}

body.in-transit .vignette::before,
body.in-transit .vignette::after {
  opacity: 1;
}

/* ── SECTIONS ───────────────────────────────────────────── */
.feature-section {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 10vw;
  pointer-events: none;
}

.feature-section * { pointer-events: auto; }

.align-left   { justify-content: flex-start; }
.align-right  { justify-content: flex-end; }
.align-center { justify-content: center; text-align: center; }

/* ── SPACER SECTIONS (scroll height for camera segments; contains the content-block) ── */
.spacer-section {
  position: relative;
  z-index: 1;
  min-height: 200vh;
  pointer-events: none;
}

#s1 {
  min-height: 250vh;
}

/* ── FEATURE BLOCK (enters from below as you scroll down) ─── */
.feature-block {
  max-width: 540px;
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.feature-block.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── BADGE ──────────────────────────────────────────────── */
.badge {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(77, 255, 238, 0.4);
  padding: 4px 12px;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 18px;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(44px, 10vw, 110px);
  letter-spacing: 0.2em;
  line-height: 1;
  margin-bottom: 0;
  background: linear-gradient(135deg, #ffffff 0%, var(--cyan) 50%, var(--blue-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  margin-bottom: 16px;
}

p {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-secondary);
}

/* ── HERO BACKDROP (dark overlay at top, eases out on scroll) ── */
.hero-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: #050510;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.6s ease-out;
}

body.hero-faded .hero-backdrop {
  opacity: 0;
}

/* ── STELLARGEN TITLE OVERLAY ───────────────────────────── */
/* Fixed at viewport center. Cross-fades over the 3D title during dezoom,
   then stays as the CTA page title while content slides up below. */
#sg-title-3d {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    0 0 6px  rgba(0, 210, 255, 0.6),
    0 0 18px rgba(0, 160, 255, 0.3);
  pointer-events: none;
  user-select: none;
  z-index: 20;
  opacity: 0;
  white-space: nowrap;
}

/* ── HERO ───────────────────────────────────────────────── */
.hero-intro {
  min-height: 130vh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 18vh;
  padding-bottom: 18vh;
  text-align: center;
  position: relative;
}

.hero-intro::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 720px);
  height: min(70vw, 520px);
  background: radial-gradient(ellipse at center,
    rgba(77, 255, 238, 0.04) 0%,
    rgba(123, 79, 255, 0.02) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-main {
  margin-bottom: 12vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.hero-intro .hero-main.feature-block {
  max-width: none;
}

.hero-detail {
  max-width: min(880px, 92vw);
  margin: 0 auto;
}

.hero-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 44px;
  flex-wrap: nowrap;
}

.hero-sample-seed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hs-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(160, 168, 208, 0.4);
}

.hs-seed {
  font-family: 'Space Mono', monospace;
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: 0.10em;
  color: var(--cyan);
  background: rgba(77, 255, 238, 0.05);
  border: 1px solid rgba(77, 255, 238, 0.22);
  padding: 14px 28px;
  border-radius: 2px;
  display: block;
}

.hero-sample-arrow {
  font-family: 'Space Mono', monospace;
  font-size: clamp(20px, 2.8vw, 30px);
  color: rgba(160, 168, 208, 0.2);
  flex-shrink: 0;
}

.hero-sample-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 48px;
}

.hs-fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  min-width: 90px;
  overflow: hidden;    /* clip text that overflows after width is locked */
}

.hs-fact-val {
  font-family: 'Space Mono', monospace;
  font-size: clamp(26px, 3.8vw, 42px);
  color: rgba(232, 240, 255, 0.95);
  line-height: 1;
  white-space: nowrap;
}

/* Stat-value pop when the hero seed cycles */
@keyframes heroStatPop {
  0%   { opacity: 0.25; transform: scale(1.18) translateY(-3px); }
  60%  { opacity: 1;    transform: scale(1.03) translateY(0); }
  100% { opacity: 1;    transform: scale(1)    translateY(0); }
}
.hero-stat-pop {
  animation: heroStatPop 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hs-fact-key {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(160, 168, 208, 0.42);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hero-sample { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .hero-sample { gap: 24px; align-items: center; }
  .hero-sample-arrow { display: none; }
  .hero-sample-facts { grid-template-columns: repeat(2, auto); gap: 16px 28px; }
  .hs-fact-val { font-size: 20px; }
  .hs-seed { font-size: 18px; }
}

.hero-cta {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(160, 168, 208, 0.9);
  margin-top: 48px;
  margin-bottom: 28px;
  font-weight: 400;
}

.scroll-indicator {
  margin-top: 48px;
  font-size: 24px;
  color: var(--cyan);
  animation: pulse-down 1.6s ease-in-out infinite;
  display: block;
  opacity: 0.7;
  letter-spacing: 0.1em;
}

.hero-line {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  margin: 24px auto;
  border-radius: 1px;
  opacity: 0.9;
}

.hero-sub {
  font-size: clamp(17px, 2vw, 22px);
  color: var(--text-primary);
  margin-bottom: 0;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.hero-sub .hero-accent {
  color: var(--cyan);
  font-weight: 500;
}

/* ── CTA SECTION ──────────────────────────────────────────── */
/* #sg-title-3d (position:fixed, viewport center) is the shared title.
   .cta-details sits below center. All opacities driven by JS scroll progress. */
.cta-section {
  position: relative;
  min-height: 100vh;
}

.cta-section-bg {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 8;
  opacity: 0;
  pointer-events: none;
}

.cta-details {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 88vw);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.cta-details.visible {
  pointer-events: auto;
}

.cta-summary {
  font-size: 19px !important;
  line-height: 1.9 !important;
  color: var(--text-secondary);
  margin-bottom: 32px !important;
}

.cta-p {
  font-size: 17px !important;
  margin-bottom: 32px !important;
  color: var(--text-secondary);
}

/* ── FORM ───────────────────────────────────────────────── */
#waitlist-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#email-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--cyan);
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  width: 320px;
  max-width: 80vw;
  padding: 12px 0;
  outline: none;
  text-align: center;
  caret-color: var(--cyan);
}

#email-input::placeholder { color: var(--text-secondary); }

#submit-btn {
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#submit-btn:hover {
  background: var(--cyan);
  color: var(--bg);
}

#submit-btn:focus-visible,
#email-input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ── SUCCESS ────────────────────────────────────────────── */
#success-container {
  display: none;
  position: relative;
  padding-top: 20px;
}

.rings {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 0; height: 0;
}

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
}

.r1 { animation: ring-out 1.8s ease-out 0s    forwards; }
.r2 { animation: ring-out 1.8s ease-out 0.45s forwards; }
.r3 { animation: ring-out 1.8s ease-out 0.9s  forwards; }

.success-title {
  font-family: 'Orbitron', sans-serif !important;
  font-size: 26px !important;
  color: var(--text-primary) !important;
  margin-bottom: 10px !important;
  margin-top: 60px;
}

.success-sub {
  font-size: 14px !important;
  color: var(--text-secondary) !important;
}

/* ── SHAKE ──────────────────────────────────────────────── */
.shake { animation: shake 0.4s; }

/* ── KEYFRAMES ──────────────────────────────────────────── */
@keyframes pulse-down {
  0%, 100% { opacity: 0.3; transform: translateY(0);   }
  50%       { opacity: 0.9; transform: translateY(8px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0);   }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX( 8px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX( 4px); }
}

@keyframes ring-out {
  0%   { opacity: 0.7; transform: translate(-50%, -50%) scale(1);   }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(3.8); }
}

/* ── CONTENT BLOCKS (fixed overlay — JS controls visibility, always centered in viewport) ──── */
.content-block {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 6vw;
  pointer-events: none;
  overflow: hidden;
}

.content-block.align-left {
  justify-content: flex-start;
  text-align: left;
}

.content-block.align-right {
  justify-content: flex-end;
  text-align: right;
}

.content-block.align-right .sp-stack {
  margin-left: auto;
}

/* section 4: moon card left, ocean planet card right */
.content-block.secondary-left .sp-stack {
  flex-direction: row;
  max-width: none;
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
.content-block.secondary-left .sp-secondary {
  order: -1;
  margin-top: 0;
  max-width: 420px;
  padding: 24px 28px;
}
.content-block.secondary-left .sp-secondary .sp-badge { margin-bottom: 14px; font-size: 11px; }
.content-block.secondary-left .sp-secondary .sp-row   { padding: 8px 0; }
.content-block.secondary-left .sp-secondary .sp-key   { font-size: 10px; }
.content-block.secondary-left .sp-secondary .sp-val   { font-size: 14px; }

/* sp-stack: column wrapper so sp-inner + sp-secondary stack vertically */
.sp-stack {
  display: flex;
  flex-direction: column;
  max-width: 540px;
}

/* sp-inner: enters from below, exits to above */
.content-block .sp-inner {
  max-width: 540px;
  opacity: 0;
  transform: translateY(100vh);
  transition: opacity 0.85s ease-out, transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-block.visible .sp-inner {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* scrolled past — exits upward */
.content-block.exited-top .sp-inner {
  opacity: 0;
  transform: translateY(-100vh);
  transition: opacity 0.5s ease-in, transform 0.5s ease-in;
}

/* not yet reached — waiting below viewport */
.content-block.exited-bottom .sp-inner {
  opacity: 0;
  transform: translateY(100vh);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.sp-inner {
  background: rgba(4, 5, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 2px solid rgba(77, 255, 238, 0.55);
  border-radius: 2px;
  padding: 36px 44px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(77, 255, 238, 0.04);
  max-width: 480px;
}

.sp-badge {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.85;
  margin-bottom: 18px;
}

.sp-text {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  line-height: 1.95;
  color: rgba(160, 168, 208, 0.72);
  margin-bottom: 24px;
}

.sp-attrs {
  border-top: 1px solid rgba(77, 255, 238, 0.08);
  padding-top: 12px;
}

.sp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.sp-row:last-child { border-bottom: none; }

.content-block.visible .sp-row {
  opacity: 1;
  transform: translateY(0);
}

/* ── SECONDARY CARD (moon, companion, etc.) ─────────────── */
.content-block .sp-secondary {
  max-width: 480px;
  margin-top: 10px;
  padding: 14px 20px;
  background: rgba(4, 5, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(77, 170, 255, 0.40);
  border-radius: 3px;
  opacity: 0;
  transform: translateY(100vh);
  transition: opacity 0.85s ease-out 0.18s, transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.18s;
}

.content-block.visible .sp-secondary {
  opacity: 1;
  transform: translateY(0);
}

.content-block.exited-top .sp-secondary {
  opacity: 0;
  transform: translateY(-100vh);
  transition: opacity 0.5s ease-in, transform 0.5s ease-in;
}

.content-block.exited-bottom .sp-secondary {
  opacity: 0;
  transform: translateY(100vh);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.sp-secondary .sp-badge { margin-bottom: 10px; }
.sp-secondary .sp-attrs { border-top: 1px solid rgba(77, 170, 255, 0.08); }
.sp-secondary .sp-row   { padding: 6px 0; }
.sp-secondary .sp-key   { font-size: 9px; }
.sp-secondary .sp-val   { font-size: 13px; }

.sp-key {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(160, 168, 208, 0.38);
  min-width: 130px;
  flex-shrink: 0;
}

.sp-val {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: rgba(232, 240, 255, 0.95);
  text-align: right;
}

/* ── TRANSIT SECTIONS (scroll-height placeholders — content is a fixed overlay) ─── */
.transit-section {
  position: relative;
  z-index: 1;
  min-height: 85vh;
  pointer-events: none;
}

.transit-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 80vh));
  width: min(680px, 84vw);
  text-align: center;
  opacity: 0;
  transition: opacity 0.9s ease-out, transform 0.9s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.transit-content.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* scrolled past — exits upward */
.transit-content.exited {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 60vh));
  transition: opacity 0.55s ease-in, transform 0.55s ease-in;
}

.transit-text {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(20px, 2.8vw, 34px);
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 22px;
  font-weight: 700;
}

.transit-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  margin: 0 auto 22px;
  border-radius: 1px;
}

.transit-project {
  font-family: 'Space Mono', monospace;
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.85;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  opacity: 1;
}

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 28px 40px;
  border-top: 1px solid rgba(77, 255, 238, 0.08);
  margin-top: 48px;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: rgba(160, 168, 208, 0.45);
  letter-spacing: 0.05em;
}

.footer-link {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: rgba(77, 255, 238, 0.5);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--cyan);
}

/* ── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .feature-block,
  .scroll-indicator,
  .ring,
  .loader-spinner { animation: none; }
  .feature-block { transition: opacity 0.3s ease; }
  .transit-content { transition: opacity 0.2s ease; }
  .content-block .sp-inner { transition: opacity 0.2s ease; }
  .sp-row { transition: none; }
}

/* ── MOBILE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .feature-section { padding: 0 6vw; }
  .feature-block   { max-width: 400px; }
  .hero-intro .hero-main { max-width: 100%; }
  h1               { font-size: clamp(36px, 10vw, 58px); letter-spacing: 0.12em; }
  p                { font-size: 15px; }
  .hero-intro      { min-height: 120vh; padding-top: 14vh; padding-bottom: 14vh; }
  .hero-intro::before { width: 95vw; height: 60vh; }
  .spacer-section  { min-height: 150vh; }
  #s1              { min-height: 80vh; }
  .transit-section { min-height: 75vh; }
  .transit-content { width: min(680px, calc(100vw - 8vw)); }
  .transit-text    { font-size: clamp(18px, 5vw, 26px); }
  .transit-project { font-size: 13px; }
  .hero-sub        { font-size: 17px; }
  .content-block   { padding: 0 4vw; }
  .sp-inner        { max-width: 380px; padding: 24px 28px; }
  .sp-text         { font-size: 15px; }
  .sp-key, .sp-val { font-size: 13px; }
}
