:root {
  --night: #102018;
  --night-2: #1a2e24;
  --cream: #f4efe4;
  --cream-dim: #d9d0c0;
  --brass: #e0c48a;
  --brass-deep: #a68445;
  --pine: #2f6a4a;
  --line: rgba(244, 239, 228, 0.16);
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(224, 196, 138, 0.16), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(47, 106, 74, 0.35), transparent 55%),
    var(--night);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
  opacity: 0.07;
  mix-blend-mode: overlay;
}

a { color: var(--brass); }
a:hover { color: var(--cream); }

.wrap {
  width: min(1080px, calc(100% - 2.5rem));
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  padding: 1.2rem 0 0.2rem;
}

header a { display: block; line-height: 0; }

header img {
  display: block;
  height: 54px;
  width: auto;
}

.hero-stage {
  position: relative;
}

#drift {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  pointer-events: none;
  z-index: 2;
}

.hero {
  position: relative;
  z-index: 1;
  padding: 2.4rem 0 1.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  grid-template-areas:
    "headline stub"
    "ledes stub"
    "actions stub"
    "portrait portrait";
  column-gap: 3rem;
  row-gap: 1rem;
  align-items: end;
}

.hero h1,
.hero-ledes,
.hero-actions,
.stub,
.portrait-block {
  min-width: 0;
}

.hero h1 { grid-area: headline; }
.hero-ledes { grid-area: ledes; }
.hero-actions { grid-area: actions; }
.stub { grid-area: stub; align-self: end; }

.portrait-block {
  grid-area: portrait;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 2.4 / 1;
  margin-top: 0;
  cursor: pointer;
  overflow: hidden;
}

#open-gallery {
  font: inherit;
  cursor: pointer;
}

#snowfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.kicker {
  margin: 0 0 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--brass);
}

@font-face {
  font-family: Canterbury;
  src: url("/fonts/Canterbury.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

h1 {
  font-family: Canterbury, Palatino, serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 4.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 0 1.2rem;
  color: #f7f3ea;
  overflow-wrap: break-word;
  -webkit-text-stroke: 0.018em #1a0c0e;
  paint-order: stroke fill;
  text-shadow: 0.04em 0.05em 0 #140608;
}

.lede {
  max-width: 38rem;
  color: var(--cream-dim);
  font-size: 1.15rem;
}

.hero-ledes .lede { margin: 0 0 0.9rem; }
.hero-ledes .lede:last-child { margin-bottom: 0; }

.stub {
  border: 1px solid var(--line);
  background: rgba(16, 32, 24, 0.55);
  padding: 1.25rem 1.3rem 1.1rem;
  border-radius: 2px 18px 2px 18px;
}

.stub .kicker {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
}

.stub .event-name {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--cream);
}

.stub strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.stub p { margin: 0.35rem 0 0; color: var(--cream-dim); }
.stub a { white-space: nowrap; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.hero-actions { margin-top: 1.2rem; }

.button {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--brass);
  color: var(--night);
  background: var(--brass);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.button.ghost {
  background: transparent;
  color: var(--cream);
}

.button:hover { background: var(--cream); color: var(--night); border-color: var(--cream); }

section { padding: 2.6rem 0; border-top: 1px solid var(--line); }

#the-night,
#sponsors {
  background: #9a3737;
  border-top-color: transparent;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  margin: 0 0 0.6rem;
}

.section-note { max-width: 40rem; color: var(--cream-dim); margin: 0 0 1.5rem; }

.run {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.run li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.run li > span {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--brass);
}

.run .when {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--brass);
}

.run strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
}

.night-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 2rem 2.2rem;
  align-items: start;
}

.night-board,
.event-map,
.run-block {
  min-width: 0;
}

.event-map {
  margin: 0;
}

.event-map img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--cream);
  border-radius: 2px 18px 2px 18px;
}

.run-block h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  margin: 1.6rem 0 0.15rem;
}

.run-block h3:first-child { margin-top: 0; }

.run.timed li {
  grid-template-columns: 8.4rem minmax(0, 1fr);
}

.run.timed .when {
  letter-spacing: 0.08em;
  padding-top: 0.28rem;
}

.run.timed strong { font-size: 1.28rem; }

.bios {
  display: grid;
  gap: 2.8rem;
}

.bios article {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.6rem;
  align-items: start;
}

.bios article:not(:has(img)) {
  grid-template-columns: 1fr;
}

.bios img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  margin: 0;
}

.bios h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  margin: 0 0 0.6rem;
}

.bios p:last-child {
  margin: 0;
  color: var(--cream-dim);
}

