/* Rebuild Mumbai: painted signboard world.
   Enamel grounds, shaded signwriter lettering, pinstripe borders.
   Safety yellow is reserved for the build action only. */

:root {
  --green: #1a4a33;          /* signwriter green, page ground */
  --green-deep: #0f3322;     /* letter shade on green */
  --green-ink: #bcd7c2;      /* secondary text on green */
  --tin: #f4ecd5;            /* tin cream board */
  --red: #c2352a;            /* vermilion lettering */
  --red-deep: #7d1d16;
  --black: #1a1712;          /* lamp black */
  --ink-2: #4a4234;          /* secondary text on tin */
  --cobalt: #1d3c94;
  --yellow: #f5c21b;         /* build action only */
  --yellow-deep: #a87f00;

  --display: 'Yatra One', 'Mukta', sans-serif;
  --body: 'Mukta', system-ui, sans-serif;

  --pad: clamp(16px, 4vw, 32px);
  --radius-notch: 10px;
  --shade: 0.06em 0.07em 0 var(--green-deep);
  --shade-tin: 0.05em 0.06em 0 var(--red-deep);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--green);
  color: var(--tin);
  font: 400 1rem/1.5 var(--body);
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
}
::selection { background: var(--red); color: var(--tin); }
:focus-visible { outline: 3px solid var(--tin); outline-offset: 3px; border-radius: 2px; }
.board :focus-visible, .tin :focus-visible { outline-color: var(--cobalt); }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
img, canvas, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
* { scrollbar-width: thin; scrollbar-color: var(--green-ink) transparent; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 2000; background: var(--tin); color: var(--black); padding: 8px 12px; }
.skip:focus { top: 8px; }

/* ---------- lettering ---------- */
.lettered {
  font-family: var(--display);
  font-weight: 400;
  line-height: .95;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-shadow: var(--shade);
  margin: 0;
}
.marathi { font-family: var(--display); letter-spacing: 0; text-transform: none; }

/* ---------- header ---------- */
.masthead {
  padding: 8px var(--pad) 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0 14px;
}
.masthead .nav { grid-column: 1 / -1; justify-self: end; margin-bottom: 8px; align-items: center; }
.masthead h1 { grid-column: 1 / -1; font-size: clamp(2rem, 10.4vw, 4.4rem); color: var(--tin); white-space: nowrap; }
.masthead .r { color: var(--red); text-shadow: 0.06em 0.07em 0 var(--black); }
.masthead .marathi { font-size: clamp(.95rem, 3.8vw, 1.25rem); color: var(--green-ink); margin: 4px 0 0; text-shadow: none; white-space: nowrap; }
.masthead p.purpose { margin: 4px 0 0; color: var(--green-ink); max-width: 46ch; font-size: .9rem; line-height: 1.35; }
.nav { display: flex; gap: 14px; font-weight: 600; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--tin); border-bottom: 2px solid transparent; padding: 4px 0; }
.nav a[aria-current="page"] { border-bottom-color: var(--red); }

/* ---------- painted board (tin panel) ---------- */
.board {
  background: var(--tin);
  color: var(--black);
  position: relative;
  padding: 18px 18px 16px;
  border: 3px solid var(--black);
  /* notched sign corners */
  -webkit-mask:
    radial-gradient(circle at 0 0, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) top left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 0, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) top right / 51% 51% no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) bottom left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) bottom right / 51% 51% no-repeat;
          mask:
    radial-gradient(circle at 0 0, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) top left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 0, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) top right / 51% 51% no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) bottom left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--radius-notch), #000 calc(var(--radius-notch) + .5px)) bottom right / 51% 51% no-repeat;
}
.board::before { /* pinstripe */
  content: '';
  position: absolute;
  inset: 5px;
  border: 1.5px solid var(--red);
  pointer-events: none;
}
.board .lettered { text-shadow: var(--shade-tin); color: var(--red); }

