/* ============================================================================
   base.css — reset, document rhythm, focus, and the accessibility primitives
   that every page depends on.
   ========================================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets and :focus must clear the sticky header.
     WCAG 2.2 — 2.4.11 Focus Not Obscured (Minimum). */
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  scroll-padding-bottom: 2rem;
  -moz-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
:root[data-motion='off'] html,
html:where([data-motion='off']) { scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--surface-0);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  font-weight: 400;
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color var(--d-slow) var(--e-soft),
              color var(--d-slow) var(--e-soft);
}

/* Lock scroll without the layout jumping when a modal/menu opens */
body[data-scroll-locked] {
  overflow: hidden;
  padding-right: var(--scrollbar-w, 0);
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img,
video { height: auto; }

/* A placeholder tint while a photograph loads, so the box is never a white
   hole. Scoped to photographs only — applying it to every <img> paints a
   beige rectangle behind transparent SVG logos. */
.media-img,
.media img,
.card-media img,
.tour-media img,
.article-media img { background-color: var(--surface-2); }

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button { background: none; border: none; }

p,
h1,
h2,
h3,
h4,
h5,
h6 { overflow-wrap: break-word; }

ul[class],
ol[class] { list-style: none; padding: 0; }

:is(h1, h2, h3, h4) {
  font-family: var(--font-display);
  /* Sans headings need real weight behind them; 400 reads as body copy. */
  font-weight: var(--w-head);
  line-height: var(--lh-tight);
  letter-spacing: -0.018em;
  /* Avoids a single orphaned word on the last line of a heading */
  text-wrap: balance;
}

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: from-font;
  transition: color var(--d-fast) var(--e-soft),
              text-decoration-color var(--d-fast) var(--e-soft);
}

a:hover { text-decoration-color: currentColor; }

hr {
  border: 0;
  height: 1px;
  background: var(--line);
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* ---- Focus -------------------------------------------------------------
   A visible, high-contrast ring on every operable control. The ring is
   never removed — only replaced with a better one. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* Pointer users don't get the ring, keyboard users always do. */
:focus:not(:focus-visible) { outline: none; }

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  translate: -50% -130%;
  z-index: var(--z-skip);
  padding: 0.9rem 1.6rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0 0 var(--r-m) var(--r-m);
  box-shadow: var(--shadow-2);
  transition: translate var(--d-base) var(--e-out);
}
.skip-link:focus-visible {
  translate: -50% 0;
  outline-offset: -4px;
}

/* ---- Screen-reader-only ------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Visible again when focused — used by in-page shortcuts */
.sr-only-focusable:focus-visible {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

/* ---- Minimum target size ------------------------------------------------
   WCAG 2.2 — 2.5.8 Target Size (Minimum) is 24x24; this project holds the
   stricter 44x44 from the mobile guidance, via a pseudo-element so small
   visual controls keep their looks but gain a real hit area. */
.tap {
  position: relative;
  min-width: 44px;
  min-height: 44px;
}
.tap-pad::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
}

/* ---- Grain -------------------------------------------------------------
   A single fixed film-grain layer over the whole page. Decorative only, so
   it is aria-hidden and pointer-transparent. */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: soft-light;
  background-image: var(--grain-url);
  background-size: 180px 180px;
}
:root[data-theme='light'] .grain { opacity: 0.3; }

/* ---- Layout helpers ----------------------------------------------------- */
.shell {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
}
.shell-text {
  width: min(100% - (var(--gutter) * 2), var(--maxw-text));
  margin-inline: auto;
}
.section { padding-block: var(--section-y); position: relative; }
.measure { max-width: var(--measure); }
.measure-tight { max-width: var(--measure-tight); }
.center { text-align: center; margin-inline: auto; }

.stack > * + * { margin-block-start: var(--flow, var(--sp-s)); }
.stack-m > * + * { margin-block-start: var(--sp-m); }
.stack-l > * + * { margin-block-start: var(--sp-l); }

/* ---- Type helpers ------------------------------------------------------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: var(--track-widest);
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: '';
  inline-size: clamp(1.5rem, 4vw, 3.25rem);
  block-size: 1px;
  background: currentColor;
  flex: none;
  opacity: 0.75;
}
.eyebrow.is-centred { justify-content: center; }
.eyebrow.is-centred::after {
  content: '';
  inline-size: clamp(1.5rem, 4vw, 3.25rem);
  block-size: 1px;
  background: currentColor;
  flex: none;
  opacity: 0.75;
}

.display {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
.display-xl { font-size: var(--t-3xl); }
.h2 { font-size: var(--t-xl); }
.h3 { font-size: var(--t-lg); }

.lede {
  font-size: var(--t-md);
  line-height: var(--lh-loose);
  color: var(--text-2);
  font-weight: 300;
}
.muted { color: var(--text-2); }
.meta {
  font-size: var(--t-xs);
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
}
.serif-num {
  font-family: var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
}

/* An italic serif accent used for the single most important phrase in a
   heading. Carries no meaning on its own. */
.accentuate {
  font-style: italic;
  color: var(--accent);
}

/* ---- The spectrum hairline ---------------------------------------------
   The one place the pride spectrum appears as pure colour. Decorative:
   nothing is communicated by it alone. */
.spectrum-rule {
  block-size: 2px;
  inline-size: 100%;
  border: 0;
  background: var(--spectrum);
  border-radius: 2px;
  opacity: 0.9;
}
.spectrum-rule.is-thin { block-size: 1px; }

/* ---- Print -------------------------------------------------------------- */
@media print {
  .grain,
  .cursor,
  .preloader,
  .access-dock,
  .site-header,
  .scroll-rail { display: none !important; }
  body { background: #fff; color: #000; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}

/* ---- Forced colors (Windows High Contrast) ------------------------------ */
@media (forced-colors: active) {
  .btn,
  .card,
  .chip { border: 1px solid CanvasText; }
  .spectrum-rule { background: CanvasText; }
  :focus-visible { outline: 3px solid Highlight; }
}
