/* ============================================================
   ENDUROCROSS — GLOBAL
   Reset · base type · a11y · header/footer · shared motifs.
   Requires tokens.css + fonts.css loaded first.
   ============================================================ */

/* ---- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: clip;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.02; text-wrap: balance; }
/* D-16 — no one-word orphans on the last line of running copy.
   Chrome/Safari 17.5+; a no-op elsewhere. */
p, li, .lede, .page-hero__lede { text-wrap: pretty; }

::selection { background: var(--x-red); color: var(--bone); }

/* Scrollbar — course rail */
html { scrollbar-color: var(--dirt-lit) var(--ink); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--dirt-mid); border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--x-red); }

/* ---- A11y --------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--hivis);
  outline-offset: 3px;
  border-radius: 1px;
}
.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: calc(var(--z-wipe) + 1);
  padding: 0.75rem 1.25rem;
  background: var(--hivis);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  transform: translateY(-250%);
}
.skip-link:focus-visible { transform: none; outline-color: var(--x-red); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---- Type voices --------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.92;
}
.data-label {
  font-family: var(--font-data);
  font-size: var(--text-data);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}
.stamp {
  font-family: var(--font-stamp);
  text-transform: uppercase;
  line-height: 1;
}

/* ---- Shared motifs ------------------------------------------- */

/* The X — the REAL brand mark (EnduroCross's own brush-stroke X, from
   their favicon source), applied as a mask so it recolors through
   the tokens. Never redraw this shape with bars or glyphs. */
.x-mark {
  position: relative;
  display: inline-block;
  width: 1.1em; height: 0.96em;
  flex: none;
  background: var(--x-red);
  -webkit-mask: url("../img/brand/x-mark.svg") center / contain no-repeat;
  mask: url("../img/brand/x-mark.svg") center / contain no-repeat;
}
.x-mark--hivis { background: var(--hivis); }
.x-mark--bone { background: var(--bone); }

/* Section divider: hairline ✕ hairline */
.x-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: 0 auto;
  max-width: var(--page-max);
  padding: 0 var(--gutter);
}
.x-divider::before, .x-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-edge);
}
.x-divider .x-mark { font-size: 0.875rem; }

/* Course stake: hi-vis marker — literally the yellow stakes in the
   photography. Notched with dark bands. */
.stake {
  display: inline-block;
  width: 5px;
  height: 2.25rem;
  background: repeating-linear-gradient(
    to bottom,
    var(--hivis) 0 9px,
    var(--ink) 9px 13px
  );
  flex: none;
}

/* Grain — arena air */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* Section kicker: ENDURO ✕ CROSS style marker */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-data);
  font-size: var(--text-data);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone-70);
}
.kicker .x-mark { font-size: 0.625rem; }
.kicker--hivis { color: var(--hivis); }

/* ---- Buttons -------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1rem 2rem 1.05rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  clip-path: var(--notch-sm);
  transition:
    transform var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  will-change: transform;
}

.btn--primary { background: var(--x-red-deep); color: var(--bone); }  /* AA contrast fix (T-005): x-red-deep vs bone = 6.4:1, x-red alone was 3.8:1 */
.btn--primary::after {           /* impact underline that loads on hover */
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 3px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out);
}
.btn--primary:hover { background: oklch(56% 0.23 27.58); transform: translateY(-2px); box-shadow: 0 14px 34px -12px oklch(60.79% 0.23 27.58 / 0.55); }  /* AA contrast fix (T-005): 4.6:1 vs bone, was 3.3:1 */
.btn--primary:hover::after { transform: scaleX(1); }

.btn--ghost {
  background: transparent;
  color: var(--bone);
  box-shadow: inset 0 0 0 1px var(--bone-50);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--hivis); color: var(--hivis); transform: translateY(-2px); }

.btn--hivis { background: var(--hivis); color: var(--ink); }
.btn--hivis:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -14px oklch(88.59% 0.1855 120.95 / 0.5); }

