/* fischerweb.dev — Base styles & reset */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg);
  background-color: var(--bg);
  font-weight: 400;
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  min-height: 100vh;
}

/* Subtle film-grain noise — global, blend works on both themes */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.18 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
}

/* ================ TYPOGRAPHY ================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
  color: var(--fg);
}

h1 { font-size: var(--text-display); letter-spacing: var(--tracking-tightest); font-weight: 500; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p { line-height: var(--leading-normal); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

ul, ol { list-style: none; }

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

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

::selection {
  background: var(--fg);
  color: var(--bg);
}

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

/* ================ LAYOUT PRIMITIVES ================ */

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 2;
}

.container--narrow { max-width: var(--max-narrow); }
.container--prose { max-width: var(--max-prose); }

main {
  position: relative;
  z-index: 2;
  padding-top: 72px;
}

section {
  position: relative;
  padding-block: clamp(5rem, 11vw, 8rem);
}

/* ================ UTILITY ================ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

.eyebrow--accent {
  color: var(--accent);
}

.eyebrow__meta {
  margin-left: var(--space-2);
  letter-spacing: var(--tracking-widest);
  color: var(--fg-faint);
  text-transform: uppercase;
}

.serif-it {
  font-family: "Times New Roman", Georgia, serif;
  font-style: italic;
  font-weight: 300;
  letter-spacing: var(--tracking-tighter);
}

.section-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  color: var(--fg-faint);
}

/* Reduced motion — respect smooth-scroll preference only.
   All animations on this site are small/ambient (gradients, marquee, scroll cue),
   none qualify as vestibular triggers, so we don't kill them universally.
*/
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
