@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,200;0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,200;1,9..40,300;1,9..40,400&family=DM+Serif+Display:ital@0;1&display=swap');

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

/* ─── Variables ─────────────────────────────────────────── */
:root {
  /* Solid black — no blue, no gradient, no navy */
  --black:        #000000;
  --white:        #ffffff;   /* primary text — pure white */
  --off-white:    #e5e5e5;   /* secondary text — bumped from #d6d6d6 */
  --dim:          #c8c8c8;   /* dimmer readable text — bumped from #b0b0b0 */
  --muted:        #a8a8a8;   /* metadata / tertiary — bumped from #888888 */
  --border:       rgba(255, 255, 255, 0.12);
  --border-strong:rgba(255, 255, 255, 0.22);

  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-sans:    'DM Sans', system-ui, sans-serif;
  --font-serif:   'DM Serif Display', Georgia, serif;

  /* Layout — narrow column, editorial */
  --col-width:    680px;
  --col-pad:      clamp(20px, 5vw, 48px);
  --section-pad:  clamp(56px, 7vw, 88px);

  scroll-behavior: smooth;
}

/* ─── Base ───────────────────────────────────────────────── */
html {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--black);
  overflow-x: hidden;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 2px; }

/* ─── Selection ─────────────────────────────────────────── */
::selection { background: rgba(255,255,255,0.12); color: var(--white); }

/* ─── Font utilities ─────────────────────────────────────── */
.font-mono  { font-family: var(--font-mono); }
.font-sans  { font-family: var(--font-sans); }
.font-serif { font-family: var(--font-serif); }

/* ─── Screen reader only ─────────────────────────────────── */
.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;
}

/* ─── Layout — single centered column ───────────────────── */
/*
   All sections use .archive-section for the wrapper.
   Content lives in .col — max-width 680px, centered.
   The right-side index is a separate fixed panel.
*/

.archive-section {
  width: 100%;
  background: #000000; /* force solid black — never inherit hero blue */
  border-top: 1px solid rgba(255,255,255,0.12);
}

.col {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: var(--section-pad) var(--col-pad);
}

/* ─── Section label ──────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted); /* now #a8a8a8 — clearly readable */
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  max-width: 40px;
  height: 1px;
  background: var(--border-strong);
}

/* ─── Section heading ────────────────────────────────────── */
.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 400;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 32px;
}

.section-heading--italic {
  font-style: italic;
}

/* ─── Thin separator ─────────────────────────────────────── */
.sep {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* ─── Reveal animation — DATA-ATTRIBUTE PATTERN ─────────── */
/*
   ROOT CAUSE OF DISAPPEARING BUG:
   IntersectionObserver previously mutated el.classList (added 'visible').
   When React re-rendered on any state change (hover, click, selection),
   it reconciled className back to the JSX string — stripping 'visible'.

   FIX:
   The observer sets `data-revealed` on the SECTION container element.
   React never touches data-* attributes it didn't put there, so it
   survives every re-render. CSS cascade reveals all child .reveal
   elements via the ancestor selector below.

   JS side: el.dataset.revealed = 'true'  (once, then observer.disconnect)
   CSS side: [data-revealed] .reveal { opacity: 1; transform: none; }
*/
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Triggered by data-revealed on the nearest ancestor container */
[data-revealed] .reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays — apply to .reveal elements, delay the above transition */
.reveal-d1 { transition-delay: 80ms; }
.reveal-d2 { transition-delay: 160ms; }
.reveal-d3 { transition-delay: 280ms; }
.reveal-d4 { transition-delay: 400ms; }

/* ─── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  [data-revealed] .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Global link reset ──────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
}
