:root {
  --bg: #10110f;
  --bg-2: #191a16;
  --ink: #f3f0e7;
  --muted: #b4ad9e;
  --line: #2d2e28;
  --accent: #f0c400;
  --accent-ink: #1b1600;
  --card: #161712;
  --hero-scrim: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.72));
  --shadow: none;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Segoe UI Mono", ui-monospace, Consolas, monospace;
  --font: var(--sans);
  --radius: 0px;
  --max: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.4rem 0.7rem;
}
.skip:focus { top: 0.5rem; z-index: 5; }

.top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.7rem 1rem;
  align-items: center;
  padding: 0.7rem 1.1rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  text-decoration: none;
  min-width: 0;
}
.brand img { width: auto; height: 28px; max-width: none; object-fit: contain; background: transparent; }
.top-end {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: nowrap;
}
.top-end nav { flex-wrap: nowrap; }
.top-end nav a { white-space: nowrap; }
nav { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-left: 0; justify-content: flex-end; }
.draw-link {
  justify-self: center;
  text-decoration: none;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  color: var(--ink);
  white-space: nowrap;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.draw-link:hover { color: var(--accent); }
.draw-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 2.6rem;
  padding: 0.32rem 0.55rem;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.lang-toggle:hover { filter: brightness(1.08); }
.lang-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
nav a {
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  color: var(--muted);
}
nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.menu {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.menu:hover,
.menu[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.menu:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hero {
  min-height: 78vh;
  display: grid;
  align-items: end;
  background: var(--bg) url("../images/hero.jpg") center 30% / cover no-repeat;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-scrim);
}
.hero-mark {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}
.hero-copy { position: relative; z-index: 2; padding: 8vh 6vw 6vh; max-width: 46rem; }
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.4rem);
  letter-spacing: 0.08em;
  line-height: 0.9;
}
.rule { width: 7rem; height: 6px; background: var(--accent); margin: 0.8rem 0; }
.hero p { max-width: 38rem; font-size: 1.05rem; }
.kicker { letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.78rem; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; }
section { padding: 2.2rem 0; }
h2 { font-size: 1.6rem; margin: 0 0 0.8rem; letter-spacing: 0.04em; }
.lead { color: var(--muted); max-width: 44rem; }

.years { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-start; margin: 1rem 0 0.4rem; }
.years a { text-decoration: none; border: 1px solid var(--line); padding: 0.2rem 0.55rem; border-radius: 999px; }

.links { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.links a { color: var(--accent); }

.season-board { margin: 0.35rem 0 1.2rem; padding: 0; }
.season-note { margin: 0 0 0.55rem; color: var(--muted); font-size: 0.82rem; max-width: 46rem; }
.season-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--card);
}
table.season {
  --name-w: 13.5rem;
  --score-w: 5rem;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}
