@font-face {
  font-family: Jost;
  src: url("assets/jost.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("assets/plex-mono.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #172832;
  --night: #172631;
  --night-deep: #11202a;
  --cream: #fff2db;
  --muted: #e0d7c8;
  --yellow: #ffce42;
  --pink: #f4a8c8;
  --blue: #80c8cf;
  --orange: #ffab70;
  --green: #a1c97e;
  --mono: "Plex Mono", "Courier New", monospace;
  --wrap: 72.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--night);
  background-image: radial-gradient(#fff2db15 .85px, transparent .85px);
  background-size: 9px 9px;
  color: var(--cream);
  font: 1.125rem/1.45 Jost, system-ui, sans-serif;
}

h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 5px;
}

.wrap {
  width: min(calc(100% - 3.5rem), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 5;
  padding: .6rem 1rem;
  transform: translateY(-200%);
  background: var(--cream);
  color: var(--ink);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  background: var(--night);
  border-bottom: 1px solid #fff2db32;
}

.header-inner,
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.header-inner { min-height: 5rem; }

.brand {
  display: block;
  flex: none;
  width: 7.35rem;
}

.brand img {
  width: 100%;
  height: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(.8rem, 3.3vw, 2.4rem);
}

nav a {
  white-space: nowrap;
  font-size: .98rem;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"],
.site-footer a:hover { color: var(--yellow); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4.25rem);
  padding-block: 4.4rem 4.8rem;
}

.hero-logo {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 12px #0a171f85);
}

.hero-copy {
  min-width: 0;
  container-type: inline-size;
}

.kicker,
.tag,
.intro figcaption {
  font: 600 .8rem/1.35 var(--mono);
  letter-spacing: .075em;
  text-transform: uppercase;
}

.hero-kicker {
  color: var(--yellow);
  margin-bottom: 1.55rem;
}

.hero-title {
  font-size: clamp(2.4rem, 15.8cqi, 4.8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.065em;
}

.hero-title span {
  display: inline-block;
  max-width: 100%;
  margin-top: .16em;
  padding: .12em .22em .16em;
  border: 2px solid var(--night-deep);
  border-radius: .12em;
  background: var(--pink);
  color: var(--ink);
  box-shadow: 4px 5px 0 #713857;
  font-size: min(.66em, 10.5cqi);
  letter-spacing: -.062em;
  transform: rotate(-2deg);
}

.hero-description {
  max-width: 27rem;
  margin-top: 1.7rem;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.55vw, 1.24rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1.55rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .54rem;
  min-height: 2.75rem;
  width: fit-content;
  padding: .48rem .93rem;
  border: 2px solid var(--ink);
  border-radius: .48rem;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(2px); }

.button-yellow {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 3px 3px 0 #9e7425;
}

.button-yellow:focus-visible { outline-color: var(--cream); }

.button-outline {
  border-color: #fff2db70;
  background: var(--night);
  color: var(--cream);
}

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

.button-ink {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 3px 3px 0 #1728324f;
}

.button-ink:focus-visible { outline-color: var(--ink); }

.play-icon {
  width: .67rem;
  height: .74rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.pilot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4.3rem);
  padding: clamp(1.45rem, 4.6vw, 3.2rem);
  border: 2px solid var(--ink);
  border-radius: 1rem;
  background:
    radial-gradient(#7e654019 .65px, transparent .65px) 0 0 / 7px 7px,
    var(--cream);
  color: var(--ink);
  box-shadow: 7px 8px 0 var(--blue);
}

.tag {
  display: inline-block;
  padding: .38rem .65rem;
  border: 2px solid var(--ink);
  border-radius: .23rem;
  box-shadow: 2px 3px 0 var(--ink);
  transform: rotate(-4deg);
}

.tag-pink { background: var(--pink); }

.pilot h2,
.section-heading h2 {
  font-weight: 850;
  letter-spacing: -.061em;
  line-height: .96;
}

.pilot h2 {
  margin-top: 1.1rem;
  font-size: clamp(2.35rem, 5.3vw, 4.65rem);
}

.pilot-description {
  max-width: 24rem;
  margin: 1.05rem 0 1.15rem;
}

.video-frame {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: .65rem;
  background: var(--ink);
  box-shadow: 4px 5px 0 #202e3360;
}

.video-frame:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.intro video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--night-deep);
}

.intro figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .85rem;
  font-size: .75rem;
  letter-spacing: .045em;
}

