:root {
  --ink: #243331;
  --paper: #fbf8ed;
  --accent: #d84e2c;
  --line: #c9cab7;
  --scene: #e8eddb;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a {
  color: inherit;
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #265ddb;
  outline-offset: 3px;
}
button:active {
  transform: translateY(2px);
}
button:disabled {
  opacity: 0.38;
  cursor: default;
}
header {
  height: 73px;
  border-bottom: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 78px);
  gap: 24px;
  background: var(--paper);
}
#home {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 32px;
  letter-spacing: -2px;
  font-weight: 900;
}
#home svg {
  width: 40px;
}
.header-title {
  font-size: 14px;
  border-left: 1px solid #a5aa97;
  padding: 8px 0 8px 22px;
}
header button {
  margin-left: auto;
}
.outline,
.arrows button {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  border-radius: 7px;
  font-weight: bold;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:hover:not(:disabled) {
  filter: brightness(0.94);
}
i {
  display: inline-flex;
  vertical-align: middle;
}
i svg {
  width: 18px;
  height: 18px;
}
.workbench {
  position: relative;
  isolation: isolate;
  min-height: 450px;
  height: clamp(450px, 65vh, 720px);
  background: var(--scene);
  overflow: hidden;
  border-bottom: 1.5px solid var(--ink);
}
.scene {
  position: absolute;
  inset: 0 0 0 31%;
  background-image: radial-gradient(#52655542 0.85px, transparent 1px);
  background-size: 16px 16px;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
canvas:active {
  cursor: grabbing;
}
.scene-label,
.scene-hint {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  pointer-events: none;
}
.scene-label {
  right: 5.7%;
  top: 22px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 800;
}
.dot {
  width: 7px;
  height: 7px;
  background: #578567;
  border-radius: 50%;
}
.scene-hint {
  right: 5.7%;
  bottom: 17px;
  background: var(--scene);
  padding: 3px 6px;
  border-radius: 4px;
}
.scene-hint svg {
  width: 17px;
}
article {
  position: relative;
  z-index: 1;
  pointer-events: none;
  width: 32%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 0 16px clamp(20px, 4vw, 78px);
}
article button {
  pointer-events: auto;
}
.station-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
.station-meta #num {
  border: 1.5px solid var(--ink);
  padding: 3px 6px;
  background: var(--paper);
  border-radius: 4px;
  white-space: nowrap;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.067em;
  line-height: 0.92;
  font-weight: bold;
  font-size: clamp(51px, 5.5vw, 88px);
  margin: 22px 0 13px;
  text-wrap: balance;
}
#intro {
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.45;
  max-width: 32ch;
  margin: 0 0 19px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  max-width: 100%;
}
.actions button {
  min-height: 40px;
  font-size: 13px;
}
#play {
  background: var(--accent);
  color: white;
  font-weight: 750;
  padding: 10px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  box-shadow: 0 3px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.text-button {
  border: 0;
  background: transparent;
  padding: 4px 1px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 13px;
}
.text-button b {
  font-size: 15px;
}
#readout {
  max-width: 36ch;
  font-size: 12px;
  line-height: 1.4;
  margin: 9px 0;
  color: #374d44;
  min-height: 1.4em;
}
#readout:empty {
  min-height: 0;
}
.route {
  padding: 17px clamp(20px, 4vw, 78px) 85px;
}
.route-header {
  display: flex;
  gap: 12px;
  align-items: center;
}
.route h2 {
  font-size: 20px;
  letter-spacing: -0.8px;
  margin: 0;
}
.route-header span {
  font-size: 12px;
  color: #5a6456;
}
.arrows {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.arrows button {
  width: 36px;
  height: 29px;
  font-size: 19px;
  padding: 0;
}
nav {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  margin-top: 14px;
  gap: 4px;
}
nav button {
  position: relative;
  text-align: left;
  border: none;
  border-top: 2px solid #b3baa9;
  background: none;
  padding: 9px 2px 5px;
  display: grid;
  gap: 4px;
  justify-content: start;
  font-size: 12px;
  font-weight: 700;
}
nav button[aria-current="step"] {
  border-color: #c84725;
  color: #a2371b;
}
nav small {
  font-size: 10px;
  letter-spacing: 0.1em;
}
dialog {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 13px;
  color: var(--ink);
  width: min(440px, 90vw);
  padding: 30px;
  box-shadow: 6px 7px 0 #24333150;
}
dialog::backdrop {
  background: #19252070;
}
dialog h2 {
  font:
    bold 34px Georgia,
    serif;
  letter-spacing: -1.5px;
  margin: 17px 0 10px;
}
dialog p {
  line-height: 1.55;
  font-size: 15px;
}
dialog small {
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 800;
}
dialog .close {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 23px;
  background: none;
  border: 0;
}
kbd {
  font: inherit;
  background: #e7e9dc;
  border: 1px solid #a9ad9e;
  padding: 1px 5px;
  border-radius: 4px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 641px) {
  .workbench {
    display: grid;
    align-items: center;
    min-height: clamp(350px, calc(100dvh - 280px), 720px);
    height: auto;
  }
  article { height:auto }
  article:has(#alt:not([hidden])) h1 {
    font-size:clamp(40px,4.55vw,70px);
    margin:12px 0 8px;
  }
  main {
    max-height: calc(100dvh - 153px);
    overflow: auto;
  }
  .route {
    padding-bottom: 5px;
  }
}
@media (min-width: 641px) and (max-height: 700px) {
  h1 {
    font-size: clamp(42px, 5.1vw, 66px);
    margin: 12px 0 8px;
  }
  #intro {
    font-size: 14px;
    margin-bottom: 12px;
  }
  article {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .actions {
    gap: 5px;
  }
  .actions button {
    min-height: 34px;
  }
  .route {
    padding-top: 12px;
  }
  nav {
    margin-top: 10px;
  }
}
@media (max-width: 850px) and (min-width: 641px) {
  article {
    width: 38%;
  }
  .scene {
    left: 34%;
  }
  .station-meta {
    font-size: 10px;
  }
  .route {
    padding-bottom: 5px;
  }
  nav button {
    font-size: 11px;
  }
}
@media (max-width: 640px) {
  header {
    height: 54px;
    padding: 0 16px;
    gap: 12px;
  }
  #home {
    font-size: 26px;
  }
  #home svg {
    width: 32px;
  }
  .header-title {
    font-size: 11px;
    padding: 4px 0 4px 11px;
    max-width: 110px;
  }
  .outline {
    padding: 7px 9px;
  }
  #help span {
    display: none;
  }
  .workbench {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .scene {
    position: relative;
    inset: auto;
    order: 2;
    height: clamp(250px, 72vw, 365px);
  }
  article {
    width: 100%;
    height: auto;
    padding: 20px 18px 0;
    display: block;
  }
  .station-meta {
    font-size: 10px;
  }
  h1 {
    font-size: 45px;
    margin: 9px 0 7px;
  }
  #intro {
    font-size: 14px;
    max-width: 48ch;
    margin-bottom: 11px;
  }
  .actions {
    display: inline-flex;
    vertical-align: middle;
  }
  .actions button {
    font-size: 12px;
    min-height: 35px;
    padding: 7px 11px;
  }
  #readout {
    font-size: 12px;
    margin: 8px 0 0;
    max-width: none;
  }
  #readout:empty {
    display: none;
  }
  #notes {
    font-size: 11px;
    margin-top: 8px;
  }
  .scene-label {
    top: 9px;
    right: 15px;
    font-size: 9px;
  }
  .scene-hint {
    right: 12px;
    bottom: 6px;
    font-size: 10px;
  }
  .route {
    padding: 13px 16px 40px;
  }
  .route h2 {
    font-size: 18px;
  }
  nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px 9px;
    margin-top: 12px;
  }
  nav button {
    display: flex;
    gap: 6px;
    align-items: baseline;
    padding-top: 6px;
  }
  nav small {
    font-size: 9px;
  }
}
@media (max-width:640px) {
  .peek .scene { order:0; height:clamp(150px,calc(100dvh - 54px),350px) }
  .peek article { order:1; padding-bottom:12px }
}