/* number plate */
.plate {
  display: inline-grid;
  place-items: center;
  min-width: 2.4em;
  height: 1.9em;
  padding: 0 .35em;
  background: var(--tin);
  color: var(--red);
  border: 2px solid var(--black);
  box-shadow: inset 0 0 0 2px var(--tin), inset 0 0 0 3px var(--red);
  font: 400 1rem/1 var(--display);
  text-shadow: 0.05em 0.05em 0 var(--black);
}
.plate.big { font-size: 1.6rem; }

/* tally plate for measurements */
.tally {
  display: inline-block;
  background: var(--black);
  color: var(--tin);
  font: 600 .82rem/1 var(--body);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  padding: 4px 6px 3px;
  border-radius: 2px;
}

/* Data needed: a painted blank waiting for lettering */
.needed {
  display: inline-block;
  font: 400 .95rem/1.2 var(--display);
  color: var(--red);
  border: 1.5px dashed var(--red);
  padding: 2px 8px 1px;
  letter-spacing: .02em;
}

/* ---------- build action (the only yellow) ---------- */
.build {
  appearance: none;
  border: 3px solid var(--black);
  background: var(--yellow);
  color: var(--black);
  font: 400 1.35rem/1 var(--display);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 14px 22px 11px;
  min-height: 52px;
  box-shadow: 0 3px 0 var(--yellow-deep), 0 8px 18px -6px #0008;
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  display: inline-flex; align-items: center; gap: 10px;
}
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-thickness: 2px; }
  .nav a:hover { border-bottom-color: var(--red); }
  .years .strip button:hover { color: color-mix(in srgb, var(--tin) 75%, var(--green)); }
  .build:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--yellow-deep), 0 12px 22px -8px #0009; }
  .quiet-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
  .map-plate:not(.is-on) .plate:hover { transform: scale(1.08); }
  .rail button:hover .plate { transform: translateY(-2px); }
}
.build:active { transform: translateY(2px) scale(0.97); box-shadow: 0 1px 0 var(--yellow-deep), 0 4px 10px -6px #0008; transition-duration: 100ms; }
.build svg { width: 22px; height: 22px; }

.quiet-btn {
  appearance: none;
  background: transparent;
  border: 2px solid currentColor;
  padding: 8px 12px 6px;
  font-weight: 600;
  font-size: .92rem;
  min-height: 44px;
  display: inline-flex; align-items: center; gap: 8px;
}
.quiet-btn { transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.quiet-btn:active, .sound:active, .rail button:active .plate, .years .strip button:active { transform: scale(0.97); }
.quiet-btn svg { width: 18px; height: 18px; }

/* ---------- home ---------- */
.home { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; }
.map-wrap { position: relative; min-height: 57dvh; border-block: 3px solid var(--black); }
#map { position: absolute; inset: 0; background: var(--green); }
.leaflet-container { background: var(--green-deep); font-family: var(--body); }
/* the city ghosted in two enamel greens under the painted plates */
.leaflet-tile-pane { filter: url(#enamel) contrast(1.08); }
.dot-icon { background: none; border: 0; }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--green-deep) 85%, transparent) !important;
  color: var(--green-ink) !important;
  font-size: 10.5px !important;
  max-width: 100%;
}
.leaflet-control-attribution a { color: var(--tin) !important; }
.leaflet-control-zoom a {
  background: var(--tin) !important; color: var(--black) !important;
  border-color: var(--black) !important; font-family: var(--body);
}
.map-plate { background: none; border: 0; }
.map-plate .plate { font-size: 13px; min-width: 30px; height: 24px; cursor: pointer; transition: transform .2s var(--ease-out); }
.map-plate.is-on .plate { background: var(--red); color: var(--tin); box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px var(--tin); text-shadow: 0.05em 0.05em 0 var(--black); transform: scale(1.18); }
.map-chip { display: block; width: 14px; height: 14px; background: var(--tin); border: 1.5px solid var(--black); box-shadow: inset 0 0 0 1.5px var(--tin), inset 0 0 0 2.5px var(--red); cursor: pointer; }
.map-chip.is-on { background: var(--red); }

.map-legend {
  position: absolute; left: 10px; top: 10px; z-index: 500; margin: 0;
  font-size: .8rem; color: var(--tin);
  background: color-mix(in srgb, var(--green-deep) 82%, transparent);
  padding: 6px 9px; border: 1px solid var(--green-ink);
  max-width: 62%;
}

/* site rail: numbers are navigation */
.rail {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--pad);
  scroll-snap-type: x proximity;
  background: var(--green-deep);
}
.rail button { flex: none; scroll-snap-align: start; appearance: none; border: 0; background: none; padding: 0; }
.rail button[aria-pressed="true"] .plate { background: var(--red); color: var(--tin); box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px var(--tin); }