/* Pressed state (D-05) — declared AFTER every variant :hover so the sink
   actually renders while the pointer is still down and hovering. */
.btn:active,
.btn:hover:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 4px 12px -8px oklch(0% 0 0 / 0.6);
  transition-duration: 60ms;
}
.btn--primary:active::after { transform: scaleX(1); }

.btn--sm { padding: 0.6rem 1.15rem 0.65rem; font-size: 0.9375rem; }

/* Status chips — literal render of events.json status values */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.3em 0.75em;
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  width: fit-content;   /* D-06 — a chip is a label, never a full-bleed bar */
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  background: currentColor;
  transform: rotate(45deg);
}
/* Both states share one silhouette — same size, same dot, same
   radius-free block — filled hi-vis for on-sale, hairline hi-vis for
   tickets-live. Two states of one component, not two components.
   Literal renders of events.json status strings; invent no urgency. */
.chip--onsale { color: var(--ink); background: var(--hivis); }
.chip--live { color: var(--hivis); background: transparent; box-shadow: inset 0 0 0 1px oklch(88.59% 0.1855 120.95 / 0.55); }
/* Neutral label — for chips that name a thing, not a live status.
   Hi-vis is the series' status voice; it is never decoration-only. */
.chip--label { color: var(--bone-50); background: transparent; box-shadow: inset 0 0 0 1px var(--ink-edge); }
.chip--label::before { background: var(--bone-50); }

/* ---- Layout shells -------------------------------------------- */
.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--space-section); }
/* D-07 — the page's closing beat. Whatever the last block in <main>
   is (.page-section, .content-section, .exclusive, .off-course) it
   ends on --space-section-end and the footer's red rule lands right
   on it; the footer itself carries no top margin any more. */
main > :last-child { padding-bottom: var(--space-section-end); }
/* D-07 — and the opening beat: every hero hands off to its first
   section on the same value, whether that section is a tight core
   section, a content section or an article body. Lives here (not in
   pages-core.css) because the content pages never load that file. */
main > :is(.page-hero, .event-hero, .article-hero) + * { padding-top: var(--space-section-end); }