.cast { margin-top: clamp(4rem, 7vw, 6rem); }

.section-heading {
  display: grid;
  gap: .65rem;
  margin-bottom: 1.35rem;
}

.section-heading h2 { font-size: clamp(2.55rem, 5.5vw, 4.25rem); }
.section-heading p { color: var(--muted); }

.preview-play {
  position: absolute;
  z-index: 1;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: clamp(3.2rem, 7vw, 5.2rem);
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 4px 5px 0 var(--ink);
  color: var(--ink);
  transform: translate(-50%, -50%) rotate(-7deg);
  cursor: pointer;
}

.preview-play[hidden] { display: none; }
.preview-play:hover { background: var(--cream); }
.preview-play:focus-visible { outline-color: var(--cream); }
.preview-play .play-icon {
  width: 32%;
  height: 34%;
  margin-left: 9%;
}

.episode-link { font-weight: 750; text-underline-offset: .2em; }

.episode-page,
.builds-page,
.scores-page { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem); }

.page-heading { margin-bottom: 2rem; }

.page-heading h1 {
  max-width: 15ch;
  margin-bottom: .6rem;
  font-size: clamp(3.4rem, 9vw, 7rem);
  font-weight: 900;
  line-height: .91;
  letter-spacing: -.068em;
}

.page-heading .tag { margin-bottom: 1rem; color: var(--ink); }
.page-heading > p:not(.tag) { max-width: 35rem; color: var(--muted); }

.episode-player,
.episode-actions { width: min(100%, 61rem); }

.episode-player .video-frame {
  border-color: var(--cream);
  box-shadow: 6px 7px 0 var(--blue);
}

.episode-player .video-frame:focus-within { outline-color: var(--cream); }

.episode-actions,
.challenge-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-top: 1.4rem;
}

.challenge-group {
  padding: clamp(1.15rem, 4vw, 2.75rem);
  border: 1px solid #fff2db45;
  border-radius: 1rem;
  background: var(--night-deep);
}

.challenge-group + .challenge-group { margin-top: 2.6rem; }

.challenge-group-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: .65rem 1.3rem;
  margin-bottom: clamp(2rem, 5vw, 3.65rem);
}

.challenge-group-heading .kicker { color: var(--yellow); }

.challenge-group-heading h2 {
  margin: .35rem 0 .45rem;
  font-size: clamp(2.45rem, 6.1vw, 4.9rem);
  font-weight: 850;
  line-height: .97;
  letter-spacing: -.052em;
}

.challenge-group-heading p:not(.kicker) { color: var(--muted); }

.build-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(1.1rem, 3vw, 1.85rem);
}

.build-card {
  position: relative;
  display: grid;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: .8rem;
  background: var(--build-paper);
  box-shadow: 6px 7px 0 var(--build-edge);
  color: var(--ink);
}

