/* ==========================================================================
   Base — reset, typography, film grain, utilities
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--bone-20) transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--amber); color: var(--on-accent); }
[hidden] { display: none !important; }

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

/* Scrollbars (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bone-12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--bone-20); background-clip: padding-box; border: 2px solid transparent; }

/* --- Typography ---------------------------------------------------------- */
.serif, h1, h2, h3, .h1, .h2, .h3, .display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: .95;
}
h4, h5, h6 { font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
em, .it { font-style: italic; }
.serif em, h1 em, h2 em, h3 em, .display em { font-style: italic; color: var(--amber); }
.display { font-size: var(--fs-display); line-height: .86; letter-spacing: -.035em; }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); line-height: 1.05; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-2); max-width: 46ch; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.amber { color: var(--amber); }
.mono, .eyebrow, .num {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1, "zero" 0;
}
.num { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: var(--fs-micro);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}
.eyebrow--plain::before { display: none; }
.eyebrow--amber { color: var(--amber); }
p { max-width: 68ch; }
.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }

/* --- Film grain ---------------------------------------------------------- */
.grain {
  position: fixed;
  inset: -100%;
  width: 300%;
  height: 300%;
  pointer-events: none;
  z-index: 9000;
  opacity: .085;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .95  0 0 0 0 .9  0 0 0 0 .82  0 0 0 1.4 -.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.1s steps(6) infinite;
  mix-blend-mode: overlay;
}
.grain--soft { opacity: .05; }
@keyframes grain {
  0% { transform: translate(0, 0); }
  17% { transform: translate(-4%, -6%); }
  34% { transform: translate(-9%, 3%); }
  51% { transform: translate(6%, -9%); }
  68% { transform: translate(-3%, 9%); }
  85% { transform: translate(8%, 4%); }
  100% { transform: translate(0, 0); }
}

/* --- Layout utilities ---------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 10000;
  background: var(--amber); color: var(--on-accent);
  padding: 10px 16px; border-radius: var(--r-pill); font-weight: 700;
  transform: translateY(-160%); transition: transform var(--t) var(--ease-out);
}
.skip-link:focus { transform: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr { height: 1px; background: var(--line); border: 0; }

/* Media treatments */
.vignette { position: relative; isolation: isolate; }
.vignette::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(14, 13, 11, .55) 80%, rgba(14, 13, 11, .9) 100%),
    linear-gradient(180deg, rgba(232, 163, 61, .06), transparent 30%, transparent 70%, rgba(14, 13, 11, .4));
  z-index: 1;
}
.cover { width: 100%; height: 100%; object-fit: cover; }

/* SplitText helpers */
.split-line { overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.split-line > * { will-change: transform; }

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