/* Scroll reveal primitive (JS adds .is-revealed; static without JS) */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .reveal.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
/* D-13 — sibling stagger. Cards in a grid, rows on the board and
   timeline entries arrive in sequence instead of popping as one
   block. Capped at 240ms so a long list never feels late. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal:nth-child(2) { transition-delay: 60ms; }
  .js .reveal:nth-child(3) { transition-delay: 120ms; }
  .js .reveal:nth-child(4) { transition-delay: 180ms; }
  .js .reveal:nth-child(n+5) { transition-delay: 240ms; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   HEADER — slim persistent top bar
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  transition: background-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.site-header.is-scrolled {
  background: oklch(14.52% 0.0021 286.13 / 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--ink-edge);
}
.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 0.7rem var(--gutter);
}
.site-header__brand { flex: none; display: block; }
.site-header__brand img { height: 42px; width: auto; }

.site-nav { margin-left: auto; }
.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 1vw, 1rem);
}
.site-nav__link, .site-nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.55rem 0.8rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bone-70);
  transition: color var(--duration-fast) var(--ease-out);
}
.site-nav__link::after, .site-nav__toggle::after {
  content: none;
}
.site-nav__item { position: relative; }
.site-nav__item > .site-nav__link,
.site-nav__item > .site-nav__toggle { position: relative; }
.site-nav__item > .site-nav__link::before,
.site-nav__item > .site-nav__toggle::before {
  content: "";
  position: absolute;
  left: 0.8rem; right: 0.8rem; bottom: 0.2rem;
  height: 2px;
  background: var(--x-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-fast) var(--ease-out);
}
.site-nav__link:hover, .site-nav__toggle:hover,
.site-nav__toggle[aria-expanded="true"] { color: var(--bone); }
.site-nav__link:hover::before, .site-nav__toggle:hover::before,
.site-nav__toggle[aria-expanded="true"]::before { transform: scaleX(1); }

.site-nav__caret {
  width: 0.5em; height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--duration-fast) var(--ease-out);
}
.site-nav__toggle[aria-expanded="true"] .site-nav__caret { transform: rotate(225deg); }

.site-nav__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 15rem;
  padding: 0.5rem 0;
  background: var(--ink-raised);
  box-shadow: 0 1px 0 var(--x-red) inset, 0 24px 48px -18px oklch(0% 0 0 / 0.7);
  clip-path: var(--notch-sm);
}
.site-nav__menu[hidden] { display: none; }
/* D-13 — the dropdown drops: -6px → 0 with a fade as `hidden` is
   removed. An animation (not a transition) because the panel comes
   from display:none. Desktop only; the phone drawer lays menus inline. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .site-nav__menu:not([hidden]) { animation: menuIn 220ms var(--ease-out) both; }
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.site-nav__menu a {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  padding: 0.55rem 1.1rem;
  text-decoration: none;
  font-family: var(--font-data);
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  color: var(--bone-70);
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}
.site-nav__menu a:hover { color: var(--bone); background: oklch(30.02% 0.0388 67.04 / 0.35); }
.site-nav__menu a .rd {
  font-family: var(--font-stamp);
  font-size: 0.8125rem;
  color: var(--x-red);
  min-width: 2.6em;
}
.site-nav__menu a .ext { color: var(--bone-50); font-size: 0.75em; }

.tickets-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.62rem 1.4rem 0.68rem;
  background: var(--x-red);
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: var(--notch-sm);
  transition: transform var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.tickets-pill:hover { background: oklch(64% 0.235 27.58); transform: translateY(-1px); box-shadow: 0 10px 26px -10px oklch(60.79% 0.23 27.58 / 0.6); }
.tickets-pill:active { transform: translateY(1px); }
.tickets-pill .x-mark { font-size: 0.55em; }

/* Mobile nav */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
}
.menu-btn span {
  display: block;
  height: 2px;
  background: var(--bone);
  transition: transform var(--duration-base) var(--ease-impact), opacity var(--duration-fast);
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--x-red); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--x-red); }

@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    margin: 0;
    padding: 6rem var(--gutter) 3rem;
    background: oklch(14.52% 0.0021 286.13 / 0.97);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-base) var(--ease-out), visibility 0s var(--duration-base);
    overflow-y: auto;
  }
  html.nav-open .site-nav { opacity: 1; visibility: visible; transition-delay: 0s; z-index: -1; }
  /* The scrolled header's backdrop-filter makes it the containing block for
     the fixed drawer, so the drawer collapsed to the header box and painted
     behind its bar (verified on iPhone 12 / iPad Mini, any scrolled page).
     Drop the filter while the drawer is open — the drawer's own ground covers
     the page — and park the consent banner so it cannot sit on the links. */
  html.nav-open .site-header.is-scrolled { backdrop-filter: none; }
  html.nav-open .consent { visibility: hidden; }
  html.nav-open,
  html.nav-open body { overflow: hidden; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__link, .site-nav__toggle {
    width: 100%;
    padding: 0.9rem 0;
    font-size: 1.5rem;
    justify-content: space-between;
    border-bottom: var(--hairline);
  }
  .site-nav__item > .site-nav__link::before,
  .site-nav__item > .site-nav__toggle::before { content: none; }
  .site-nav__menu {
    position: static;
    min-width: 0;
    background: transparent;
    box-shadow: none;
    clip-path: none;
    padding: 0 0 0.75rem;
  }
  .menu-btn { display: flex; }

  /* D-13 — drawer links land one after another (40ms steps) instead
     of the whole list fading in as a block. */
  @media (prefers-reduced-motion: no-preference) {
    html.nav-open .site-nav__list > .site-nav__item > .site-nav__link,
    html.nav-open .site-nav__list > .site-nav__item > .site-nav__toggle {
      animation: navIn 320ms var(--ease-out) both;
    }
    html.nav-open .site-nav__item:nth-child(2) > :is(.site-nav__link, .site-nav__toggle) { animation-delay: 40ms; }
    html.nav-open .site-nav__item:nth-child(3) > :is(.site-nav__link, .site-nav__toggle) { animation-delay: 80ms; }
    html.nav-open .site-nav__item:nth-child(4) > :is(.site-nav__link, .site-nav__toggle) { animation-delay: 120ms; }
    html.nav-open .site-nav__item:nth-child(5) > :is(.site-nav__link, .site-nav__toggle) { animation-delay: 160ms; }
    html.nav-open .site-nav__item:nth-child(n+6) > :is(.site-nav__link, .site-nav__toggle) { animation-delay: 200ms; }
  }
}
@keyframes navIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   COURSE PROGRESS — sitewide scroll tick bar, 6 round markers
   ============================================================ */
