:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #616161;
  --line: #e6e6e6;
  --soft: #f7f7f5;
  --dark: #000000;
  --on-dark: #ffffff;
  --lime: #dceeb1;
  --lilac: #c5b0f4;
  --cream: #f4ecd6;
  --pink: #efd4d4;
  --mint: #c8e6cd;
  --coral: #f3c9b6;
  --navy: #1f1d3d;
  --magenta: #ff3d8b;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
}

html,
body {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

.landing {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(560px, 1.38fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: stretch;
  padding: clamp(24px, 4vw, 48px);
  background: var(--paper);
  color: var(--ink);
}

.landing[hidden],
.detail[hidden] {
  display: none;
}

.landing-copy,
.detail-copy {
  position: relative;
  z-index: 3;
}

.landing-copy {
  display: flex;
  min-height: calc(100vh - 96px);
  flex-direction: column;
  justify-content: center;
  gap: clamp(64px, 10vh, 108px);
  padding: clamp(18px, 2vw, 28px) 0;
}

.landing-copy > .eyebrow {
  margin-bottom: 0;
}

.eyebrow,
.back-link {
  margin: 0 0 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 7.5em;
  font-size: clamp(52px, 6.35vw, 94px);
  font-weight: 340;
  line-height: 1;
  letter-spacing: 0;
}

.title-block {
  display: grid;
  gap: clamp(48px, 7vh, 76px);
}

.lede {
  max-width: 430px;
  margin: 24px 0 0;
  color: var(--ink);
  font-size: clamp(18px, 1.45vw, 22px);
  font-weight: 330;
  line-height: 1.4;
}

.collection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  align-self: center;
  padding: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
}

.station-tile {
  appearance: none;
  text-decoration: none;
  border: 0;
  border-radius: 0;
  min-height: clamp(168px, 22vh, 234px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  box-shadow: none;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.station-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0 solid var(--magenta);
  pointer-events: none;
  transition: border-width 180ms ease;
}

.station-tile canvas {
  width: 100%;
  height: min(16vh, 150px);
  min-height: 108px;
  order: 2;
  margin: 6px 0 4px;
  opacity: 1;
}

.plate-head,
.plate-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink);
}

.plate-head {
  order: 1;
}

.plate-foot {
  order: 3;
}

.plate-name {
  font-size: 13px;
  font-weight: 620;
}

.plate-index,
.plate-count {
  color: var(--muted);
}

.plate-count {
  text-transform: none;
}

.station-tile:hover,
.station-tile:focus-visible {
  background: #fbfbf7;
  outline: 0;
}

.station-tile:hover::after,
.station-tile:focus-visible::after {
  border-width: 3px;
}

.station-tile[data-tone="0"] {
  background: var(--paper);
}

.station-tile[data-tone="1"] {
  background: var(--paper);
}

.station-tile[data-tone="2"] {
  background: var(--paper);
}

.station-tile[data-tone="3"] {
  background: var(--paper);
}

.station-tile[data-tone="4"] {
  background: var(--paper);
}

.station-tile[data-tone="5"] {
  background: var(--paper);
}

.station-tile[data-tone="6"] {
  background: var(--paper);
}

.station-tile[data-tone="7"] {
  background: var(--paper);
}

.station-tile[data-tone="8"] {
  background: var(--paper);
  color: var(--ink);
}

.station-tile[data-tone="8"] .plate-head,
.station-tile[data-tone="8"] .plate-foot {
  color: var(--ink);
}

.detail {
  min-height: 100vh;
  background: var(--paper);
}

.detail-copy {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(34vw, 430px);
  padding: clamp(26px, 4vw, 56px);
  color: var(--ink);
  pointer-events: none;
  background: transparent;
  border-radius: 0;
}

.detail-copy h1 {
  display: inline-block;
  padding: 8px 14px 12px;
  border: 2px solid var(--ink);
  font-size: clamp(44px, 5.4vw, 86px);
  font-weight: 340;
  line-height: 0.92;
}

.detail-copy .lede {
  color: var(--muted);
}

