/* Colorado Freedom Runners
   Palette: the sky over Boulder just before a Memorial Day start.
   Motif: the race bib. */

:root {
  --ink: #131a33;        /* pre-dawn sky */
  --ink-deep: #0b1022;   /* ridge silhouette */
  --paper: #f7f2e8;      /* bib stock */
  --sand: #efe7d6;
  --ember: #e9502b;      /* first light */
  --ember-dark: #b23815; /* ember for small text on paper */
  --gold: #f6b53c;
  --text: #1d2238;
  --muted: #565b74;
  --line: rgba(19, 26, 51, 0.18);
  --line-light: rgba(247, 242, 232, 0.22);

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4rem, 9vw, 7.5rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: min(100%, 72rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { width: min(100%, 46rem); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ───────── Type ───────── */

h1, h2 {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.94;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(3.25rem, 1.6rem + 7.4vw, 7rem); }
h2 { font-size: clamp(2.4rem, 1.5rem + 3.8vw, 4.25rem); margin-bottom: 0.55em; }

h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 1.1rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-dark);
}
.eyebrow--light { color: var(--gold); }

.lede { font-size: 1.2em; max-width: 44rem; }

.text-link {
  font-weight: 600;
  color: var(--ember-dark);
}
.text-link::after { content: " →"; }

/* ───────── Buttons ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8em 1.5em 0.72em;
  border: 2px solid transparent;
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--gold { background: var(--gold); color: var(--ink-deep); }
.btn--gold:hover { background: #ffc85a; }

.btn--ghost { border-color: var(--line-light); color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); }

.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--ink-deep); }

.btn--outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }

/* ───────── Header ───────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 34, 0.92);
  backdrop-filter: blur(8px);
  color: var(--paper);
  border-bottom: 1px solid var(--line-light);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--gold); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--gold); }
.site-nav__cta {
  padding: 0.5em 0.9em 0.42em;
  border-radius: 4px;
  background: var(--gold);
  color: var(--ink-deep);
  font-weight: 800;
  white-space: nowrap;
}
.site-nav a.site-nav__cta:hover { background: #ffc85a; color: var(--ink-deep); }

/* ───────── Hero ───────── */

.hero {
  position: relative;
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(
      180deg,
      var(--ink-deep) 0%,
      var(--ink) 38%,
      #2a2d59 64%,
      #6a3c5a 80%,
      #cf5a39 92%,
      #f6a24a 100%
    );
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-top: clamp(3.5rem, 8vw, 6.5rem);
  padding-bottom: clamp(11rem, 20vw, 16rem);
}
.hero h1 { margin-bottom: 0.3em; }
.hero__lede {
  max-width: 36rem;
  font-size: 1.15em;
  color: rgba(247, 242, 232, 0.9);
}
.hero__lede a { color: var(--paper); }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.hero__ridge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  width: 100%;
  height: clamp(110px, 16vw, 200px);
}
.ridge-far { fill: #1b1d3f; opacity: 0.85; }
.ridge-near { fill: var(--ink-deep); }

/* ───────── Race bib ───────── */

.bib {
  position: relative;
  justify-self: center;
  width: min(100%, 23rem);
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  text-align: center;
  transform: rotate(-2.5deg);
  box-shadow: 0 34px 60px -24px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
/* Safety-pin holes */
.bib::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18px 18px, var(--ink-deep) 0 5px, transparent 6px),
    radial-gradient(circle at calc(100% - 18px) 18px, var(--ink-deep) 0 5px, transparent 6px),
    radial-gradient(circle at 18px calc(100% - 18px), var(--ink-deep) 0 5px, transparent 6px),
    radial-gradient(circle at calc(100% - 18px) calc(100% - 18px), var(--ink-deep) 0 5px, transparent 6px);
}
.bib__band {
  padding: 0.85rem 2.2rem 0.7rem;
  background: var(--ember);
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(0.95rem, 0.6rem + 0.9vw, 1.2rem);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--ink-deep);
}
.bib__number {
  padding-top: 0.12em;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(6.5rem, 4rem + 9vw, 10.5rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.bib__caption {
  padding: 0.2rem 1rem 1.2rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember-dark);
}
.bib__strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 2.6rem 0.8rem;
  border-top: 2px dashed var(--line);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ───────── Sections ───────── */

.section { padding-block: var(--section); }
.section--sand { background: var(--sand); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink p { color: rgba(247, 242, 232, 0.88); font-size: 1.12em; }
.section--ink .eyebrow { color: var(--gold); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 3px solid var(--ink);
}
.work-list li {
  padding: 1.4rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}
.work-list h3 { margin-bottom: 0.35rem; }
.work-list p { color: var(--muted); }

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.75rem);
  background: var(--gold);
  color: var(--ink-deep);
  border-radius: 6px;
}
.callout p {
  flex: 1 1 24rem;
  margin: 0;
  font-size: 1.2em;
  line-height: 1.4;
}