.build-claude { --build-paper: #ffc196; --build-edge: #df824c; --sticker-angle: -9deg; }
.build-codex { --build-paper: #b6e2e2; --build-edge: #5c9ea9; --sticker-angle: 8deg; }
.build-card:nth-child(even) { margin-top: 1.05rem; }

.build-art {
  position: relative;
  height: clamp(13rem, 23vw, 18rem);
  border-bottom: 2px solid var(--ink);
}

.build-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: .67rem .67rem 0 0;
  background: var(--night);
}

.build-preview iframe {
  display: block;
  width: 120%;
  height: 120%;
  border: 0;
  transform: scale(.833333);
  transform-origin: top left;
  pointer-events: none;
}

.build-character {
  position: absolute;
  z-index: 1;
  right: clamp(.75rem, 3vw, 1.6rem);
  bottom: -.85rem;
  width: clamp(5rem, 11vw, 9.3rem);
  max-height: 81%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(3px 4px 0 #101d26a6);
  transform: rotate(var(--sticker-angle));
}

.builder-tag {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: -.8rem;
  background: var(--build-paper);
}

.build-copy {
  display: grid;
  justify-items: start;
  gap: .57rem;
  padding: 1.35rem 1.15rem;
}

.build-copy h3 {
  max-width: 100%;
  font-size: clamp(1.85rem, 3.9vw, 3rem);
  font-weight: 850;
  line-height: .98;
  letter-spacing: -.05em;
}

.build-copy p { font-size: 1.02rem; }

.cast { margin-bottom: clamp(4rem, 7vw, 6rem); }

.cast-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.15rem;
  margin: 0;
  border: 1px solid #fff2db39;
  border-radius: 1rem;
  background: var(--night-deep);
  list-style: none;
}

.cast-list li {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  justify-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .76rem .55rem .6rem;
  border-radius: .6rem;
  background: var(--cast-color);
  color: var(--ink);
}

.cast-list img {
  width: 90%;
  height: clamp(6rem, 13vw, 10.5rem);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 3px 0 #17283240);
}

.cast-list span {
  font: 600 .82rem/1.25 var(--mono);
  text-transform: uppercase;
}

.cast-muse { --cast-color: var(--green); }
.cast-grok { --cast-color: var(--pink); }
.cast-gemini { --cast-color: var(--yellow); }
.cast-codex { --cast-color: var(--blue); }
.cast-claude { --cast-color: var(--orange); }

.site-footer {
  margin-top: auto;
  border-top: 1px solid #fff2db32;
  background: var(--night-deep);
}

.footer-inner {
  min-height: 4.8rem;
  padding-block: .85rem;
  color: var(--muted);
  font-size: .92rem;
}

.footer-credits {
  display: grid;
  gap: .15rem;
}

.footer-credits p:first-child {
  color: var(--cream);
  font-weight: 650;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .65rem;
}

.site-footer a { text-underline-offset: .18em; }

.build-dialog {
  width: min(55rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  padding: 0;
  border: 2px solid var(--cream);
  border-radius: .8rem;
  background: var(--night-deep);
  color: var(--cream);
}

.build-dialog::backdrop { background: #080f15d9; }
body:has(.build-dialog[open]) { overflow: hidden; }

.dialog-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  padding: .85rem 1rem;
}

.dialog-header h2 {
  margin-right: auto;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  line-height: 1.1;
}

.dialog-tab { font-size: .9rem; }

.build-dialog iframe {
  display: block;
  width: 100%;
  height: min(33rem, 68dvh);
  border: 0;
  border-top: 1px solid #fff2db32;
}

@media (max-width: 57rem) {
  .hero { gap: 1.8rem; }
}

@media (max-width: 43rem) {
  .wrap { width: calc(100% - 2.25rem); }

  .header-inner { min-height: 4rem; gap: .65rem; }
  .brand { width: 5.5rem; }
  nav { gap: .6rem; }
  nav a { font-size: .84rem; }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.7rem;
    padding-block: 2rem 3.3rem;
  }

  .hero-kicker { margin-bottom: 1.25rem; }
  .hero-description { margin-top: 1.4rem; }
  .hero-actions { margin-top: 1.3rem; gap: .65rem; }
  .hero-actions .button { padding-inline: .76rem; }
  .hero-logo { width: min(100%, 31rem); justify-self: center; }

  .pilot { grid-template-columns: 1fr; gap: 1.6rem; }
  .pilot-break { display: none; }
  .build-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .build-card:nth-child(even) { margin-top: 0; }

  .cast-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    padding: .65rem;
  }

  .cast-list img { height: clamp(4.6rem, 18vw, 7rem); }
  .cast-list span { font-size: .75rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .7rem; }
}

@media (max-width: 23rem) {
  .wrap { width: calc(100% - 1.6rem); }
  .header-inner { gap: .4rem; }
  .brand { width: 4.75rem; }
  nav { gap: .46rem; }
  nav a { font-size: .77rem; }
  .button { font-size: .94rem; padding-inline: .66rem; }
  .build-copy { padding-inline: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

.episode-catalog { display: grid; gap: 1.85rem; }

.episode-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.2rem, 4vw, 3rem);
  padding: clamp(1rem, 3vw, 2.5rem);
  border: 2px solid var(--ink);
  border-radius: 1rem;
  background: radial-gradient(#7e654019 .65px, transparent .65px) 0 0 / 7px 7px, var(--cream);
  box-shadow: 7px 8px 0 var(--blue);
  color: var(--ink);
}

.episode-art {
  position: relative;
  display: block;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: .7rem;
  box-shadow: 4px 5px 0 var(--ink);
}

.episode-art img { width: 100%; height: auto; }
.episode-art:hover .preview-play { background: var(--cream); }
.episode-art .preview-play { pointer-events: none; }

.episode-card h2,
.board-heading h2,
.sheet-heading h2 {
  font-size: clamp(2.2rem, 5.1vw, 4.35rem);
  font-weight: 850;
  line-height: .98;
  letter-spacing: -.058em;
}

.episode-card h2 { margin: .9rem 0 .6rem; }
.episode-description { max-width: 32rem; }
.episode-duration { margin-block: .9rem; }

.overall-board {
  margin-top: clamp(3.4rem, 7vw, 5.4rem);
  padding: clamp(1.1rem, 3.8vw, 2.8rem);
  border: 2px solid #fff2db72;
  border-radius: 1rem;
  background: var(--night-deep);
  box-shadow: 6px 7px 0 #0b1821;
}

.board-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.board-heading p { margin-top: .48rem; color: var(--muted); }

.board-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.65rem, 2.5vw, 1.7rem);
}

