/* ============================================================
   NadirLabs.AI — company surface. The descent.
   Two fonts. One accent (teal). One glow (white). One canvas.
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/Inter-Variable.woff2") format("woff2");
  font-weight: 300 600;
  font-display: swap;
}

:root {
  /* Canvas — surface to nadir */
  --surface: #0A0E14;
  --mid: #080B11;
  --deep: #06080C;
  --nadir: #05070A;

  /* Accent: silver / platinum only (white, black, silver) */
  --teal: #E3E8EE;
  --teal-deep: #aab3bf;
  --teal-dim: rgba(227, 232, 238, 0.55);

  /* One glow */
  --glow: #FFFFFF;

  /* Text */
  --ink: #FFFFFF;
  --ink-2: #C9D1D9;
  --ink-3: #8A94A1;
  --ink-4: #59616C;
  --hair: rgba(201, 209, 217, 0.10);
  --hair-strong: rgba(201, 209, 217, 0.18);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* tunables (Tweaks) */
  --accent-intensity: 1;
  --orbit-opacity: 1;

  --maxw: 1280px;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--ink-2);
  background: var(--nadir);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* The descent gradient — the page itself darkens as you go deeper.
   Applied to a tall fixed-less layer sized to the full document. */
#descent {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(180deg,
      var(--surface) 0%,
      #090C12 32%,
      var(--deep) 68%,
      var(--nadir) 100%);
}

/* faint cool depth haze — NOT a third hue, just dimensional cool-white */
#haze {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% -5%, rgba(120,150,185,0.08), transparent 60%),
    radial-gradient(50% 35% at 80% 30%, rgba(70,95,130,0.05), transparent 65%),
    radial-gradient(55% 40% at 15% 60%, rgba(60,90,120,0.045), transparent 65%);
}

img { display: block; max-width: 100%; }

::selection { background: rgba(255,255,255,0.22); color: #fff; }

/* ----------------------------------------------------------------
   STARFIELD + ORBITAL SYSTEM (fixed layers, parallax via --scroll)
   ---------------------------------------------------------------- */
.layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
#stars   { z-index: -1; }
#orbits  { z-index: -1; }

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px 1px rgba(255,255,255,0.35);
  animation: twinkle var(--dur, 5s) ease-in-out infinite;
  animation-delay: var(--del, 0s);
  will-change: opacity;
}
.star.bright { box-shadow: 0 0 6px 1px rgba(255,255,255,0.6), 0 0 16px 3px rgba(255,255,255,0.18); }
@keyframes twinkle { 0%,100%{opacity:.35} 50%{opacity:1} }

/* shooting stars injected by JS */
#shooting { z-index: -1; }
.shoot {
  position: fixed;
  width: var(--sz, 2px); height: var(--sz, 2px);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px 1px rgba(255,255,255,0.5);
  animation: shoot var(--spd, 1.1s) linear forwards;
}
.shoot::before {
  content: ""; position: absolute; top: 50%; right: 100%;
  width: var(--trail, 120px); height: 1.5px; transform: translateY(-50%);
  background: linear-gradient(to left, rgba(255,255,255,.55), transparent);
}
@keyframes shoot {
  0% { transform: translate(0,0) rotate(var(--ang,28deg)); opacity: .9; }
  70% { opacity: .9; }
  100% { transform: translate(var(--tx,420px), var(--ty,230px)) rotate(var(--ang,28deg)); opacity: 0; }
}

/* Orbital arcs — the brand ring motif expanded as the structure of the descent */
#orbits svg { position: absolute; left: 50%; top: 50%; overflow: visible; }
.orbit-ring {
  fill: none;
  stroke: rgba(201,209,217,0.20);
  vector-effect: non-scaling-stroke;
}
.orbit-ring.teal {
  stroke: rgba(255,255,255, calc(0.30 * var(--accent-intensity)));
}

/* ----------------------------------------------------------------
   TYPOGRAPHY
   ---------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(0.66rem, 1vw, 0.78rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.eyebrow .idx { color: var(--teal-dim); }

.movement {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.18;
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  text-wrap: balance;
}
.lede {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.6;
}
.teal { color: var(--teal); }
.dim { color: var(--ink-3); }

/* ----------------------------------------------------------------
   LAYOUT
   ---------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.5rem, 5vw, 4rem); }

section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  scroll-margin-top: 72px;
}

/* reveal */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 1s cubic-bezier(.16,.7,.2,1), transform 1s cubic-bezier(.16,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; }

