/* ============================================================
   BASE — Reset, CSS variables, fonts
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:ital,wght@0,300;0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* --- Variables --- */
:root {
  --navy:      #0A0E1A;
  --navy-mid:  #111828;
  --navy-light: #1a2235;
  --bone:      #F4EDE4;
  --bone-dim:  rgba(244, 237, 228, 0.65);
  --bone-faint: rgba(244, 237, 228, 0.15);
  --red:       #FC3D21;
  --amber:     #FFB000;
  --green:     #00C07F;
  --rule:      1px solid rgba(244, 237, 228, 0.12);
  --rule-strong: 1px solid rgba(244, 237, 228, 0.3);
  --grid-size: 32px;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'Inter Tight', 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --section-pad: clamp(64px, 10vw, 128px);
  --max-w: 1280px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--navy);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Graph-paper grid overlay --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(244,237,228,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,237,228,0.04) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: 0;
}

/* --- Film grain overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(3rem, 7vw, 6rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h4 { font-size: 1.1rem; }

p { max-width: 68ch; }

a {
  color: var(--bone);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
a:hover { color: var(--amber); }

strong { font-weight: 600; color: var(--bone); }

em { font-style: italic; }

/* --- Mono spans --- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.8em;
  letter-spacing: 0.05em;
}

/* --- Section label (overline) --- */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
  margin-bottom: 1rem;
}

/* --- Hairline rule --- */
hr {
  border: none;
  border-top: var(--rule);
  margin: 2rem 0;
}

/* --- Utility --- */
.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;
}

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

/* --- Scroll reveal base state --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }
