/* ================================================================
   NEXUS — nexusplatform.global
   Space-grade minimalism · slow halos · Neue Haas Grotesk Text Pro
   ================================================================ */

/* ---- Typeface -------------------------------------------------
   Neue Haas Grotesk Text Pro is a licensed face (Monotype).
   Drop licensed .woff2 files into /fonts with the names below,
   or replace these with your Adobe Fonts kit <link>.
   Until then the stack falls back to Helvetica Neue / Arial. */
@font-face {
  font-family: "Neue Haas Grotesk Text Pro";
  src: url("../fonts/NHaasGroteskTXPro-55Rg.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Neue Haas Grotesk Text Pro";
  src: url("../fonts/NHaasGroteskTXPro-65Md.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Neue Haas Grotesk Text Pro";
  src: url("../fonts/NHaasGroteskTXPro-75Bd.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #050508;
  --text: #f4f4f6;
  --muted: #8f8f9d;
  --faint: #55555f;
  --line: rgba(255, 255, 255, 0.08);

  --violet: #7c3aed;
  --purple: #a855f7;
  --magenta: #d1409d;
  --crimson: #de4560;
  --ember: #ef6a3f;
  --lavender: #c9a0ff;

  --grad: linear-gradient(100deg, var(--lavender) 0%, #e879ac 48%, var(--ember) 100%);

  --font: "Neue Haas Grotesk Text Pro", "neue-haas-grotesk-text",
          "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

::selection { background: rgba(168, 85, 247, 0.35); color: #fff; }

a { color: inherit; text-decoration: none; }

/* ================================================================
   BACKGROUND — deep space
   ================================================================ */
.space {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% -20%, #0c0a18 0%, var(--bg) 55%);
}

/* ---- Slowly moving halos ---- */
.halo-field {
  position: absolute;
  inset: -20%;
  will-change: transform;
  transition: transform 1.6s var(--ease);
}

.halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.halo--violet {
  width: 62vmax; height: 62vmax;
  left: -18vmax; top: -16vmax;
  background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.42) 0%, rgba(124, 58, 237, 0) 62%);
  animation: drift-a 110s ease-in-out infinite alternate;
}

.halo--magenta {
  width: 52vmax; height: 52vmax;
  right: -20vmax; top: 8vmax;
  background: radial-gradient(circle at 50% 50%, rgba(209, 64, 157, 0.30) 0%, rgba(209, 64, 157, 0) 60%);
  animation: drift-b 140s ease-in-out infinite alternate;
}

.halo--ember {
  width: 48vmax; height: 48vmax;
  left: -14vmax; bottom: -20vmax;
  background: radial-gradient(circle at 50% 50%, rgba(239, 106, 63, 0.26) 0%, rgba(222, 69, 96, 0) 62%);
  animation: drift-c 95s ease-in-out infinite alternate;
}

.halo--deep {
  width: 70vmax; height: 70vmax;
  left: 28vw; top: 30vh;
  background: radial-gradient(circle at 50% 50%, rgba(88, 40, 170, 0.20) 0%, rgba(88, 40, 170, 0) 58%);
  animation: drift-d 160s ease-in-out infinite alternate;
}

@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(9vw, 7vh, 0) scale(1.12); }
  100% { transform: translate3d(16vw, -4vh, 0) scale(0.96); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-11vw, 10vh, 0) scale(1.08); }
  100% { transform: translate3d(-5vw, 22vh, 0) scale(1.18); }
}
@keyframes drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(10vw, -8vh, 0) scale(1.15); }
  100% { transform: translate3d(20vw, -2vh, 0) scale(1); }
}
@keyframes drift-d {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-14vw, -12vh, 0) scale(1.25); }
}

#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 140% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ================================================================
   SCROLL PROGRESS
   ================================================================ */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 100;
}
.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
}

/* ================================================================
   NAV
   ================================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.4rem clamp(1.5rem, 5vw, 4rem);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), padding 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  background: rgba(5, 5, 8, 0.55);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}

.nav__brand {
  font-weight: 500;
  letter-spacing: 0.42em;
  font-size: 0.95rem;
  padding-left: 0.42em; /* optical balance for tracking */
}

.nav__links {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.6rem);
}

.nav__links a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.3s;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  width: 100%; height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

/* ================================================================
   HERO
   ================================================================ */
main { position: relative; z-index: 10; }

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem clamp(1.5rem, 5vw, 4rem) 4rem;
  position: relative;
}

.hero__orbit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero__orbit svg {
  width: min(140vmin, 1300px);
  height: min(140vmin, 1300px);
  opacity: 0.9;
}
.orbit-spin {
  transform-origin: 600px 600px;
  animation: orbit-rotate 180s linear infinite;
}
@keyframes orbit-rotate { to { transform: rotate(360deg); } }

.hero__kicker {
  font-size: 0.78rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(1.4rem, 3vh, 2.4rem);
  padding-left: 0.5em;
}