.season th, .season td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: middle;
}
.season thead th {
  background: var(--bg-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: left;
  vertical-align: bottom;
  border-bottom: 2px solid var(--accent);
}
.season .who, .season .score { position: sticky; z-index: 1; background: var(--card); }
.season thead .who, .season thead .score { z-index: 3; background: var(--bg-2); }
.season thead .score { text-align: right; color: var(--accent); }
.season .who { left: 0; width: var(--name-w); min-width: var(--name-w); }
.flyer-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 0.16em;
}
.flyer-open:hover, .flyer-open:focus-visible { color: var(--accent); }
.season .score {
  left: var(--name-w);
  width: var(--score-w);
  min-width: var(--score-w);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  box-shadow: 1px 0 0 var(--line);
}
.season tbody .who { color: var(--ink); font-weight: 650; }
.season th.contest { min-width: 9.2rem; max-width: 13rem; }
.season-date { display: block; color: var(--accent); font-weight: 700; font-size: 0.82rem; margin-bottom: 0.12rem; }
.season-where, .season-sub { display: block; color: var(--muted); font-weight: 500; }
.season-title { display: block; color: var(--ink); font-weight: 650; margin-top: 0.12rem; }
.season td.mark { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.season td.empty { color: var(--muted); }
.medal {
  flex: none;
  margin-top: 0.05rem;
  font-size: 1.3rem;
  line-height: 1;
}
.season td.trophy { display: flex; align-items: center; justify-content: center; gap: 0.28rem; font-weight: 700; }
.season td.trophy-1 { background: #f0c400; color: #1b1600; }
.season td.trophy-2 { background: #d5dbe3; color: #1b1e22; }
.season td.trophy-3 { background: #c4844a; color: #1b1208; }
.season tbody tr:hover td { background: var(--bg-2); }
.season tbody tr:hover .who, .season tbody tr:hover .score { background: var(--bg-2); }
.season tbody tr:hover td.trophy-1 { background: #f0c400; color: #1b1600; }
.season tbody tr:hover td.trophy-2 { background: #d5dbe3; color: #1b1e22; }
.season tbody tr:hover td.trophy-3 { background: #c4844a; color: #1b1208; }

@media (max-width: 860px) {
  table.season {
    --name-w: 11rem;
    font-size: 0.78rem;
  }
  .season th, .season td { padding: 0.4rem 0.35rem; }
  .season .score { position: static; left: auto; box-shadow: none; }
  .season th.contest { min-width: 6.4rem; max-width: 8.2rem; }
}

.year-block { margin-top: 0.8rem; }
.year-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border-bottom: 2px solid var(--accent);
}
.year-block.is-open .year-head {
  position: sticky;
  top: 3.4rem;
  z-index: 2;
}
.year-toggle, .year-fold {
  margin: 0;
  padding: 0.85rem 0.2rem;
  background: transparent;
  color: inherit;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.year-fold { margin-left: auto; padding-right: 0.45rem; }
.year-export {
  margin: 0;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.year-export:hover, .year-export:focus-visible {
  background: var(--accent);
  color: var(--accent-ink);
}
.year-toggle h2 { margin: 0; font-size: 1.6rem; letter-spacing: 0.04em; }
.chevron {
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.year-block.is-open .chevron { transform: rotate(-135deg); margin-top: 0.3rem; }
.year-body { padding-top: 0.4rem; }

.event {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0 1.1rem 0.9rem;
  border-left: 2px solid var(--accent);
  margin-left: 0.2rem;
}
.event:has(.shot) {
  grid-template-columns: 8.5rem minmax(0, 1fr) 220px;
}
.event + .event { border-top: 1px solid var(--line); }
.when { grid-column: 1; font-variant-numeric: tabular-nums; }
.body { grid-column: 2; }
.shot { grid-column: 3; }
.when time { display: block; font-weight: 650; }
.place { margin: 0.15rem 0 0.4rem; color: var(--muted); }
.event h3 { margin: 0; font-size: 1.25rem; }
.sub { margin: 0.1rem 0 0; }
.classes { display: inline-block; margin-top: 0.35rem; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.results { margin: 0.55rem 0 0; padding-left: 0; list-style: none; }
.results li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.22rem 0;
  padding: 0.2rem 0.5rem;
}
.results li > span { min-width: 0; }
.results li.podium { font-weight: 650; }
.results li.podium-1 { background: #f0c400; color: #1b1600; }
.results li.podium-2 { background: #d5dbe3; color: #1b1e22; }
.results li.podium-3 { background: #c4844a; color: #1b1208; }
.note { color: var(--muted); font-size: 0.92rem; }
.shot {
  display: block;
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  align-self: start;
}
.shot img { width: 100%; height: 160px; object-fit: cover; }
.shot.map {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  height: 160px;
  padding: 0.45rem 0.7rem 0.4rem;
  background: var(--card);
  border: 1px solid var(--line);
}
.shot.map svg { width: 100%; height: 100%; }
.map-name {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}
.gallery {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.gallery .shot { grid-column: auto; width: 160px; }
.gallery .shot img { height: 110px; }
.shot[data-kind="mark"] img,
.event[data-kind="mark"] .shot img { object-fit: contain; background: #fff; height: 110px; }
.shot[data-kind="flyer"] img,
.event[data-kind="flyer"] .shot img { object-fit: contain; background: #fff; height: 180px; }
.no-shot { display: none; }

.page-hero { padding: 2.4rem 0 0.4rem; }
.page-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); }

.people, .cards, .sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.8rem; }
.person, .card, .sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.person img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg-2); }
.person img,
.models img,
.team-banner img,
.flyer-sheet img,
body[data-page="team"] #viewer img { filter: grayscale(1); }
.team-banner img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
}
.initial {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: var(--bg-2);
  color: var(--accent);
}
.person div, .card div, .sheet { padding: 0.7rem 0.8rem 0.9rem; }
.person h3, .card h3 { margin: 0; font-size: 1rem; }
.role, .meta { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.88rem; }
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.7rem; }
.models img { width: 100%; height: 220px; object-fit: cover; background: var(--card); border-radius: var(--radius); }
.strip { grid-column: 1 / -1; }
.strip img { height: 140px; object-fit: cover; }

.sheet { display: flex; flex-direction: column; justify-content: space-between; min-height: 9rem; text-decoration: none; }
.sheet strong { display: block; }
.sheet:hover { border-color: var(--accent); }

.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.5rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.panel h3 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
#viewer {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(960px, 94vw);
}
#viewer::backdrop, #flyer::backdrop { background: rgba(0,0,0,0.78); }
#viewer img { max-height: 88vh; margin: 0 auto; }
#viewer button {
  position: absolute;
  right: 0.4rem;
  top: 0.4rem;
  background: #fff;
  color: #111;
  border: 0;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}
#flyer {
  width: min(22rem, 92vw);
  max-width: min(22rem, 92vw);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
#flyer button {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  z-index: 1;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}
.flyer-sheet img, .flyer-sheet .initial { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.flyer-sheet .sheet-body { padding: 0.95rem 1rem 1.15rem; }
.flyer-sheet h2 { margin: 0; font-size: 1.35rem; padding-right: 4.5rem; }
.flyer-sheet dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.28rem 0.85rem;
  margin: 0.75rem 0 0;
}
.flyer-sheet dt { color: var(--muted); }
.flyer-sheet dd { margin: 0; font-variant-numeric: tabular-nums; }

.foot {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.foot a { color: var(--accent); }

.to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.to-top.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.to-top:hover { filter: brightness(1.06); }
.to-top:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 1240px) {
  .menu { display: inline-block; }
  .top-end { position: relative; }
  .top-end nav { display: none; margin-left: 0; justify-content: flex-start; }
  .lang-toggle { margin-left: 0; }
  .top.open .top-end nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    left: auto;
    width: max-content;
    min-width: 11.5rem;
    max-width: calc(100vw - 2.2rem);
    margin: 0;
    padding: 0.4rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    z-index: 5;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    border: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
  }
  .top.open .top-end nav a { display: block; }
  .top.open .top-end nav a:hover:not([aria-current="page"]),
  .top.open .top-end nav a:focus-visible:not([aria-current="page"]) {
    color: var(--ink);
    background: color-mix(in srgb, var(--ink) 8%, transparent);
  }
}

@media (max-width: 860px) {
  .event,
  .event:has(.shot) {
    grid-template-columns: 1fr;
    border-left-width: 3px;
  }
  .when, .body, .shot, .gallery {
    grid-column: 1;
    grid-row: auto;
  }
  .split { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; }
  .hero-mark { opacity: 0.18; }
}

@media (max-width: 560px) {
  .top {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.3rem 0.35rem;
    padding: 0.45rem 0.45rem;
  }
  .brand img { height: clamp(15px, 4.5vw, 20px); max-width: min(4.6rem, 22vw); }
  .top-end { gap: 0.3rem; }
  .lang-toggle { min-width: 2rem; padding: 0.22rem 0.38rem; }
  .draw-link {
    font-size: clamp(0.64rem, 2.7vw, 0.9rem);
    padding: 0.24rem 0.42rem;
    min-width: 0;
  }
  .menu { font-size: clamp(0.68rem, 2.8vw, 0.9rem); padding: 0.22rem 0.48rem; }
}