.course-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-progress);
  height: 3px;
  background: oklch(26% 0.006 60 / 0.6);
  pointer-events: none;
}
.course-progress__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--x-red) 0 82%, var(--hivis) 97%);
  transform: scaleX(0);
  transform-origin: left;
}
.course-progress__tick {
  position: absolute;
  top: -2px;
  width: 7px; height: 7px;
  background: var(--ink-edge);
  opacity: 0.4;
  transform: translateX(-50%) rotate(45deg);
  transition: background-color var(--duration-fast) linear, opacity var(--duration-fast) linear;
}
.course-progress__tick.is-passed { background: var(--hivis); opacity: 1; }
/* Fixed 6-tick positions — nth-child so markup never needs an inline
   left:%% (CORE.11). Kept in sync with the 6 <span> ticks every page
   renders after .course-progress__fill. */
.course-progress__tick:nth-child(2) { left: 16%; }
.course-progress__tick:nth-child(3) { left: 32%; }
.course-progress__tick:nth-child(4) { left: 48%; }
.course-progress__tick:nth-child(5) { left: 64%; }
.course-progress__tick:nth-child(6) { left: 80%; }
.course-progress__tick:nth-child(7) { left: 96%; }

/* ============================================================
   X-WIPE page transition (View Transitions handled in main.js)
   ============================================================ */
.x-wipe {
  position: fixed;
  inset: 0;
  z-index: var(--z-wipe);
  pointer-events: none;
  visibility: hidden;
}
.x-wipe__bar {
  position: absolute;
  left: 50%; top: 50%;
  width: 180vmax; height: 24vmax;
  background: var(--x-red);
  transform: translate(-50%, -50%) rotate(45deg) scaleX(0);
}
.x-wipe__bar--b { transform: translate(-50%, -50%) rotate(-45deg) scaleX(0); background: oklch(48% 0.19 27.58); }
.x-wipe.is-out { visibility: visible; }
.x-wipe.is-out .x-wipe__bar {
  animation: xwipe-in 0.42s var(--ease-impact) forwards;
}
.x-wipe.is-out .x-wipe__bar--b { animation-delay: 0.09s; }
.x-wipe.is-in { visibility: visible; }
.x-wipe.is-in .x-wipe__bar {
  transform: translate(-50%, -50%) rotate(45deg) scaleX(1);
  animation: xwipe-out 0.5s var(--ease-out) 0.05s forwards;
}
.x-wipe.is-in .x-wipe__bar--b {
  transform: translate(-50%, -50%) rotate(-45deg) scaleX(1);
  animation-delay: 0.14s;
}
@keyframes xwipe-in {
  to { transform: translate(-50%, -50%) rotate(var(--wipe-rot, 45deg)) scaleX(1); }
}
@keyframes xwipe-out {
  to { transform: translate(-50%, -50%) rotate(var(--wipe-rot, 45deg)) scaleX(0); }
}
.x-wipe__bar { --wipe-rot: 45deg; }
.x-wipe__bar--b { --wipe-rot: -45deg; }
@media (prefers-reduced-motion: reduce) {
  .x-wipe { display: none; }
}

