/* ==========================================================================
   Base: reset, typography, layout utilities, accessibility, motion gating
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h-live, var(--header-h));
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
:where(a[class]) { text-decoration: none; }
hr { border: 0; border-top: var(--hairline); margin: 0; }
[hidden] { display: none !important; }

::selection { background: var(--ink); color: var(--paper); }
.surface-dark ::selection { background: var(--paper); color: var(--ink); }

/* ---- Accessibility -------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-small);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: none; outline: 2px solid var(--paper); outline-offset: -4px; }

/* ---- Typography ----------------------------------------------------- */
.display,
.h1,
.h2,
.h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
}
.h1 { font-size: var(--fs-hero); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.h4 {
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* Playfair: only 1–3 giant words per page */
.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.lead {
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: var(--ls-tight);
}
.body-lg { font-size: var(--fs-body-lg); line-height: 1.5; }
.small { font-size: var(--fs-small); line-height: 1.5; }
.muted { color: var(--muted); }

.label {
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.3;
}
.caps {
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}

/* "● eyebrow" */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.3;
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: currentColor;
}

/* "( 01 )" */
.index {
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stack > * + * { margin-top: var(--stack, 1em); }

/* Typographic finish: no widows on giant type, fewer orphans in copy */
h1, h2, h3, .h1, .h2, .h3, .h4, .lead { text-wrap: balance; }
p, li, figcaption, blockquote { text-wrap: pretty; }

/* ---- Layout --------------------------------------------------------- */
.container {
  width: var(--container);
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-y);
}
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--full {
  min-height: 100svh;
  display: grid;
  align-content: center;
}

/* Body copy starts ~36% across on desktop (the editorial offset) */
.offset { margin-left: var(--offset); }
.offset-pad { padding-left: var(--offset); }
.text-col { max-width: var(--text-col); }
.measure { max-width: var(--measure); }

/* Two short paragraphs side by side inside the offset column */
.split-2 {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .split-2 { grid-template-columns: 1fr 1fr; gap: var(--space-7); }
}

.gap-block > * + * { margin-top: var(--block-gap); }
.mt-block { margin-top: var(--block-gap); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }

.rule { border: 0; border-top: var(--hairline); }
.rule--dashed { border-top: var(--hairline-dashed); }

/* ---- Media ----------------------------------------------------------
   <div class="media media--portrait"><img src="…" alt="…"></div>
   Placeholder: <div class="media media--portrait media--placeholder" role="img" aria-label="…"></div> */
.media {
  position: relative;
  overflow: hidden;
  background: #2b2b29;
  aspect-ratio: var(--ratio, 4 / 5);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
  filter: grayscale(1);
}
.media--portrait { --ratio: 4 / 5; }
.media--landscape { --ratio: 3 / 2; }
.media--wide { --ratio: 16 / 9; }
.media--square { --ratio: 1 / 1; }
.media--placeholder {
  background:
    linear-gradient(160deg, #3a3a38 0%, #262624 100%);
}
.media--placeholder::after {
  content: attr(data-label);
  position: absolute;
  inset: auto 0 var(--space-3) 0;
  text-align: center;
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--paper-70);
}

/* ---- Motion gating ---------------------------------------------------
   <html> gets .motion from an inline head script only when JS runs and the
   user has not asked for reduced motion. main.js removes it if GSAP fails,
   and a 2.5 s safety timer removes it if main.js never runs. Without
   .motion everything is simply visible. */
.motion [data-reveal],
.motion [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(32px);
}
.motion [data-split]:not(.is-split) { visibility: hidden; }

/* split helpers created by main.js */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  padding-right: 0.04em;
  margin-right: -0.04em;
}
.split-word__inner { display: inline-block; will-change: transform; }

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