/* Beyond Belief: one day in Cora City, morning at the top, the last train at
   the bottom. Colours come from the game's own branding art. */

@font-face {
  font-family: "Jersey 25";
  src: url("/fonts/jersey25-regular.ttf") format("truetype");
  font-display: swap;
}

/* Registered so the sky can ease between times of day. */
@property --sky-top { syntax: "<color>"; inherits: true; initial-value: #7d87b8; }
@property --sky-bottom { syntax: "<color>"; inherits: true; initial-value: #f2c99a; }
@property --sky-ink { syntax: "<color>"; inherits: true; initial-value: #251d33; }
@property --sky-shade { syntax: "<color>"; inherits: true; initial-value: #f6e8c8; }
@property --clock-dot { syntax: "<color>"; inherits: true; initial-value: #f2c99a; }
@property --stars { syntax: "<number>"; inherits: true; initial-value: 0.2; }

:root {
  /* the game's palette */
  --ink: #251d33;
  --violet: #453567;
  --rose: #a05a68;
  --rose-deep: #85404f;
  --gold: #f0ba48;
  --paper: #f6e8c8;
  --larkspur: #8aa0e0;
  --larkspur-deep: #5f74c4;
  --leaf: #6f9e57;
  --leaf-deep: #44702f;
  --panel: #1e1a2c;
  --panel-edge: #5b4c7a;
  --wood: #6e4a30;
  --wood-dark: #553823;

  /* type */
  --pixel: "Jersey 25", ui-monospace, monospace;
  --serif: "Literata", "Iowan Old Style", Georgia, serif;

  /* the sky, set per section by app.js */
  --sky-top: #7d87b8;
  --sky-bottom: #f2c99a;
  --sky-ink: #251d33;
  --sky-shade: #f6e8c8;
  --clock-dot: #f2c99a;
  --stars: 0.2;

  transition:
    --sky-top 1.4s ease, --sky-bottom 1.4s ease, --sky-ink 1.4s ease,
    --sky-shade 1.4s ease, --clock-dot 1.4s ease, --stars 1.4s ease;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--sky-ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }

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

:focus-visible { outline: 3px solid var(--larkspur); outline-offset: 4px; }

/* ── the sky ───────────────────────────────────────────── */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom));
}

.stars {
  position: absolute;
  inset: 0 0 35% 0;
  opacity: var(--stars);
  background-image:
    radial-gradient(2px 2px at 40px 60px, var(--paper) 50%, transparent 51%),
    radial-gradient(2px 2px at 190px 140px, var(--paper) 50%, transparent 51%),
    radial-gradient(3px 3px at 310px 40px, var(--paper) 50%, transparent 51%),
    radial-gradient(2px 2px at 120px 230px, var(--gold) 50%, transparent 51%),
    radial-gradient(2px 2px at 260px 300px, var(--paper) 50%, transparent 51%);
  background-size: 360px 340px, 420px 380px, 520px 300px, 640px 460px, 380px 520px;
  -webkit-mask-image: linear-gradient(black, transparent);
  mask-image: linear-gradient(black, transparent);
}

/* ── the game's clock pill ─────────────────────────────── */

.clock-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.clock {
  margin: 0;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px 4px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--paper);
  font: 25px/1.2 var(--pixel);
  box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}

.clock-dot {
  width: 10px;
  height: 10px;
  background: var(--clock-dot);
  box-shadow: 0 0 0 2px var(--ink);
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--gold);
  color: var(--ink);
  font: 25px var(--pixel);
  text-decoration: none;
}
.skip:focus { top: 16px; }

/* ── shared pieces ─────────────────────────────────────── */

h2 {
  margin: 0 0 20px;
  font: 75px/0.95 var(--pixel);
  font-weight: normal;
  color: var(--sky-ink);
  text-shadow: 3px 3px 0 color-mix(in srgb, var(--sky-shade) 45%, transparent);
  text-wrap: balance;
}

