/* ============================================================
   Null Space — nextGen homepage · base layer
   Brand LOCKED: #6E8BFF family, deep-space voids, SF Pro/Mono.
   Homepage-only. Other pages keep styles.css / plugins.css.
   ============================================================ */

:root {
  --void-deep:   #030409;
  --void:        #06070D;
  --panel:       #0C0E16;
  --panel-2:     #11141F;
  --panel-hi:    #181C2A;

  --hair:        rgba(255,255,255,0.06);
  --hair-2:      rgba(255,255,255,0.10);
  --hair-3:      rgba(255,255,255,0.16);

  --text:        #ECEFF7;
  --text-2:      #97A0B6;
  --text-3:      #5A6276;

  /* BRAND — locked */
  --accent:        #6E8BFF;
  --accent-bright: #8FB4FF;
  --accent-glow:   #5A7CFF;
  --accent-deep:   #3D55C9;
  --accent-rgb:        110,139,255;
  --accent-bright-rgb: 143,180,255;
  --accent-deep-rgb:   61,85,201;
  --accent-soft:   rgba(var(--accent-rgb),0.14);
  --accent-line:   rgba(var(--accent-rgb),0.30);

  --success: #5BE0A8;
  --warning: #FFC56E;
  --danger:  #FF7A8A;

  --atmo-glow: 1;
  --atmo-grain: 1;

  --font-ui: "SF Pro Display", "SF Pro Rounded", ui-rounded, -apple-system,
             BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, monospace;

  --gut: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-ui);
  background: var(--void-deep);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(var(--accent-rgb),0.32); color: #fff; }

/* ============================================================
   AMBIENT COSMOS
   ============================================================ */
.bg-stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }

.bg-nebula { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(130% 80% at 50% -20%, #0B0E1A 0%, transparent 55%),
    var(--void-deep);
}
.neb { position: absolute; border-radius: 50%; filter: blur(130px); opacity: calc(0.5 * var(--atmo-glow)); }
.neb--1 { width: 760px; height: 760px; top: -320px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(var(--accent-rgb),0.38), transparent 70%); }
.neb--2 { width: 600px; height: 600px; top: 58%; right: -220px;
  background: radial-gradient(circle, rgba(var(--accent-deep-rgb),0.30), transparent 70%); }

/* orbital rings — the brand motif, drifting behind the hero.
   JS fades the whole layer while the canvas scene is being read. */
.bg-orbits {
  position: fixed; top: 50%; left: 50%; z-index: -1; pointer-events: none;
  width: min(1180px, 150vmin); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 0.5;
}
.bg-orbits::before {
  /* the sphere — a soft luminous core at the centre of the rings */
  content: ""; position: absolute; inset: 31%; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb),0.17), transparent 70%);
  filter: blur(34px);
}
.orbit { position: absolute; inset: 0; margin: auto; border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb),0.10); }
.orbit--a { width: 100%; height: 100%; }
.orbit--b { width: 70%; height: 70%; border-color: rgba(var(--accent-rgb),0.14); }
.orbit--c { width: 44%; height: 44%; border-color: rgba(var(--accent-bright-rgb),0.18); }
.orbit .sat { position: absolute; top: -4px; left: calc(50% - 4px); width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent-bright);
  box-shadow: 0 0 14px 2px rgba(var(--accent-bright-rgb),0.8); }
@media (prefers-reduced-motion: no-preference) {
  .orbit--a { animation: spin 80s linear infinite; }
  .orbit--b { animation: spin 56s linear infinite reverse; }
  .orbit--c { animation: spin 38s linear infinite; }
}

.bg-grain { position: fixed; inset: 0; z-index: 70; pointer-events: none;
  opacity: calc(.035 * var(--atmo-grain)); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ============================================================
   TYPE PRIMITIVES
   ============================================================ */
.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-bright);
}
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--accent-line); }

