/* ==========================================================================
   RJP site starter: base (reset, type roles, frame, media, motion, a11y)
   Reads role tokens from tokens.css. No component styles here.
   ========================================================================== */

/* Metric-matched fallbacks (measured against Liberation = Times/Arial metrics)
   so the web-font swap does not move the layout (CLS). Re-measure when a
   brand swaps a family: README "Fonts". */
@font-face {
  font-family: "Fraunces Fallback";
  src: local("Times New Roman"), local("Liberation Serif"), local("Times");
  size-adjust: 115.1%;
  ascent-override: 85%;
  descent-override: 22.2%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 101.8%;
  ascent-override: 104.7%;
  descent-override: 29.5%;
  line-gap-override: 0%;
}

/* --- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
:where(ul[role="list"], ol[role="list"], .list-reset) { list-style: none; padding: 0; }
img, picture, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* --- Page --------------------------------------------------------------- */
body {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 1024px) { body { font-size: 1.0625rem; } }

[data-surface] { background-color: var(--surface); color: var(--text); }
[data-surface="media"] { background-color: transparent; }

/* --- Type roles --------------------------------------------------------- */
.t-display, .t-h1, .t-h2, .t-h3, .t-statement, .t-intro {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  text-wrap: balance;
  font-optical-sizing: auto;
}
.t-display { font-size: var(--fs-display-xl); line-height: 0.95; }
.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-display); }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.t-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.t-statement { font-size: var(--fs-statement); line-height: var(--lh-statement); }
.t-intro { font-size: var(--fs-intro); line-height: 1.22; }
.t-display em, .t-h1 em, .t-h2 em, .t-h3 em, .t-statement em, .t-intro em {
  font-style: var(--display-italic);
}
.t-lead { font-size: var(--fs-lead); line-height: 1.45; text-wrap: pretty; }
.t-body { font-size: inherit; text-wrap: pretty; }
.t-small { font-size: var(--fs-small); line-height: 1.5; }
.t-label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.t-muted { color: var(--text-muted); }

/* --- Frame -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--margin);
}
.section { padding-block: var(--section-y); }
.section--tight { padding-block: var(--section-y-tight); }
.section--loose { padding-block: var(--section-y-loose); }
.section--flush-top { padding-top: 0; }
/* Two plain sections in a row on the same surface share one gap instead of
   stacking two (the whitespace should frame one thing, not pile up). */
main > :is(.section, .section--tight, .section--loose):not([data-surface]) + :is(.section, .section--tight):not([data-surface]) { padding-top: 0; }
.container--narrow { max-width: calc(880px + 2 * var(--margin)); }
.container--xs { max-width: calc(640px + 2 * var(--margin)); }

/* Heading row above cards and carousels: heading left, action right
   (layout-architecture.md pattern 7). */
.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--stack-m) var(--stack-l);
  margin-bottom: var(--head-to-content);
}
.head-row__text { display: grid; gap: var(--stack-s); max-width: 44rem; }
.head-row__text > p:not(.t-label) { color: var(--text-muted); max-width: var(--measure-text); }

/* Stack: label -> heading -> sentence -> action (Camper ladder 20/20/40). */
.stack { display: grid; gap: var(--stack-s); justify-items: start; }
.stack > .stack__action { margin-top: var(--stack-s); }

/* --- Media -------------------------------------------------------------- */
.media { position: relative; overflow: hidden; border-radius: var(--radius-media); background: var(--surface-alt); }
.media > img, .media > picture > img, .media > video, .media > picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--fill { position: absolute; inset: 0; border-radius: 0; }
/* <picture> is the box the <img> fills inside every media slot. */
picture { display: block; }
.media > picture, [class*="__media"] > picture, .selector__layer > picture, .hero__photo > picture { width: 100%; height: 100%; }

/* Hover zoom inside the frame: 1.03-1.05, 0.6-0.8s. No lift, shadow or tilt. */
.zoom img { transition: transform var(--dur-zoom) var(--ease-out-long); }
@media (hover: hover) {
  .zoom:hover img, .zoom:focus-within img { transform: scale(var(--zoom)); }
}

/* --- Text scrim -----------------------------------------------------------
   The overlay is sized to where the text sits (colour-imagery.md: "Hero
   overlay sized to the photo"; first-screen.md: "Gradient, not flat tint, so
   the rest of the photo stays bright"). The whole text block sits on at
   least --scrim-a, then the shade fades out above it. So the contrast floor
   holds over ANY photo, even pure white (tests check scrim pairs).
   .text-scrim--bleed  runs the shade to the viewport edges
   .text-scrim--left   eases it off to the right of a left-aligned block */
.text-scrim { position: relative; }
.text-scrim::before {
  --_a: var(--scrim-a, var(--scrim-text));
  --_h: var(--scrim-hold, 62%);
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(-1 * var(--scrim-reach, 70%)) var(--scrim-bleed, 0px) calc(-1 * var(--scrim-below, 0px)) var(--scrim-bleed, 0px);
  pointer-events: none;
  /* eased fade above the hold zone, so there is no visible edge */
  background: linear-gradient(to top,
    rgb(var(--brand-scrim) / var(--_a)) 0%,
    rgb(var(--brand-scrim) / var(--_a)) var(--_h),
    rgb(var(--brand-scrim) / calc(var(--_a) * 0.8)) calc(var(--_h) + (100% - var(--_h)) * 0.14),
    rgb(var(--brand-scrim) / calc(var(--_a) * 0.55)) calc(var(--_h) + (100% - var(--_h)) * 0.32),
    rgb(var(--brand-scrim) / calc(var(--_a) * 0.32)) calc(var(--_h) + (100% - var(--_h)) * 0.52),
    rgb(var(--brand-scrim) / calc(var(--_a) * 0.14)) calc(var(--_h) + (100% - var(--_h)) * 0.74),
    rgb(var(--brand-scrim) / 0) 100%);
}
.text-scrim--bleed { --scrim-bleed: calc(50% - 50vw); }
.text-scrim--left::before {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(max(0px, (100vw - var(--page-max)) / 2) + 920px), rgb(0 0 0 / 0.3) 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(max(0px, (100vw - var(--page-max)) / 2) + 920px), rgb(0 0 0 / 0.3) 100%);
}
@media (max-width: 767px) {
  .text-scrim { --scrim-a: min(0.78, calc(var(--scrim-text) + 0.1)); }
}

/* --- Accessibility ------------------------------------------------------ */
.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;
}
.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: calc(var(--z-menu) + 1);
  padding: 12px 18px;
  background: var(--brand-ink);
  color: var(--brand-paper);
  font-size: var(--fs-small);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur-ui) var(--ease-ui);
}
.skip-link:focus { transform: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* --- Reveal on enter (motion-interaction.md pattern 1) -------------------
   Content is visible by default. Only when JS runs AND the visitor has not
   asked for reduced motion does it start hidden and rise in once. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal]:not(.is-in) {
    opacity: 0;
    transform: translateY(var(--rise));
  }
  .js [data-reveal] {
    transition:
      opacity var(--dur-reveal) var(--ease-out-long),
      transform var(--dur-reveal) var(--ease-out-long);
    transition-delay: calc(var(--reveal-i, 0) * 80ms);
  }
}

/* Reduced motion: no transforms, no zoom, instant swaps. Written with the
   motion, not after it. */
@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;
  }
  .zoom:hover img, .zoom:focus-within img { transform: none; }
}