.intro {
  max-width: 58ch;
  margin: 0 0 40px;
  font-size: 19px;
}

.hour {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18vh 16px 0;
}

/* Pixel-edged frame: four offset shadows leave the corners notched. */
.shot,
.year img,
.board,
.ticket {
  box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink);
}

.scene { margin: 0; position: relative; }

.shot {
  display: block;
  width: 100%;
  height: auto;
  background: var(--ink);
}

/* The dialogue box, drawn the way the game draws it over a scene. */
.box {
  position: relative;
  width: min(720px, calc(100% - 48px));
  margin: -64px auto 0;
  padding: 26px 28px 18px;
  background: var(--panel);
  color: var(--paper);
  box-shadow:
    inset 0 0 0 2px var(--panel-edge),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}

.box p {
  margin: 0 0 0.7em;
  font-size: 17px;
  line-height: 1.6;
}
.box p:last-child { margin-bottom: 0; }

.plate {
  position: absolute;
  top: 0;
  left: 20px;
  transform: translateY(-60%);
  padding: 0 12px 2px;
  background: var(--violet);
  color: var(--paper);
  font: 25px/1.2 var(--pixel);
  box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}
.plate .role { color: var(--larkspur); }

.aside {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 60ch;
  margin: 56px 0 0;
  font-style: italic;
}

.item {
  flex: none;
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.button {
  display: inline-block;
  padding: 6px 22px 8px;
  border: 0;
  background: var(--gold);
  color: var(--ink);
  font: 25px/1.2 var(--pixel);
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink),
    0 8px 0 color-mix(in srgb, var(--ink) 45%, transparent);
  transition: transform 80ms ease, background-color 120ms ease;
}
.button:hover { background: #f6c968; }
.button:active { transform: translateY(3px); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.button.secondary { background: var(--paper); }
.button.secondary:hover { background: #fff3da; }

/* ── dawn ──────────────────────────────────────────────── */

.hero {
  padding-top: 15vh;
  text-align: center;
}

.hero-title { margin: 0 auto; }

/* The logo is pixel art: shown at whole-number multiples of its 93 px. */
.logo {
  display: block;
  width: 744px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
  animation: logo-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes logo-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.tagline {
  margin: 12px 0 0;
  font: 50px/1 var(--pixel);
  color: var(--sky-ink);
  text-wrap: balance;
}

.hero-lede {
  max-width: 50ch;
  margin: 24px auto 36px;
  font-size: 20px;
}

.hero-scene { margin-top: 12vh; text-align: left; }

/* ── the town map ──────────────────────────────────────── */

.map .shot { aspect-ratio: 4 / 3; }

/* Hidden until app.js has placed them, so they never pile up in a corner. */
.pins { position: absolute; inset: 0; display: none; }
.has-map .pins { display: block; }

.pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1)));
}

.pin::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--ink);
  transform: rotate(45deg);
  transition: transform 120ms ease, background-color 120ms ease;
}
.pin:hover::before { transform: rotate(45deg) scale(1.25); }
.pin[aria-pressed="true"]::before {
  background: var(--larkspur);
  transform: rotate(45deg) scale(1.35);
}
.pin[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 3px solid var(--paper);
  border-radius: 50%;
}

.map-box { margin-top: -40px; min-height: 120px; }

/* ── neighbours ────────────────────────────────────────── */

.lineup {
  display: grid;
  grid-template-columns: repeat(8, 92px);
  gap: 6px 4px;
  margin-bottom: 20px;
}
@media (max-width: 800px) {
  .lineup { grid-template-columns: repeat(4, 1fr); }
  .person { width: auto; }
}

.person {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 92px;
  padding: 26px 0 6px;
  border: 0;
  background: none;
  color: var(--sky-ink);
  font: 25px/1 var(--pixel);
  cursor: pointer;
}

.person-sprite {
  display: block;
  width: 48px;
  height: 72px;
  background: 0 0 / 600% 100% no-repeat;
  image-rendering: pixelated;
}
.person:hover .person-sprite,
.person:focus-visible .person-sprite { animation: walk 560ms steps(1) infinite; }
.person[aria-pressed="true"] .person-sprite { animation: wave 520ms steps(1) 4; }

/* The game's "talking" bubble over a head. */
.person[aria-pressed="true"]::before {
  content: "···";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 7px 3px;
  background: var(--panel);
  color: var(--paper);
  font: 25px/0.7 var(--pixel);
  box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink);
}
.person[aria-pressed="true"] .person-name {
  text-decoration: underline 3px var(--gold);
  text-underline-offset: 5px;
}

blockquote.box { margin-bottom: 0; }
blockquote.box p { font-size: 19px; }

/* ── your own time ─────────────────────────────────────── */

/* A journal page: ruled paper, the list written on the lines. */
.things {
  list-style: none;
  margin: -40px 24px 0;
  padding: 30px 32px 26px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 39px, color-mix(in srgb, var(--larkspur-deep) 28%, transparent) 39px 40px),
    var(--paper);
  background-position: 0 30px;
  color: var(--ink);
  box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink);
}

.things li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 7px 0 13px;
  font-size: 17px;
  line-height: 1.55;
}
.things .item { margin-top: -2px; }

.year {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-top: 72px;
}
.year figure { margin: 0; }
.year img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.year figcaption {
  margin-top: 14px;
  font-size: 16px;
  font-style: italic;
}

/* ── the board ─────────────────────────────────────────── */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px 24px;
  padding: 36px 28px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 46px, var(--wood-dark) 46px 49px),
    var(--wood);
}

.note {
  position: relative;
  padding: 22px 20px 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 5px 0 color-mix(in srgb, var(--ink) 55%, transparent);
  transform: rotate(-1.1deg);
}
.note:nth-child(3n + 2) { transform: rotate(0.9deg); }
.note:nth-child(4n + 3) { transform: rotate(-0.4deg); }
.note:nth-child(5n + 4) { transform: rotate(1.4deg); }

/* the pin */
.note::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--ink);
}
.note.done::before { background: var(--leaf); }

.note h3 {
  margin: 0 0 8px;
  font: 32px/1 var(--pixel);
  font-weight: normal;
}
.note p { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }

.note .stamp {
  display: inline-block;
  margin: 0;
  padding: 0 8px 2px;
  border: 2px solid currentColor;
  color: var(--rose-deep);
  font: 22px/1.2 var(--pixel);
  transform: rotate(-3deg);
}
.note.done .stamp { color: var(--leaf-deep); }

/* ── the last train ────────────────────────────────────── */

.station {
  max-width: none;
  padding-bottom: 20vh;
  overflow: hidden;
}

.station-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
}

.station-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
}

.station h2,
.station .intro { text-shadow: 2px 2px 0 var(--ink); }

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  background: var(--paper);
  color: var(--ink);
}

.ticket-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
  background: var(--gold);
  border-right: 4px dashed var(--ink);
  font: 25px/1 var(--pixel);
}
.ticket-stub img { width: 32px; height: 32px; image-rendering: pixelated; }
.ticket-stub span { writing-mode: vertical-rl; transform: rotate(180deg); }

.ticket-body { position: relative; padding: 24px 28px 26px; }

.ticket-head {
  margin: 0 0 18px;
  font: 50px/1 var(--pixel);
}
.ticket-version {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  color: var(--violet);
}

.unlock label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 16px;
}

.unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.unlock input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: #fffaf0;
  color: var(--ink);
  font: 18px var(--serif);
}
.unlock input:focus-visible { outline: 3px solid var(--larkspur-deep); outline-offset: 2px; }