.logo-rail {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.4rem 1.6rem;
}

.logo-rail li {
  grid-column: span 2;
  min-height: 108px;
  border: 0;
  display: grid;
  place-items: center;
  padding: 0.4rem 0.6rem;
}

.logo-rail span {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--brass-deep);
}

.logo-rail img {
  max-width: 100%;
  max-height: 86px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.logo-rail li:last-child:nth-child(3n + 1) {
  grid-column: 3 / span 2;
}

.logo-rail li:nth-last-child(2):nth-child(3n + 1) {
  grid-column: 2 / span 2;
}

.logo-rail li:last-child:nth-child(3n + 2) {
  grid-column: 4 / span 2;
}

#sponsors .actions {
  justify-content: center;
}

.photo-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.frame {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(224, 196, 138, 0.18), transparent 42%),
    var(--night-2);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--cream-dim);
}

.frame strong {
  display: block;
  font-family: var(--serif);
  color: var(--cream);
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

footer {
  padding: 2rem 0 3rem;
  color: var(--cream-dim);
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

main, header, footer { position: relative; z-index: 1; }

@media (max-width: 760px) {
  header { padding: 0.65rem 0 0; }
  header img { height: 38px; }
  h1 {
    font-size: clamp(2rem, 8.4vw, 2.4rem);
    margin-bottom: 0;
  }
  .hero, .photo-panel, .bios, .bios article { grid-template-columns: minmax(0, 1fr); }
  .hero {
    padding: 0.7rem 0 1.2rem;
    row-gap: 0.75rem;
    grid-template-areas:
      "headline"
      "stub"
      "actions"
      "ledes"
      "portrait";
  }
  .stub {
    padding: 0.8rem 0.95rem 0.75rem;
  }
  .stub strong { font-size: 1.35rem; }
  .stub .event-name { font-size: 1.05rem; }
  .stub a { white-space: normal; }
  .stub p:last-child { font-size: 0.9rem; }
  .hero-actions { margin-top: 0.1rem; }
  .lede { font-size: 1.02rem; }
  .portrait { aspect-ratio: 16 / 10; }
  .night-board { grid-template-columns: 1fr; }
  .run.timed li { grid-template-columns: 6.6rem minmax(0, 1fr); }
  .run.timed strong { font-size: 1.12rem; }
  .section-note { overflow-wrap: break-word; }
  .logo-rail { grid-template-columns: 1fr 1fr; }
  .logo-rail li,
  .logo-rail li:last-child:nth-child(3n + 1),
  .logo-rail li:nth-last-child(2):nth-child(3n + 1),
  .logo-rail li:last-child:nth-child(3n + 2) { grid-column: auto; }
}

.gallery {
  width: min(1080px, calc(100% - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px 22px 2px 22px;
  background: var(--night);
  color: var(--cream);
  overflow: hidden;
}

.gallery::backdrop {
  background: rgba(8, 14, 11, 0.82);
}

.gallery-sheet {
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
  padding: 1.4rem 1.4rem 1.8rem;
}

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.gallery-head .kicker { margin-bottom: 0.35rem; }

.gallery-close,
.viewer-nav {
  font: inherit;
  cursor: pointer;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.gallery-close:hover,
.viewer-nav:hover { background: var(--cream); color: var(--night); }

.gallery-years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 1.1rem;
}

.gallery-years:empty { display: none; }

.gallery-years button {
  font: inherit;
  cursor: pointer;
  color: var(--cream-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

.gallery-years button[aria-pressed="true"] {
  color: var(--night);
  background: var(--brass);
  border-color: var(--brass);
}

.gallery-status {
  color: var(--cream-dim);
  margin: 0.4rem 0 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.7rem;
}

.gallery-grid button {
  display: block;
  padding: 0;
  border: 0;
  background: var(--night-2);
  cursor: pointer;
  border-radius: 2px 14px 2px 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  background: rgba(8, 14, 11, 0.94);
}

.viewer[hidden] { display: none; }

.viewer figure {
  margin: 0;
  min-width: 0;
}

.viewer img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
}

.viewer figcaption {
  margin-top: 0.55rem;
  text-align: center;
  color: var(--cream-dim);
  font-size: 0.92rem;
}

.viewer figcaption:empty { display: none; }

@media (max-width: 760px) {
  .gallery-sheet { padding: 1.1rem 1rem 1.4rem; }
  .viewer { grid-template-columns: 1fr; }
  .viewer-nav.prev { order: 2; }
  .viewer-nav.next { order: 3; }
  .viewer figure { order: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .portrait { cursor: default; }
}