.detail-attribution {
  display: grid;
  gap: 6px;
  position: fixed;
  left: clamp(26px, 4vw, 56px);
  bottom: clamp(26px, 4vw, 56px);
  max-width: 340px;
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}

.detail-attribution a {
  color: var(--ink);
  text-decoration: none;
}

.detail-attribution a:hover,
.detail-attribution a:focus-visible {
  text-decoration: underline;
}

.music-toggle {
  position: fixed;
  left: clamp(26px, 4vw, 56px);
  bottom: clamp(92px, 9vw, 124px);
  z-index: 5;
  appearance: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  display: inline-grid;
  grid-template-columns: auto auto auto;
  gap: 0;
  align-items: stretch;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.music-label,
.music-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px 8px;
}

.music-state {
  border-left: 1px solid var(--ink);
}

.music-label {
  border-left: 0;
}

.music-toggle[aria-pressed="true"] .music-state[data-state="on"],
.music-toggle[aria-pressed="false"] .music-state[data-state="off"] {
  background: var(--ink);
  color: var(--paper);
}

.back-link {
  display: block;
  color: var(--ink);
  text-decoration: none;
  pointer-events: auto;
}

.stage {
  min-height: 118vh;
  pointer-events: none;
}

.stage-hold {
  min-height: 90vh;
}

.canvas-wrap {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--paper);
  pointer-events: none;
}

.is-detail .canvas-wrap {
  display: block;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.attribution {
  display: grid;
  gap: 12px;
  align-items: start;
  margin: 0;
  max-width: 340px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  pointer-events: auto;
}

.attribution a {
  color: var(--ink);
  text-decoration: none;
}

.attribution a:hover,
.attribution a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .attribution {
    position: absolute;
    right: 16px;
    bottom: 12px;
    left: auto;
    z-index: 4;
    gap: 4px;
    justify-content: end;
    padding: 4px 6px;
    background: var(--paper);
    border: 1px solid var(--line);
    font-size: 8px;
    text-align: right;
  }

  .landing {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 16px;
    padding: 16px 16px 58px;
  }

  .landing-copy {
    min-height: auto;
    gap: 12px;
    justify-content: start;
    padding: 0;
  }

  .eyebrow,
  .back-link {
    margin-bottom: 12px;
    font-size: 10px;
  }

  h1 {
    max-width: 6.4em;
    font-size: clamp(44px, 13.5vw, 58px);
  }

  .title-block {
    gap: 0;
  }

  .lede {
    margin-top: 16px;
    font-size: 14px;
  }

  .collection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 2px;
  }

  .station-tile {
    min-height: 136px;
    padding: 9px;
  }

  .station-tile canvas {
    height: 88px;
    min-height: 78px;
    margin: 2px 0;
  }

  .plate-head,
  .plate-foot {
    gap: 8px;
    font-size: 9px;
  }

  .plate-name {
    font-size: 10px;
  }

  .detail-copy {
    inset: auto;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: auto;
    padding: 9px 14px 8px;
    border-radius: 0;
  }

  .detail-copy .eyebrow {
    display: none;
  }

  .detail-copy .back-link {
    margin-bottom: 6px;
    font-size: 9px;
  }

  .detail-copy h1 {
    padding: 5px 9px 8px;
    border-width: 1.5px;
    font-size: 28px;
  }

  .detail-copy .lede {
    margin-top: 6px;
    font-size: 11px;
  }

  .detail-attribution {
    position: fixed;
    right: 10px;
    bottom: 9px;
    left: auto;
    gap: 3px;
    margin: 0;
    padding: 4px 6px;
    background: var(--paper);
    border: 1px solid var(--line);
    font-size: 8px;
    text-align: right;
  }

  .music-toggle {
    right: 10px;
    bottom: 50px;
    left: auto;
    font-size: 9px;
  }

  .music-label,
  .music-state {
    padding: 6px 7px 7px;
  }

  .stage {
    min-height: 125vh;
  }

  .stage-hold {
    min-height: 95vh;
  }
}