.message {
  min-height: 1.5em;
  margin: 14px 0 0;
  font-size: 16px;
}
.message.is-error { color: var(--rose-deep); font-weight: 600; }

.builds ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.builds li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}
.build-detail { font-size: 15px; color: color-mix(in srgb, var(--ink) 75%, var(--paper)); }
.builds details { flex-basis: 100%; font-size: 14px; }
.builds summary { cursor: pointer; width: max-content; }
.builds code { font-size: 12px; word-break: break-all; }
.small { margin: 20px 0 0; font-size: 14px; }

.stamp-mark {
  position: absolute;
  top: 18px;
  right: 22px;
  margin: 0;
  padding: 0 12px 4px;
  border: 4px solid currentColor;
  color: var(--rose-deep);
  font: 40px/1 var(--pixel);
  opacity: 0;
  transform: rotate(-8deg) scale(1.7);
  pointer-events: none;
  transition: opacity 160ms ease-in, transform 220ms cubic-bezier(0.3, 1.6, 0.6, 1);
}

.ticket.is-unlocked .stamp-mark { opacity: 0.85; transform: rotate(-8deg) scale(1); }
.ticket.is-unlocked .unlock { display: none; }

/* ── footer ────────────────────────────────────────────── */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 16px 56px;
  color: var(--sky-ink);
  font-size: 14px;
  text-align: center;
}
.footer img { width: 32px; height: 48px; image-rendering: pixelated; }
.footer p { margin: 0; max-width: 60ch; }

/* ── sprite animation ──────────────────────────────────── */
/* Neighbour strips are six frames: stand, walk 1-3, reach up, hold up.
   With background-size 600%, frame n sits at n * 20%. */

@keyframes walk {
  0% { background-position: 20% 0; }
  25% { background-position: 40% 0; }
  50% { background-position: 60% 0; }
  75% { background-position: 0 0; }
}
@keyframes wave {
  0% { background-position: 80% 0; }
  50% { background-position: 100% 0; }
}

/* ── the clock menu ────────────────────────────────────── */

.clock-caret {
  width: 0;
  height: 0;
  margin-left: 2px;
  border: 5px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
  transition: transform 150ms ease;
}
.clock[aria-expanded="true"] .clock-caret { transform: rotate(180deg); }

.day-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  padding: 10px 0;
  background: var(--panel);
  box-shadow:
    inset 0 0 0 2px var(--panel-edge),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}
.day-menu ol { list-style: none; margin: 0; padding: 0; }
.day-menu a {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 6px 18px;
  color: var(--paper);
  font-size: 16px;
  text-decoration: none;
}
.day-menu a:hover,
.day-menu a:focus-visible { background: var(--violet); outline-offset: -3px; }
.day-menu a[aria-current] { color: var(--gold); }
.day-time { flex: none; width: 52px; font: 25px/1 var(--pixel); color: var(--larkspur); }
.day-menu a[aria-current] .day-time { color: var(--gold); }

/* ── hero extras ───────────────────────────────────────── */

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.text-link {
  color: var(--sky-ink);
  font: 25px/1.2 var(--pixel);
  text-decoration: underline 3px var(--gold);
  text-underline-offset: 6px;
}

/* ── the zoomable map ──────────────────────────────────── */

.map { position: relative; }

.map-view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #5d9a43;
  touch-action: pan-y;
  box-shadow: 0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink);
}
.town[data-zoomed] .map-view { touch-action: none; cursor: grab; }
.map-view.is-dragging { cursor: grabbing; }
.map-view:focus-visible { outline-offset: 6px; }

.map-layer {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.map-layer.is-animating { transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1); }

.map-img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
.town[data-close] .map-img { image-rendering: pixelated; }

/* Place names appear beside the pins once you're zoomed in. */
.pin-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.town[data-close] .pin-label {
  left: calc(100% + 2px);
  top: 50%;
  width: auto;
  height: auto;
  clip: auto;
  transform: translateY(-50%);
  padding: 0 8px 2px;
  background: var(--panel);
  color: var(--paper);
  font: 20px/1.2 var(--pixel);
  box-shadow: 0 0 0 2px var(--ink);
  pointer-events: none;
}
.town[data-close] .pin[aria-pressed="true"] .pin-label { background: var(--violet); }

.map-person {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -100%) scale(calc(1 / var(--zoom, 1)));
  transform-origin: 50% 100%;
  pointer-events: none;
}
.map-person .sprite {
  display: block;
  width: 48px;
  height: 72px;
  background: 0 0 / 600% 100% no-repeat;
  image-rendering: pixelated;
  animation: wave 520ms steps(1) infinite;
  filter: drop-shadow(0 3px 0 rgba(37, 29, 51, 0.45));
}

.map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  gap: 10px;
}

.map-button {
  min-width: 40px;
  height: 40px;
  padding: 0 10px 3px;
  border: 0;
  background: var(--panel);
  color: var(--paper);
  font: 28px/1 var(--pixel);
  cursor: pointer;
  box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}
.map-button.wide { font-size: 22px; }
.map-button:hover { background: var(--violet); }

.map-hint {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  margin: 0;
  padding: 4px 12px 6px;
  background: var(--panel);
  color: var(--paper);
  font-size: 15px;
  box-shadow: 0 0 0 3px var(--ink);
}
.map-hint:empty { display: none; }

/* ── the gallery ───────────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 28px;
}
.gallery figure { margin: 0; }
.gallery .shot { aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption,
.year figcaption {
  margin-top: 14px;
  font-size: 16px;
  font-style: italic;
}

.shot[role="button"] { cursor: zoom-in; transition: transform 160ms ease; }
.gallery .shot[role="button"]:hover,
.year .shot[role="button"]:hover { transform: translateY(-3px); }

/* ── neighbour profile ─────────────────────────────────── */

.lineup { margin-bottom: 28px; }

.profile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
  max-width: 820px;
  padding: 28px;
  background: var(--panel);
  color: var(--paper);
  box-shadow:
    inset 0 0 0 2px var(--panel-edge),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}
.profile.is-new { animation: profile-in 260ms ease-out; }
@keyframes profile-in {
  from { transform: translateY(4px); }
  to { transform: none; }
}

.profile-face {
  padding: 6px;
  background: var(--violet);
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px var(--panel-edge);
}
.profile-face img {
  display: block;
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
}

.profile h3 {
  margin: 0 0 12px;
  font: 40px/1 var(--pixel);
  font-weight: normal;
}
.profile-role { color: var(--larkspur); font-size: 28px; }

.profile blockquote {
  min-height: 3.2em;
  margin: 0 0 18px;
  font-size: 20px;
  font-style: italic;
  line-height: 1.5;
}
.profile blockquote::before { content: "\201C"; }
.profile blockquote::after { content: "\201D"; }
.profile blockquote.is-about { font-style: normal; font-size: 18px; }
.profile blockquote.is-about::before,
.profile blockquote.is-about::after { content: none; }

.profile-where {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 22px;
  font-size: 16px;
  color: color-mix(in srgb, var(--paper) 85%, var(--larkspur));
}

/* ── fireflies after dusk ──────────────────────────────── */