.h2 {
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.04;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  text-wrap: balance;
}
.h-display {
  font-weight: 600; letter-spacing: -0.035em; line-height: 1.0;
  font-size: clamp(2.5rem, 6.2vw, 5.4rem);
  text-wrap: balance;
}
.grad {
  background: linear-gradient(110deg, var(--accent-bright) 0%, #C7D6FF 45%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 26px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 560; letter-spacing: -0.005em;
  transition: box-shadow .35s var(--ease), background .3s;
  will-change: transform;
}
.btn--primary {
  color: #060810;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-glow));
  box-shadow: 0 0 0 1px rgba(var(--accent-bright-rgb),0.35), 0 10px 36px rgba(var(--accent-rgb),0.35);
}
.btn--primary:hover { box-shadow: 0 0 0 1px rgba(var(--accent-bright-rgb),0.55), 0 14px 48px rgba(var(--accent-rgb),0.5); }
.btn--ghost {
  color: var(--text); border: 1px solid var(--hair-3);
  background: rgba(255,255,255,0.02);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.btn--sm { padding: 8px 18px; font-size: 0.86rem; }
.btn svg { transition: transform .3s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 18px var(--gut);
  border-bottom: 1px solid transparent;
  transition: padding .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
}
.nav.scrolled {
  padding-block: 11px;
  background: rgba(6,7,13,0.7);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border-bottom-color: var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; }
.brand-name { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--text-2); font-size: 0.9rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-account { color: var(--text); }
.nav-cta { margin-left: 0; }

/* mobile menu toggle (hidden on desktop) */
.nav-toggle { display: none; }

/* ============================================================
   ACT SHELLS — pinned cinematic stages
   ============================================================ */
.act { position: relative; }
.act-hero  { height: 150vh; }
.act-space { height: 480vh; }
.stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   ACT I · HERO
   ============================================================ */
.hero-core {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 26px; padding-inline: var(--gut); max-width: 1100px;
  will-change: transform, opacity, filter;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.74rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-2);
  padding: 8px 16px; border: 1px solid var(--hair-2); border-radius: 999px;
  background: rgba(255,255,255,0.02);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 10px 2px rgba(91,224,168,0.85); }
@media (prefers-reduced-motion: no-preference) {
  .eyebrow .dot { animation: pulse-dot 1.8s var(--ease) infinite; }
}

.hero-title {
  font-weight: 620; letter-spacing: -0.04em; line-height: 1.02;
  font-size: clamp(2.9rem, 7.6vw, 6.6rem);
  text-wrap: balance;
}
.ht-line { display: block; overflow: hidden; padding-block: 0.06em; }
.ht-w { display: inline-block; }

.hero-sub {
  color: var(--text-2); font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55; max-width: 52ch; text-wrap: pretty;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-note { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-3); }

/* hero entrance — GSAP owns the load-in (see nextgen.js · "HERO LOAD-IN").
   `.pre-anim` on <body> hides the cast before first paint so there's no flash;
   the GSAP timeline reveals each piece, then drops the class. Gated on
   no-preference so reduced-motion users see the hero immediately, and no-JS
   users get the <noscript> reveal in index.html. */
@media (prefers-reduced-motion: no-preference) {
  .pre-anim .nav,
  .pre-anim .eyebrow,
  .pre-anim .ht-w,
  .pre-anim .hero-sub,
  .pre-anim .hero-cta > *,
  .pre-anim .hero-note { opacity: 0; }
}
@keyframes pulse-dot { 50% { opacity: 0.35; } }

/* scroll hint */
.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: opacity .5s;
}
.sh-track { width: 22px; height: 36px; border: 1.5px solid var(--hair-3); border-radius: 999px;
  display: flex; justify-content: center; padding-top: 6px; }
