/* Cōrra website. The Race Bib world from the app (DESIGN.md): race-day grey
   page, Tyvek bibs with a hairline edge, bib black for action, a coloured
   band only for a cause, Big Shoulders for the number that matters, system
   sans for everything you read. Light only, flat paper, no shadows. */

@font-face { font-family: 'Big Shoulders'; src: url('/assets/fonts/BigShouldersDisplay_900Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Big Shoulders'; src: url('/assets/fonts/BigShouldersDisplay_800ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --page: #E3E4E7;
  --bib: #FBFBF8;
  --well: #E6E7E4;
  --ink: #0E0E0F;
  --ink-raised: #2B2C2F;
  --ink-2: #3F4248;
  --ink-3: #55585E;
  --line: rgba(14, 14, 15, 0.10);
  --line-strong: rgba(14, 14, 15, 0.18);
  --pin: #D3D6DA;
  --pin-rim: #868A91;
  --cause: #1F5FD1;
  --cause-tint: rgba(31, 95, 209, 0.10);
  --ok: #157238;
  --error: #B42D22;
  --numerals: 'Big Shoulders', 'Arial Narrow', sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --gutter: 16px;
  --max: 1080px;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.55 var(--sans); caret-color: var(--ink); }
::selection { background: var(--ink); color: var(--bib); }
img { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink-raised); }
/* Focus is black: blue belongs to causes (DESIGN.md, The Colour Has a Job) */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 38em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Header ─── */
.site-head { display: flex; align-items: center; gap: 24px; min-height: 72px; flex-wrap: wrap; padding: 8px 0; }
.wordmark { font-family: var(--numerals); font-weight: 900; font-size: 28px; letter-spacing: 2px; text-decoration: none; line-height: 1; }
.site-nav { display: flex; gap: 4px 22px; flex-wrap: wrap; font-size: 15px; font-weight: 600; }
.site-nav a { text-decoration: none; color: var(--ink-2); padding: 10px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }
.site-head .btn { margin-left: auto; min-height: 44px; padding: 0 18px; font-size: 15px; }
.site-nav .short { display: none; }
@media (max-width: 719px) {
  .site-nav { order: 3; width: 100%; gap: 0 20px; margin-top: -6px; }
  .site-nav .long { display: none; }
  .site-nav .short { display: inline; }
}

/* ─── Bib ─── */
.bib { background: var(--bib); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; position: relative; }
.band { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 46px; color: #fff; background: var(--cause); }
.band.plan { background: var(--ink); }
.band .tile { width: 28px; height: 28px; border-radius: 6px; background: #fff; display: grid; place-items: center; flex-shrink: 0; }
.band .tile svg { width: 18px; height: 18px; }
.band .title { font-size: 14px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band .detail { margin-left: auto; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.88); white-space: nowrap; }
.pin { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--pin); box-shadow: inset 0 0 0 2px var(--pin-rim); }
.face { position: relative; padding: 28px 20px 24px; }
.face > .pin { top: 12px; }
.face > .pin.l { left: 12px; } .face > .pin.r { right: 12px; }
.perf { position: relative; height: 2px; margin: 0 10px; border-top: 2px dashed var(--line-strong); }
.perf::before, .perf::after { content: ''; position: absolute; top: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--page); }
.perf::before { left: -18px; } .perf::after { right: -18px; }
.tear { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; padding: 14px 20px 18px; }
.tear .value { display: block; font-family: var(--numerals); font-weight: 800; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tear .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.numeral { font-family: var(--numerals); font-weight: 900; line-height: 0.92; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 0.08em; }
.numeral .unit { font-weight: 800; font-size: 0.3em; letter-spacing: 0; }

/* ─── Type ─── */
.display { font-family: var(--numerals); font-weight: 900; text-transform: uppercase; line-height: 0.92; letter-spacing: -0.01em; font-size: clamp(52px, 8.4vw, 96px); }
.h2 { font-family: var(--numerals); font-weight: 900; text-transform: uppercase; line-height: 0.95; font-size: clamp(40px, 5.6vw, 64px); }
.h3 { font-size: 20px; font-weight: 700; line-height: 1.25; }
.lead { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; line-height: 1.45; color: var(--ink-2); }

/* ─── Buttons and fields ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 12px; border: 0; font: 600 17px/1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color 160ms ease-out, opacity 160ms ease-out; }
.btn.primary { background: var(--ink); color: var(--bib); }
.btn.primary:hover { background: var(--ink-raised); color: var(--bib); }
.btn.on-dark { background: var(--bib); color: var(--ink); }
.btn.on-dark:hover { background: #fff; }
.btn.secondary { background: var(--bib); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=email], input[type=text], select, textarea {
  width: 100%; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--well); color: var(--ink); font: 17px/1.3 var(--sans); appearance: none; -webkit-appearance: none;
}
textarea { min-height: 128px; padding: 14px; resize: vertical; line-height: 1.5; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233F4248' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--ink); outline-offset: 1px; background-color: #fff; }
[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
[aria-invalid="true"]:focus { outline-color: var(--error); }
.form { display: grid; gap: 12px; }
.form .row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .form .row.two { grid-template-columns: 1fr 1fr; } }
.form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 15px; font-weight: 600; min-height: 0; }
.form-status.ok { color: var(--ok); }
.form-status.error { color: var(--error); }
.form.sent .fields { display: none; }
.sent-note { display: none; padding: 16px; border-radius: 10px; background: var(--bib); border: 1px solid var(--line-strong); }
.form.sent .sent-note.shown { display: block; }
.sent-note strong { display: block; font-size: 17px; margin-bottom: 2px; }
.dark .sent-note { color: var(--ink); }

/* ─── Sections ─── */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line-strong); }
.section-head { display: grid; gap: 12px; margin-bottom: 36px; }
.dark { background: var(--ink); color: var(--bib); }
.dark .lead, .dark .muted, .dark .small { color: rgba(251, 251, 248, 0.78); }
.dark input, .dark select { background-color: var(--bib); border-color: transparent; }
.dark .field > span { color: rgba(251, 251, 248, 0.78); }
.dark .btn.primary { background: var(--bib); color: var(--ink); }
.dark .btn.primary:hover { background: #fff; }

/* Lists printed like a tear-off strip: a value or term, then what it means */
.facts { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.facts li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--line-strong); }
/* The section rule below closes the list; no second line */
.facts li:last-child { border-bottom: 0; }
@media (min-width: 720px) { .facts li { grid-template-columns: minmax(0, 18em) minmax(0, 1fr); gap: 32px; } }
.facts b { font-size: 17px; }
.facts span { color: var(--ink-2); }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px; padding: 18px 0; font-size: 18px; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; margin-left: auto; flex-shrink: 0; width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E0E0F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; transition: transform 200ms ease-out; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 20px; max-width: 64ch; color: var(--ink-2); display: grid; gap: 10px; }

