/* ═══════════════════════════════════════════════════════════════
   BRASAS — Reset, typography, utilities, global grain
   ═══════════════════════════════════════════════════════════════ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
}

/* Lenis body scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

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

img { filter: saturate(0.95) contrast(1.04); }

a { color: inherit; text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Headings */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.h-display {
  font-family: var(--ff-display);
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-5);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 var(--sp-4);
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Utility */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

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

/* Global grain overlay — reads "expensive" on OLED */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* Reveal-on-scroll initial state (animation.js will un-set) */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  will-change: opacity, transform;
}

/* Split-text wrapper — headings are split into char spans on init */
.split {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.split .ch {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}
.split .ch.is-space { width: 0.28em; }

/* Scroll progress bar at top of viewport */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: calc(var(--z-nav) + 1);
  background: rgba(183, 134, 11, 0.08);
  pointer-events: none;
}
.scroll-progress__fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--fire) 0%, var(--gold) 50%, var(--gold-light) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  box-shadow: 0 0 8px rgba(183, 134, 11, 0.5);
}

/* Count-up years highlight */
.about__years {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.12em;
  color: var(--gold);
  white-space: nowrap;
}
.about__years [data-count-up] {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Section rhythm */
section { position: relative; isolation: isolate; }

/* Gold hairline between sections */
section + section::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: min(160px, 30%);
  height: 1px;
  background: var(--gold-soft);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Reduced motion — gated by a class set by motion-prefs.js (not @media-reduce
   directly) because Brasas defaults to full motion. ?motion=auto restores
   OS-preference behavior via this class. */
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
.reduced-motion .reveal { opacity: 1; transform: none; }