/* ───────── Course strip ───────── */

.course { margin: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem); }
.course__line {
  position: relative;
  height: 22px;
  /* A tick at every kilometre */
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 10%) left / calc(100% - 2px) 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) right / 2px 100% no-repeat;
}
.course__line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--ink) 0%, var(--ember) 100%);
}
.course__line::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 5px rgba(233, 80, 43, 0.25);
}
.course__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem clamp(1.5rem, 3vw, 3rem);
  margin: 0;
}
.facts dt {
  margin-bottom: 0.3rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-dark);
}
.facts dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.facts dd small {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

/* ───────── Steps ───────── */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
}
.steps li {
  counter-increment: step;
  padding-top: 1.1rem;
  border-top: 3px solid var(--ink);
}
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: 4.5rem;
  line-height: 0.9;
  color: var(--ember);
}
.steps h3 { margin-bottom: 0.5rem; }
.steps p { color: var(--muted); }
.steps p a { color: var(--text); }
.steps__action { margin-top: 1rem; }

/* ───────── Ways to help ───────── */

.ways {
  list-style: none;
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 0;
  padding: 0;
  border-top: 3px solid var(--ink);
}
.ways li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.ways h3 { margin-bottom: 0.35rem; }
.ways p { max-width: 38rem; color: var(--muted); }
.ways .btn { flex: none; min-width: 11.5rem; }

/* ───────── FAQ ───────── */

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 3px solid var(--ink); }
summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.25rem 0;
  font-weight: 600;
  font-size: 1.12em;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  flex: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 0.8;
  color: var(--ember-dark);
}
details[open] summary::after { content: "–"; }
details > p { padding-bottom: 1.4rem; color: var(--muted); max-width: 40rem; }
details > p a { color: var(--text); }

/* ───────── Footer ───────── */

.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  background: var(--ink-deep);
  color: rgba(247, 242, 232, 0.8);
  font-size: 1rem;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 2.5rem 4rem;
  flex-wrap: wrap;
}
.site-footer__inner > div { max-width: 28rem; }
.wordmark--footer { margin-bottom: 0.75rem; font-size: 1.6rem; color: var(--paper); white-space: normal; }
.site-footer__links { list-style: none; margin: 0; padding: 0; }
.site-footer__links li + li { margin-top: 0.5rem; }
.site-footer__links a:hover { color: var(--gold); }
.site-footer__legal {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-light);
  font-size: 0.9rem;
  color: rgba(247, 242, 232, 0.6);
}

/* ───────── Small screens ───────── */

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .bib { justify-self: start; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li::before { font-size: 3.5rem; }
}

@media (max-width: 720px) {
  .site-nav a:not(.site-nav__cta) { display: none; }
  .ways li { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .site-header .wordmark { font-size: 1.1rem; letter-spacing: 0.04em; }
  .site-nav__cta { font-size: 0.95rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .bib__strip { padding-inline: 2.2rem; font-size: 0.85rem; }
}

/* Very narrow phones: let the name wrap rather than push the button off-screen */
@media (max-width: 380px) {
  .site-header .wordmark { white-space: normal; line-height: 1.05; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