/* Long-form pages (privacy, terms) */
.prose { max-width: 36em; padding: 24px 0 64px; }
.prose h1 { font-size: 40px; letter-spacing: -0.5px; line-height: 1.1; margin-bottom: 6px; }
.prose h2 { font-size: 21px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--ink); margin: 0 0 12px; }
.prose ul { padding-left: 1.2em; margin: 0 0 12px; }
.prose .updated { color: var(--ink-2); margin-bottom: 8px; }

/* ─── Footer ─── */
.site-foot { padding: 40px 0 56px; display: grid; gap: 16px; font-size: 14px; color: var(--ink-2); border-top: 1px solid var(--line-strong); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-foot a { color: var(--ink-2); padding: 6px 0; display: inline-block; }
.site-foot a:hover { color: var(--ink); }

/* A section that runs edge to edge inside the centred page */
body { overflow-x: clip; }
.bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.btn.block { width: 100%; }
.notice { background: var(--bib); border: 1px solid var(--line-strong); border-radius: 10px; padding: 16px; }
.notice h2 { font-size: 18px; margin: 0 0 4px; }
.notice p { color: var(--ink-2); }
[hidden] { display: none !important; }
/* Facts beside a heading stack their term over the explanation */
.split .facts li { grid-template-columns: minmax(0, 1fr); gap: 4px; }

/* ─── Charity carousel ─── */
.charities { padding: 56px 0 72px; border-top: 1px solid var(--line-strong); }
.charities .head { display: flex; align-items: end; gap: 16px; margin-bottom: 24px; }
.charities .head > .intro { display: grid; gap: 10px; flex: 1; min-width: 0; }
/* Pause/play is always there (the row moves by itself); the arrows join it on wider screens */
.charities .head > .arrows { display: flex; flex: none; gap: 8px; }
.charities .arrows .nav { display: none; }
@media (min-width: 720px) { .charities .arrows .nav { display: grid; } }
.round .i-play { display: none; }
.round.stopped .i-play { display: contents; }
.round.stopped .i-pause { display: none; }
.round .i-pause, .round .i-play { line-height: 0; }
.round { width: 48px; height: 48px; border-radius: 24px; border: 1px solid var(--line-strong); background: var(--bib); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background-color 120ms ease-out, opacity 120ms ease-out; }
.round:hover { background: #fff; }
.round[disabled] { opacity: 0.35; cursor: default; background: var(--bib); }
.round svg { width: 18px; height: 18px; }
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding: 4px 2px 18px; margin: 0 -2px; list-style: none; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 3px; }
.rail li { flex: 0 0 min(300px, 82%); scroll-snap-align: start; display: flex; }
.rail .bib { display: flex; flex-direction: column; width: 100%; }
.rail .band { min-height: 52px; }
.rail .band .title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.25; }
.rail .band .tile img { width: 24px; height: 24px; object-fit: contain; }
.rail .face { flex: 1; display: grid; align-content: space-between; gap: 16px; padding: 24px 18px 18px; }
.rail .face p { color: var(--ink-2); font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rail .face a { font-size: 15px; font-weight: 600; justify-self: start; }
.charities .note { margin-top: 12px; }
.charities + .section { border-top: 1px solid var(--line-strong); }
