/* ==========================================================================
   Advocate v2 — Reset, typography, layout primitives (light ground)
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

/* Content sits above the ambient canvas */
main, .nav, .footer, .strip, .actionbar { position: relative; z-index: var(--z-content); }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.024em;
  color: var(--ink);
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 40;
}

h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.18; letter-spacing: -0.012em; }
h4 { font-size: var(--t-h4); line-height: 1.3; letter-spacing: -0.006em; }

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

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

ul, ol { margin: 0; padding: 0; list-style: none; }

/* The UA stylesheet gives figure a 40px side margin, which silently
   narrows the portrait by 80px inside its column. */
figure, figcaption, blockquote { margin: 0; }

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

button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; cursor: pointer; }

strong { font-weight: 600; color: var(--ink); }

::selection { background: var(--emerald); color: var(--bone); }

/* --- Focus ------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* --- Skip link --------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: .8rem 1.2rem;
  background: var(--emerald);
  color: var(--bone);
  font-weight: 600;
  font-size: var(--t-sm);
}
.skip:focus { left: 1rem; top: 1rem; }

/* --- Layout primitives -------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { position: relative; padding-block: var(--section-y); }
.section--hair { border-top: 1px solid var(--hair); }

/* Inverted (emerald ground) sections */
.section--invert {
  background: var(--inv-bg);
  color: var(--inv-text);
  border-top: 0;
}
.section--invert h1,
.section--invert h2,
.section--invert h3,
.section--invert h4 { color: var(--inv-text); }
.section--invert .lead { color: var(--inv-muted); }
.section--invert .muted { color: var(--inv-muted); }
.section--invert .eyebrow { color: var(--brass-light); }
.section--invert .eyebrow::before { background: rgba(203, 164, 92, .5); }
.section--invert .numeral { -webkit-text-stroke-color: rgba(203, 164, 92, .55); }
.section--invert .rule { background: var(--inv-hair); }

.rail-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0 clamp(1.2rem, 0.4rem + 2.4vw, 3rem);
  align-items: start;
}
@media (max-width: 860px) { .rail-grid { grid-template-columns: 1fr; } }

/* --- Type helpers ------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: clamp(18px, 4vw, 34px);
  height: 1px;
  background: var(--brass);
  flex: none;
}
.eyebrow--plain::before { display: none; }

.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--ink-soft);
  letter-spacing: -0.004em;
}

.muted { color: var(--ink-muted); }
.small { font-size: var(--t-sm); }
.mono { font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: .08em; }

.em-serif {
  font-style: italic;
  color: var(--emerald);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60;
}
.section--invert .em-serif { color: var(--brass-light); }

.hide-sm { display: initial; }
@media (max-width: 720px) { .hide-sm { display: none !important; } }
.show-sm { display: none !important; }
@media (max-width: 720px) { .show-sm { display: flex !important; } }

/* --- Section numeral ---------------------------------------------------- */
.numeral {
  font-family: var(--font-mono);
  font-size: var(--t-numeral);
  font-weight: 400;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--brass);
  letter-spacing: -0.03em;
  user-select: none;
}
@media (max-width: 860px) {
  .numeral { font-size: 1.4rem; -webkit-text-stroke: 0; color: var(--brass-deep); }
  .section--invert .numeral { color: var(--brass-light); }
}

/* --- Rules -------------------------------------------------------------- */
.rule { height: 1px; border: 0; margin: 0; background: var(--hair); }
.rule--brass { background: linear-gradient(90deg, var(--brass), transparent 65%); }

/* --- Utility ------------------------------------------------------------ */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.is-hidden { display: none !important; }

/* --- Ambient canvas + grain --------------------------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: var(--z-ambient);
  pointer-events: none;
  opacity: .9;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-ambient);
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