/* ============================================================
   CONSENT BANNER — Consent Mode v2, minimal
   ------------------------------------------------------------
   UX F-01 / RESP F-08 — the banner used to be a tall stacked card
   sitting exactly where the hero's ticket CTA lands. It is now a
   single-row slim bar on desktop and a two-line bar on phones, so
   it never covers a [data-track^="tickets:buy"] button. Consent Mode
   defaults, z-index and the focus trap are unchanged.
   ============================================================ */
.consent {
  position: fixed;
  left: var(--space-4); right: var(--space-4); bottom: var(--space-4);
  z-index: var(--z-consent);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: 44rem;
  padding: var(--space-3) var(--space-4);
  background: var(--ink-raised);
  box-shadow: 0 2px 0 var(--x-red) inset, 0 30px 60px -20px oklch(0% 0 0 / 0.8);
  clip-path: var(--notch-sm);
}
.consent[hidden] { display: none; }
.consent p {
  flex: 1 1 auto;
  margin-bottom: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--bone-70);
}
.consent__actions { display: flex; flex: 0 0 auto; gap: var(--space-3); }
.consent__actions .btn { min-height: 44px; padding-block: 0; }
/* The opt-out/opt-in pair on /privacy-policy/ toggles via the hidden
   attribute; .btn's inline-flex would otherwise out-rank the UA rule. */
.btn[hidden] { display: none; }
.consent-status { font-size: var(--text-sm); color: var(--bone-70); }

/* Compact footprint on phones — two rows, still short enough that the
   hero CTA above it stays clear (HOMEPAGE.2). */
@media (max-width: 760px) {
  .consent {
    left: var(--space-3); right: var(--space-3);
    bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    /* W4-A — trimmed from space-3/space-3 to hold the banner under the
       132px budget on a 3-line wrap (iPhone 12/Pixel 5 measured 135px).
       Copy stays at --text-sm and the buttons stay 44px per UX F-01. */
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
  }
  /* UX F-01 — on phones the event hero's GET TICKETS button lands within
     a banner's height of the viewport floor, so a bottom-docked bar
     always covers it and shrinking the bar only makes the covered
     fraction worse. main.js measures the bottom slot against every
     visible tickets:buy CTA and adds .is-top only when they collide, so
     the homepage (strip clear of the floor on most phones) keeps its H1
     while event pages keep their button. Was a blanket max-height:800px
     rule, which hid the ENDURO line of the hero on every phone.
     Position only - the copy, z-index, focus trap and Consent Mode
     defaults are unchanged. */
  .consent.is-top {
    top: 5rem;   /* clears the fixed header bar (~72px tall) */
    bottom: auto;
  }
  .consent p { font-size: var(--text-sm); line-height: 1.3; text-wrap: pretty; }
  .consent__actions { flex-wrap: nowrap; gap: var(--space-2); }
  .consent__actions .btn { flex: 1 1 0; min-height: 44px; font-size: 0.875rem; }
}

/* ============================================================
   STICKY TICKET BAR — appears when the page's primary ticket CTA
   scrolls out of view, hides again at the footer.
   ------------------------------------------------------------
   UX F-06 — it used to be gated behind max-width:760px and so never
   appeared on desktop at all. It now runs at every width - full-bleed
   on phones, a right-docked pill on desktop.
   RESP F-03 — on phones the bar reserved no space, so it sat on top of
   the very ticket buttons it advertises. body:has() now pads for it.
   ============================================================ */
.ticket-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-sticky-cta);
  display: block;
  padding: 0.6rem var(--space-4) calc(0.6rem + env(safe-area-inset-bottom));
  background: oklch(14.52% 0.0021 286.13 / 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 -1px 0 var(--ink-edge);
  transform: translateY(110%);
  transition: transform var(--duration-base) var(--ease-out);
}
.ticket-bar.is-visible { transform: none; }
.ticket-bar .btn { width: 100%; }