.dock { padding: 10px var(--pad) calc(12px + env(safe-area-inset-bottom)); }
.dock .board { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 14px 16px 14px; }
.dock h2 { font-size: clamp(1.35rem, 6vw, 2rem); grid-column: 2; }
.dock .meta { grid-column: 1 / -1; color: var(--ink-2); font-size: .92rem; line-height: 1.35; margin: 2px 0 6px; }
.dock .board .actions { flex-wrap: nowrap; }
.dock .actions .build { flex: 1 1 auto; justify-content: center; min-width: 0; }
@media (max-width: 520px) {
  .dock .board { padding: 10px 12px 12px; }
  .dock .plate.big { font-size: 1.25rem; }
  .dock .build { font-size: 1.1rem; padding: 11px 12px 9px; min-height: 48px; }
  .dock .step { width: 48px; justify-content: center; padding: 0; }
}
.dock .meta b { color: var(--black); font-weight: 600; }
.dock .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dock .step { color: var(--black); }

.jump { display: flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--green-ink); }
.jump input {
  width: 4.2em; padding: 6px 6px 4px; font: 400 1rem/1 var(--display); text-align: center;
  background: var(--tin); color: var(--red); border: 2px solid var(--black);
}

/* ---------- site view ---------- */
.site {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--green);
  overflow-y: auto; overscroll-behavior: contain;
  visibility: hidden; opacity: 0; transform: translateY(28px);
  /* exit: quick */
  transition: opacity 180ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms;
}
.site.is-open {
  visibility: visible; opacity: 1; transform: none;
  /* enter: a drawer rising, slower than the exit */
  transition: opacity 260ms ease, transform 460ms var(--ease-drawer), visibility 0s;
}
.site-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px var(--pad); }
.site-top .crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-top .crumbs .lettered { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.site-body { display: grid; gap: 14px; padding: 0 var(--pad) 32px; }

.stage {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 72dvh;
  width: 100%;
  margin-inline: auto;
  border: 3px solid var(--black);
  background: var(--green-deep);
  overflow: hidden;
  touch-action: pan-y;
}
.stage canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 3;
}
.stage .status[hidden] { display: none; }
.stage .status { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; }
.status-copy { display: grid; gap: 4px; }
.status-count { font: 600 .78rem/1 var(--body); color: var(--ink-2); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.status:not(.is-loading) .mosaic, .status:not(.is-loading) .status-count { display: none; }
/* tile mosaic: squares land in aerial colours as the real tiles arrive */
.mosaic { display: grid; grid-template-columns: repeat(4, 9px); gap: 2px; padding: 3px; background: var(--black); flex: none; }
.mosaic i { width: 9px; height: 9px; background: color-mix(in srgb, var(--ink-2) 22%, var(--tin));
  animation: tile-wait 1.4s ease-in-out calc(var(--n) * 80ms) infinite; }
.mosaic i.on { background: var(--c); animation: tile-in 320ms var(--ease-out) both; }
@keyframes tile-wait { 50% { opacity: .35; } }
@keyframes tile-in { from { transform: scale(.3); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .mosaic i, .mosaic i.on { animation: none; } }
/* a closed view takes no input, even from children that set their own visibility */
.site:not(.is-open) { pointer-events: none; }
.stage-ctl { position: absolute; right: 8px; bottom: 8px; z-index: 4; display: flex; gap: 8px; }
/* zoom belongs to the before/after compare only */
.stage:not(:has(.compare.is-on)) .zoom-ctl { opacity: 0; visibility: hidden; transform: translateY(6px); }
.zoom-ctl { transition: opacity 200ms ease, transform 260ms var(--ease-out), visibility 0s; }
.zoom-ctl {
  position: absolute; left: 8px; bottom: 8px; z-index: 4; display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--green-deep) 82%, transparent); border: 2px solid var(--tin); color: var(--tin);
}
.zoom-ctl button { appearance: none; border: 0; background: none; width: 44px; height: 44px; display: grid; place-items: center; transition: transform 160ms var(--ease-out), opacity 160ms ease; }
.zoom-ctl button:active { transform: scale(0.97); }
.zoom-ctl button:disabled { opacity: .35; cursor: default; }
.zoom-ctl button svg { width: 18px; height: 18px; }
.zoom-ctl output { min-width: 3.2em; display: grid; place-items: center; font: 400 1rem/1 var(--display); border-inline: 1.5px solid color-mix(in srgb, var(--tin) 40%, transparent); }
.stage-ctl .quiet-btn { background: color-mix(in srgb, var(--green-deep) 80%, transparent); color: var(--tin); }

