/* ==========================================================================
   Nuvya Design System
   Typography: Geist only — hierarchy is built from scale, weight and
   tracking, not from mixing typefaces. Technological sibling of the
   Avvyun design language (same interface sans, distinct palette,
   distinct voice): near-black, off-white, a single restrained violet
   used like a light source rather than a decoration.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */

:root {
  /* brand palette — sampled directly from the Nuvya mark artwork, fixed,
     do not extend with new hues */
  --n-black: #0a0216;
  --n-black-soft: #150a26;
  --n-white: #f6f2f8;
  --n-violet: #6a35ab;
  --n-magenta: #f0a6cb;
  --n-lavender: #c9aee6;
  --n-pink: #f2b8dd;
  --n-purple: #a06adf; /* midpoint accent — links, focus rings, small ui */

  --n-white-a64: rgba(246, 242, 248, 0.64);
  --n-white-a38: rgba(246, 242, 248, 0.38);
  --n-white-a12: rgba(246, 242, 248, 0.12);
  --n-white-a06: rgba(246, 242, 248, 0.06);
  --n-purple-a50: rgba(160, 106, 223, 0.5);
  --n-purple-a20: rgba(160, 106, 223, 0.2);
  --n-magenta-a40: rgba(240, 166, 203, 0.4);

  --n-text-gradient: linear-gradient(100deg, var(--n-lavender) 0%, var(--n-pink) 100%);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --space-11: 10rem;

  --container-max: 1280px;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --topbar-h: 76px;

  --ease-out: cubic-bezier(0.16, 0.8, 0.24, 1);
  --ease-spatial: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.15, 1);
  --dur-fast: 220ms;
  --dur-base: 700ms;
  --dur-slow: 1100ms;
}

/* ---- Reset ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (hover: none) {
  .nv-topbar__word:active { opacity: 0.6; }
  .nv-close__link:active { color: var(--n-purple); }
  .nv-close__link:active::after { background: var(--n-purple); }
}

body.nuvya {
  margin: 0;
  background: var(--n-black);
  color: var(--n-white);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.nuvya img, .nuvya svg { max-width: 100%; display: block; }
.nuvya a { text-decoration: none; color: inherit; }
.nuvya ul { margin: 0; padding: 0; list-style: none; }
.nuvya h1, .nuvya h2, .nuvya h3, .nuvya p { margin: 0; }
.nuvya button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---- Layout primitives -------------------------------------------------- */

.nv-container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}

/* ---- Grain + ambient light ----------------------------------------------
   A single fixed layer beneath all content: near-imperceptible film grain
   plus a slow-drifting violet glow that reads as a distant light source,
   not a decoration. Both are pure CSS — no canvas, no per-frame JS cost. */

.nv-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.nv-atmosphere__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1100px, 140vw);
  height: min(1100px, 140vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(160, 106, 223, 0.22) 0%, rgba(240, 166, 203, 0.07) 38%, transparent 68%);
  filter: blur(10px);
  animation: nv-drift 34s var(--ease-in-out) infinite alternate;
  will-change: transform;
}

@keyframes nv-drift {
  0%   { transform: translate(-54%, -52%) scale(1); }
  50%  { transform: translate(-46%, -49%) scale(1.06); }
  100% { transform: translate(-50%, -55%) scale(1); }
}

.nv-atmosphere__grain {
  position: absolute;
  inset: -10%;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

@media (prefers-reduced-motion: reduce) {
  .nv-atmosphere__glow { animation: none; }
}

/* ---- Type system --------------------------------------------------------- */

.nv-kicker {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--n-purple);
}

.nv-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n-white-a64);
}

.nv-wordmark {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(2.6rem, 1.6rem + 7.4vw, 8.25rem);
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--n-white);
}

/* The stylized wordmark reads as a soft lavender-to-pink gradient, matching
   the mark artwork — same trick everywhere the word appears at display size. */
.nv-gradient-text {
  background: var(--n-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  .nv-gradient-text { color: var(--n-lavender); }
}

.nv-statement {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(1.4rem, 1.1rem + 1.9vw, 2.5rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--n-white);
  max-width: 20ch;
}

.nv-h2 {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(1.4rem, 1.15rem + 1.4vw, 2.15rem);
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--n-white-a64);
}

.nv-lede {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  line-height: 1.8;
  color: var(--n-white-a64);
}

