/* Fonts are self-hosted, so the site doesn't depend on Google Fonts. */
@font-face { font-family: 'Shrikhand'; src: url('fonts/shrikhand-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-display: swap; }

:root {
  --koa: #3B2314;
  --koa-soft: #5A3A24;
  --wood: #7A3E1D;
  --wood-light: #A86E38;
  --rust: #B5432A;
  --rust-dark: #8F3220;
  --gold: #EBB54A;
  --lagoon: #2F6F6B;
  --lagoon-dark: #24524F;
  --paper: #FFFFFF;
  --cream: #FBF6EA;
  --sand: #F3E4C4;
  --display: 'Shrikhand', Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 62ch;
  --zigzag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='28' viewBox='0 0 40 28'%3E%3Crect width='40' height='28' fill='%233B2314'/%3E%3Cpath d='M0 20 L10 8 L20 20 L30 8 L40 20' fill='none' stroke='%23EBB54A' stroke-width='4' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--koa);
  background: var(--paper);
}
img { max-width: 100%; display: block; }
a { color: var(--rust); text-underline-offset: 0.15em; }
a:hover { color: var(--rust-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 30;
  background: var(--gold); color: var(--koa);
  padding: 0.5rem 1rem; border-radius: 6px; font-weight: 700;
}
.skip:focus { top: 1rem; }

.zigzag { height: 28px; background: var(--zigzag) repeat-x center / 40px 28px; }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
}
.site-header.is-solid { position: static; background: var(--koa); }
.logo {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--rust-dark);
}
.logo:hover { color: var(--paper); }
.site-nav { display: flex; gap: 0.4rem; }
.site-nav a {
  color: var(--paper);
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 2px solid transparent;
}
.site-nav a:hover { border-color: rgba(255, 255, 255, 0.6); color: var(--paper); }
.site-nav a[aria-current="page"] { background: var(--gold); color: var(--koa); }
.site-nav a.shop-link { border-color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; align-items: end;
  overflow: hidden;
  background: radial-gradient(120% 90% at 70% 110%, #E8813A 0%, #B5432A 35%, #5A2416 70%, #2A160C 100%);
  color: var(--paper);
}
.hero-videos { position: absolute; inset: 0; }
.hero-videos video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.2s ease;
}
.hero-videos video.is-on { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(40, 22, 12, 0.9) 0%, rgba(40, 22, 12, 0.2) 55%, rgba(40, 22, 12, 0.5) 100%);
}
.hero-inner {
  position: relative; z-index: 2; width: 100%;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 2.5rem 3rem;
  padding: 8rem clamp(1rem, 4vw, 3rem) clamp(2.5rem, 7vw, 5rem);
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.4rem, 10.5vw, 9rem);
  line-height: 0.92;
  color: var(--gold);
  -webkit-text-stroke: 0.07em var(--cream);
  paint-order: stroke fill;
  text-shadow: 0.06em 0.07em 0 var(--rust);
  transform: rotate(-4deg);
  transform-origin: left bottom;
}
.hero h1 span { display: block; }
.hero h1 span:nth-child(2) { margin-left: 0.35em; }
.hero h1 span:nth-child(3) { margin-left: 0.7em; }

/* Race bib */
.bib {
  position: relative;
  width: min(100%, 370px);
  background: var(--paper);
  color: var(--koa);
  border-radius: 12px;
  padding: 1.2rem 1.5rem 1.4rem;
  transform: rotate(3deg);
  transform-origin: 50% 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border-top: 14px solid var(--rust);
}
.bib-pins::before, .bib-pins::after, .bib-pins span::before, .bib-pins span::after {
  content: ""; position: absolute;
  width: 12px; height: 12px; border-radius: 50%;
  background: #D8D2C4; box-shadow: inset 0 0 0 3px #9A927F;
}
.bib-pins::before { left: 10px; top: 8px; }
.bib-pins::after { right: 10px; top: 8px; }
.bib-pins span::before { left: 10px; bottom: 10px; }
.bib-pins span::after { right: 10px; bottom: 10px; }
.bib-top { margin: 0 1.2rem; text-align: center; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.03em; color: var(--rust); }
.bib-number {
  margin: 0 0 0.3rem; text-align: center;
  font-weight: 900; font-size: 7.5rem; line-height: 1; letter-spacing: -0.05em;
  color: var(--koa);
}
.bib-details { margin: 0; display: grid; gap: 0.1rem; text-align: center; font-weight: 600; }
.bib-details dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bib-details dd { margin: 0; }
.bib-details .when { font-size: 1.15rem; font-weight: 800; }
.countdown {
  margin: 0.9rem 0 0; padding: 0.5rem 0.75rem;
  background: var(--sand); border-radius: 8px;
  text-align: center; font-weight: 800; font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.countdown:empty { display: none; }
.bib-actions { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0.6rem 1.3rem;
  border-radius: 999px; border: 3px solid var(--koa);
  background: var(--gold); color: var(--koa);
  font: 800 1rem var(--body); text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--koa);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:hover { color: var(--koa); transform: translateY(-2px); box-shadow: 0 6px 0 var(--koa); }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--koa); }