/* compare */
.compare { position: absolute; inset: 0; z-index: 2; opacity: 0; visibility: hidden; filter: blur(6px); transform: scale(1.015);
  transition: opacity 200ms ease, filter 200ms ease, transform 200ms var(--ease-out), visibility 0s 200ms; }
.compare.is-on { opacity: 1; visibility: visible; filter: none; transform: none;
  transition: opacity 520ms ease, filter 520ms ease, transform 620ms var(--ease-out); }
.compare canvas.swap { animation: swap 240ms ease; }
@keyframes swap { from { filter: blur(3px); opacity: .55; } }
.compare .pane { position: absolute; inset: 0; overflow: hidden; }
.compare .pane.ol { pointer-events: none; }
.compare .zoomer, .compare .zoomer > * { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }
.compare .pane.after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.compare.radial .pane.after { clip-path: circle(var(--rad, 30%) at 50% 50%); }
.compare .handle {
  position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 3px; margin-left: -1.5px;
  background: var(--tin); box-shadow: 0 0 0 1.5px var(--black); pointer-events: none;
}
.compare .handle::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--tin); border: 2px solid var(--black);
}
.compare.radial .handle { display: none; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; touch-action: pan-y; }
.compare .tag {
  position: absolute; top: 8px; z-index: 1;
  background: var(--black); color: var(--tin); font: 600 .78rem/1 var(--body); padding: 5px 7px 4px; letter-spacing: .03em;
}
.compare .tag.l { left: 8px; } .compare .tag.r { right: 8px; }
.compare.radial .tag.l { left: 8px; }

/* year scrubber: every year present as a ghost, the active one struck */
.years { display: grid; gap: 6px; }
.years .modes { display: flex; gap: 0; border: 2px solid var(--tin); width: max-content; }
.years .modes button { appearance: none; border: 0; background: transparent; color: var(--tin); padding: 7px 12px 5px; font-weight: 600; min-height: 40px; }
.years .modes button[aria-pressed="true"] { background: var(--tin); color: var(--black); }
.years .strip { display: flex; gap: 2px; overflow-x: auto; padding: 4px 0 8px; scroll-snap-type: x proximity; }
.years .strip button {
  appearance: none; border: 0; background: none; padding: 4px 6px; flex: none; scroll-snap-align: center;
  font: 400 clamp(1.5rem, 6vw, 2.1rem)/1 var(--display); color: color-mix(in srgb, var(--tin) 50%, var(--green));
  transition: color .25s var(--ease-out), text-shadow .25s var(--ease-out);
  min-width: 44px; min-height: 44px;
}
.years .strip button[data-role="before"] { color: var(--tin); text-shadow: var(--shade); }
.years .strip button[data-role="after"] { color: var(--tin); text-shadow: 0.06em 0.07em 0 var(--red); }
.years .strip button span { display: block; font: 600 .62rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; color: var(--green-ink); text-shadow: none; }
.years .note { font-size: .85rem; color: var(--green-ink); margin: 0; }