.fireflies {
  position: absolute;
  inset: 0;
  opacity: calc((var(--stars) - 0.3) * 1.5);
}
.fireflies i {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ffdf8c;
  box-shadow: 0 0 8px 2px rgba(240, 186, 72, 0.55);
  animation: drift 14s ease-in-out infinite alternate, blink 3.2s ease-in-out infinite;
}
.fireflies i:nth-child(1) { left: 8%; top: 70%; animation-duration: 15s, 2.9s; }
.fireflies i:nth-child(2) { left: 18%; top: 40%; animation-duration: 19s, 3.6s; animation-delay: -4s, -1s; }
.fireflies i:nth-child(3) { left: 27%; top: 82%; animation-duration: 13s, 2.4s; animation-delay: -7s, -2s; }
.fireflies i:nth-child(4) { left: 39%; top: 58%; animation-duration: 17s, 4.1s; animation-delay: -2s, -.5s; }
.fireflies i:nth-child(5) { left: 47%; top: 88%; animation-duration: 21s, 3.3s; animation-delay: -9s, -1.5s; }
.fireflies i:nth-child(6) { left: 56%; top: 34%; animation-duration: 16s, 2.7s; animation-delay: -5s, -2.5s; }
.fireflies i:nth-child(7) { left: 64%; top: 74%; animation-duration: 18s, 3.8s; animation-delay: -11s, -.8s; }
.fireflies i:nth-child(8) { left: 72%; top: 48%; animation-duration: 14s, 2.6s; animation-delay: -3s, -1.9s; }
.fireflies i:nth-child(9) { left: 81%; top: 86%; animation-duration: 20s, 3.1s; animation-delay: -8s, -2.2s; }
.fireflies i:nth-child(10) { left: 88%; top: 62%; animation-duration: 15s, 4s; animation-delay: -6s, -.3s; }
.fireflies i:nth-child(11) { left: 94%; top: 30%; animation-duration: 22s, 2.8s; animation-delay: -12s, -1.2s; }
.fireflies i:nth-child(12) { left: 3%; top: 28%; animation-duration: 17s, 3.5s; animation-delay: -10s, -2.8s; }
@keyframes drift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(26px, -34px); }
  100% { transform: translate(-18px, -70px); }
}
@keyframes blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* ── the neighbour who pops up ─────────────────────────── */

.visitor {
  position: fixed;
  left: 28px;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  transform: translateY(110%);
  transition: transform 420ms cubic-bezier(0.3, 1.45, 0.5, 1);
  cursor: pointer;
}
.visitor.is-in { transform: translateY(12px); }

.visitor-sprite {
  width: 64px;
  height: 96px;
  background: 0 0 / 600% 100% no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 2px rgba(246, 232, 200, 0.5));
}
.visitor.is-waving .visitor-sprite { animation: wave 480ms steps(1) infinite; }

.visitor-bubble {
  position: relative;
  max-width: 230px;
  margin-bottom: 64px;
  padding: 8px 14px 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink);
}
.visitor-sprite { order: 0; }
.visitor-bubble { order: 1; }

/* the bubble's tail, pointing back at whoever is talking */
.visitor-bubble::before,
.visitor-bubble::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-color: transparent;
}
.visitor-bubble::before { left: -14px; bottom: 8px; border-width: 8px 14px 8px 0; border-right-color: var(--ink); }
.visitor-bubble::after { left: -8px; bottom: 11px; border-width: 5px 9px 5px 0; border-right-color: var(--paper); }

/* ── the station cat ───────────────────────────────────── */

.cat {
  position: absolute;
  right: 48px;
  bottom: 100%;
  z-index: 2;
  width: 48px;
  height: 36px;
  margin-bottom: 3px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.cat-sprite {
  display: block;
  width: 48px;
  height: 36px;
  background: url("/img/people/cat.png") 50% 0 / 500% 100% no-repeat;
  image-rendering: pixelated;
  animation: tail 5s steps(1) infinite;
}
.cat.is-purring .cat-sprite { animation: purr 360ms steps(1) infinite; }
@keyframes tail {
  0%, 88% { background-position: 50% 0; }
  92% { background-position: 75% 0; }
  96% { background-position: 50% 0; }
}
@keyframes purr {
  0% { background-position: 75% 0; }
  50% { background-position: 50% 0; }
}

.cat-hearts span {
  position: absolute;
  left: 8px;
  bottom: 100%;
  width: 32px;
  height: 32px;
  background: url("/img/people/heart.png") 0 0 / 200% 100% no-repeat;
  image-rendering: pixelated;
  animation: float-up 1.2s ease-out forwards;
  pointer-events: none;
}
.cat-hearts span.note { background: url("/img/people/note.png") 0 0 / 100% 100% no-repeat; }
@keyframes float-up {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-44px); }
}