/* ----------------------------------------------------------------
   NAV
   ---------------------------------------------------------------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .4s ease, backdrop-filter .4s ease, border-color .4s ease;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(6,8,12,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--hair);
}
.nav-inner { max-width: var(--maxw); margin-inline: auto; padding: 1.1rem clamp(1.5rem,5vw,4rem); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(255,255,255,0.25)); }
.brand .wm { font-family: var(--font-display); font-weight: 700; font-size: .82rem; letter-spacing: 0.12em; color: var(--ink); }
.brand .wm b { font-weight: 300; }
.brand .wm .ai { font-weight: 300; color: var(--ink-3); }

.nav-links { display: flex; align-items: center; gap: clamp(1.2rem, 2.4vw, 2.2rem); }
.nav-links a {
  font-family: var(--font-display); font-weight: 500;
  font-size: .74rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); text-decoration: none; transition: color .25s; position: relative; padding: .3rem 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.7);
}

/* language toggle */
.lang {
  display: inline-flex; align-items: center; border: 1px solid var(--hair-strong);
  border-radius: 999px; overflow: hidden; font-family: var(--font-display);
}
.lang button, .lang a {
  background: none; border: 0; cursor: pointer; color: var(--ink-4); text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: .72rem; font-weight: 600; letter-spacing: .08em; padding: .5rem .72rem; min-height: 38px; transition: color .25s, background .25s;
}
.lang button.on, .lang a.on { color: #05070A; background: var(--ink); }
.lang button:not(.on):hover, .lang a:not(.on):hover { color: var(--ink-2); }

.nav-cta-group { display: flex; align-items: center; gap: 1rem; }

/* hamburger */
.burger { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.burger span { width: 22px; height: 1.5px; background: var(--ink-2); transition: transform .3s, opacity .3s; }

#mobile { position: fixed; inset: 0; z-index: 49; background: rgba(5,7,10,0.96); backdrop-filter: blur(20px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2rem; opacity: 0; pointer-events: none; transition: opacity .35s; }
#mobile.open { opacity: 1; pointer-events: auto; }
#mobile a { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; }

/* ----------------------------------------------------------------
   HERO — the surface
   ---------------------------------------------------------------- */
#hero { text-align: center; flex-direction: column; justify-content: center; }
.hero-h1 { display: flex; flex-direction: column; align-items: center; gap: 1.9rem; }
.hero-logo {
  width: clamp(112px, 16vw, 168px); height: auto; margin: 0 auto 2.2rem;
  filter: drop-shadow(0 0 70px rgba(255,255,255,0.42)) drop-shadow(0 0 150px rgba(255,255,255,0.10));
  animation: breathe 6s ease-in-out infinite;
  will-change: opacity, filter;
}
@keyframes breathe {
  0%,100% { filter: drop-shadow(0 0 60px rgba(255,255,255,0.34)) drop-shadow(0 0 140px rgba(255,255,255,0.08)); }
  50%     { filter: drop-shadow(0 0 84px rgba(255,255,255,0.48)) drop-shadow(0 0 170px rgba(255,255,255,0.13)); }
}
#hero .slogan {
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  font-size: clamp(2.6rem, 9vw, 7rem); line-height: 0.98; letter-spacing: -0.03em;
  text-transform: uppercase; text-wrap: balance;
  text-shadow: 0 0 70px rgba(255,255,255,0.12);
}
#hero .h1-cat {
  font-family: var(--font-body); font-weight: 300; text-transform: none;
  font-size: clamp(1.02rem, 1.6vw, 1.4rem); letter-spacing: -0.005em; line-height: 1.55;
  color: var(--ink-2); max-width: 40ch; text-shadow: none;
}
.scrollcue {
  position: absolute; bottom: clamp(1.6rem, 4vh, 2.6rem); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .7rem; color: var(--ink-4);
}
.scrollcue span { font-family: var(--font-display); font-size: .6rem; letter-spacing: .42em; text-transform: uppercase; }
.scrollcue svg { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%,100%{ transform: translateY(0); opacity:.5 } 50%{ transform: translateY(7px); opacity:1 } }

/* ----------------------------------------------------------------
   WHY DEPTH
   ---------------------------------------------------------------- */
