/* ============================================================
   nrajpk.studio
   Design tokens derived from the Dala reference system.
   PPNeueMontreal is licensed; Switzer is the free geometric
   grotesque with the closest construction (incl. weight 200).
   ============================================================ */

:root {
  /* Colors */
  --color-void:          #000000;
  --color-bone-white:    #ffffff;
  --color-ash-gray:      #9a9a9a;
  --color-silver-mist:   #bdbdbd;
  --color-electric-iris: #8052ff;
  --color-saffron-spark: #ffb829;
  --color-deep-verdant:  #15846e;

  /* Type */
  --font-sans: 'Switzer', 'Inter', ui-sans-serif, system-ui, -apple-system,
               BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --font-weight-extralight: 200;
  --font-weight-regular:    400;
  --font-weight-semibold:   600;

  /* Scale — fluid, anchored to the reference stops (113 / 78 / 42 / 18 / 12) */
  --text-display:    clamp(2.875rem, 11.2vw, 7.0625rem); /* → 113px */
  --text-heading-lg: clamp(2.25rem,  7.4vw, 4.875rem);   /* →  78px */
  --text-lead:       clamp(1.625rem, 5.1vw, 3.5rem);
  --text-heading:    clamp(2rem,     6.2vw, 3rem);       /* →  48px */
  --text-body:       1.125rem;                           /*    18px */
  --text-nav-label:  0.875rem;                           /*    14px */
  --text-caption:    0.75rem;                            /*    12px */

  --leading-display: 0.96;
  --leading-lead:    1.14;
  --leading-body:    1.5;

  /* Tracking is size-specific — never one value for every size */
  --tracking-display:   -0.04em;
  --tracking-lead:      -0.032em;
  --tracking-heading:   -0.035em;
  --tracking-nav-label:  0.025em;

  /* Space */
  --spacing-6:   6px;
  --spacing-12:  12px;
  --spacing-18:  18px;
  --spacing-24:  24px;
  --spacing-30:  30px;
  --spacing-36:  36px;
  --spacing-60:  60px;
  --spacing-96:  96px;
  --spacing-120: 120px;

  --page-max-width: 1280px;
  --gutter: clamp(24px, 5vw, 60px);

  /* Shape */
  --radius-3xl:  24px;
  --radius-full: 9999px;

  /* Motion */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* Scroll runway length — the camera's travel distance */
  --track: 620svh;

  color-scheme: dark;
}

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

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

html {
  background: var(--color-void);
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--color-void);
  color: var(--color-bone-white);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--font-weight-extralight);
  line-height: var(--leading-body);
  font-feature-settings: 'ss01' on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, p { margin: 0; }

::selection { background: var(--color-electric-iris); color: var(--color-bone-white); }

:focus-visible {
  outline: 2px solid var(--color-saffron-spark);
  outline-offset: 6px;
  border-radius: 4px;
}

/* ---------- Stage: the particle field ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}
.is-ready .stage { opacity: 1; }

#field {
  display: block;
  width: 100%;
  height: 100%;
}

/* Pull the eye to the centre without a hard edge */
.stage__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 50%,
      rgba(0,0,0,0) 38%,
      rgba(0,0,0,0.45) 76%,
      rgba(0,0,0,0.9) 100%);
}

/* Static film grain — keeps the pure black from banding on wide gamut panels */
.stage__grain {
  position: absolute;
  inset: -50%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Chrome ---------- */

.chrome {
  position: fixed;
  z-index: 3;
  font-size: var(--text-nav-label);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-nav-label);
  line-height: 1.2;
}

.chrome--top {
  top: var(--spacing-30);
  left: var(--gutter);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-12);
  text-decoration: none;
  color: var(--color-bone-white);
  padding: var(--spacing-6) 0;
  transition: opacity 200ms var(--ease-out);
}
.lockup__mark {
  flex: none;
  transform: translateY(-1px);
}
.lockup__word { color: var(--color-bone-white); }
.lockup__tld  { color: var(--color-ash-gray); transition: color 260ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .lockup:hover .lockup__tld { color: var(--color-electric-iris); }
}

/* Scroll hint */
.chrome--hint {
  bottom: var(--spacing-30);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-12);
  color: var(--color-ash-gray);
  text-transform: uppercase;
  font-size: var(--text-caption);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.chrome--hint[data-gone] {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}