/* Desktop — a docked pill in the bottom-right gutter, not a full-width
   band. It never spans the viewport, so it cannot cover in-page CTAs. */
@media (min-width: 761px) {
  .ticket-bar {
    left: auto;
    right: var(--space-5);
    bottom: var(--space-5);
    width: auto;
    max-width: 22rem;
    padding: var(--space-3);
    clip-path: var(--notch-sm);
    box-shadow: 0 24px 50px -20px oklch(0% 0 0 / 0.85);
  }
  .ticket-bar .btn { width: auto; }
}

/* Phones — reserve the bar's height so it stops covering the last
   section's ticket buttons, and collapse the redundant header pill
   while the bar is up (D-14). */
@media (max-width: 760px) {
  body:has(.ticket-bar.is-visible) {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }
  /* The header CTA on this shell is .tickets-pill, not a .btn--primary —
     both are covered so the rule survives either markup. */
  html.has-ticket-bar .site-header .tickets-pill,
  html.has-ticket-bar .site-header .btn--primary { display: none; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  margin-top: 0;   /* D-07 — the gap before the footer is the last section's --space-section-end, not a second void */
  background: var(--dirt-ground);   /* D-23 — one clear step above page ink */
  box-shadow: 0 3px 0 var(--x-red) inset;
}
.site-footer__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding: var(--space-16) var(--gutter) var(--space-8);
}
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(16rem, 1.2fr) repeat(3, minmax(9rem, 1fr));
  gap: var(--space-12) var(--space-8);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid oklch(30.02% 0.0388 67.04 / 0.8);
}
.site-footer__brand img { height: 64px; width: auto; }
.site-footer__brand p {
  margin-top: var(--space-4);
  max-width: 30ch;
  color: var(--bone-70);
  font-size: var(--text-sm);
}
.site-footer__social { display: flex; gap: var(--space-3); margin-top: var(--space-6); }
.site-footer__social a {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;   /* RESP F-05 — WCAG 2.5.5 minimum */
  color: var(--bone-70);
  box-shadow: inset 0 0 0 1px oklch(43.77% 0.0663 65.38 / 0.7);
  transition: color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast) var(--ease-out);
}
.site-footer__social a:hover { color: var(--ink); background: var(--hivis); box-shadow: none; transform: translateY(-2px); }
.site-footer__social a:active { transform: scale(0.94); }
.site-footer__social svg { width: 18px; height: 18px; fill: currentColor; }

.site-footer__col h3 {
  font-family: var(--font-data);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--hivis);
  margin-bottom: var(--space-4);
}
.site-footer__col ul { display: grid; gap: 0.1rem; list-style: none; padding: 0; margin: 0; }
.site-footer__col a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-block: 0.3rem;
  text-decoration: none;
  color: var(--bone-70);
  font-size: var(--text-sm);
  transition: color var(--duration-fast);
}
.site-footer__col a:hover { color: var(--bone); }

.sponsor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4) var(--space-6);
  padding: var(--space-8) 0;
  border-bottom: 1px solid oklch(30.02% 0.0388 67.04 / 0.8);
}

/* Every partner mark ships as a bone silhouette carried in the PNG alpha
   channel, so one mask rule tints them all and no logo fights the ink ground.
   --logo is the mask source, --sc the optical-size correction that keeps a
   stacked wordmark from reading smaller than a compact one at equal height. */
.partner-logo {
  --sc: 1;
  display: block;
  flex: none;
  height: calc(1.75rem * var(--sc));
  width: calc(1.75rem * var(--sc) * var(--ar));
  background-color: var(--bone-70);
  -webkit-mask-image: var(--logo);
  mask-image: var(--logo);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color var(--duration-fast);
}
a.partner-logo:hover,
a.partner-logo:focus-visible { background-color: var(--bone); }

