/* ─────────────────────────────────────────────────────────────────────────
   Reset · Typography · Layout primitives
   ───────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--leading-norm);
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: clip;       /* stricter than hidden; honored when supported */
  width: 100%;
  max-width: 100vw;
}
html {
  overflow-x: clip;
  max-width: 100vw;
}
/* Belt-and-braces: nothing should ever exceed viewport width on mobile.
   NOTE: do NOT add overflow-x:hidden or clip on `section` — sections can
   contain `position:sticky` children, and an overflow on the ancestor
   creates a scroll container that breaks sticky. body+html overflow:clip
   is the correct level for the safety net. */
@media (max-width: 880px) {
  body, main, header, footer { max-width: 100vw; }
}

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --c-saffron is the brand navy on light sections and warm cream on dark ones.
   Pairing it with a fixed --c-ink gave navy-on-navy (1.2:1) everywhere the page
   was light, which is most of the site. --c-on-saffron is the token that already
   flips alongside it, so selected text stays legible on both. */
::selection {
  background: var(--c-saffron);
  color: var(--c-on-saffron);
}

/* ── Display type ─────────────────────────────────────────────────────── */
.display, .h1, .h2, .h3, .eyebrow {
  font-family: var(--font-display);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--fg-mute);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: '';
  width: 1.4em;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow.no-line::before { display: none; }
/* Terracotta eyebrow — the client mock-ups' letterspaced orange section
   labels (About Omar, Live Music).
   --c-clay-text, not --c-clay: the raw terracotta is 2.64:1 on cream and
   2.28:1 on the soft-blue band this label sits on in .lm-return, so it failed
   AA and even the 3:1 large-text threshold. --c-clay-text is the same hue
   pushed to 5.28 / 4.56:1. Keep --c-clay for fills and rules, where the 3:1
   non-text threshold applies instead. */
.eyebrow--clay { color: var(--c-clay-text); }

.display {
  font-size: var(--t-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 350;
  font-variation-settings: 'opsz' 144, 'SOFT' 50, 'WONK' 1;
}
.display em { font-style: italic; font-weight: 320; }

.h1 {
  font-size: var(--t-h1);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 350;
  font-variation-settings: 'opsz' 96, 'SOFT' 40;
}
.h2 {
  font-size: var(--t-h2);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-norm);
  font-weight: 350;
  font-variation-settings: 'opsz' 72, 'SOFT' 30;
}
.h3 {
  font-size: var(--t-h3);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-norm);
  font-weight: 400;
  font-variation-settings: 'opsz' 36, 'SOFT' 20;
}
.h4 {
  font-family: var(--font-display);
  font-size: var(--t-h4);
  line-height: 1.25;
  font-weight: 450;
  letter-spacing: -0.005em;
  font-variation-settings: 'opsz' 24, 'SOFT' 12;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.45;
  color: var(--fg-soft);
  max-width: 38ch;
}

.italic { font-style: italic; }

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

.section { padding-block: var(--s-11); }
.section--tight { padding-block: var(--s-9); }

.section--ink {
  background: var(--bg-deep);
  color: var(--fg-on-deep);
}
.section--night {
  background: var(--bg-night);
  color: var(--fg-on-deep);
}
.section--lift {
  background: var(--bg-lift);
}
.section--ink .eyebrow,
.section--night .eyebrow { color: color-mix(in oklch, var(--c-bone) 70%, transparent); }
.section--ink .lead,
.section--night .lead { color: color-mix(in oklch, var(--c-bone) 78%, transparent); }

/* Reveal-on-scroll utility (driven by IntersectionObserver in main.js) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 900ms var(--ease-out-expo),
    transform 900ms var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

.is-stagger > * { transition-delay: calc(var(--stagger, 80ms) * var(--i, 0)); }

/* ── Visually-hidden helper ───────────────────────────────────────────── */
.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;
}

/* ── Focus ────────────────────────────────────────────────────────────── */
/* --focus-ring, not --c-azul-glow directly: marina blue is 4.2:1 on cream but
   only 2.9:1 on the navy-2 short footer, so the ring failed 1.4.11 on the seven
   pages that close on it. The dark-section list in tokens.css flips the token
   to cream. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Page enter ───────────────────────────────────────────────────────── */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
main { animation: pageEnter 700ms var(--ease-out-expo) both; }

/* ── Mobile global tweaks ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Tighter section rhythm on small screens */
  .section, .section--tight { padding-block: clamp(3.5rem, 9vw, 5rem); }

  /* Page hero: less top padding under sticky header */
  .page-hero { padding: clamp(6rem, 14vh, 8.5rem) 0 clamp(2.5rem, 8vw, 4rem); }
}

@media (max-width: 480px) {
  /* Mobile body type nudge — larger lead, tighter wrap */
  .lead { font-size: 1.04rem; line-height: 1.55; }
}

/* No `overscroll-behavior-y: none` here. It was added as "iOS overscroll
   polish" to suppress the rubber-band, but on iOS Safari that gesture *is*
   pull-to-refresh — killing it means the page cannot be reloaded by pulling
   down, and the browser chrome stops expanding at the top of the page.
   The rubber-band area is already the site colour because body's background
   propagates to the canvas, so it bought nothing that wasn't already covered.
   Inner scrollers that must not chain still set `overscroll-behavior: contain`
   individually — see components.css. */
/* Prevent text auto-inflate on landscape rotate */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Better touch behaviour */
a, button, [role="button"], input, label, select, textarea {
  -webkit-tap-highlight-color: transparent;
}