.board-player {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(7.8rem, 15vw, 12rem);
  padding: .9rem 1rem .9rem clamp(4.6rem, 14vw, 10.5rem);
  border: 2px solid var(--ink);
  border-radius: .75rem;
  background: radial-gradient(#17283232 .8px, transparent .8px) 0 0 / 8px 8px, var(--team);
  box-shadow: 4px 5px 0 var(--team-shadow);
  color: var(--ink);
}

.board-claude { --team: #ffad72; --team-shadow: #d77042; --player-angle: -7deg; }
.board-codex { --team: #86d3d9; --team-shadow: #479ba7; --player-angle: 7deg; }

.board-player img {
  position: absolute;
  bottom: -.28rem;
  left: clamp(.35rem, 2vw, 1.1rem);
  width: clamp(3.6rem, 11vw, 8rem);
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 3px 0 #17283266);
  transform: rotate(var(--player-angle));
}

.board-player div {
  display: grid;
  justify-items: start;
  gap: .38rem;
}

.board-player div > span {
  font: 600 .82rem/1.2 var(--mono);
  letter-spacing: .075em;
  text-transform: uppercase;
}

.board-player strong {
  min-width: 1.55em;
  padding: .035em .18em .085em;
  border-radius: .11em;
  background: var(--night-deep);
  color: var(--cream);
  font: 600 clamp(2.25rem, 6.9vw, 5.2rem)/1 var(--mono);
  text-align: center;
  box-shadow: inset 0 0 0 2px #fff2db42;
  font-variant-numeric: tabular-nums;
}

.board-status {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: .9rem;
}

.score-sheet {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 1rem;
  background: var(--cream);
  box-shadow: 7px 8px 0 var(--blue);
  color: var(--ink);
}

.sheet-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 9.5rem;
  padding: clamp(1.15rem, 4vw, 2.15rem);
  border-bottom: 2px solid var(--ink);
  background: radial-gradient(#17283225 .8px, transparent .8px) 0 0 / 8px 8px, var(--yellow);
}

.sheet-heading p { margin-top: .48rem; }

.sheet-cast { display: flex; align-items: end; flex: none; gap: .35rem; }
.sheet-cast img { width: auto; height: clamp(3.1rem, 7vw, 6.5rem); }
.sheet-cast img:first-child { transform: rotate(-10deg); }
.sheet-cast img:last-child { transform: rotate(8deg); }

.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table :is(th, td) { padding: 1rem clamp(.5rem, 3vw, 2.1rem); }
.sheet-table thead { background: #172832; color: var(--cream); }
.sheet-table th { text-align: left; }
.sheet-table thead th,
.sheet-table td { font-variant-numeric: tabular-nums; }
.sheet-table :is(th, td):nth-child(2),
.sheet-table :is(th, td):nth-child(3) { text-align: center; }
.sheet-table tbody tr + tr { border-top: 1px solid #17283241; }
.sheet-table tbody a { font-weight: 780; text-underline-offset: .2em; }

.result-label {
  display: inline-block;
  padding: .2em .55em;
  border: 1px solid #17283263;
  border-radius: .3rem;
  font-weight: 740;
  line-height: 1.2;
}

.result-label[data-leader="claude"] { background: #ffc196; }
.result-label[data-leader="codex"] { background: #b6e2e2; }

@media (max-width: 43rem) {
  .episode-card { grid-template-columns: 1fr; }
  .board-player { justify-items: center; gap: .55rem; padding: .65rem .35rem .8rem; }
  .board-player img { position: static; width: 3.7rem; height: 4.2rem; }
  .board-player div { justify-items: center; }
  .sheet-table { font-size: .88rem; }
  .sheet-table :is(th, td) { padding: .8rem .45rem; }
}

@media (max-width: 23rem) {
  .board-player div > span { font-size: .72rem; }
  .sheet-cast img { height: 2.55rem; }
}