/* ── the rest of the bottom ────────────────────────────── */

.platforms {
  margin: 22px 0 0;
  font-size: 15px;
  text-shadow: 2px 2px 0 var(--ink);
}

.footer .button { margin-bottom: 12px; }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.credits { opacity: 0.75; }

/* ── the lightbox ──────────────────────────────────────── */

.lightbox {
  width: min(1260px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 16px 18px 18px;
  border: 0;
  background: var(--panel);
  color: var(--paper);
  box-shadow:
    inset 0 0 0 2px var(--panel-edge),
    0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink);
}
.lightbox::backdrop { background: rgba(18, 14, 32, 0.85); }
.lightbox-close-form { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.lightbox img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  image-rendering: pixelated;
  box-shadow: 0 0 0 3px var(--ink);
}
.lightbox-caption { margin: 14px 0; font-size: 16px; font-style: italic; }
.lightbox-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font: 22px/1 var(--pixel);
  color: var(--larkspur);
}

/* ── small screens ─────────────────────────────────────── */

@media (max-width: 760px) {
  body { font-size: 17px; }
  h2 { font-size: 50px; }
  .hour { padding-top: 13vh; }
  .tagline { font-size: 34px; }
  .hero-lede { font-size: 18px; }
  .intro { font-size: 17px; }
  .box { width: calc(100% - 20px); margin-top: -20px; padding: 24px 18px 16px; }
  .map-box { margin-top: 12px; }
  .hour { scroll-margin-top: 48px; }
  .things { grid-template-columns: 1fr; margin: -20px 10px 0; padding: 26px 20px 20px; }
  .person { width: 72px; }
  .clock { top: 10px; right: 10px; font-size: 22px; padding: 0 10px 2px; }
  .board { padding: 28px 18px; }
  .ticket { grid-template-columns: 1fr; }
  .ticket-stub { flex-direction: row; justify-content: center; padding: 10px 0; border-right: 0; border-bottom: 4px dashed var(--ink); }
  .ticket-stub span { writing-mode: horizontal-tb; transform: none; }
  .ticket-body { padding: 22px 18px; }
  .ticket-head { font-size: 40px; }
  .stamp-mark { top: auto; bottom: 18px; right: 14px; font-size: 32px; }
  .logo { width: 372px; }
  .text-link { font-size: 22px; }
  .clock-wrap { top: 10px; right: 10px; }
  .day-menu { width: min(280px, calc(100vw - 20px)); }
  .gallery { grid-template-columns: 1fr; gap: 28px; }
  .profile { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; }
  .profile-face { justify-self: start; }
  .profile-face img { width: 96px; height: 96px; }
  .profile h3 { font-size: 32px; }
  .profile-role { font-size: 24px; }
  .map-controls { top: 8px; right: 8px; gap: 8px; }
  .map-button { min-width: 36px; height: 36px; font-size: 24px; }
  .map-button.wide { font-size: 18px; }
  .visitor { left: 12px; }
  .visitor-sprite { width: 48px; height: 72px; }
  .visitor-bubble { max-width: 190px; margin-bottom: 48px; font-size: 14px; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .logo { width: 558px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .logo { width: 279px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :root { transition: none; }
  *, *::before, *::after { transition: none !important; }
  .logo, .profile.is-new, .cat-sprite,
  .person:hover .person-sprite, .person:focus-visible .person-sprite { animation: none; }
  .fireflies { display: none; }
  .visitor.is-waving .visitor-sprite,
  .person[aria-pressed="true"] .person-sprite,
  .map-person .sprite { animation: none; background-position: 80% 0; }
}