/* the site board */
.record h2 { font-size: clamp(1.8rem, 8vw, 2.8rem); }
.record .sub { margin: 6px 0 14px; color: var(--ink-2); font-weight: 600; }
.record dl { margin: 0; display: grid; grid-template-columns: 1fr; }
.record .row { display: grid; grid-template-columns: minmax(7.5em, 34%) 1fr; gap: 10px; padding: 10px 0 9px; border-top: 1.5px solid var(--black); }
.record .row:first-child { border-top-width: 3px; }
.record dt { font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding-top: 2px; }
.record dd { margin: 0; font-size: 1rem; }
.record dd small { display: block; color: var(--ink-2); font-size: .85rem; margin-top: 2px; }
.record .src { margin: 14px 0 0; font-size: .9rem; color: var(--ink-2); }
.record .src a { color: var(--cobalt); font-weight: 600; }

/* other side: companion rail on phones, column on desktop */
.otherside { color: var(--tin); }
.otherside > h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
.otherside > p { color: var(--green-ink); margin: 6px 0 10px; max-width: 60ch; }
.otherside details { border-top: 1.5px solid color-mix(in srgb, var(--tin) 45%, transparent); }
.otherside details:last-of-type { border-bottom: 1.5px solid color-mix(in srgb, var(--tin) 45%, transparent); }
.otherside summary { list-style: none; cursor: pointer; padding: 12px 0 10px; font: 400 1.2rem/1.15 var(--display); display: flex; justify-content: space-between; gap: 10px; }
.otherside summary::-webkit-details-marker { display: none; }
.otherside summary .pm { width: 20px; height: 20px; flex: none; }
.otherside summary .pm .v { transition: transform 200ms var(--ease-out); transform-origin: center; }
.otherside details[open] summary .pm .v { transform: scaleY(0); }
.otherside .body { padding: 0 0 12px; max-width: 62ch; }
.otherside .body p { margin: 0 0 8px; }
.otherside .body ul { margin: 0; padding-left: 18px; font-size: .9rem; color: var(--green-ink); }
.otherside .body a { color: var(--tin); }
.site-note { background: var(--green-deep); border: 1.5px solid var(--green-ink); padding: 10px 12px; margin: 0 0 10px; }

.rail-tab {
  position: fixed; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 1001;
  transition: opacity 200ms ease, transform 260ms var(--ease-out);
  writing-mode: vertical-rl; text-orientation: mixed;
  background: var(--tin); color: var(--red); border: 3px solid var(--black); border-right: 0;
  font: 400 1rem/1 var(--display); padding: 14px 8px; letter-spacing: .04em; text-transform: uppercase;
  text-shadow: var(--shade-tin);
  display: none;
}
.site.is-open ~ .rail-tab { display: block; }

/* ---------- prose pages ---------- */
.page { padding: 0 var(--pad) 48px; display: grid; gap: 22px; max-width: 980px; }
.page .board { padding: 22px; }
.page h2 { font-size: clamp(1.6rem, 7vw, 2.4rem); margin-bottom: 10px; }
.page p, .page li { max-width: 66ch; }
.page .board p, .page .board li { color: var(--black); }
.page .board a { color: var(--cobalt); font-weight: 600; }
.page ul { padding-left: 20px; }
.page .facts { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0; }
.page .facts span { display: inline-flex; gap: 6px; align-items: baseline; }

footer.foot { padding: 16px var(--pad) calc(20px + env(safe-area-inset-bottom)); color: var(--green-ink); font-size: .85rem; border-top: 3px solid var(--black); }
footer.foot a { color: var(--tin); }

/* ---------- responsive: ornament drops in declared steps ---------- */
@media (max-width: 400px) {
  :root { --radius-notch: 7px; }
  .board::before { inset: 4px; }
  .masthead p.purpose { font-size: .9rem; }
}
@media (max-width: 359px) {
  .board::before { display: none; } /* step 2: pinstripes go */
  .lettered { text-shadow: none; }   /* step 3: shade goes; names keep their size */
}

