:root {
  --olive: #828874;
  --stripe: #666666;
  --orange: #ff9900;
  --red: #cc0000;
  --ink: #333333;
  --muted: #666666;
  --hover: #aaaaaa;
  --line: #e4d4b0;
  --paper: rgba(255, 255, 255, 0.92);
  --max: 980px;
  /* sampled from the left and right edge columns of tracknew.jpg */
  --track-left: #ffbc5a;
  --track-right: #ff9800;
  --font: Verdana, Geneva, Tahoma, sans-serif;
}

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

html {
  color-scheme: light;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--muted);
  text-decoration: none;
}

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

a:active {
  color: var(--red);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  min-height: 100vh;
  min-width: 0;
}

.masthead {
  position: relative;
  height: 56px;
  background: #fff;
}

.stripes {
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background:
    linear-gradient(var(--olive), var(--olive)) 0 0 / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 0 2px / 100% 1px no-repeat,
    linear-gradient(var(--stripe), var(--stripe)) 0 3px / 100% 3px no-repeat;
}

.logo {
  position: absolute;
  left: max(16px, calc((100% - min(100%, var(--max))) / 2 + 30px));
  top: 16px;
  display: block;
  line-height: 0;
}

.logo img {
  width: 310px;
  height: 26px;
  image-rendering: auto;
}

.hero {
  --gutter: max(0px, (100% - var(--max)) / 2);
  width: 100%;
  overflow: hidden;
  /* the stop sits a few px inside the image so fractional zoom rounding
     can never expose the saturated colour left of the image edge */
  background: linear-gradient(
    to right,
    var(--track-left) calc(var(--gutter) + 4px),
    var(--track-right) calc(var(--gutter) + 4px)
  );
}

/* height follows the image so the lane numbers along the bottom stay visible */
.hero img {
  display: block;
  width: min(100%, var(--max));
  height: auto;
  margin-inline: auto;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0 8px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 64px 30px;
}

.nav {
  padding-top: 6px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  margin: 0 0 10px;
}

.nav-list a,
.nav-list span {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
}

.nav-list .is-current {
  color: var(--red);
  font-weight: 500;
}

.nav-list img {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  image-rendering: pixelated;
}

.bourse {
  margin-top: 36px;
}

.bourse-label {
  font-size: 12px;
  font-weight: 700;
  color: #777;
  margin-bottom: 10px;
}

.shoe {
  display: block;
  width: 130px;
  height: auto;
  margin: 4px 0 12px;
}

.bourse select {
  width: 170px;
  max-width: 100%;
  font-family: var(--font);
  font-size: 12px;
  color: #444;
  padding: 4px 6px;
  border: 1px solid #ccc;
  background: #fff;
}

.content {
  position: relative;
  padding: 4px 8px 24px 22px;
  min-width: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--orange) 0 2px,
      transparent 2px 7px
    ) 0 0 / 2px 100% no-repeat;
}

.kicker {
  margin: 0 0 14px;
  line-height: 0;
}

.kicker img {
  width: min(290px, 100%);
  height: auto;
  image-rendering: auto;
}

.prose {
  max-width: min(40rem, 100%);
  overflow-wrap: break-word;
}

.prose p {
  margin: 0 0 1em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.rule {
  color: var(--red);
  font-weight: 700;
}

.event-name {
  color: var(--orange);
  font-weight: 700;
}

.sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 0 0 1.2em;
}

.sheet th {
  text-align: left;
  color: var(--orange);
  font-weight: 700;
  padding: 4px 12px 8px 0;
  border-bottom: 1px solid var(--line);
}

.sheet td {
  padding: 4px 12px 4px 0;
  vertical-align: top;
}

.sheet td.event-name {
  width: 7.5rem;
  white-space: nowrap;
}

.sheet tr.gap td {
  padding-bottom: 14px;
}

.sheet-wrap {
  overflow-x: auto;
}

.footnote {
  margin-top: 1.5em;
  color: var(--muted);
  font-size: 13px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.gallery button {
  display: block;
  padding: 0;
  border: 0;
  background: #111;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.95);
  transition: transform 0.25s ease;
}

.gallery button:hover img {
  transform: scale(1.04);
}

.lightbox {
  border: 0;
  padding: 0;
  max-width: min(92vw, 960px);
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(20, 16, 8, 0.72);
}

.lightbox img {
  display: block;
  max-height: 86vh;
  width: auto;
  margin: 0 auto;
}

.lightbox p {
  margin: 8px 0 0;
  color: #f4f0e8;
  text-align: center;
  font-size: 13px;
}

.chart-panel {
  background: var(--paper);
  border: 1px solid #eadfc8;
  padding: 12px;
  max-width: 100%;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.chart-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-controls input[type="range"] {
  width: 120px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 11px;
}

.legend button {
  border: 0;
  background: none;
  font-family: var(--font);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend button.is-dim {
  opacity: 0.35;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 1px;
}

.colophon {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 40px 30px;
  font-size: 11px;
  color: #888;
}

@media (max-width: 760px) {
  .logo {
    left: 16px;
    top: 18px;
  }

  .logo img {
    width: min(250px, calc(100vw - 32px));
    height: auto;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 16px 48px;
    width: 100%;
  }

  .nav,
  .content,
  .prose {
    min-width: 0;
    max-width: 100%;
  }

  .prose p {
    max-width: 100%;
  }

  .nav {
    display: block;
    padding-bottom: 20px;
    border-bottom: 1px dotted var(--orange);
    margin-bottom: 18px;
  }

  .bourse {
    margin-top: 18px;
  }

  .bourse select {
    width: 100%;
    max-width: 220px;
    min-width: 0;
  }

  .content {
    padding: 8px 4px 24px 14px;
    width: 100%;
  }

  .colophon {
    padding: 0 16px 32px;
  }
}
