/* ═══════════════════════════════════════════════════════
   FORGE — Base Styles
   Reset, body defaults, global typography, scrollbar,
   focus states, selection, grain texture.
   ═══════════════════════════════════════════════════════ */

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

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

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: var(--weight-light);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typography defaults ────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: var(--weight-regular);
  color: var(--bone);
  line-height: var(--leading-tight);
}

.t-headline {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--weight-light);
  color: var(--bone);
  line-height: var(--leading-tight);
  max-width: 22ch;
}

.t-body {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: var(--weight-light);
  color: var(--n7);
  line-height: var(--leading-relaxed);
  max-width: var(--measure);
}

.t-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--n6);
}

.t-subhead {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: var(--weight-light);
  color: var(--n7);
  max-width: 55ch;
  line-height: var(--leading-relaxed);
  margin-top: var(--space-4);
}

.t-note {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--n6);
  max-width: 55ch;
  line-height: var(--leading-relaxed);
}

.t-identity {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--bone);
}

p { max-width: var(--measure); }
a { color: inherit; }
img, svg { display: block; }

/* ── Selection ──────────────────────────────────────── */
::selection {
  background: rgba(232, 131, 42, 0.25);
  color: var(--bone);
}

/* ── Focus ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--n1); }
::-webkit-scrollbar-thumb { background: var(--n5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--n6); }

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

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