/* ============================================================================
   BASE — reset, document defaults, layout primitives, shared utilities.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Hidden until skin.js applies a skin — avoids a flash of unstyled vars. */
}
html:not([data-skin]) body { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 380;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

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

ul { list-style: none; padding: 0; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

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

p { text-wrap: pretty; }

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

.section { padding-block: clamp(3.5rem, 8vw, var(--space-10)); }
.section--tight { padding-block: clamp(2.5rem, 5vw, var(--space-8)); }
.section--raised { background: var(--bg-2); }

/* ---- Section header (centered eyebrow + serif title) ---- */
.section-head { text-align: center; max-width: 46rem; margin-inline: auto; }
.section-head .eyebrow { justify-content: center; }
.section-head h2 { font-size: var(--fs-h2); margin-top: var(--space-3); }
.section-head .section-sub {
  margin-top: var(--space-4);
  color: var(--ink-mute);
  font-size: var(--fs-body);
}

/* ----------------------------------------------------------------------- */
/* Shared text utilities                                                    */
/* ----------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.section-head .eyebrow::before { display: none; }

.lead { font-size: var(--fs-lead); color: var(--ink-soft); line-height: 1.55; }
.muted { color: var(--ink-mute); }
.accent { color: var(--accent); }
.serif { font-family: var(--font-display); }

.hr { height: 1px; background: var(--line); border: 0; }

/* Visually hidden but available to screen readers */
.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;
}

.skip-link {
  position: absolute; left: var(--space-4); top: var(--space-4);
  transform: translateY(-150%);
  background: var(--accent); color: var(--on-accent);
  padding: var(--space-2) var(--space-4); border-radius: var(--r-md);
  font-size: var(--fs-small); font-weight: 600; z-index: var(--z-modal);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Reveal-on-scroll (progressive — visible by default if JS/anim off) */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .reveal.is-in { opacity: 1; transform: none; }
}