.hero__wordmark {
  font-size: clamp(4.2rem, 15vw, 12rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  padding-left: 0.16em;
  margin-bottom: clamp(1.6rem, 3.5vh, 2.8rem);
}
/* gradient lives on each letter — background-clip:text breaks when
   applied to a parent whose children are transformed during reveal */
.hero__wordmark span {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 30%, #b9b3d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__sub {
  max-width: 34em;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: #c9c9d4;
  margin-bottom: 1.2rem;
}

.hero__meta {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero__scroll {
  position: absolute;
  bottom: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.hero__scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.5));
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--lavender);
  animation: scroll-beam 2.4s var(--ease) infinite;
}
@keyframes scroll-beam { to { top: 110%; } }
.hero__scroll-text {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.3s;
}
.hero__scroll:hover .hero__scroll-text { color: var(--muted); }

/* ================================================================
   SECTIONS
   ================================================================ */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(6rem, 14vh, 10rem) clamp(1.5rem, 5vw, 4rem);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2.2rem, 5vh, 3.6rem);
}
.section__index {
  font-size: 0.8rem;
  color: var(--lavender);
  letter-spacing: 0.1em;
}
.section__name {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--faint);
}
.section__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  align-self: center;
}

.statement {
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.01em;
  max-width: 22em;
}

.statement--center {
  text-align: center;
  margin: 0 auto;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lede {
  margin-top: 2rem;
  max-width: 44em;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.7;
}

/* ================================================================
   02 · SYSTEMS GRID
   ================================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.card {
  background: rgba(10, 10, 18, 0.72);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  position: relative;
  transition: background 0.45s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
              rgba(168, 85, 247, 0.10), transparent 65%);
  opacity: 0;
  transition: opacity 0.45s;
  pointer-events: none;
}
.card:hover { background: rgba(14, 13, 26, 0.85); }
.card:hover::before { opacity: 1; }

.card__tag {
  display: inline-block;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  color: var(--faint);
  margin-bottom: 1.5rem;
}

.card h3 {
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.65rem;
}

.card p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ================================================================
   03 · UNIVERSES
   ================================================================ */
.universes {
  margin-top: clamp(2.6rem, 6vh, 4rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.2rem, 2.5vw, 2rem);
}

.universe {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.8rem, 3.4vw, 2.8rem);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
}
.universe:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 160, 255, 0.28);
}
.universe::after {
  content: "";
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  right: -140px; top: -140px;
  filter: blur(70px);
  opacity: 0.35;
  transition: opacity 0.5s;
  pointer-events: none;
}
.universe:first-child::after { background: radial-gradient(circle, rgba(124, 58, 237, 0.5), transparent 65%); }
.universe:last-child::after  { background: radial-gradient(circle, rgba(239, 106, 63, 0.42), transparent 65%); }
.universe:hover::after { opacity: 0.6; }

.universe__orbit-tag {
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}

.universe h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 500;
  margin: 1.1rem 0 0.7rem;
}

.universe p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 30em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.6rem;
}
.chips span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #b9b9c6;
  padding: 0.42em 0.95em;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.02);
}

/* ================================================================
   04 · TELEMETRY / STATS
   ================================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2rem);
}

.stat {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}

.stat__value {
  display: block;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__value em { font-style: normal; font-size: 0.6em; }
.stat__value--word { letter-spacing: 0.08em; }

.stat__label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ================================================================
   CLOSING
   ================================================================ */
.section--closing {
  padding-top: clamp(7rem, 18vh, 12rem);
  padding-bottom: clamp(7rem, 16vh, 11rem);
}

.closing-cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(2.4rem, 6vh, 3.6rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  padding: 1em 2.1em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s, transform 0.4s var(--ease);
  isolation: isolate;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s;
}
.btn:hover { border-color: transparent; transform: translateY(-2px); }
.btn:hover::before { opacity: 1; }
.btn:hover { color: #0b0512; }
.btn svg { transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 2.2rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.08em;
}
.footer__brand { letter-spacing: 0.42em; color: var(--muted); font-weight: 500; }
.footer__status { display: flex; align-items: center; gap: 0.55rem; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.18em; }

/* ================================================================
   REVEAL ANIMATIONS
   ================================================================ */
.reveal-load {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 1.1s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 2.6rem; }
  .nav__status .nav__status-text { display: none; }
}

@media (max-width: 640px) {
  .nav__links { display: none; }
  .grid { grid-template-columns: 1fr; }
  .universes { grid-template-columns: 1fr; }
  .hero__orbit svg { width: 190vmin; height: 190vmin; }
  .hero__kicker { letter-spacing: 0.3em; padding-left: 0.3em; font-size: 0.7rem; }
  .hero__meta { letter-spacing: 0.1em; padding: 0 1rem; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .halo, .orbit-spin, .nav__dot, .hero__scroll-line::after { animation: none !important; }
  .reveal-load, .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