#why .wrap { max-width: 980px; }
#why .movement { margin-top: 1.6rem; }
.depthword { color: #fff; text-shadow: 0 0 38px rgba(255,255,255, calc(0.55 * var(--accent-intensity))); }

/* ----------------------------------------------------------------
   BELIEVE — principles
   ---------------------------------------------------------------- */
#believe { padding-block: 12vh; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 4rem); margin-top: clamp(2.5rem, 6vw, 5rem); }
.principle { border-top: 1px solid var(--hair); padding-top: 1.6rem; }
.principle .pno { font-family: var(--font-display); font-size: .72rem; letter-spacing: .3em; color: var(--teal-dim); margin-bottom: 1.2rem; }
.principle h3 { font-family: var(--font-display); font-weight: 500; color: var(--ink); font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.12; letter-spacing: -0.01em; margin-bottom: 1rem; }
.principle p { font-size: 1.02rem; line-height: 1.62; color: var(--ink-3); font-weight: 300; }

/* ----------------------------------------------------------------
   PORTFOLIO — places in the space
   ---------------------------------------------------------------- */
#portfolio { padding-block: 12vh; }
.port-head { text-align: center; margin-bottom: clamp(3rem, 7vw, 5.5rem); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.4rem, 2.4vw, 2rem); }

.card {
  position: relative; isolation: isolate;
  border: 1px solid var(--hair); border-radius: 14px;
  padding: clamp(1.8rem, 2.6vw, 2.6rem);
  background: linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0.004));
  overflow: hidden; min-height: 360px;
  display: flex; flex-direction: column;
  transition: transform .5s cubic-bezier(.16,.7,.2,1), border-color .5s, box-shadow .5s;
}
.card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: 14px; opacity: 0; transition: opacity .5s;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255, calc(0.16 * var(--accent-intensity))), transparent 60%);
}
.card .cardorbit { position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; z-index: -1; opacity: .5; transition: opacity .5s, transform .6s; }
.card .cardorbit ellipse { fill: none; stroke: var(--hair-strong); }
.card:hover { transform: translateY(-6px) scale(1.012); border-color: rgba(255,255,255,calc(0.42*var(--accent-intensity))); box-shadow: 0 30px 80px -30px rgba(255,255,255,calc(0.30*var(--accent-intensity))); }
.card:hover::before { opacity: 1; }
.card:hover .cardorbit { opacity: 1; transform: rotate(12deg) scale(1.06); }
.card:hover .cardorbit ellipse { stroke: rgba(255,255,255,0.5); }

.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; padding: .34rem .7rem; border-radius: 999px; border: 1px solid var(--hair-strong); color: var(--ink-3); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.badge.live { color: var(--teal); border-color: rgba(255,255,255,0.4); }
.badge.live .dot { background: var(--teal); box-shadow: 0 0 8px var(--teal); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

.card h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: clamp(1.5rem, 2vw, 1.85rem); letter-spacing: -0.01em; margin: 1.6rem 0 .8rem; }
.card .essence { color: var(--ink-3); font-weight: 300; font-size: 1rem; line-height: 1.55; flex: 1; }
.card .route {
  margin-top: 1.8rem; display: inline-flex; align-items: center; gap: .6rem; align-self: flex-start;
  font-family: var(--font-display); font-weight: 600; font-size: .82rem; letter-spacing: .02em;
  color: var(--ink-2); text-decoration: none; transition: color .3s, gap .3s;
}
.card .route svg { transition: transform .3s; }
.card:hover .route { color: var(--teal); }
.card:hover .route svg { transform: translateX(4px); }

/* primary routing CTA (the single teal CTA on the page lives on the Live card) */
.card.primary .route { color: var(--teal); }

/* ----------------------------------------------------------------
   THE CORE / NADIR
   ---------------------------------------------------------------- */