.hint__rail {
  position: relative;
  display: block;
  width: 1px;
  height: 34px;
  background: rgba(255,255,255,0.14);
  overflow: hidden;
}
.hint__rail i {
  position: absolute;
  inset-inline: 0;
  height: 12px;
  background: var(--color-electric-iris);
  animation: drip 2.4s var(--ease-in-out) infinite;
}
@keyframes drip {
  0%       { transform: translateY(-14px); opacity: 0; }
  22%, 62% { opacity: 1; }
  100%     { transform: translateY(34px);  opacity: 0; }
}

/* Progress rail — wayfinding: how far in am I, how much is left */
.rail {
  position: fixed;
  z-index: 3;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: min(34svh, 300px);
  background: rgba(255,255,255,0.10);
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}
.is-ready .rail { opacity: 1; }

.rail__fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  background: var(--color-electric-iris);
  transform: scaleY(var(--p, 0));
  transform-origin: top;
}
.rail__tick {
  position: absolute;
  left: -2px;
  width: 5px;
  height: 1px;
  top: calc(var(--at) * 100%);
  background: rgba(255,255,255,0.32);
}

@media (max-width: 640px) {
  .rail { display: none; }
}

/* Stacked composition: the field rides high, the type sits below it */
/* ---------- Acts ---------- */

/* Scroll runway. Nothing lives here — it only gives the camera
   distance to travel, which is why it is aria-hidden. */
.track { height: var(--track); }

@media (max-width: 640px) {
  :root { --track: 540svh; }
}

.acts {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
}

.act {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100% - (var(--gutter) * 2), var(--page-max-width));
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  opacity: 0;
  backface-visibility: hidden;
  /* JS flips this to auto only while an act is actually legible,
     so invisible copy never swallows a click */
  pointer-events: none;
}

/* Type */

.t-display {
  font-size: var(--text-display);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  color: var(--color-bone-white);
  text-wrap: balance;
}
.t-display--quiet { color: var(--color-silver-mist); }

.t-lead {
  font-size: var(--text-lead);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-lead);
  letter-spacing: var(--tracking-lead);
  max-width: 20ch;
}
.t-lead .line { display: block; }
.t-lead em {
  font-style: normal;
  color: var(--color-saffron-spark);
}

.t-heading {
  font-size: var(--text-heading);
  font-weight: var(--font-weight-regular);
  line-height: 1.1;
  letter-spacing: var(--tracking-heading);
}

.act--end {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-36);
}

/* Stacked composition on narrow viewports: the field rides high through the
   corridor, and the closing act sits above the horizon rather than on it.
   Must come after the base .act rules — equal specificity, source order wins. */
@media (max-width: 760px) {
  .act:not(.act--end) { top: 66%; }
  .act--end { top: 24%; }
}

/* The single filled violet pill — the sole primary action on the site */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-12);
  padding: 15px 24px;
  border-radius: var(--radius-full);
  background: var(--color-electric-iris);
  color: var(--color-bone-white);
  text-decoration: none;
  font-size: var(--text-nav-label);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-nav-label);
  text-transform: uppercase;
  transition: transform 160ms var(--ease-out), background-color 220ms var(--ease-out);
}
.pill__arrow { transition: transform 220ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: #9268ff; }
  .pill:hover .pill__arrow { transform: translate(2px, -2px); }
}
.pill:active { transform: scale(0.97); }

/* ---------- Reduced motion ----------
   Not "no feedback" — a gentler, non-vestibular equivalent.
   The runway collapses, the acts become ordinary sections that
   cross-fade in, and the field renders a single still frame. */

.rm .track,
.rm .chrome--hint,
.rm .rail { display: none; }

.rm .acts {
  position: static;
  pointer-events: auto;
  padding: 0 var(--gutter);
}

.rm .act {
  position: static;
  transform: none !important;
  filter: none !important;
  width: min(100%, var(--page-max-width));
  margin-inline: auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--spacing-36);
  opacity: 0;
  transition: opacity 500ms var(--ease-out);
}
.rm .act[data-seen] { opacity: 1; }

/* ---------- Fallbacks ---------- */

.no-js .stage { opacity: 1; }
.no-js .acts { position: static; }
