/* Page chrome, the card, the list, and the scene's motion. */

:root {
  --ink: #1c1b1a;
  --paper: #f7f1ec;
  --white: #fffdfa;
  --cream: #f4eee6;
  --red: #8f5c56;
  --mustard: #d9a441;
  --muted: #625b55;
  --rule: #e2d9cf;
  --lit: #d9a441;
  --soft: 0 14px 40px rgba(96, 74, 56, .2), 0 2px 6px rgba(96, 74, 56, .1);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
html.js body { overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- header and controls ---------- */

.masthead {
  position: fixed; left: 12px; top: 10px; z-index: 20; padding: 10px 16px 13px 12px; border-radius: 10px;
  background: rgba(255, 253, 250, 0); transition: background-color .3s ease;
}
.has-open .masthead { background: rgba(255, 253, 250, .92); }
/* Clear paper behind the name, whatever the camera has brought under it. */
html.js body::before {
  content: ""; position: fixed; left: 0; top: 0; z-index: 10; width: 440px; height: 170px; pointer-events: none;
  background: radial-gradient(120% 120% at 0 0, rgba(247, 241, 236, .94), rgba(247, 241, 236, .6) 38%, rgba(247, 241, 236, 0) 70%);
}
.masthead h1 { margin: 0; font: 700 19px/1.15 var(--sans); letter-spacing: .01em; color: var(--ink); }
.masthead p { margin: 3px 0 7px; font-size: 13px; color: var(--muted); }
.masthead a { font-size: 13px; color: var(--ink); text-underline-offset: 3px; }
.masthead a:hover { color: #000; }

.controls { position: fixed; right: 20px; top: 18px; z-index: 70; display: flex; gap: 8px; }
.ctl {
  font: 600 13px/1 var(--sans); color: var(--ink); cursor: pointer;
  background: rgba(255, 253, 250, .82); border: 1px solid rgba(28, 27, 26, .34);
  border-radius: 999px; padding: 10px 16px; min-height: 38px;
}
.ctl:hover { background: var(--white); border-color: var(--ink); }
.has-open .ctl, .has-list .ctl { background: var(--white); }

a:focus-visible, button:focus-visible, .card:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 3px;
}

.hint {
  position: fixed; left: 16px; bottom: 14px; z-index: 15; margin: 0; max-width: 72ch; width: fit-content;
  padding: 6px 11px 7px; border-radius: 8px; background: rgba(255, 253, 250, .9);
  box-shadow: 0 2px 10px rgba(96, 74, 56, .12);
  font-size: 12.5px; line-height: 1.45; color: #4a4541;
}
.hint .when-pan { display: none; }
.is-pan .hint .when-pan { display: inline; }
.has-open .hint, .is-opening .hint, .has-list .hint, .is-pan.hint-done .hint { opacity: 0; }
.is-pan.hint-done .hint { transition: opacity .4s ease; }

.year {
  position: fixed; left: 24px; top: 110px; z-index: 19;
  font: 600 46px/1 var(--sans); letter-spacing: .01em;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .6s;
}
.year::before { content: ""; display: block; width: 26px; height: 2px; margin-bottom: 11px; background: var(--red); }
.is-opening .year { opacity: 1; transition: none; }

/* The sheet of paper darkens a little towards the edges of the window
   and towards its foot, whatever the camera does. */
html.js body::after {
  content: ""; position: fixed; inset: 0; z-index: 11; pointer-events: none;
  background:
    radial-gradient(ellipse 84% 78% at 50% 44%, rgba(120, 96, 80, 0) 48%, rgba(120, 96, 80, .13) 100%),
    linear-gradient(to bottom, rgba(120, 96, 80, 0) 45%, rgba(120, 96, 80, .045) 100%);
}

/* ---------- stage ---------- */

.stage { position: fixed; inset: 0; overflow: hidden; background: var(--paper); }
.is-pan .stage {
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  scrollbar-width: none; touch-action: pan-x pan-y;
}
.is-pan .stage::-webkit-scrollbar { display: none; }
.is-pan.has-open .stage, .is-pan.is-opening .stage { overflow: hidden; }
.plate { position: relative; overflow: hidden; }
.world { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; }
.scene { position: absolute; left: 0; top: 0; display: block; overflow: visible; }

.hits { position: absolute; inset: 0; }
.hit {
  position: absolute; margin: 0; padding: 0; border: 0; background: transparent;
  cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent;
}
.is-opening .hits { pointer-events: none; }

.chip {
  position: absolute; z-index: 9000; display: flex; align-items: center; gap: 7px;
  padding: 7px 11px 7px 8px; border-radius: 4px; white-space: nowrap;
  background: var(--white); color: var(--ink); font: 700 13px/1 var(--sans);
  box-shadow: 0 6px 18px rgba(96, 74, 56, .22), 0 1px 3px rgba(96, 74, 56, .12);
  transform-origin: 50% 100%; opacity: 0; pointer-events: none; transition: opacity .14s;
}
.chip.on { opacity: 1; }
.chip-n {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); color: var(--cream); font-size: 11px;
}

/* ---------- lettering in the scene ---------- */

.scene text { font-family: var(--sans); }
.t-sign { font-weight: 800; fill: var(--ink); }
.t-board { font-weight: 700; fill: var(--ink); }
.t-board-when { font-weight: 600; fill: #57504a; }
.t-node { font-weight: 800; font-size: 14px; fill: var(--cream); }
.t-now { font-weight: 800; font-size: 9px; letter-spacing: .09em; fill: var(--ink); }
.t-plaque { font-weight: 700; fill: var(--ink); }
.t-arm { font-weight: 700; fill: var(--ink); }
.t-meter { font-family: var(--mono); font-weight: 700; fill: var(--mustard); }
.t-term { font-family: var(--mono); font-weight: 600; fill: var(--paper); }
.t-slip { font-weight: 800; font-size: 10.5px; fill: var(--ink); }
.t-clock { font-family: var(--mono); font-weight: 700; fill: #fff; }
.t-pay { font-weight: 800; fill: var(--ink); }

/* ---------- hover, focus and the town stepping back ---------- */

.lm > .rise, .client, .signpost, .node { transition: transform .22s cubic-bezier(.2, .8, .3, 1); }
.lm.is-hot > .rise { transform: translateY(-4px); }
.client.is-hot, .signpost.is-hot { transform: translateY(-3px); }
.is-far { opacity: .92; }
.citylimit { opacity: .92; }

.focus-ring {
  fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round;
  opacity: 0; pointer-events: none;
}
.focus-ring.on { opacity: 1; }

/* While a landmark is open the rest of the town fades towards the paper
   under an even veil. town.js draws the open landmark above the veil; whatever
   stands in front of it is drawn there too, under a sheet of the veil
   cut to its own outline. */
.veil-rect { opacity: 0; pointer-events: none; transition: opacity .5s; }
.has-open .veil-rect { opacity: 1; }
.L-fx, .L-rings { pointer-events: none; }

/* ---------- idle life ----------
   town.js writes --back, minus the scene's age, on any group it moves
   in the drawing order. As a delay it puts a loop that starts over
   where it would have been, so nothing jumps. */

.tape { animation: tape linear infinite; animation-delay: var(--back, 0s); }
@keyframes tape { to { transform: translateX(calc(var(--unit) * -1)); } }

.beacon { animation: beacon 2.8s ease-in-out var(--back, 0s) infinite; }
@keyframes beacon { 0%, 100% { opacity: .45; } 45%, 60% { opacity: 1; } }

.chrysalis { animation: sway 3.8s ease-in-out var(--back, 0s) infinite; }
@keyframes sway { 0%, 100% { transform: rotate(5deg); } 50% { transform: rotate(-5deg); } }

.led { animation: ledBlink var(--t0, 3s) calc(var(--d, 0s) + var(--back, 0s)) infinite; }
@keyframes ledBlink { 0%, 60% { opacity: 1; } 68%, 90% { opacity: .3; } 100% { opacity: 1; } }

.cursor { animation: blink 1.1s steps(1) var(--back, 0s) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.now-flag { transform-box: fill-box; transform-origin: 0 50%; animation: flag 2.6s ease-in-out var(--back, 0s) infinite; }
@keyframes flag { 0%, 100% { transform: skewY(0deg); } 50% { transform: skewY(-5deg); } }

/* ---------- what each landmark does when opened ----------
   town.js writes the seconds since a landmark opened to --t on its
   group. Each effect here is a paused animation whose delay is minus
   --t, so the picture is always the one for that moment. */

.lm-hat.is-open .hat-lid { animation: hatTip .75s cubic-bezier(.3, 1.5, .5, 1) both paused; animation-delay: calc(var(--t, 0s) * -1); }
@keyframes hatTip { 0% { transform: rotate(0deg); } 100% { transform: rotate(17deg) translateY(-2px); } }

.flood, .ticker-burst { opacity: 0; }
.lm-ticker.is-open .flood { animation: flood 3.2s ease-out both paused; animation-delay: calc(var(--t, 0s) * -1); }
@keyframes flood { 0% { opacity: 0; } 8% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: .88; } }
.lm-ticker.is-open .ticker-burst { opacity: 1; }
.lm-ticker.is-open .ticker-idle { opacity: 0; }

.rings { display: none; }
.rings.on { display: block; }
.ring {
  fill: none; stroke: var(--mustard); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: 0;
  animation: ring 2.8s linear infinite paused; animation-delay: calc(var(--i) * -.7s - var(--t, 0s));
}
@keyframes ring { 0% { transform: scale(.06); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* The lines are thin grey cable, a little firmer once a line is live.
   Mustard is kept for what travels on them: the pulse, and after it a
   run of small dots. One window lights in each client as its pulse
   lands, and a scattered few in the building itself. */
.wire { fill: none; stroke: #9a9087; stroke-width: 1.1; stroke-opacity: .8; stroke-linejoin: round; }
.wire-live { fill: none; stroke: #9a9087; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.wire-live.on { opacity: 1; }
.wire-flow { fill: none; stroke: var(--mustard); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: .1 43.9; opacity: 0; }
.wire-flow.on { opacity: 1; animation: flow 1.6s linear infinite paused; animation-delay: calc(var(--t, 0s) * -1); }
@keyframes flow { to { stroke-dashoffset: -44; } }
.line.beat .wire-flow { stroke-width: 4.6; }
.bead { opacity: 0; }
.bead.on { opacity: 1; }
.seat.on { fill: var(--mustard); }
.client.is-lit .cwin.one, .lm-cabin.is-open .cabin-win { fill: var(--lit); }
.lm-exchange.is-open .win.wake { animation: winOn .14s linear both paused; animation-delay: calc(var(--r, 0) * .12s + .05s - var(--t, 0s)); }
@keyframes winOn { 100% { fill: #d9a441; } }
.lm-exchange.beat .win.lit, .lm-exchange.beat .win.wake, .client.beat .cwin.one { fill: #efc873 !important; }
.pole-lamp { opacity: 0; }
.pole-lamp.on { opacity: 1; }
.plq { transform: scale(var(--lk, 1)); transition: opacity .3s ease; }
/* While some other landmark is open the clients' name plates step back,
   so none can end up under the header or the controls. */
.has-open .client:not(.is-open) .plq { opacity: 0; }
.plq-narrow { display: none; }
.is-pan .plq-wide { display: none; }
.is-pan .plq-narrow { display: inline; }
.forklift-lamp { opacity: 0; }
.client.is-lit .forklift-lamp { opacity: 1; }
.client.is-lit .forks { animation: forks 2.4s ease-in-out infinite paused; animation-delay: calc(var(--t, 0s) * -1); }
@keyframes forks { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.slips { opacity: 0; }
.lm-cabstand.is-open .slips { opacity: 1; }
.slip-flip { transform-box: fill-box; transform-origin: center; }
.slip-back { opacity: 0; }
.lm-cabstand.is-open .slip-flip, .lm-cabstand.is-open .slip-front, .lm-cabstand.is-open .slip-back {
  animation: slipFlip .5s ease-in-out both paused;
  animation-delay: calc(var(--i) * .55s + .25s - var(--t, 0s));
}
.lm-cabstand.is-open .slip-front { animation-name: slipFront; animation-timing-function: steps(1); }
.lm-cabstand.is-open .slip-back { animation-name: slipBack; animation-timing-function: steps(1); }
@keyframes slipFlip { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.03); } }
@keyframes slipFront { 0% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes slipBack { 0% { opacity: 0; } 50%, 100% { opacity: 1; } }

.shell { transform-origin: 0 4px; }
.lm-conservatory.is-open .chrysalis { animation: none; }
.lm-conservatory.is-open .shell { animation: shellL .6s ease both paused; animation-delay: calc(var(--t, 0s) * -1); }
.lm-conservatory.is-open .shell-r { animation-name: shellR; }
.lm-conservatory.is-open .shell-band { opacity: 0; }
@keyframes shellL { 0% { transform: rotate(0deg); } 100% { transform: rotate(26deg); } }
@keyframes shellR { 0% { transform: rotate(0deg); } 100% { transform: rotate(-26deg); } }
.butterfly.gone { display: none; }

.lm-shed.is-open .led {
  transform-box: fill-box; transform-origin: center;
  animation: ledBlink var(--t0, 3s) infinite, ledWave 2.1s infinite paused;
  animation-delay: calc(var(--d, 0s) + var(--back, 0s)), calc(var(--c) * .07s + .15s - var(--t, 0s));
}
@keyframes ledWave { 0%, 20%, 100% { transform: scale(1); } 8% { transform: scale(2.3); } }

/* Powers: the bulb turns from unlit to lit and the meter's needle
   sweeps to and fro. */
.needle { transform-origin: 0 0; transform: rotate(-58deg); }
.lm-lamp.is-open .bulb { animation: bulbWarm 2.4s ease-in-out both paused; animation-delay: calc(var(--t, 0s) * -1); }
.lm-lamp.is-open .needle { animation: needle 3.6s ease-in-out infinite alternate paused; animation-delay: calc(var(--t, 0s) * -1); }
@keyframes bulbWarm { 100% { fill: #d9a441; } }
@keyframes needle { 0% { transform: rotate(-58deg); } 100% { transform: rotate(58deg); } }

/* Home: the lamps round the monument come on, one after another. */
.lm-monument.is-open .plaza-lamp { animation: lampOn .3s ease both paused; animation-delay: calc(var(--i, 0) * .12s + .1s - var(--t, 0s)); }
@keyframes lampOn { 100% { fill: #d9a441; } }

.lm-fingerpost.is-open .arm { animation: armA 1.8s ease-in-out infinite paused; animation-delay: calc(var(--t, 0s) * -1); }
.lm-fingerpost.is-open .arm-1 { animation-name: armB; }
@keyframes armA { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(4deg); } }
@keyframes armB { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-4deg); } }
/* The sign shop: when its card opens the lettering on its plaques prints
   in, plaque by plaque, each wiped in from its left edge. */
.t-sg { font-weight: 700; fill: var(--ink); }
.t-sg.t-sg-fine { font-weight: 600; }
.sg-wipe { transform-box: fill-box; transform-origin: 0 0; }
.lm-signshop.is-open .sg-wipe { animation: sgWipe .3s linear both paused; animation-delay: calc(var(--k, 0) * .3s + .15s - var(--t, 0s)); }
@keyframes sgWipe { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
.lm-cone.is-open .snow { animation: snow 2.4s ease-in-out infinite paused; animation-delay: calc(var(--t, 0s) * -1); }
@keyframes snow { 0%, 100% { opacity: 1; } 50% { opacity: .84; } }

/* ---------- the opening ----------
   The same idea: --now on the root is the opening's clock, and --at is
   the moment each piece appears. */

.is-opening .lm > .rise {
  animation: rise .62s cubic-bezier(.2, .75, .3, 1) both paused;
  animation-delay: calc(var(--at, 0s) - var(--now, 0s));
}
.is-opening .lm.no-clip > .rise { animation-name: drop; }
@keyframes rise { 0% { transform: translateY(var(--rise, 140px)); } 74% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-16px); } 100% { opacity: 1; transform: translateY(0); } }
.is-opening .signpost, .is-opening .node, .is-opening .client, .is-opening .pole, .is-opening .citylimit {
  animation: pop .42s ease-out both paused; animation-delay: calc(var(--at, 0s) - var(--now, 0s));
}
@keyframes pop { 0% { opacity: 0; transform: translateY(9px); } 100% { opacity: 1; transform: translateY(0); } }
.is-opening .shade { animation: fade .5s ease both paused; animation-delay: calc(var(--at, 0s) + .35s - var(--now, 0s)); }
.is-opening .road-ring { animation: fade .7s ease both paused; animation-delay: calc(.2s - var(--now, 0s)); }
.is-opening .bay { animation: fade .4s ease both paused; animation-delay: calc(var(--at, 0s) - var(--now, 0s)); }
@keyframes fade { 0% { opacity: 0; } 100% { opacity: 1; } }

/* Staging goes up first, the building rises inside it, the staging goes. */
.scaf { display: none; }
.is-opening .scaf {
  display: inline; animation: scaf 1.5s linear both paused;
  animation-delay: calc(var(--at, 0s) - .6s - var(--now, 0s));
}
@keyframes scaf {
  0% { opacity: 0; transform: translateY(var(--rise, 140px)); }
  5% { opacity: 1; }
  30% { transform: translateY(0); }
  76% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}
/* Things that change as the years pass: lights out and back on, a
   climber going up, lines strung one at a time, the pennant planted. */
.is-opening .sleeps .win.lit { animation: sleepWin var(--sleep, 3s) linear both paused; animation-delay: calc(var(--dark, 0s) - var(--now, 0s)); }
@keyframes sleepWin { 0%, 100% { fill: #d9a441; } 7%, 93% { fill: #c4b9ad; } }
.is-opening .sleeps .hat-band { animation: sleepBand var(--sleep, 3s) linear both paused; animation-delay: calc(var(--dark, 0s) - var(--now, 0s)); }
@keyframes sleepBand { 0%, 100% { opacity: 1; } 7%, 93% { opacity: .25; } }
.is-opening .climber { animation: climb 1.3s cubic-bezier(.35, 0, .3, 1) both paused; animation-delay: calc(var(--at, 0s) + .8s - var(--now, 0s)); }
@keyframes climb { 0% { opacity: 0; transform: translateY(var(--climb, 150px)); } 10% { opacity: 1; } 100% { opacity: 1; transform: translateY(0); } }
.is-opening .line .wire { stroke-dasharray: var(--len, 400); animation: string .55s ease-in-out both paused; animation-delay: calc(var(--at, 0s) - var(--now, 0s)); }
@keyframes string { 0% { stroke-dashoffset: var(--len, 400); } 100% { stroke-dashoffset: 0; } }
.is-opening .now { animation: plant .85s linear both paused; animation-delay: calc(var(--at, 0s) - var(--now, 0s)); }
@keyframes plant {
  0% { opacity: 0; transform: translateY(-36px); }
  8% { opacity: 1; }
  42% { transform: translateY(0); }
  58% { transform: translateY(-8px); }
  74% { transform: translateY(0); }
  86% { transform: translateY(-3px); }
  100% { opacity: 1; transform: translateY(0); }
}

.snap * { transition: none !important; }

/* ---------- the card ---------- */

.card {
  position: fixed; z-index: 40; right: 20px; top: 68px; max-height: calc(100% - 88px); width: min(404px, 38vw);
  display: flex; flex-direction: column; outline: none;
  background: var(--white); color: var(--ink); border-radius: 10px;
  box-shadow: var(--soft);
  opacity: 0; transform: translateX(18px);
  transition: opacity .26s ease, transform .34s cubic-bezier(.2, .8, .3, 1);
}
.card.on { opacity: 1; transform: none; }
.card:not(.on), .list:not(.on) { pointer-events: none; }
#cardBody { flex: 1; overflow: auto; padding: 26px 26px 16px; overscroll-behavior: contain; }
.card-close, .list-close {
  position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
}
.card-close:hover, .list-close:hover { background: rgba(28, 27, 26, .07); }
.card-close svg, .list-close svg { display: block; margin: auto; }

.card p.card-kicker {
  display: flex; align-items: center; gap: 8px; margin: 0 44px 10px 0;
  font: 600 11.5px/1.35 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.card-stop, .entry-n {
  display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--cream); font: 700 12px/1 var(--sans); letter-spacing: 0;
}
.card-title { margin: 0 0 16px; font: 600 30px/1.12 var(--serif); letter-spacing: -.005em; }
.card p, .entry p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.56; }
.own { margin: 0 0 16px; padding: 1px 0 1px 16px; border-left: 3px solid var(--red); }
.card .own p, .entry .own p { margin: 0 0 6px; font: italic 400 18px/1.45 var(--serif); }
.own footer { font: 600 10.5px/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.tag {
  display: inline-block; margin-right: 3px; padding: 3px 5px; vertical-align: 2px;
  font: 700 9.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase;
  color: #6a4708; background: #f6e6c2; border: 1px dashed #b98529; border-radius: 3px;
}
.card-photo { margin: 0 0 16px; }
.card-photo img { display: block; width: 100%; height: auto; border-radius: 4px; background: #e8e0da; }
.card-photo figcaption { margin-top: 7px; font-size: 12px; line-height: 1.42; color: var(--muted); }
/* Marks, icons and phone screens are shown at a modest size, whole. */
.card-photo.ph-hat img, .entry img.ph-hat { width: 200px; padding: 10px 10px; background: var(--white); border: 1px solid var(--rule); }
.card-photo.ph-powers img, .entry img.ph-powers { width: 220px; }
.card-photo.ph-herehat img, .entry img.ph-herehat { width: auto; height: 360px; max-width: 100%; object-fit: contain; }
.card-photo.ph-hat img, .card-photo.ph-powers img, .card-photo.ph-herehat img { margin: 0 auto; }
.card-photo.ph-hat figcaption, .card-photo.ph-powers figcaption, .card-photo.ph-herehat figcaption { text-align: center; }
.card-frame {
  display: grid; place-items: center; aspect-ratio: 16 / 10; margin: 0 0 16px;
  border: 1.5px dashed #b9afa5; border-radius: 4px; color: var(--muted);
  font: 600 11px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase;
}
.card p.card-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 17px; border-radius: 6px;
  background: var(--ink); color: var(--white); font: 600 14.5px/1 var(--sans); text-decoration: none;
}
.btn::after { content: "\2197"; margin-left: 8px; opacity: .7; }
.btn:hover { background: #3a3735; }
.card-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--rule); }
.step { min-height: 46px; padding: 6px 2px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.step-next { text-align: right; margin-left: auto; }
.step-none { flex: 1; }
.step-dir { display: block; font: 600 10.5px/1.5 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.step-name { font: 600 13.5px/1.25 var(--sans); }
.step:hover .step-name { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the list (and the page without scripts) ---------- */

.list {
  position: fixed; inset: 0; z-index: 60; overflow: auto; background: var(--paper); color: var(--ink);
  opacity: 0; transition: opacity .22s ease;
}
.list.on { opacity: 1; }
.list-inner { position: relative; max-width: 700px; margin: 0 auto; padding: 30px 24px 90px; }
.list-owner { margin: 0 96px 40px 0; }
.list-owner p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.list-owner p.list-owner-name { margin: 0; font: 700 19px/1.15 var(--sans); letter-spacing: .01em; color: var(--ink); }
.list-owner a { color: var(--ink); text-underline-offset: 3px; }
.list-title { margin: 0 0 6px; font: 600 34px/1.1 var(--serif); outline: none; }
.list-lede { margin: 0 0 30px; font-size: 14px; color: var(--muted); }
.list-group-title {
  margin: 40px 0 6px; padding-top: 14px; border-top: 1px solid var(--rule);
  font: 600 11.5px/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.entry { padding: 20px 0 6px; border-top: 1px solid var(--rule); }
.list-group > .entry:first-child, .list-group-title + .entry { border-top: 0; }
.entry-title { margin: 0 0 4px; font: 600 22px/1.2 var(--serif); }
.entry-title a { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.entry-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.entry-when, .entry-note { color: var(--muted); }
.entry p.entry-when { margin-bottom: 10px; font-size: 13px; }
.entry p.entry-note { font-size: 13px; }
.entry-links a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.entry img { display: block; max-width: 100%; height: auto; margin: 0 0 8px; border-radius: 4px; }
.btn-back {
  min-height: 46px; margin-top: 34px; padding: 0 18px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--ink); color: var(--white); font: 600 14.5px/1 var(--sans);
}

html:not(.js) body { background: var(--paper); color: var(--ink); }
html:not(.js) .stage, html:not(.js) .controls, html:not(.js) .year, html:not(.js) .hint { display: none; }
html:not(.js) .masthead { position: static; max-width: 700px; margin: 0 auto; padding: 40px 24px 0; }
html:not(.js) .masthead p { color: var(--muted); }
html:not(.js) .masthead a { color: var(--ink); }
html:not(.js) .list-inner { padding-top: 34px; }

/* ---------- the rail of stops shown when the town is dragged about ---------- */

.rail { display: none; }
.is-pan .rail {
  position: fixed; left: 10px; right: 10px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 16;
  display: flex; justify-content: space-between; align-items: center; height: 44px;
}
.is-pan .rail::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: 50%; height: 1px; background: rgba(28, 27, 26, .22);
}
.rail-dot {
  position: relative; display: grid; place-items: center; width: 40px; height: 44px; padding: 0;
  border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rail-dot span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--white); border: 1px solid rgba(28, 27, 26, .45); color: var(--ink); font: 700 11px/1 var(--sans);
}
.rail-dot.on span { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.has-open .rail, .is-opening .rail, .has-list .rail { opacity: 0; pointer-events: none; }

/* ---------- narrow screens: the card becomes a bottom sheet ---------- */

@media (max-width: 859px) {
  .masthead { left: 4px; top: 4px; }
  .masthead h1 { font-size: 17px; }
  .year { left: 16px; top: 100px; font-size: 34px; }
  .controls { right: 12px; top: 12px; }
  .hint { left: 10px; right: auto; max-width: calc(100% - 20px); bottom: 10px; }
  .is-pan .hint { bottom: calc(54px + env(safe-area-inset-bottom, 0px)); }
  .card {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 56vh;
    border-radius: 16px 16px 0 0; transform: translateY(28px);
  }
  .card::before {
    content: ""; position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; margin-left: -19px;
    border-radius: 2px; background: rgba(28, 27, 26, .2);
  }
  #cardBody { padding: 24px 20px 14px; }
  .card-title { font-size: 26px; margin-bottom: 12px; }
  .card p { font-size: 15px; }
  .card .own p { font-size: 17px; }
  .list-inner { padding: 24px 20px 70px; }
  .card-frame { aspect-ratio: 16 / 6; }
  .card-photo.ph-herehat img { height: 240px; }
  .card-photo.ph-hat img { width: 160px; }
  .card-photo.ph-powers img { width: 170px; }
  .list-title { font-size: 28px; }
}

/* ---------- lit mode ----------
   A finished picture of the town lies under the scene and the scene
   draws only its ink. Body is marked data-b, and only in a lit build, so
   this rule is idle in flat mode; it is written without ancestors so that
   it also holds inside the <use> copies the veil's masks are made from. */

[data-b] { visibility: hidden; }
html.lit-wait .scene { visibility: hidden; }

/* The picture is still: nothing rises, tips, sways or turns. */
html.lit .lm.is-hot > .rise, html.lit .client.is-hot, html.lit .signpost.is-hot { transform: none; }
html.lit .lm-hat.is-open .hat-lid, html.lit .now-flag, html.lit .lm-fingerpost.is-open .arm, html.lit .climber { animation: none; }

/* Hover: the chip, and a quiet outline of the landmark. */
html.lit .focus-ring.hot { opacity: .3; stroke-width: 1.5; }
html.lit .focus-ring.on { opacity: 1; stroke-width: 2.4; }

/* Lettering on the picture's own boards and panels, which are darker
   than the page's: every line keeps at least 4.5 to 1 against what is
   behind it (measured: boards turned away from the light, the shaded
   pennant and the grey meter face). */
html.lit .t-board-when { fill: #2b2622; }
html.lit .t-now { fill: #fffdf9; }
html.lit .t-meter { fill: #ffd27a; }

/* The truck, shown by its frames, is unseen until its sheet has decoded. */
html.lit .lm-truck.ts-wait > .rise { visibility: hidden; }

/* Left out while lift() measures its groups (the truck's frames would
   count the whole sheet). */
.lit-measure .lit-body, .lit-measure .truck-sprite { display: none; }

/* The open landmark's cut-out; one that arrives late fades in. */
html.lit .lit-cut { opacity: 0; transition: opacity .3s ease; }
html.lit .lit-cut.ready { opacity: 1; }

/* Lights that only show in the picture while they are on. */
html.lit .win.wake, html.lit .cwin.one, html.lit .cabin-win, html.lit .plaza-lamp { opacity: 0; }
html.lit .lm-exchange.is-open .win.wake { animation-name: winOnLit; }
@keyframes winOnLit { 0% { opacity: 0; fill: #d9a441; } 100% { opacity: 1; fill: #d9a441; } }
html.lit .client.is-lit .cwin.one, html.lit .lm-cabin.is-open .cabin-win { opacity: 1; }
html.lit .lm-monument.is-open .plaza-lamp { animation-name: lampOnLit; }
@keyframes lampOnLit { 0% { opacity: 0; fill: #d9a441; } 100% { opacity: 1; fill: #d9a441; } }

/* The lit opening: the same clock (--now) and moments (--at) as the flat
   one. Nothing rises or drops: the plate is hidden, a masked copy of it
   comes up piece by piece (06d-lit.js), and each piece's ink fades in on
   the same curve as its piece of picture. */
html.lit-opening .lit-plate { opacity: 0; }
html.lit-reveal .lit-plate { transition: opacity .4s ease; }
.lit-ring { opacity: 0; animation: fade .7s ease both paused; animation-delay: calc(.2s - var(--now, 0s)); }
.lit-blob { color: #000; animation: litBlob .6s ease both paused; animation-delay: calc(var(--at, 0s) - var(--now, 0s)); }
@keyframes litBlob { 0% { color: #000; } 100% { color: #fff; } }
html.lit.is-opening .lm > .rise, html.lit.is-opening .signpost, html.lit.is-opening .node, html.lit.is-opening .client,
html.lit.is-opening .pole, html.lit.is-opening .citylimit, html.lit.is-opening .now {
  animation: litIn .6s ease both paused; animation-delay: calc(var(--at, 0s) - var(--now, 0s));
}
@keyframes litIn { 0% { opacity: 0; } 100% { opacity: 1; } }
/* The lights go out for the dormant years: the picture's own unlit
   windows show through. */
html.lit.is-opening .sleeps .win.lit { animation-name: sleepWinLit; }
@keyframes sleepWinLit { 0%, 100% { opacity: 1; } 7%, 93% { opacity: 0; } }

/* ---------- reduced motion: no idle motion, end states only ---------- */

@media (prefers-reduced-motion: reduce) {
  .tape, .beacon, .chrysalis, .led, .cursor, .now-flag, .bf-wing,
  .wire-flow.on, .client.is-lit .forks, .lm-shed.is-open .led, .lm-fingerpost.is-open .arm,
  .lm-cone.is-open .snow, .lm-lamp.is-open .needle { animation: none !important; }
  .lm > .rise, .client, .signpost, .node, .hat-lid, .shell, .card, .list, .veil-rect, .win { transition: none !important; }
  .ring { animation: none; opacity: .55; transform: scale(calc(.25 + var(--i) * .25)); }
  .lm-ticker.is-open .flood { animation: none; opacity: .8; }
  .lm-cabstand.is-open .slip-flip { animation: none; }
  .lm-cabstand.is-open .slip-front { animation: none; opacity: 0; }
  .lm-cabstand.is-open .slip-back { animation: none; opacity: 1; }
  .lm-signshop.is-open .sg-wipe { animation: none; }
}