.nv-meta {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--n-white-a38);
}

.nv-numeral {
  font-family: var(--font-sans);
  font-weight: 300;
  font-variant-numeric: lining-nums proportional-nums;
  letter-spacing: -0.01em;
}

/* ---- Topbar --------------------------------------------------------------
   Not a navigation bar — there is nowhere else to go yet. Just identity,
   left and right, small enough to disappear until you look for it. */

.nv-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--topbar-h);
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.nv-topbar.is-ready { opacity: 1; }

.nv-topbar__row {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nv-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.nv-topbar__mark {
  width: 17px;
  height: auto;
  flex: none;
  display: block;
}

.nv-topbar__word {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--n-white);
  transition: opacity var(--dur-fast) ease;
}
.nv-topbar__brand:hover .nv-topbar__word { opacity: 0.7; }

.nv-topbar__right {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--n-white-a38);
}

/* ---- Hero: arrival ---------------------------------------------------------
   .nv-hero-scene is a tall track; .nv-hero is pinned via position:sticky
   while it scrolls underneath. nuvya.js reads scroll progress through the
   track (0-1, gated by IntersectionObserver so the listener only runs near
   the viewport) and writes it directly to .nv-hero__stage's transform /
   opacity / filter each frame — the recession as you scroll past is the
   scene, not a decoration on top of it. The very first paint additionally
   gets a one-shot CSS-transition entrance (mark focuses in, type stacks up)
   before any scrolling has happened. */

.nv-hero-scene {
  position: relative;
  height: 190vh;
}

.nv-hero {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100svh;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--topbar-h) + var(--space-8)) var(--gutter) var(--space-9);
}

.nv-hero__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform, opacity;
}

.nv-hero__mark-holder {
  position: relative;
  display: inline-block;
  margin-bottom: clamp(var(--space-4), 3vw, var(--space-6));
}

/* The glow is its own blurred layer, independent of the image's alpha —
   drop-shadow() would otherwise trace the PNG's raw (unmasked) edge and
   bloom into a faint rectangle instead of a clean light source. */
.nv-hero__mark-holder::before {
  content: "";
  position: absolute;
  inset: -55%;
  background: radial-gradient(circle, var(--n-purple-a50) 0%, var(--n-magenta-a40) 32%, transparent 68%);
  filter: blur(28px);
  z-index: -1;
  opacity: 0;
  transition: opacity 1300ms var(--ease-out);
}
.nv-hero.is-ready .nv-hero__mark-holder::before {
  opacity: 1;
  transition-delay: 200ms;
}

.nv-hero__mark {
  width: clamp(64px, 9vw, 108px);
  height: auto;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 58%, transparent 100%);
  opacity: 0;
  transform: scale(0.9);
  filter: blur(10px);
  transition: opacity 1300ms var(--ease-out), transform 1300ms var(--ease-out), filter 1300ms var(--ease-out);
  will-change: transform;
}
.nv-hero.is-ready .nv-hero__mark {
  opacity: 1;
  transform: scale(1);
  filter: none;
  transition-delay: 100ms;
}

.nv-hero__word,
.nv-hero__label,
.nv-hero__statement {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.nv-hero.is-ready .nv-hero__word { opacity: 1; transform: translateY(0); transition-delay: 620ms; }
.nv-hero.is-ready .nv-hero__label { opacity: 1; transform: translateY(0); transition-delay: 800ms; }
.nv-hero.is-ready .nv-hero__statement { opacity: 1; transform: translateY(0); transition-delay: 940ms; }

.nv-hero__word { margin: 0; }

.nv-hero__label {
  margin-top: clamp(var(--space-3), 2vw, var(--space-4));
}

.nv-hero__statement {
  margin-top: clamp(var(--space-7), 7vw, var(--space-9));
}

.nv-hero__cue {
  position: absolute;
  bottom: clamp(var(--space-5), 5vh, var(--space-8));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
  transition-delay: 1480ms;
}
.nv-hero.is-ready .nv-hero__cue { opacity: 0.5; }

.nv-hero__cue-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--n-white-a64), transparent);
  animation: nv-cue 2.6s var(--ease-in-out) infinite;
}

