/* Atlantic Race Credits and Licences pages (credits.html, licenses.html), 2026-10-25, linked
   after race.css and menu-polish.css. Uses only menu-polish's --mp-* tokens, so both pages
   follow the Dark (Storm) and Light (Coast Daylight, html[data-look-theme=sand]) themes.
   - Credits, html[data-cr-view]:
       roll:  a centred film-credits column on the bare backdrop, a title card, wide gaps between
              sections, the screen's top and bottom edges fading out; credits.js scrolls it.
       plain: the same sections as the menus' glass cards, two columns on wide screens.
     The transport bar (Play/Pause, Roll/Plain, Licences) is fixed at the bottom.
   - Licences: a contents strip, then one card per licence with its full text.
   - Accessibility: html[data-motion=reduce] stops animations; html[data-text=large] enlarges
     the type (the same switches as Options and Profile; menu-page.js sets them). */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.topbar { position: relative; z-index: 3; }

/* ---------------- credits: shared ---------------- */
.cr-main { width: min(1080px, 100%); padding-bottom: 140px; }
.cr-block { scroll-margin: 24px 0 120px; }
.cr-block:focus-visible { outline-offset: 6px; }
.cr-kicker { margin: 0 0 4px; color: var(--mp-ink-2); font-size: .72rem; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; }
.cr-list { display: grid; gap: 14px; margin: 0; }
.cr-item { display: grid; align-content: start; gap: 2px; min-width: 0; }
.cr-item dt { color: var(--mp-ink-2); font-size: .74rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.cr-item dd { margin: 0; display: grid; gap: 4px; min-width: 0; }
.cr-item b { color: var(--mp-title); font-size: 1.12rem; font-weight: 800; letter-spacing: .02em; }
.cr-item small, .cr-text, .cr-foot { color: var(--mp-ink-2); font-weight: 500; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.cr-text { margin: 0 0 10px; color: var(--mp-ink); font-size: 1rem; }
.cr-foot { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--mp-stroke); font-size: .84rem; }
.cr-more { margin: 14px 0 0; }
.cr-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: .82rem; text-decoration: none; }

/* the title card */
.cr-title { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 8px 0 12px; }
.cr-logo { width: min(520px, 86%); height: auto; filter: drop-shadow(0 10px 26px rgb(0 0 0 / .35)); }
html[data-look-theme='sand'] .cr-logo { filter: drop-shadow(0 10px 22px rgb(60 48 20 / .22)); }
.cr-name {
  margin: 4px 0 0; color: var(--mp-title); font-weight: 800; font-size: clamp(2.2rem, 7vw, 4.4rem); line-height: 1;
  letter-spacing: .06em; text-transform: uppercase; transform: skewX(-10deg);
  text-shadow: 0 2px 22px color-mix(in srgb, var(--accent) 30%, transparent);
}
html[data-look-theme='sand'] .cr-name { text-shadow: none; }
/* the home page's cream subtitle banner (index.html .tagline) */
.cr-sub {
  margin: 4px 0 0; max-width: 100%; padding: .5em 1.6em .45em; border-radius: 999px;
  background: rgb(241 228 200 / .95); border: 2px solid #3b2416; box-shadow: 0 0 0 3px rgb(241 228 200 / .35), 0 6px 18px rgb(0 0 0 / .25);
  color: #3b2416; font: 600 clamp(.9rem, 2.4vw, 1.3rem)/1.1 Barlow, system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase;
}
.cr-creator { margin: 10px 0 0; color: var(--mp-gold-ink); font-size: .95rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }

/* the closing card */
.cr-end { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 24px 0; }
.cr-end-big { margin: 0; color: var(--mp-title); font-weight: 800; font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: .08em; text-transform: uppercase; transform: skewX(-10deg); }
.cr-end-big::after { content: ''; display: block; width: 60%; height: 4px; margin: 12px auto 0; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.cr-end-sub { margin: 0; color: var(--mp-ink-2); font-weight: 500; }

/* ---------------- credits: plain view ---------------- */
html[data-cr-view='plain'] .cr-main { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
html[data-cr-view='plain'] .cr-title, html[data-cr-view='plain'] .cr-end,
html[data-cr-view='plain'] #cr-places, html[data-cr-view='plain'] #cr-built { grid-column: 1 / -1; }
html[data-cr-view='plain'] .cr-places { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
html[data-cr-view='plain'] #cr-built .cr-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
html[data-cr-view='plain'] .cr-title { padding: 12px 0 4px; }
html[data-cr-view='plain'] .cr-logo { width: min(400px, 80%); }

/* ---------------- credits: roll view ---------------- */
html[data-cr-view='roll'] .cr-main { width: min(720px, 100%); gap: clamp(80px, 18vh, 170px); padding-top: 10vh; padding-bottom: 60vh; text-align: center; }
html[data-cr-view='roll'] .cr-block.card { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; animation: none; }
html[data-cr-view='roll'] .cr-block.card::before { display: none; }
html[data-cr-view='roll'] .card h2 { justify-content: center; margin-bottom: 26px; font-size: .9rem; }
html[data-cr-view='roll'] .card h2::before { display: none; }
html[data-cr-view='roll'] .cr-kicker { margin-bottom: 8px; }
html[data-cr-view='roll'] .cr-list { gap: 30px; justify-items: center; }
html[data-cr-view='roll'] .cr-item { justify-items: center; max-width: 560px; }
html[data-cr-view='roll'] .cr-item b { font-size: clamp(1.3rem, 3.4vw, 1.75rem); }
html[data-cr-view='roll'] .cr-item small { max-width: 52ch; }
html[data-cr-view='roll'] .cr-foot { border-top: 0; max-width: 56ch; margin: 30px auto 0; font-style: italic; }
html[data-cr-view='roll'] .cr-text { max-width: 52ch; margin-inline: auto; font-size: 1.08rem; }
html[data-cr-view='roll'] .cr-title { min-height: 62vh; align-content: center; }
html[data-cr-view='roll'] .cr-end { min-height: 40vh; align-content: center; }
/* the screen's top and bottom edges fade, like a film roll (only while in roll view) */
.cr-fade { position: fixed; left: 0; right: 0; z-index: 2; pointer-events: none; display: none; }
html[data-cr-view='roll'] .cr-fade { display: block; }
.cr-fade-top { top: 0; height: 12vh; background: linear-gradient(180deg, var(--mp-bg-top), transparent); opacity: .9; }
.cr-fade-bot { bottom: 0; height: 22vh; background: linear-gradient(0deg, var(--mp-bg-bot) 30%, transparent); }

/* ---------------- the transport bar ---------------- */
.cr-bar {
  position: fixed; z-index: 10; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px); padding: 6px; border-radius: 16px;
  background: var(--mp-glass-strong); border: 1px solid var(--mp-stroke); box-shadow: var(--mp-hi), var(--mp-shadow-sm);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
.cr-play, .cr-lic-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 11px;
  border: 1px solid var(--mp-stroke-2); background: var(--mp-well); color: var(--mp-gold-ink); cursor: pointer; text-decoration: none;
  font: 800 .8rem Barlow, system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.cr-play:hover:not(:disabled), .cr-lic-link:hover { border-color: var(--mp-gold-ink); }
.cr-play:active:not(:disabled), .cr-lic-link:active { transform: scale(.97); }
.cr-play:disabled { opacity: .45; cursor: default; }
/* a play triangle, two pause bars while rolling */
.cr-play-icon { position: relative; width: 12px; height: 12px; flex: none; }
.cr-play-icon::before { content: ''; position: absolute; inset: 0 0 0 2px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.cr-play[aria-pressed='true'] .cr-play-icon::before { inset: 0 1px; clip-path: none; background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.cr-views button { min-width: 64px; padding: 9px 10px; }
/* the hint floats just above the bar, so showing it never moves the buttons under the pointer */
.cr-hint {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 5px 12px; border-radius: 999px;
  background: var(--mp-glass-strong); border: 1px solid var(--mp-stroke); box-shadow: var(--mp-shadow-sm);
  text-align: center; color: var(--mp-ink-2); font-size: .74rem; font-weight: 600; letter-spacing: .04em; pointer-events: none;
}
.cr-hint:empty { display: none; }

/* ---------------- licences page ---------------- */
.lic-main { width: min(900px, 100%); }
.lic-toc ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lic-toc a { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--mp-stroke-2); background: var(--mp-well); color: var(--mp-ink); font-size: .84rem; text-decoration: none; }
.lic-toc a:hover { border-color: var(--accent); }
.lic-card { scroll-margin-top: 16px; }
.lic-for { margin: 0 0 6px; color: var(--mp-ink); font-weight: 700; }
.lic-for small { display: block; color: var(--mp-ink-2); font-weight: 500; font-size: .86rem; margin-top: 2px; }
.lic-note { margin: 10px 0 0; color: var(--mp-ink-2); font-weight: 500; font-size: .88rem; }
.lic-note a, .lic-for a { color: var(--mp-gold-ink); }
.lic-text {
  margin: 12px 0 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--mp-stroke); background: var(--mp-well);
  color: var(--mp-ink); font: 500 .8rem/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow-y: auto;
}
.lic-copy { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--mp-ink); font-size: .9rem; }

/* ---------------- phones ---------------- */
@media (max-width: 899px) {
  html[data-cr-view='plain'] .cr-main { grid-template-columns: minmax(0, 1fr); }
  html[data-cr-view='plain'] #cr-built .cr-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  html[data-cr-view='plain'] .cr-places { grid-template-columns: minmax(0, 1fr); }
  html[data-cr-view='roll'] .cr-main { gap: 84px; }
  html[data-cr-view='roll'] .cr-title { min-height: 54vh; }
  .cr-bar { gap: 6px; padding: 5px; }
  .cr-play, .cr-lic-link { padding: 8px 10px; letter-spacing: .08em; }
  .cr-views button { min-width: 56px; padding: 9px 8px; }
  .lic-text { padding: 12px; font-size: .74rem; }
}

/* ---------------- accessibility ---------------- */
html[data-motion='reduce'] *, html[data-motion='reduce'] *::before, html[data-motion='reduce'] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-text='large'] { font-size: 112.5%; }
html[data-text='large'] body { font-size: 18px; }
