/* ==========================================================================
   THE NULLBORN — base.css
   Design tokens, reset, grain texture, glass utilities, shared keyframes.

   Direction: monochrome. The Void has no colour — the only accent is light.
   Restraint is the point: "stripped of intricate, unnecessary layers,
   distilled down to striking perfection."

   Token NAMES are unchanged from the previous colourway on purpose, so every
   component inherits the new palette without being rewritten.
   ========================================================================== */

:root {
  /* --- Surface -------------------------------------------------------- */
  --void-black: #050505;
  --abyss: #0a0a0b;
  --panel: #0e0e10;
  --panel-raised: #141417;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.24);

  /* --- Ink: warm bone, not cold grey. Reads as paper, not as UI. ------- */
  --text-primary: #efede8;
  --text-secondary: rgba(239, 237, 232, 0.56);
  --text-tertiary: rgba(239, 237, 232, 0.32);

  /* --- Accent: luminance, not hue.
         --accent is pure light. --accent-2 carries the faintest ice cast so
         "signal" states (verified, complete) are distinguishable without
         introducing colour. ---------------------------------------------- */
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.28);
  --accent-2: #c9d4f0;
  --accent-2-soft: rgba(201, 212, 240, 0.26);
  --danger: #ff4a3d;

  /* Gradients */
  --grad-accent: linear-gradient(135deg, #ffffff 0%, #c9d4f0 100%);
  --grad-radial-hero: radial-gradient(58% 58% at 50% 42%, rgba(255, 255, 255, 0.07), transparent 72%);

  /* --- Typography ------------------------------------------------------
         Two families only. Archivo is a neo-grotesque that stays narrow at heavy
         weights, so headlines can be set genuinely large. Everything functional
         is monospace, which suits beings made of code. -------------------- */
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: var(--font-mono);

  /* --- Spacing / layout ------------------------------------------------ */
  --container-max: 1320px;
  --section-pad: clamp(96px, 15vw, 210px);
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-pill: 999px;

  /* --- Motion ----------------------------------------------------------
         Slower and more deliberate than before. Precision over sparkle. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.28s;
  --dur-med: 0.6s;
  --dur-slow: 1.1s;

  --nav-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--void-black);
}

body {
  background: var(--void-black);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* editorial section numbering, rendered by .eyebrow::before */
  counter-reset: section;
}

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

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

button, input {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button { cursor: pointer; }

ul { list-style: none; }

::selection {
  background: var(--text-primary);
  color: var(--void-black);
}

/* --- Global film grain / noise overlay ---------------------------------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%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: 180px 180px;
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(130% 95% at 50% 8%, transparent 45%, rgba(0, 0, 0, 0.72) 100%);
}

/* --- Cursor glow --------------------------------------------------------
   Colourless now: a soft lift in luminance rather than a violet wash. */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 460px;
  height: 460px;
  margin-left: -230px;
  margin-top: -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.055) 0%, rgba(201, 212, 240, 0.02) 45%, transparent 70%);
  pointer-events: none;
  z-index: 3;
  transform: translate3d(-500px, -500px, 0);
  transition: opacity 0.4s ease;
  will-change: transform;
}

@media (hover: none), (pointer: coarse) {
  .cursor-glow { display: none; }
}

/* --- Layout helpers ------------------------------------------------------*/
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(22px, 5vw, 64px);
}

.section {
  position: relative;
  padding: var(--section-pad) 0;
  counter-increment: section;
}

/* Hairline that separates every section — the editorial spine of the page. */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: clamp(22px, 5vw, 64px);
  right: clamp(22px, 5vw, 64px);
  height: 1px;
  background: var(--line);
}

.section-inner {
  position: relative;
  z-index: 2;
}

/* --- Eyebrow: boxed section index + label ------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.eyebrow::before {
  content: counter(section, decimal-leading-zero);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  line-height: 1;
}

/* --- Display type --------------------------------------------------------
   Bigger, tighter, heavier than the previous scale. The size contrast between
   display and mono is the main typographic gesture. */
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 7.6vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin-top: 26px;
  text-transform: uppercase;
}

.section-sub {
  margin-top: 26px;
  max-width: 54ch;
  color: var(--text-secondary);
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.8;
}

/* --- Glass ---------------------------------------------------------------
   Barely there. A hairline and a whisper of lift, not a frosted slab. */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(110%);
  -webkit-backdrop-filter: blur(16px) saturate(110%);
  border-radius: var(--radius-lg);
}

.glass-strong {
  background: rgba(14, 14, 16, 0.78);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}

/* --- Buttons -------------------------------------------------------------
   Primary is bone-on-void: the highest-contrast object on the page, so it
   always reads as the action. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 34px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  isolation: isolate;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.btn-primary {
  color: var(--void-black);
  background: var(--text-primary);
  box-shadow: 0 0 0 rgba(255, 255, 255, 0);
}

.btn-primary:hover {
  background: #ffffff;
  box-shadow: 0 10px 40px -10px rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
}

.btn-ghost {
  color: var(--text-primary);
  border: 1px solid var(--line-strong);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.btn:disabled,
.btn[data-disabled="true"] {
  opacity: 0.3;
  pointer-events: none;
}

.btn-sm {
  padding: 12px 22px;
  font-size: 10px;
  letter-spacing: 0.2em;
}

/* magnetic wrap target */
.magnetic { will-change: transform; }

/* --- Scroll reveal base ------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="fade"] { transform: none; }
[data-reveal="left"] { transform: translateX(-36px); }
[data-reveal="left"].in-view { transform: translateX(0); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="right"].in-view { transform: translateX(0); }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal="scale"].in-view { transform: scale(1); }

/* Stagger children via inline --d custom property set by JS */
[data-reveal] { transition-delay: var(--d, 0s); }

/* --- Shared keyframes ---------------------------------------------------*/
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1.5deg); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes dashMove {
  to { stroke-dashoffset: -400; }
}

@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 22%, 24%, 55% { opacity: 0.55; }
}

/* Hairline that draws itself in — used for editorial rules. */
@keyframes drawLine {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.text-gradient {
  background: var(--grad-accent);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
}

.mono { font-family: var(--font-mono); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