.sh-dot { width: 4px; height: 8px; border-radius: 999px; background: var(--accent-bright); }
.sh-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-3); }
@media (prefers-reduced-motion: no-preference) {
  .sh-dot { animation: sh-fall 1.6s var(--ease) infinite; }
}
@keyframes sh-fall { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* handoff cue — guidance during the hero → canvas "void".
   JS toggles `.show` while the title has faded but the scene hasn't started its
   story, so the empty starfield never looks like the end of the page. */
.enter-cue {
  position: fixed; left: 50%; bottom: clamp(26px, 5.5vh, 48px);
  z-index: 40; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  opacity: 0; transform: translateX(-50%) translateY(10px);
  transition: opacity .55s var(--ease), transform .6s var(--ease-out);
}
.enter-cue.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ec-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--text-2);
  text-shadow: 0 2px 20px rgba(3,4,9,0.95);
}
.ec-chev { position: relative; width: 16px; height: 24px; }
.ec-chev i {
  position: absolute; left: 2px; width: 11px; height: 11px;
  border-right: 1.6px solid var(--accent-bright);
  border-bottom: 1.6px solid var(--accent-bright);
  transform: rotate(45deg); opacity: 0.22;
}
.ec-chev i:nth-child(1) { top: 0; }
.ec-chev i:nth-child(2) { top: 6px; }
.ec-chev i:nth-child(3) { top: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .enter-cue.show .ec-chev i { animation: ec-fall 1.5s var(--ease) infinite; }
  .enter-cue.show .ec-chev i:nth-child(2) { animation-delay: .16s; }
  .enter-cue.show .ec-chev i:nth-child(3) { animation-delay: .32s; }
}
@keyframes ec-fall { 0%, 100% { opacity: 0.16; } 45% { opacity: 0.95; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 48px var(--gut) 60px; border-top: 1px solid var(--hair);
  text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 0.95rem; }
.footer-brand img { border-radius: 6px; }
.footer-meta { color: var(--text-3); font-size: 0.84rem; max-width: 60ch; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  color: var(--text-3); font-size: 0.84rem; }
.footer-links a { color: var(--text-2); transition: color .2s; }
.footer-links a:hover { color: var(--text); }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 860px) {
  .nav { gap: 14px; }
  .nav-toggle {
    display: inline-flex; margin-left: auto; width: 40px; height: 40px;
    align-items: center; justify-content: center; border-radius: 10px;
    border: 1px solid var(--hair-2); background: rgba(255,255,255,0.02);
    color: var(--text); cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 17px; height: 1.6px; border-radius: 2px;
    background: currentColor; transition: transform .3s var(--ease), opacity .2s;
  }
  .nav-toggle span { position: relative; }
  .nav-toggle span::before { position: absolute; top: -5px; }
  .nav-toggle span::after  { position: absolute; top: 5px; }
  .nav[data-open="1"] .nav-toggle span { background: transparent; }
  .nav[data-open="1"] .nav-toggle span::before { transform: translateY(5px) rotate(45deg); }
  .nav[data-open="1"] .nav-toggle span::after  { transform: translateY(-5px) rotate(-45deg); }

  .nav-links {
    position: fixed; inset: 70px 14px auto 14px; flex-direction: column;
    align-items: stretch; gap: 4px; margin-left: 0; padding: 12px;
    border-radius: 16px; border: 1px solid var(--hair-2);
    background: rgba(8,10,17,0.92);
    -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    opacity: 0; transform: translateY(-10px) scale(0.98); pointer-events: none;
    transition: opacity .25s var(--ease), transform .3s var(--ease-out);
  }
  .nav[data-open="1"] .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 11px 13px; border-radius: 10px; font-size: 0.95rem; }
  .nav-links a:hover { background: var(--accent-soft); }
  .nav .nav-cta { display: none; }

  /* tighter cinematic acts on phones — less dead scroll across the dive,
     and the canvas reaches its story faster. */
  .act-hero  { height: 132vh; }
  .act-space { height: 420vh; }
  .ec-label  { font-size: 0.6rem; letter-spacing: 0.2em; }
}
