/* ==========================================================================
   Base: fonts, reset, typography defaults, layout primitives, utilities
   ========================================================================== */

/* ---------- Self-hosted fonts ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

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

img { height: auto; }

input,
button,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: 0; padding: 0; }

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

:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }

[hidden] { display: none !important; }

::selection { background: var(--saffron-soft); color: var(--maroon); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  color: var(--maroon);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--text-h1); line-height: var(--leading-tight); font-weight: var(--weight-semibold); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); line-height: var(--leading-snug); }
h4 { font-size: var(--text-h4); line-height: var(--leading-snug); }

p { text-wrap: pretty; }

strong, b { font-weight: var(--weight-semibold); }

small { font-size: var(--text-small); }

.serif { font-family: var(--font-serif); }
.italic { font-style: italic; }

/* Long-form text (article bodies, bios): admin-authored HTML lands here. */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--text-h3-lg); margin-top: 1.8em; }
.prose h3 { font-size: var(--text-h3); margin-top: 1.6em; }
.prose a {
  color: var(--saffron-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.prose a:hover { color: var(--maroon); }
.prose ul,
.prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote {
  border-left: 2px solid var(--saffron);
  padding-left: var(--space-5);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-h3);
  line-height: 1.4;
  color: var(--maroon);
}
.prose img { border-radius: var(--radius-1); }
.prose > p:first-child { font-size: var(--text-lead); color: var(--maroon); }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-5);
  background: var(--maroon);
  color: var(--on-maroon);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
  transition: transform var(--dur-ui) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

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

.section {
  position: relative;
  padding-block: var(--section-pad);
}
.section--tight { padding-block: calc(var(--section-pad) * 0.6); }
.section--deep { background: var(--cream-deep); }
.section--paper { background: var(--paper); }
.section--maroon { background: var(--maroon); color: var(--on-maroon-muted); }
.section--maroon :is(h1, h2, h3, h4) { color: var(--on-maroon); }

/* Subtle paper grain on alternate bands (≈3% opacity). */
.grain { isolation: isolate; }
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .42 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Text utilities ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--saffron-ink);
}
.eyebrow--rule::before {
  content: "";
  flex: none;
  width: 2rem;
  height: 1px;
  background: var(--saffron);
}
.section--maroon .eyebrow,
.on-maroon .eyebrow { color: var(--saffron-on-maroon); }

.meta {
  font-size: var(--text-small);
  line-height: var(--leading-meta);
  letter-spacing: var(--tracking-meta);
  color: var(--muted);
}

.small-caps {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}

.lead { font-size: var(--text-lead); line-height: 1.6; }

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

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Media frames: fixed ratios, no layout shift, gentle hover zoom ---------- */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-1);
  background: var(--cream-deep);
}
.frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-reveal) var(--ease-out);
}
.frame--3x2 { aspect-ratio: 3 / 2; }
.frame--4x5 { aspect-ratio: 4 / 5; }
.frame--2x3 { aspect-ratio: 2 / 3; }
.frame--16x9 { aspect-ratio: 16 / 9; }
.frame--1x1 { aspect-ratio: 1; }

/* ---------- Reveal on scroll ----------
   Hidden only when scripting is on (site.js adds .is-visible). No JS → content always visible. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(var(--reveal-distance));
    transition:
      opacity var(--dur-reveal) var(--ease-out),
      transform var(--dur-reveal) var(--ease-out);
    transition-delay: calc(var(--reveal-i, 0) * var(--stagger));
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* Cormorant's default old-style figures read "10" as "IO" at display sizes: use lining figures for numbers. */
.nums,
.event-row__day,
.hero__count,
.lightbox__count,
.ds-swatch__hex { font-variant-numeric: lining-nums; }
