/* ==========================================================================
   Base — reset, elements, grain, typography, utilities
   ========================================================================== */

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  min-height: 100svh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Film-grain texture, purely decorative, fixed over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

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

/* Components below set their own `display` (e.g. .btn { display: inline-flex }),
   which otherwise silently defeats the `hidden` attribute — author styles beat
   the UA stylesheet's [hidden]{display:none} regardless of specificity. This
   keeps `el.hidden = true` reliable everywhere. */
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

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

/* ---- Skip link ---- */
.skip-link {
  position: fixed;
  top: -100px;
  left: var(--sp-4);
  z-index: 10000;
  background: var(--color-gold);
  color: var(--color-on-gold);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--sp-4); }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--color-ink);
}
h1 { font-size: var(--fs-display-xl); }
h2 { font-size: var(--fs-display-lg); }
h3 { font-size: var(--fs-display-md); }
h4 { font-size: var(--fs-display-sm); font-weight: 600; }

p { color: var(--color-ink-muted); }
p.lead { font-size: var(--fs-body-lg); color: var(--color-ink); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--color-gold);
}

.text-muted { color: var(--color-ink-muted); }
.text-faint { color: var(--color-ink-faint); }
.text-gold { color: var(--color-gold); }
.text-silver { color: var(--color-silver); }

.serif { font-family: var(--font-display); }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--sp-10);
}
.section--tight { padding-block: var(--sp-8); }
.section-alt { background: var(--color-bg-alt); }

/* Sections separated by the brand brown re-map the palette so everything
   nested inside them (type, borders, cards, accents) inverts in one place. */
.section-alt,
.on-brown,
.service-detail:nth-of-type(even),
.case-block:nth-of-type(even) {
  --color-ink: #fdf8f0;
  --color-ink-muted: #e2d5c4;
  --color-ink-faint: #c4b3a0;
  --color-gold: #d9b877;
  --color-gold-bright: #ecd6a4;
  --color-gold-dim: #b8945a;
  --color-on-gold: #3a2000;
  --color-silver: #d8d3cb;
  --color-silver-bright: #f1ede6;
  --color-border: rgba(253, 248, 240, 0.16);
  --color-border-strong: rgba(253, 248, 240, 0.30);
  --color-bg-surface: rgba(253, 248, 240, 0.07);
  --color-bg-surface-2: rgba(253, 248, 240, 0.12);
  --color-bg-raised: var(--color-brown-deep);
  color: var(--color-ink);
}

main { display: block; }

.divider {
  height: 1px;
  background: var(--color-border);
  border: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Scroll reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-group] > * { transition-delay: calc(var(--reveal-index, 0) * 90ms); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