@media (min-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: auto auto minmax(0, 1fr); height: 100dvh; min-height: 560px; }
  .masthead { grid-column: 1 / -1; }
  .map-wrap { grid-row: 2 / 4; border: 3px solid var(--black); border-left: 0; border-bottom: 0; min-height: 0; }
  .dock { grid-column: 2; grid-row: 2; }
  .rail { grid-column: 2; grid-row: 3; flex-wrap: wrap; overflow-y: auto; align-content: start; min-height: 0; }
  .site-body { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); align-items: start; column-gap: 28px; }
  .site-body .stage-col { grid-row: 1 / span 3; position: sticky; top: 10px; display: grid; gap: 14px; }
  .stage { max-height: 76dvh; }
  .rail-tab { display: none !important; }
}



.quiet-btn[hidden], .build[hidden] { display: none; }
.site-body > *, .stage-col > *, .years { min-width: 0; }
[tabindex="-1"]:focus { outline: none; }

/* sound toggle */
.sound {
  appearance: none; background: none; border: 0; color: inherit; padding: 4px 2px; min-height: 36px;
  display: inline-flex; align-items: center; gap: 6px; font: 600 .95rem/1 var(--body);
  transition: transform 160ms var(--ease-out), opacity 160ms ease;
}
.sound svg { width: 20px; height: 20px; }
.sound .off { display: none; }
.sound[aria-pressed="false"] .on { display: none; }
.sound[aria-pressed="false"] .off { display: inline; }
.sound[aria-pressed="false"] { opacity: .75; }
.site-top .sound { color: var(--tin); margin-right: 12px; }
@media (max-width: 520px) { .sound .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* record rows arrive in a short stagger when a site opens */
.record .row { transition: opacity 320ms ease, transform 420ms var(--ease-out); transition-delay: calc(var(--i, 0) * 40ms); }
@starting-style { .record .row { opacity: 0; transform: translateY(8px); } }
/* a field that just got its value is lettered in */
.fresh { animation: letter-in 520ms var(--ease-out) both; }
@keyframes letter-in { from { opacity: 0; filter: blur(3px); transform: scale(1.06); } }
.otherside details[open] .body { animation: open-body 260ms var(--ease-out); }
@keyframes open-body { from { opacity: 0; transform: translateY(-4px); } }
.map-plate.is-on .plate { animation: plate-on 360ms var(--ease-out); }
@keyframes plate-on { from { transform: scale(.92); } }
.rail button .plate { transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease; }

@media (prefers-reduced-motion: reduce) {
  /* fewer, gentler: keep fades that explain, drop movement */
  .site, .site.is-open { transform: none; }
  .compare, .compare.is-on { transform: none; filter: none; }
  .record .row { transform: none !important; }
  .fresh, .map-plate.is-on .plate, .otherside details[open] .body { animation: fade-only 200ms ease; }
  @keyframes fade-only { from { opacity: 0; } }
}

body.stage-in-view .rail-tab { opacity: 0; transform: translateX(100%); pointer-events: none; }
/* no-WebGL reveal: a painted ring at the reveal edge, and the instruction on the stage */
.compare .ring { display: none; }
.compare.radial .ring {
  display: block; position: absolute; left: 50%; top: 50%; pointer-events: none;
  width: calc(var(--rad, 0%) * 2); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 3px solid var(--tin); border-radius: 50%; box-shadow: 0 0 0 1.5px var(--black), inset 0 0 0 1.5px var(--black);
  min-width: 26px;
}
.compare .hint {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); margin: 0; z-index: 3; pointer-events: none;
  background: var(--tin); color: var(--black); border: 2px solid var(--black); padding: 8px 12px 6px; font-weight: 600; white-space: nowrap;
}
.build { white-space: nowrap; }
@media (max-width: 400px) { .build .wide { display: none; } }

/* page furniture formerly set inline */
.svg-defs { position: absolute; }
.site-top .site-close { color: var(--tin); }
.marathi-sub { margin: 4px 0 0; font-size: 1.1rem; }
.page-mark { font-size: clamp(1.6rem, 7vw, 2.4rem); }
.page-mark a { text-decoration: none; }
.page-title { font-size: clamp(2rem, 9vw, 3.2rem); margin-bottom: 4px; }
.marathi-board { color: var(--ink-2); margin: 0 0 14px; font-size: 1.15rem; }
.page h2.sub-h { font-size: clamp(1.4rem, 6vw, 2rem); }