@keyframes nv-cue {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(0.55); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .nv-hero-scene { height: auto; }
  .nv-hero { position: relative; }
  .nv-hero__mark, .nv-hero__word, .nv-hero__label, .nv-hero__statement, .nv-hero__cue {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .nv-hero__mark { filter: drop-shadow(0 0 50px var(--n-purple-a50)) drop-shadow(0 0 90px var(--n-magenta-a40)); }
  .nv-hero__cue-line { animation: none; }
}

/* ---- Reveal-on-scroll utility ------------------------------------------ */

.nv-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.nv-reveal.is-visible { opacity: 1; transform: translateY(0); }

.nv-reveal--d1.is-visible { transition-delay: 120ms; }
.nv-reveal--d2.is-visible { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .nv-reveal { transition-duration: 1ms; transform: none; }
}

/* ---- Section: philosophy ------------------------------------------------ */

.nv-philosophy {
  position: relative;
  z-index: 1;
  padding-block: var(--space-10);
}

.nv-philosophy__inner {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

/* Scroll-scrubbed wipe: nuvya.js drives --wipe (0%-100%) from how far this
   section has crossed the viewport, revealing the statement left to right
   as you scroll rather than all at once. */
.nv-philosophy__statement {
  --wipe: 0%;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--wipe) - 14%), transparent var(--wipe));
  mask-image: linear-gradient(90deg, #000 calc(var(--wipe) - 14%), transparent var(--wipe));
}

@media (prefers-reduced-motion: reduce) {
  .nv-philosophy__statement { -webkit-mask-image: none; mask-image: none; }
}

/* ---- Section: coming soon ------------------------------------------------ */

.nv-forming {
  position: relative;
  z-index: 1;
  padding-block: var(--space-10);
  overflow: hidden;
}

.nv-forming__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.nv-forming__statement {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(1.6rem, 1.3rem + 2vw, 2.75rem);
  letter-spacing: -0.01em;
  color: var(--n-white);
  max-width: 16ch;
}

.nv-forming__meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--n-white-a38);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nv-forming__meta span { color: var(--n-white-a12); }

/* Oversized echo of the mark, mostly cropped, almost invisible — the same
   structure recurring, not a new decoration. nuvya.js drives a slow
   rotate/scale on this as the section crosses the viewport; the base
   transform below is the resting state (also the reduced-motion state). */
.nv-forming__echo {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: clamp(360px, 52vw, 760px);
  height: auto;
  transform: translate(-50%, -46%);
  -webkit-mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 55%, transparent 100%);
  opacity: 0.08;
  pointer-events: none;
  will-change: transform;
}

/* ---- Section: closing ---------------------------------------------------- */

.nv-close {
  position: relative;
  z-index: 1;
  padding-block: var(--space-10) var(--space-9);
  border-top: 1px solid var(--n-white-a06);
}

.nv-close__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.nv-close__wordmark {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(1.7rem, 1.3rem + 2.6vw, 3rem);
  letter-spacing: 0.07em;
  color: var(--n-white);
}

.nv-close__link {
  position: relative;
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.0625rem;
  color: var(--n-white-a64);
  padding-bottom: 2px;
  transition: color var(--dur-fast) ease;
}
.nv-close__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--n-white-a12);
  transform-origin: left;
  transition: background-color var(--dur-fast) ease;
}
.nv-close__link:hover { color: var(--n-white); }
.nv-close__link:hover::after { background: var(--n-purple); }

.nv-close__tag {
  margin-top: var(--space-2);
}

.nv-close__foot {
  margin-top: clamp(var(--space-7), 6vw, var(--space-9));
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--n-white-a38);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}
.nv-close__foot span { color: var(--n-white-a12); }

/* ---- Utility -------------------------------------------------------------- */

.nv-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Focus states --------------------------------------------------------- */

.nuvya a:focus-visible,
.nuvya button:focus-visible {
  outline: 1px solid var(--n-purple);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---- Responsive ----------------------------------------------------------- */

@media (max-width: 640px) {
  :root { --topbar-h: 64px; }
  .nv-hero { padding-top: calc(var(--topbar-h) + var(--space-6)); }
  .nv-hero__statement { max-width: 17ch; }
  .nv-topbar__right { display: none; }
  .nv-close__foot { flex-direction: column; gap: var(--space-1); text-align: center; }
}

@media (max-width: 380px) {
  .nv-forming__statement { max-width: 12ch; }
}

@media (min-width: 1600px) {
  .nv-container { max-width: 1440px; }
}