#nadir { background: var(--nadir); text-align: center; flex-direction: column; justify-content: center; padding-block: 16vh; }
#nadir .movement { max-width: 24ch; margin: 0 auto; }
.nadir-logo {
  width: clamp(120px, 17vw, 184px); height: auto; margin: 3.4rem auto 0;
  filter: drop-shadow(0 0 90px rgba(255,255,255,0.5)) drop-shadow(0 0 200px rgba(255,255,255,0.16));
  animation: arrive 7s ease-in-out infinite;
}
@keyframes arrive {
  0%,100% { filter: drop-shadow(0 0 70px rgba(255,255,255,0.40)) drop-shadow(0 0 170px rgba(255,255,255,0.10)); transform: scale(1); }
  50%     { filter: drop-shadow(0 0 110px rgba(255,255,255,0.58)) drop-shadow(0 0 230px rgba(255,255,255,0.20)); transform: scale(1.015); }
}
#nadir .arrival { margin-top: 2.6rem; font-family: var(--font-display); font-weight: 500; letter-spacing: .26em; text-transform: uppercase; font-size: clamp(.72rem,1.1vw,.86rem); color: #fff; text-shadow: 0 0 30px rgba(255,255,255,calc(0.55*var(--accent-intensity))); }ext-shadow: 0 0 30px rgba(255,255,255,calc(0.5*var(--accent-intensity))); }

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
footer { position: relative; z-index: 1; background: var(--nadir); border-top: 1px solid var(--hair); padding: clamp(4rem,8vw,7rem) 0 3rem; min-height: auto; display: block; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
.foot-brand .wm { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: .1em; color: var(--ink); }
.foot-brand .wm b { font-weight: 300; } .foot-brand .wm .ai { font-weight: 300; color: var(--ink-3); }
.foot-brand p { margin-top: 1rem; color: var(--ink-4); font-size: .9rem; font-weight: 300; max-width: 30ch; line-height: 1.5; }
.foot-col h4 { font-family: var(--font-display); font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 1.1rem; }
.foot-col a { display: flex; align-items: center; gap: .5rem; color: var(--ink-3); text-decoration: none; font-size: .9rem; padding: .5rem 0; min-height: 40px; transition: color .25s; }
.foot-col a:hover { color: var(--ink); }
.foot-col a svg { opacity: .7; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: clamp(3rem,6vw,5rem); padding-top: 1.8rem; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.foot-bottom p { color: var(--ink-4); font-size: .78rem; }
.foot-bottom .payoff { font-family: var(--font-display); font-style: italic; color: var(--ink-3); letter-spacing: .04em; }

/* ----------------------------------------------------------------
   DEPTH RAIL — minimal scroll progress, surface → nadir
   ---------------------------------------------------------------- */
#rail { position: fixed; right: clamp(1rem, 2.4vw, 2.2rem); top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: .8rem; pointer-events: none; }
#rail .track { width: 1px; height: 34vh; background: var(--hair); position: relative; }
#rail .fill { position: absolute; top: 0; left: 0; width: 1px; background: linear-gradient(var(--teal), var(--teal-deep)); box-shadow: 0 0 8px var(--teal); height: 0; }
#rail .cap { font-family: var(--font-display); font-size: .56rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-4); writing-mode: vertical-rl; }
@media (max-width: 980px) { #rail { display: none; } }

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr; gap: 2.4rem; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: auto; }
  .nav-links { display: none; }
  .burger { display: flex; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .foot-brand { grid-column: 1 / -1; }
}

/* phones */
@media (max-width: 600px) {
  .nav-inner { padding: .9rem clamp(1.1rem, 5vw, 1.5rem); }
  .brand .wm { font-size: .74rem; }
  #hero .slogan { font-size: clamp(2.5rem, 13vw, 4rem); }
  .hero-h1 { gap: 1.4rem; }
  #hero .h1-cat { font-size: 1.02rem; max-width: 30ch; }
  .movement { font-size: clamp(1.5rem, 6.4vw, 2rem); }
  .card { padding: 1.6rem 1.5rem; }
  .card h3 { margin-top: 1.2rem; }
  .foot-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: .6rem; }
  #believe, #portfolio { padding-block: 14vh; }
}

/* very small */
@media (max-width: 360px) {
  #hero .slogan { font-size: 2.2rem; }
  .brand img { width: 26px; height: 26px; }
}

/* short / landscape viewports */
@media (max-height: 560px) and (min-width: 601px) {
  .hero-logo { width: clamp(80px, 11vh, 110px); margin-bottom: 1.4rem; }
  .hero-h1 { gap: 1rem; }
  section { min-height: auto; padding-block: 16vh; }
  #hero { padding-block: 12vh; }
  .scrollcue { display: none; }
}

/* ultra-wide */
@media (min-width: 1800px) {
  :root { --maxw: 1440px; }
  #hero .slogan { font-size: clamp(7rem, 9vw, 9rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html { scroll-behavior: auto; }
}

/* Tweaks: motion modes */
body.motion-calm #shooting { display: none; }
body.motion-off #shooting { display: none; }
body.motion-off .star,
body.motion-off .hero-logo,
body.motion-off .nadir-logo,
body.motion-off .scrollcue svg,
body.motion-off .badge.live .dot { animation: none !important; }

/* disable heavy fixed motion on small screens (perf budget) */
@media (max-width: 768px) {
  #stars, #shooting, #orbits { display: none; }
}
