/* Firstlight - base: fonts, tokens, reset */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/geist.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/geist-mono.woff2') format('woff2');
}

:root {
  --canvas: #fdfdfd;
  --surface: #ffffff;
  --ink: #18181b;
  --ink-soft: #52525b;
  --ink-faint: #71717a;
  --line: #e4e4e7;
  --line-strong: #8e8e96;
  --accent: #2f57d9;
  --accent-ink: #ffffff;
  --accent-wash: rgba(47, 87, 217, 0.08);
  --accent-ring: rgba(47, 87, 217, 0.22);

  --sans: 'Geist', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;

  --r-card: 16px;
  --r-ctrl: 10px;
  --r-sm: 6px;

  --shadow-card:
    0 1px 2px rgba(24, 24, 27, 0.04),
    0 12px 32px -16px rgba(24, 24, 27, 0.10);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  min-height: 100dvh;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

input, button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

ul, ol {
  list-style: none;
}

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

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Static dot grid: decorative layer under page content.
   Two lattices — fine ink dots over a fainter warm-gray coarse grid.
   Replaced by the WebGL layer when js/dots.js initialises. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(24, 24, 27, 0.16) 1.4px, transparent 1.5px),
    radial-gradient(circle, rgba(148, 142, 132, 0.14) 1.9px, transparent 2.0px);
  background-size: 40px 40px, 120px 120px;
  background-position: 0 0, 20px 20px;
}

html.has-dots-gl body::before {
  display: none;
}

.dots-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
}

/* Film grain: fixed overlay, never repaints on scroll */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}


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

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

/* Entrance reveal: one shot, staggered via --i */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.is-loaded .reveal {
  opacity: 1;
  transform: none;
}

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

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
