/* ===========================================================================
   base.css — @font-face, reset, typography defaults, grain overlay, focus
   =========================================================================== */

/* ---------- @font-face ---------- */

@font-face {
  font-family: 'ChunkFive';
  src: url('../assets/fonts/ChunkFive-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GeneralSans';
  src: url('../assets/fonts/GeneralSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GeneralSans';
  src: url('../assets/fonts/GeneralSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GeneralSans';
  src: url('../assets/fonts/GeneralSans-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrainsMono';
  src: url('../assets/fonts/JetBrainsMono.woff2') format('woff2-variations'),
       url('../assets/fonts/JetBrainsMono.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- reset ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--tr-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Global grain overlay — sits above backgrounds, below content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('../assets/img/grain.svg');
  background-size: 240px 240px;
  opacity: 0.055;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 100;
}

/* Soft vignette that deepens page edges without darkening center */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0,0,0,0.35) 100%
  );
  pointer-events: none;
  z-index: 99;
}

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

video {
  object-fit: cover;
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

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

ul, ol { list-style: none; }

/* ---------- typography defaults ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  color: var(--text-primary);
}

h1 { font-size: var(--fs-hero); letter-spacing: var(--tr-hero); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-display); }
h3 { font-size: var(--fs-h2); }
h4 { font-size: var(--fs-h3); }

p {
  max-width: 65ch;
  color: var(--text-secondary);
}

strong { font-weight: var(--fw-semibold); color: var(--text-primary); }

/* utility — eyebrow mono label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent-red);
  display: inline-block;
}

.eyebrow--center { justify-content: center; }

/* utility — pull quote */
.pull-quote {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-display);
  color: var(--text-primary);
}

/* ---------- selection ---------- */

::selection {
  background: var(--accent-red);
  color: var(--text-primary);
}

/* ---------- focus visible ---------- */

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

/* ---------- scrollbar (dark, minimal) ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-red); }

/* ---------- accessibility utilities ---------- */

.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;
}

/* ---------- reduced motion master switch ---------- */

@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;
  }
}