.button.secondary { background: var(--paper); }

.video-toggle {
  position: absolute; z-index: 3;
  right: clamp(1rem, 4vw, 3rem); top: 5.25rem;
  min-height: 40px; padding: 0.35rem 0.9rem;
  border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(40, 22, 12, 0.45); color: var(--paper);
  font: 700 0.9rem var(--body); cursor: pointer;
}
.video-toggle:hover { background: rgba(40, 22, 12, 0.75); }
.video-toggle[hidden] { display: none; }

/* One orchestrated entrance: title words drop in, then the bib swings on its pins. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 span { animation: drop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
  .hero h1 span:nth-child(2) { animation-delay: 0.12s; }
  .hero h1 span:nth-child(3) { animation-delay: 0.24s; }
  .bib { animation: swing 1.4s cubic-bezier(0.3, 1.5, 0.5, 1) 0.45s both; }
  .bib:hover { animation: sway 1.2s ease-in-out; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-0.6em) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes swing { 0% { opacity: 0; transform: rotate(-24deg) translateY(-40px); } 40% { opacity: 1; } 100% { transform: rotate(3deg); } }
@keyframes sway { 0%, 100% { transform: rotate(3deg); } 30% { transform: rotate(-2deg); } 65% { transform: rotate(5deg); } }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 4vw, 3rem); }
.section h2 {
  margin: 0 0 1rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.3rem, 5.5vw, 3.8rem); line-height: 1.02;
}
.section p { max-width: var(--measure); margin: 0 0 1rem; }

.race {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  max-width: 1200px; margin: 0 auto;
}
.race:has(.course-map[hidden]) { grid-template-columns: minmax(0, 1fr); }
.race h2 { color: var(--rust); }
.race-facts { margin: 1.5rem 0 0; display: grid; gap: 0.9rem; max-width: 40rem; }
.race-facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; }
.race-facts dt { font-weight: 800; color: var(--rust); }
.race-facts dd { margin: 0; font-weight: 600; }
.course-map {
  margin: 0; background: var(--sand);
  border: 3px solid var(--koa); border-radius: 14px; padding: 0.75rem;
  transform: rotate(1.5deg); box-shadow: 8px 8px 0 var(--gold);
}
.course-map img { border-radius: 8px; width: 100%; }
.course-map figcaption { font-size: 0.95rem; font-weight: 700; padding: 0.6rem 0.25rem 0.1rem; }

/* Mug shelf */
.shelf-section { background: var(--sand); text-align: center; overflow: hidden; }
.shelf-section h2 { color: var(--koa); }
.shelf-section > p { margin: 0 auto 2.5rem; }
.shelf {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: clamp(0.25rem, 1vw, 0.9rem);
  padding: 0 0.5rem;
  list-style: none;
  position: relative;
}
.shelf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 3.1rem; height: 22px;
  background: var(--wood); border: 3px solid var(--koa); border-radius: 6px;
  box-shadow: 0 10px 0 -3px var(--koa-soft);
  z-index: 0;
}
.shelf li { position: relative; z-index: 1; }
.shelf a {
  display: flex; flex-direction: column; align-items: center; gap: 1.6rem;
  text-decoration: none; color: var(--koa);
}
.shelf img {
  height: clamp(90px, 13vw, 190px); width: auto; max-width: 100%; object-fit: contain;
  transform-origin: 50% 100%;
  transition: transform 0.2s ease;
  margin-bottom: -1.35rem;
  position: relative; z-index: 2;
}
.shelf a:hover img, .shelf a:focus-visible img { transform: translateY(-10px) rotate(-4deg); }
@media (prefers-reduced-motion: reduce) { .shelf a:hover img, .shelf a:focus-visible img { transform: none; } }
.plaque {
  display: inline-block; padding: 0.15rem 0.6rem;
  background: var(--gold); border: 2px solid var(--koa); border-radius: 4px;
  font-weight: 800; font-size: clamp(0.75rem, 1.4vw, 1rem); font-variant-numeric: tabular-nums;
}
.shelf a.is-ghost img { opacity: 0.8; }

