@font-face {
  font-family: "Barlow Condensed";
  src: url("./assets/fonts/barlow-condensed-extrabold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --rose: #ef9fc4;
  --raspberry: #de1d60;
  --cream: #fbf3e8;
  --plum: #782046;
  --sand: #f6cb96;
  --edge: clamp(20px, 3vw, 64px);
  --logo-size: clamp(104px, 12vw, 174px);
  --logo-top: max(25px, env(safe-area-inset-top));
  font-family: Arial, Helvetica, sans-serif;
  color: var(--plum);
  background: var(--rose);
  font-synthesis: none;
  scrollbar-color: var(--plum) var(--rose);
  scrollbar-width: thin;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
button[hidden] { display: none; }
::selection { background: var(--plum); color: var(--cream); }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 8px; }

.intro { height: 100svh; }
.has-motion .intro { height: 280svh; }
.scene {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100svh;
  min-height: 360px;
  padding: max(25px, env(safe-area-inset-top)) var(--edge) max(22px, env(safe-area-inset-bottom));
  overflow: clip;
  background: var(--cream);
}

.masthead, .scene__footer { display: flex; align-items: center; justify-content: space-between; }
.masthead { position: relative; z-index: 1; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.rally { font-weight: 800; }
.site-logo-slot {
  display: block;
  flex: none;
  width: var(--logo-size);
  aspect-ratio: 800 / 680;
}
.site-logo {
  position: fixed;
  z-index: 20;
  top: var(--logo-top);
  right: max(var(--edge), env(safe-area-inset-right));
  width: var(--logo-size);
  aspect-ratio: 800 / 680;
}
.site-logo__poster, .site-logo__model { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.site-logo__poster { object-fit: contain; }
.site-logo__model { opacity: 0; pointer-events: none; background: transparent; --poster-color: transparent; }
.site-logo.is-ready .site-logo__model { opacity: 1; pointer-events: auto; cursor: grab; }
.site-logo.is-ready .site-logo__model:active { cursor: grabbing; }
.site-logo__model:focus-visible { outline-offset: 2px; }
.site-logo.is-ready .site-logo__poster { visibility: hidden; }
.site-logo__model::part(default-progress-bar) { display: none; }
.site-logo__reset {
  position: absolute;
  right: 0;
  top: calc(100% - 8px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--plum);
  border-radius: 50%;
  color: var(--plum);
  background: var(--cream);
  cursor: pointer;
}
.site-logo__reset svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; }
.site-logo__reset:hover { color: var(--cream); background: var(--plum); }

/* Reserve the corner in the chapter headers that stay pinned to the screen. */
@media (min-width: 701px) {
  .route .route__header, .team .team__header, .car .car__header,
  .sponsors .sponsors__header, .album .album__header {
    padding-right: calc(var(--logo-size) + 24px);
  }
}
.album-viewer .album-viewer__header { padding-right: calc(var(--logo-size) + 20px); }
@media (max-width: 700px) {
  .route .route__header { align-items: flex-start; flex-direction: column; }
  .route .route__header p { text-align: left; }
  .team .team__header h2 { font-size: 15vw; }
  .car .car__header h2 { max-width: calc(100% - var(--logo-size) - 16px); font-size: 14vw; }
  .album .album__header { padding-top: 44px; }
  .donations { padding-top: calc(var(--logo-top) + var(--logo-size) + 10px); }
}

.wordmark {
  display: grid;
  grid-template-columns: 31fr 69fr;
  grid-template-rows: 1fr 1fr;
  column-gap: clamp(12px, 2.3vw, 44px);
  width: 100%;
  height: 100%;
  max-height: 72vw;
  align-self: center;
  margin: 0;
  padding: clamp(20px, 4vh, 52px) 0 clamp(22px, 4vh, 52px);
  color: var(--title-ink, var(--raspberry));
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: -.025em;
}

.word {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  line-height: 1;
  white-space: nowrap;
}
.word--4l { grid-row: 1 / 3; font-size: 51vw; }
.word--physio, .word--squad { font-size: 21vw; }
.word__outline, .word__fill {
  position: absolute;
  left: 0;
  top: 50%;
  display: flex;
  width: max-content;
  transform: translateY(-50%);
  transform-origin: left center;
}
.word__outline { color: transparent; -webkit-text-stroke: 1px var(--title-ink, var(--raspberry)); opacity: .26; }
.word__fill { overflow: clip; }
.letter { display: inline-block; }
.has-motion .letter { will-change: transform; }

.scene__footer { position: relative; z-index: 1; min-height: 44px; gap: 16px; font-size: 10px; letter-spacing: .06em; font-weight: 700; }
.signature { line-height: 1.4; }
.scroll-progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; background: transparent; }
.scroll-progress span { display: block; height: 100%; background: var(--raspberry); transform: scaleX(0); transform-origin: left; }

:root:not(.has-js) .wordmark { display: flex; flex-direction: column; justify-content: space-around; align-items: center; }
:root:not(.has-js) .word { font-size: min(28vw, 26svh); }
:root:not(.has-js) .word__outline { display: none; }
:root:not(.has-js) .word__fill { position: static; transform: none; }

@media (max-width: 700px) {
  :root { --logo-size: 104px; --logo-top: max(20px, env(safe-area-inset-top)); }
  .scene { min-height: 480px; padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .masthead { font-size: 10px; }
  .wordmark { grid-template-columns: 1fr; grid-template-rows: 1.25fr 1fr 1fr; gap: 0; max-height: none; padding: 22px 0 28px; }
  .word--4l { grid-row: auto; font-size: 52vw; }
  .word--physio, .word--squad { font-size: 30vw; }
  .word--4l .word__outline, .word--4l .word__fill { left: 50%; transform: translate(-50%, -50%); transform-origin: center; }
  .scene__footer { align-items: center; font-size: 8px; letter-spacing: .03em; }
  .signature { max-width: 110px; }
}

@media (max-height: 500px) and (min-width: 701px) {
  :root { --logo-size: 92px; --logo-top: max(15px, env(safe-area-inset-top)); }
  .scene { padding-top: 15px; padding-bottom: 12px; min-height: 300px; }
  .wordmark { padding-block: 10px; }
  .masthead { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .has-motion .intro { height: 100svh; }
  .has-motion .letter { will-change: auto; }
}

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

.project {
  --project-gap: clamp(40px, 7vw, 120px);
  position: relative;
  padding: clamp(72px, 9vw, 140px) var(--edge) 0;
  background: var(--cream);
  color: var(--plum);
  scroll-margin-top: 0;
}
.project__heading, .project-story { max-width: 1500px; margin-inline: auto; }
.project__heading { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: var(--project-gap); padding-bottom: 42px; border-bottom: 1px solid color-mix(in srgb, var(--plum) 30%, transparent); }
.project h2, .project h3 { font-family: "Barlow Condensed", sans-serif; font-weight: 800; letter-spacing: -.025em; }
.project h2 { margin: 0; font-size: clamp(3.5rem, 7.2vw, 6rem); line-height: .95; }
.project h2 span { color: var(--raspberry); }
.project__heading > p { max-width: 35ch; margin: 0; font-size: clamp(18px, 1.65vw, 25px); line-height: 1.45; }
.project-story { padding-bottom: 40px; }
.project-chapter { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: var(--project-gap); min-height: 62svh; padding: 80px 0; scroll-margin-top: 6vh; }
.project-chapter + .project-chapter { border-top: 1px solid color-mix(in srgb, var(--plum) 30%, transparent); }
.project-chapter__copy { padding-right: clamp(0px, 2vw, 32px); }
.project h3 { margin: 0; font-size: clamp(4rem, 9.4vw, 9.2rem); line-height: .94; color: var(--plum); }
.project-word { position: relative; display: block; width: fit-content; }
.project-word::after { content: attr(data-word); position: absolute; inset: 0; color: var(--raspberry); clip-path: inset(0 var(--reveal-right, 0%) 0 0); }
.project-motion .project-chapter__copy { transform: translateY(var(--copy-shift, 0px)); }
.project-chapter__copy > p { max-width: 47ch; margin: 0 0 20px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.65; text-wrap: pretty; }
.project-chapter__copy > :last-child { margin-bottom: 0; }
.project-chapter__copy strong { font-weight: 700; }
.project-link { display: inline-flex; align-items: center; gap: 16px; min-height: 44px; max-width: 100%; margin-top: 8px; color: inherit; font-size: 14px; line-height: 1.5; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.project-link svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform 200ms ease; }
.project-link:hover svg { transform: translate(3px, -3px); }
.project-link:hover { text-decoration-thickness: 2px; }

@media (max-width: 900px) {
  .project { --project-gap: 28px; }
  .project__heading { grid-template-columns: 1fr; gap: 24px; padding-bottom: 32px; }
  .project__heading > p { max-width: 40ch; }
  .project-chapter { min-height: auto; padding: 60px 0; gap: 30px; }
  .project-chapter__copy { padding-right: 0; }
  .project-chapter__copy > p { font-size: 16px; }
  .project h3 { font-size: 8.9vw; }
}

@media (max-width: 600px) {
  .project-story { padding-bottom: 12px; }
  .project-chapter { grid-template-columns: 1fr; gap: 30px; padding: 44px 0 52px; }
  .project h3 { font-size: clamp(3.5rem, 21.5vw, 7.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .project-link svg { transition: none; }
  .project-chapter__copy { transform: none !important; }
  .project-word::after { clip-path: none; }
}