/* Per-logo geometry (--logo/--ar/--sc) is CMS-managed and rides inline on
   each .partner-logo element — see sponsorRow() in tools/shell.mjs. */

@media (max-width: 47.9375rem) {
  .sponsor-row { gap: var(--space-3) var(--space-5); }
  .partner-logo { height: calc(1.375rem * var(--sc)); width: calc(1.375rem * var(--sc) * var(--ar)); }
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding-top: var(--space-6);
  font-size: 0.8125rem;
  color: var(--bone-50);
}
.site-footer__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--bone-50);
}
.site-footer__legal a:hover { color: var(--bone); }
.site-footer__ama { margin-left: auto; }
.site-footer__ama img { height: 34px; width: auto; }

@media (max-width: 900px) {
  .site-footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .site-footer__top { grid-template-columns: 1fr; }
  .site-footer__ama { margin-left: 0; }
}
/* RESP F-08 — real sentences read at 16px on phones; labels, chips and
   eyebrows keep their designed sizes. */
@media (max-width: 760px) {
  .site-footer__brand p { font-size: 1rem; }
}

/* ============================================================
   PULL QUOTE — attributed buyer reviews (Gate 2 §B insertions).
   Quotes render AS quotes: platform + venue + year attribution in
   the data face; the buyer's words carry the claim, never brand
   voice. Red rule = the X interrupting the page, not decoration.
   ============================================================ */
.pull-quote {
  margin: var(--space-6) 0 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  border-left: 3px solid var(--x-red);
  max-width: var(--measure);
}
.pull-quote p {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--bone);
  max-width: 46ch;
}
.pull-quote cite {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-data);
  font-style: normal;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-50);
}
.pull-quote--center { margin-inline: auto; text-align: left; }
.quote-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: var(--space-4) var(--space-10);
}
.quote-strip .pull-quote { margin-top: 0; }

/* ============================================================
   PLATE UTILITIES — one photo treatment per job (D-20)
   .plate--night  documentary shots: the event-hero chain, dimmed
   .plate--red    editorial moments: the podium duotone (luminosity
                  over deep red, ink cap at the foot)
   Apply to the <img>/<picture> or to a positioned wrapper.
   ============================================================ */
.plate--night { filter: brightness(0.55) saturate(0.7); }
.plate--red {
  position: relative;
  background: var(--x-red-deep);
  isolation: isolate;
}
.plate--red > img,
.plate--red > picture,
img.plate--red {
  filter: saturate(1.2) contrast(1.05);
  mix-blend-mode: luminosity;
}
.plate--red::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, var(--ink) 100%);
}
img.plate--red::after { content: none; }

/* ============================================================
   PRINT — the schedule is the page fans print (D-11)
   ============================================================ */
@media print {
  /* Remap the ground/type tokens so every component that colours
     itself through them (board rows, cards, dates) prints dark-on-
     paper whether or not the browser prints backgrounds. */
  :root {
    color-scheme: light;
    --ink: #fff;
    --ink-raised: #f2f1ee;
    --ink-edge: #c9c6c0;
    --dirt-deep: #fff;
    --dirt-mid: #ddd8d0;
    --dirt-ground: #fff;
    --bone: #111;
    --bone-70: #333;
    --bone-50: #555;
    --hivis: #3d5c00;
    --x-red: #b31212;
    --x-red-deep: #8f0f0f;
  }
  .site-header, .site-footer, .ticket-bar, .consent, .course-progress, .x-wipe,
  .skip-link, .menu-btn, .event-strip, .grain::after { display: none !important; }
  body { background: #fff; color: #111; }
  .js .reveal { opacity: 1; transform: none; }
  .page-hero, .event-hero { padding-top: var(--space-8); background: none; }
  .page-hero::before, .event-hero::before, .hero-offer::before { content: none !important; } /* pages-core.css loads later; the hatch must lose on paper */
  .board__row { break-inside: avoid; }
}