/* 2026 shirt */
.shirt { background: var(--lagoon); color: var(--paper); }
.shirt-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  max-width: 1200px; margin: 0 auto;
}
.shirt h2 { color: var(--gold); text-shadow: 3px 3px 0 var(--lagoon-dark); }
.shirt-art {
  background: var(--paper); border-radius: 22px;
  padding: clamp(1rem, 3vw, 2rem); border: 4px solid var(--koa);
  box-shadow: 12px 12px 0 var(--gold);
  transform: rotate(-1.5deg);
}
.shirt-art img { width: 100%; max-height: 660px; object-fit: contain; }

/* ---------- Gallery page ---------- */
.page-title {
  position: relative; overflow: hidden;
  background: var(--rust); color: var(--paper);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem);
}
.page-title h1 {
  margin: 0 0 0.6rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 5.4rem); line-height: 1;
  color: var(--gold); -webkit-text-stroke: 0.06em var(--cream); paint-order: stroke fill;
  text-shadow: 0.06em 0.07em 0 var(--rust-dark);
}
.page-title p { margin: 0; max-width: var(--measure); font-weight: 600; }
.page-title a { color: var(--gold); }
.year-jump { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.4rem; padding: 0; list-style: none; }
.year-jump a {
  display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); color: var(--paper);
  font-weight: 800; text-decoration: none; font-variant-numeric: tabular-nums;
}
.year-jump a:hover { background: var(--gold); color: var(--koa); }

.years { max-width: 1200px; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem); }
.year {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 2rem;
  padding: 2.5rem 0; border-top: 3px dashed rgba(59, 35, 20, 0.22);
  scroll-margin-top: 1rem;
}
.year:first-child { border-top: 0; }
.year-head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.year-head img { height: 96px; width: auto; }
.year h2 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: 2.6rem; line-height: 1; color: var(--rust);
}
.year-note { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--koa-soft); }
.photos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 1.6rem 1.2rem; margin: 0; padding: 0.5rem 0 0; list-style: none;
}
.photos button {
  display: block; width: 100%;
  background: var(--paper); border: 0; cursor: zoom-in;
  padding: 10px 10px 34px;
  box-shadow: 0 2px 0 rgba(59, 35, 20, 0.15), 0 10px 22px rgba(59, 35, 20, 0.18);
  transform: rotate(-1.5deg);
  transition: transform 0.2s ease;
}
.photos li:nth-child(2n) button { transform: rotate(1.8deg); }
.photos li:nth-child(3n) button { transform: rotate(-0.6deg); }
.photos button:hover, .photos button:focus-visible { transform: rotate(0) scale(1.03); }
.photos .frame { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .photos button { transition: none; } }
.empty {
  margin: 0; padding: 1.25rem 1.4rem;
  border: 3px dashed rgba(59, 35, 20, 0.28); border-radius: 12px;
  font-weight: 600; color: var(--koa-soft);
  align-self: start;
}

.lightbox { width: min(96vw, 1400px); max-height: 94vh; padding: 0; border: 0; background: transparent; color: var(--paper); }
.lightbox::backdrop { background: rgba(30, 16, 8, 0.93); }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 0.6rem; }
.lightbox img { max-height: 80vh; width: auto; border: 10px solid var(--paper); border-bottom-width: 18px; }
.lightbox figcaption { font-weight: 700; text-align: center; }
.lightbox-controls { display: flex; justify-content: center; gap: 0.6rem; margin-top: 0.9rem; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--koa); color: var(--sand);
  padding: 2.5rem clamp(1rem, 4vw, 3rem) 3rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem;
  font-size: 1rem;
}
.site-footer p { margin: 0; max-width: var(--measure); }
.site-footer a { color: var(--gold); }
.site-footer .logo { font-size: 1.6rem; }

@media (max-width: 900px) {
  .shelf { grid-template-columns: repeat(9, 110px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; justify-content: start; }
  .shelf li { scroll-snap-align: center; }
  .shelf::after { width: calc(9 * 110px + 8 * 0.9rem + 1rem); right: auto; }
  .shelf img { height: 150px; }
}
@media (max-width: 820px) {
  .race, .shirt-inner { grid-template-columns: 1fr; }
  .shirt-art { order: -1; }
  .year { grid-template-columns: 1fr; gap: 1rem; }
  .year-head { flex-direction: row; align-items: center; }
  .year-head img { height: 72px; }
  .hero-inner { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .site-nav a { padding: 0.35rem 0.75rem; }
  .video-toggle { top: 1.25rem; }
  .race-facts div { grid-template-columns: 1fr; gap: 0.1rem; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
