/* ═══ BASE — reset, typography, page atmosphere ═══ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* anchors land below the fixed nav */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-secondary);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-med) ease, color var(--dur-med) ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

img, video { max-width: 100%; height: auto; display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection { background: var(--flare); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Page atmosphere: aurora mesh + film grain ──
   Two fixed layers behind everything. The aurora is three radial
   blobs that drift very slowly; the grain is an SVG noise tile. */

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

/* Soft-stop radial gradients read as blurred light without any
   filter — a huge blur() here would tank paint performance. */
.atmosphere::before {
  content: '';
  position: absolute;
  inset: -20%;
  opacity: var(--aurora-opacity);
  background:
    radial-gradient(42% 50% at 18% 22%, color-mix(in srgb, var(--flare) 55%, transparent) 0%, color-mix(in srgb, var(--flare) 22%, transparent) 42%, transparent 72%),
    radial-gradient(36% 44% at 82% 12%, color-mix(in srgb, var(--azure) 45%, transparent) 0%, color-mix(in srgb, var(--azure) 18%, transparent) 40%, transparent 70%),
    radial-gradient(40% 48% at 62% 86%, color-mix(in srgb, var(--rose) 34%, transparent) 0%, color-mix(in srgb, var(--rose) 14%, transparent) 42%, transparent 72%);
  animation: aurora-drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes aurora-drift {
  from { transform: translate3d(-2.5%, -2%, 0) rotate(-1.5deg) scale(1); }
  to   { transform: translate3d(2.5%, 2.5%, 0) rotate(1.5deg) scale(1.07); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ── Layout primitives ── */

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.container-wide {
  width: min(var(--container-wide), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.section { padding-block: var(--space-section); position: relative; }

/* ── Text utilities ── */

.text-aurora {
  background: var(--aurora-ink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '//';
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.85;
}

/* ── Reveal states (GSAP flips these; visible without JS) ── */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(28px); }

/* ── Reduced motion: kill all decoration movement ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .atmosphere::before { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
