#street-tour {
  display: grid;
  position: relative;
  background: #191622;
  isolation: isolate;
}
.route-pin,
.route-stops {
  grid-area: 1/1;
}
.route-pin {
  --head: 66px;
  position: sticky;
  top: var(--head);
  align-self: start;
  height: calc(100svh - var(--head));
  overflow: hidden;
  isolation: isolate;
  background: #211b2a;
  z-index: 1;
}
.route-art,
.route-shade,
#route-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.route-art {
  background: url(assets/places/market-quarter.webp) center/cover;
}
#route-canvas {
  display: block;
}
.route-shade {
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      #130f1cf7 0%,
      #16101ee0 17%,
      #18101eb5 34%,
      transparent 61%
    ),
    linear-gradient(0deg, #140f1fba, transparent 16%);
}
.route-stops {
  pointer-events: none;
}
.route-stop {
  height: max(490px, 76svh);
}
.route-stop:last-child {
  height: calc(100svh - 20px);
}
.route-copy {
  position: absolute;
  width: min(32%, 435px);
  top: 48%;
  transform: translateY(-50%);
  left: var(--rail);
  pointer-events: none;
}
.route-copy h2 {
  margin: 0.15em 0 0.16em;
  font-size: clamp(48px, 5.7vw, 104px);
  font-weight: 800;
  line-height: 0.91;
  letter-spacing: -0.08em;
  text-wrap: balance;
}
.route-pin[data-stop="market"] .route-copy h2 {
  color: var(--orange);
}
.route-copy > p {
  margin: 18px 0 8px;
  font-size: clamp(16px, 1.35vw, 22px);
  line-height: 1.4;
  color: #e5d9d4;
  text-wrap: pretty;
}
#street-tour [hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .route-pin {
    --head: 92px;
  }
  .route-shade {
    background: linear-gradient(
      0deg,
      #15101e 1%,
      #15101ef2 22%,
      #17111fe0 32%,
      transparent 60%
    );
  }
  .route-copy {
    left: 22px;
    right: 22px;
    top: auto;
    bottom: 30px;
    width: auto;
    max-width: none;
    transform: none;
  }
  .route-copy h2 {
    display: block;
    font-size: clamp(35px, 9vw, 57px);
    margin: 5px 0;
  }
  .route-copy > p {
    display: block;
    font-size: 15px;
    margin: 8px 0 0;
    line-height: 1.35;
  }
}
@media (max-height: 570px) and (min-width: 761px) {
  .route-copy h2 {
    font-size: 45px;
  }
  .route-copy > p {
    font-size: 14px;
  }
}
@media (max-width: 355px) {
  header nav a {
    font-size: 10px;
  }
}

/* The street remains just visible around the 16:9 trailer. */
#street-film { height: max(750px, 235svh); }
.street-film {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  background: linear-gradient(0deg, #110d17 0%, #14101bed 35%, #14101bd6);
  color: var(--paper);
}
.street-film-inner {
  width: min(100%, 1120px, calc((100svh - var(--head) - 130px) * 16 / 9));
}
.street-film video {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
}
.street-film figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 30px;
  padding: 18px 0 0;
  flex-wrap: wrap;
}
.street-film h2 { color: var(--orange); font-size: clamp(30px, 3.3vw, 54px); letter-spacing: -.055em; line-height: 1; margin: 0; }
.street-film p { max-width: 52ch; flex: 1 1 300px; font-size: clamp(15px, 1.2vw, 19px); line-height: 1.4; margin: 0; }
.street-film button { color: var(--paper); text-decoration: underline; font: inherit; }
@media (max-width: 760px) {
  .street-film-inner { width: min(100%, calc((100svh - var(--head) - 146px) * 16 / 9)); }
  .street-film figcaption { display: grid; gap: 9px; padding: 20px var(--rail) 0; }
  .street-film h2 { font-size: clamp(34px, 9vw, 48px); }
  .street-film button { justify-self: start; }
}
/* Leave enough street before the in-flow reader to see the shop entrance. */
#ink.route-stop { height: calc(76svh + 100svh - 66px); }
/* Hold the centered sign in the black room before the shelf scrolls in. */
#herowave-entry { height: calc(136svh - var(--head, 66px)); }
.edition-shop {
  position: relative;
  z-index: 2;
  height: auto;
  min-height: calc(100svh - 66px);
  display: grid;
  align-items: center;
  pointer-events: auto;
  padding: clamp(28px, 4vh, 60px) var(--rail);
  background: #000;
  color: #fff0d7;
}
.edition-inner { width: 100%; max-width: 1200px; min-width: 0; margin: auto; }
.edition-intro { margin-bottom: 20px; }
.edition-sign { display: flex; align-items: center; gap: clamp(24px, 4vw, 54px); }
.edition-sign h2 img {
  display: block;
  width: clamp(150px, 15vw, 215px);
  height: auto;
  position: relative;
  z-index: 1;
  pointer-events: none;
  transform-origin: top left;
  image-rendering: pixelated;
}
.edition-sign p { font-size: 15px; max-width: 49ch; color: #e2e0d6; }
.edition-shelf {
  --step: min(calc(100% / 9), 124px);
  --cover: 72px;
  position: relative;
  overflow: clip;
  margin-top: 12px;
  height: 140px;
  border-bottom: 1px solid #475057;
}
.edition-shelf button {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: var(--step);
  height: calc(100% - 6px);
  display: grid;
  grid-template-rows: 1fr 22px;
  justify-items: center;
  align-items: center;
  padding: 0;
  color: #cdcfc6;
  transform: translateX(calc(-50% + var(--slot) * 100%));
  transition: transform .36s cubic-bezier(.22,.75,.22,1);
}
.edition-shelf button span { font: 700 12px/1.2 City, sans-serif; white-space: nowrap; }
.edition-shelf button img {
  width: var(--cover);
  height: auto;
  image-rendering: pixelated;
  scale: .62;
  filter: saturate(.68) brightness(.82);
  transition: scale .32s ease, filter .24s ease;
}
.edition-shelf button[aria-pressed="true"] { color: #fff4ce; }
.edition-shelf button[aria-pressed="true"] img {
  scale: 1;
  filter: none;
  animation: cover-float 3s ease-in-out infinite alternate;
}
@keyframes cover-float {
  from { transform: translateY(2px) rotate(-2deg); }
  to { transform: translateY(-5px) rotate(2deg); }
}
@media (hover: hover) {
  .edition-shelf button:hover img { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .edition-shelf button, .edition-shelf button img { transition: none; }
  .edition-shelf button[aria-pressed="true"] img { animation: none; }
}
.edition-shelf button:focus-visible { outline-offset: -2px; }
.edition-spread {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: radial-gradient(#6c483421 .9px, transparent 1px) 0 0/5px 5px, #f6e8ce;
  color: #201a26;
  border: 3px solid #101720;
  box-shadow: 1px 3px #b5a892, 1px 5px #483e42, 2px 8px #b5a892, 4px 12px 0 #101b23;
  display: grid;
  grid-template-columns: minmax(0, .46fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(clamp(190px, 25vw, 360px), 1fr);
  grid-template-areas: "story film" "portrait film";
  --gutter: clamp(16px, 1.8vw, 26px);
  gap: 10px var(--gutter);
  padding: var(--gutter);
}
.edition-art {
  grid-area: portrait;
  position: relative;
  z-index: 1;
  margin-right: calc(-1 * var(--gutter) - min(5vw, 68px));
  margin-bottom: calc(-1 * var(--gutter) - 5px);
  pointer-events: none;
}
.edition-art img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(2px -1px #fff4d9) drop-shadow(-1px 0 #fff4d9);
  transform-origin: right bottom;
  animation: comic-drift 4.5s ease-in-out infinite alternate;
}
@keyframes comic-drift { to { transform: translateY(-2px) rotate(.55deg); } }
.still .edition-art img { animation: none; }
.edition-story { grid-area: story; align-self: start; }
.edition-story h3 {
  font-size: clamp(34px, 3.2vw, 50px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.055em;
  margin-bottom: 12px;
  transform: skewX(-7deg);
  transform-origin: bottom left;
}
.edition-narration { display: grid; }
.edition-narration p { grid-area: 1 / 1; }
.edition-narration p, .battle-heading p {
  align-self: start;
  background: color-mix(in srgb, #ffe6a2 90%, var(--issue, #ffe6a2));
  color: #271c23;
  border: 2px solid #271c23;
  box-shadow: 3px 3px #271c23;
  padding: 10px 14px;
  font: italic clamp(16px, 1.32vw, 20px)/1.35 Georgia, serif;
}
.edition-narration [aria-hidden="true"] { visibility: hidden; }
.edition-screen {
  grid-area: film;
  align-self: end;
  position: relative;
  width: 100%;
  aspect-ratio: 5/3;
  background: #191727;
  border: 3px solid #24202a;
}
.edition-screen :is(video,img) { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; image-rendering: pixelated; }
.route-pin[data-scene="comics"] .route-copy { visibility: hidden; }
@media (max-width: 880px) {
  .edition-spread {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas: "story" "film";
    gap: 16px;
    padding: 13px 13px var(--portrait-margin);
    --portrait-margin: clamp(44px, 16vw, 140px);
  }
  .edition-story h3 { font-size: clamp(30px, 6vw, 42px); margin-bottom: 8px; }
  .edition-narration { max-width: 48ch; }
  .edition-narration p { padding: 8px 12px; }
  .edition-art {
    grid-area: film;
    align-self: end;
    justify-self: start;
    width: 35%;
    height: 59%;
    margin: 0 0 calc(-1 * var(--portrait-margin) - 3px) -10px;
  }
  .edition-art img { object-position: left bottom; }
}
@media(max-width: 760px) {
  #ink.route-stop { height: calc(176svh - 92px); }
  .edition-shop { padding: 24px var(--rail) 28px; min-height: calc(100svh - 92px); }
  .edition-intro { margin-bottom: 14px; }
  .edition-sign { display: block; }
  .edition-sign h2 img { width: 145px; }
  .edition-sign p { font-size: 14px; line-height: 1.4; max-width: 48ch; margin-top: 10px; }
  .edition-shelf {
    --step: 20%;
    --cover: 62px;
    height: 122px;
    margin-top: 8px;
  }
}
@media (max-width: 460px) {
  .edition-shelf { --step: calc(100% / 3); }
}

/* The reader and the battle are consecutive pages in the same shop. */
.route-pin[data-scene="page"] .route-copy {visibility:hidden}
.battle-page,.cabinet-room {position:relative;z-index:2;pointer-events:auto;height:auto;min-height:calc(100svh - 66px);padding:clamp(36px,6vw,86px) var(--rail);display:grid;align-items:center}
.battle-page { background: #000; }
.battle-sheet {
  width: min(100%, 1050px);
  margin: auto;
  padding: clamp(18px, 2.4vw, 34px) 0 0;
  overflow: clip;
  background: radial-gradient(#6c483421 .9px, transparent 1px) 0 0/5px 5px, #f6e8ce;
  color: #201a26;
  border: 3px solid #101720;
  box-shadow: 1px 3px #b5a892, 1px 5px #483e42, 2px 8px #b5a892, 4px 12px #101b23;
}
.battle-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 0 4% 22px;
}
.battle-heading h2 {
  font-size: clamp(46px, 5.4vw, 80px);
  letter-spacing: -.07em;
  line-height: .95;
  transform: skewX(-6deg);
  font-weight: 800;
}
.battle-heading p { max-width: 43ch; }
.battle-scene {
  --apron: clamp(64px, 8.6vw, 115px);
  width: 80%;
  position: relative;
  margin: 0 auto var(--apron);
}
.battle-film {
  position: relative;
  background: #171520;
  border: 3px solid #24202a;
  aspect-ratio: 5/3;
}
.battle-film :is(video,img) { position: absolute; inset: 0; }
.battle-pair {
  position: absolute;
  bottom: calc(-1 * var(--apron) - 2px);
  width: 32%;
  height: 46%;
  pointer-events: none;
}
.battle-pair.challengers { left: -11%; }
.battle-pair.rivals { right: -11%; }
.battle-pair img {
  position: absolute;
  bottom: 0;
  height: 100%;
  width: 75%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(1px -1px #fff4d9);
}
.battle-pair img + img { height: 78%; width: 60%; }
.challengers img:first-child, .rivals img:last-child { left: 0; }
.rivals img:first-child, .challengers img:last-child { right: 0; }
.rivals img { transform: scaleX(-1); }
.battle-film :is(video,img),.cabinet-glass :is(video,img){display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.route-pin[data-scene="weather"] h2 {font-size:clamp(38px,4.5vw,76px)}
.route-copy h2 img {width:clamp(60px,6vw,94px);display:block;image-rendering:pixelated;margin-bottom:10px}
/* The camera stops stay in document coordinates while the arcade stays on screen. */
.arcade-visit {
  --storefront-run: 185svh;
  --interior-run: 125svh;
  --cabinet-run: 115svh;
  --exit-run: 160svh;
  position: relative;
}
.arcade-stops { position: absolute; inset: 0; display: flex; flex-direction: column; }
#arcade { flex: 0 0 var(--storefront-run); }
#arcade-entry { flex: 0 0 var(--interior-run); }
#game-floor { flex: 0 0 var(--cabinet-run); }
#arcade-exit { flex: 1; height: auto; }
#city-pullback { height: 170svh; }
.arcade-visit::after { content: ""; display: block; height: calc(var(--storefront-run) + var(--interior-run) + var(--cabinet-run) + var(--exit-run)); }
.cabinet-room {
  position: sticky;
  top: var(--head, 66px);
  clip-path: inset(var(--portal-clip, 50%));
  pointer-events: none;
  isolation: isolate;
  background: #100e18;
  color: var(--paper);
  padding: clamp(24px, 4vh, 50px) 0;
  text-align: center;
}
.cabinet-room::before, .cabinet-room::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.cabinet-room::before {
  background: url("assets/market/arcade-floor.webp?rev=guests") center / cover no-repeat;
  filter: saturate(calc(1 - .35 * var(--room-dim, 1)));
  image-rendering: pixelated;
}
@media (prefers-reduced-motion: no-preference) {
  .cabinet-room[data-running]::before {
    background-image: url("assets/market/arcade-floor-loop.webp"), url("assets/market/arcade-floor.webp?rev=guests");
  }
}
.cabinet-room::after {
  opacity: var(--room-dim, 1);
  background: linear-gradient(0deg, #0b0914c9, transparent 32%, transparent 78%, #0b091443),
    radial-gradient(ellipse at center, #0c0a15ed 12%, #0c0a15d4 64%, #0c0a15b5);
}
.cabinet-inner { width: 100%; min-width: 0; opacity: var(--shelf-opacity, 1); }
.cabinet-inner:not([inert]) { pointer-events: auto; }
#cabinet-heading {
  margin: 0;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.05;
  letter-spacing: -.055em;
  text-shadow: 0 2px 12px #141020;
}
.marquees {
  --step: clamp(135px, 14vw, 206px);
  position: relative;
  height: clamp(96px, 13vh, 132px);
  overflow: clip;
}
.marquees button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--step);
  height: 80%;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translate(calc(-50% + var(--slot) * var(--step)), -50%);
  transition: transform .38s cubic-bezier(.2,.8,.2,1);
  -webkit-tap-highlight-color: transparent;
}
.marquees img {
  display: block;
  width: 96%;
  height: 77%;
  object-fit: contain;
  image-rendering: pixelated;
  transform: scale(.57);
  filter: saturate(.5) brightness(.83) drop-shadow(0 2px 3px #100c17);
  transition: transform .38s ease, filter .32s;
}
.marquees button[aria-pressed=true] img {
  transform: scale(1.34);
  filter: drop-shadow(0 4px 4px #110d18);
}
.marquees button:focus-visible { outline: none; }
.marquees button:focus-visible::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 30px;
  height: 3px;
  background: var(--paper);
}
.cabinet-glass {
  width: min(640px, 68vw, 71svh);
  aspect-ratio: 5 / 3;
  margin: 0 auto;
  background: #0a0811;
  box-shadow: 0 12px 38px #0b0918a6;
}
.cabinet-caption { display: grid; margin: 16px auto 0; padding: 0 18px; max-width: 610px; }
.cabinet-caption h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cabinet-caption .caption-measure { visibility: hidden; }
.cabinet-caption p {
  grid-area: 1 / 1;
  margin: 0;
  min-height: 2.8em;
  color: #f2e7dd;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.4;
  text-wrap: balance;
  text-shadow: 0 1px 6px #100c17;
}
@media (prefers-reduced-motion: reduce) {
  .marquees button, .marquees img { transition: none; }
}
@media (max-width:760px){
  .battle-page,.cabinet-room{min-height:calc(100svh - 92px);padding:28px var(--rail)}
  .battle-heading { display: grid; gap: 10px; margin: 0 4% 16px; }
  .battle-heading h2 { font-size: clamp(40px, 9vw, 58px); }
  .battle-heading p { padding: 8px 12px; }
  .battle-scene { width: 92%; --apron: clamp(48px, 17vw, 130px); }
  .battle-pair { width: 39%; height: 49%; }
  .battle-pair.challengers { left: -3%; }
  .battle-pair.rivals { right: -3%; }
  .route-pin[data-scene="weather"] h2 {font-size:clamp(32px,8vw,48px)}
  .route-copy h2 img {width:50px}
  .cabinet-room { padding: 26px 0; }
  .cabinet-room::before { background-position: 49% center; }
  .marquees { --step: clamp(96px, 33vw, 168px); height: 96px; }
  .cabinet-glass { width: min(calc(100% - 32px), 560px); }
  .cabinet-caption { max-width: 39ch; }
}

@media(max-width:760px){header .studio {margin-inline:0 auto}}

.district-atlas.route-stop {
  position: relative; z-index: 2;
  min-height: calc(100svh - var(--head)); height: auto;
  pointer-events: none;
}
.atlas-map {
  --stage-height: calc(100svh - var(--head));
  --map-size: min(100%, calc(var(--stage-height) * 1380 / 1388));
  --map-left: calc((100% - var(--map-size)) * .60);
  --gutter: clamp(16px, 3vw, 56px);
  position: relative; isolation: isolate; container-type: inline-size;
  min-height: var(--stage-height);
  transform: translateY(calc(-1 * var(--atlas-lift, 0px)));
  opacity: var(--atlas-opacity, 0);
  pointer-events: auto;
}
.atlas-map::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #226988 url(assets/districts/sea.png) repeat;
  background-size: calc(var(--stage-height) * 64 / 1388);
  filter: brightness(.44) saturate(.68);
}
.district-chart {
  position: relative; isolation: isolate;
  width: var(--map-size); margin-left: var(--map-left);
}
.district-chart > img {
  width: 100%; height: auto; display: block;
  filter: brightness(.44) saturate(.68);
}
.district-bounds, .district-pins { position: absolute; inset: 0; width: 100%; height: 100%; }
.district-area image { opacity: 0; pointer-events: none; transition: opacity .48s ease; }
.district-area.is-lit image { opacity: .88; }
.district-area > path {
  fill: var(--tint); fill-opacity: .025;
  stroke: var(--tint); stroke-opacity: .43; stroke-width: 1;
  vector-effect: non-scaling-stroke; stroke-linejoin: round; cursor: pointer;
  transition: fill-opacity .35s, stroke-opacity .35s;
}
.district-area > path:hover { fill-opacity: .14; stroke-opacity: 1; }
.district-area.is-lit > path { fill-opacity: .085; stroke-opacity: 1; stroke-width: 1.5; }
.district-pins { pointer-events: none; }
.district-pins button {
  pointer-events: auto; position: absolute; width: 28%; min-height: 44px;
  display: grid; place-items: center; padding: 0;
  transform: translate(-50%, -50%); touch-action: manipulation;
}
.district-pins img {
  display: block; width: 100%;
  filter: drop-shadow(0 2px 1px #090a13) drop-shadow(0 0 3px color-mix(in srgb, var(--tint) 55%, transparent));
  transition: transform .35s ease, filter .35s;
}
.district-pins button:is(:hover, :focus-visible, [aria-pressed=true]) img {
  transform: scale(1.08);
  filter: drop-shadow(0 2px 2px #090a13) drop-shadow(0 0 5px var(--tint));
}
.atlas-intro, .district-story {
  position: absolute; left: var(--gutter); bottom: clamp(12px, 3.6svh, 44px);
  pointer-events: none;
  width: min(400px, calc(var(--stage-height) * .47), calc(var(--map-left) + var(--map-size) * .285 - var(--gutter)));
  color: var(--paper);
}
.atlas-intro h2, .district-story h3 {
  margin: 0; font-size: clamp(25px, 3vw, 52px); line-height: .98; letter-spacing: -.055em;
}
.atlas-intro p, .district-story p {
  font-size: clamp(15px, 1.18vw, 20px); line-height: 1.38; margin: .55em 0 0;
}
.district-story h3 { color: var(--district-color); }
.district-story video {
  display: block; width: 100%; aspect-ratio: 5 / 3; margin: 12px 0 0;
  image-rendering: pixelated; background: #12141c;
}
.has-selection .atlas-intro {
  width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
@media (max-aspect-ratio: 6/5) {
  .atlas-map { --map-size: min(100%, var(--stage-height)); --map-left: calc((100% - var(--map-size)) / 2); }
  .atlas-intro, .district-story h3 {
    position: absolute; top: auto; bottom: auto;
    left: calc(var(--map-left) + var(--map-size) * .022);
    width: calc(var(--map-size) * .265);
    font-size: clamp(19px, 5vw, 39px);
  }
  .atlas-intro, .district-story h3 { top: min(60cqw, calc(var(--stage-height) * .60)); }
  .atlas-intro h2 { font-size: inherit; }
  .atlas-intro p { font-size: 14px; }
  .district-story { position: static; width: auto; }
  .district-story video, .district-story p {
    width: min(calc(100% - 32px), 500px); margin-inline: auto;
  }
  .district-story video { margin-top: 0; }
  .district-story p { font-size: clamp(15px, 3.5vw, 20px); padding-bottom: 16px; }

}
@media (max-width: 760px) and (orientation: portrait) {
  .atlas-map {
    --map-size: min(100%, calc((var(--stage-height) - 125px) * 1380 / 1388));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: clamp(18px, calc((var(--stage-height) - 100vw) * .2), 72px);
  }
  .district-chart { margin-left: 0; }
  .atlas-map:not(.has-selection) .atlas-intro {
    position: static;
    width: 100%;
    margin-block: auto;
    padding: 16px 20px 24px;
    text-align: center;
  }
  .atlas-intro h2 { font-size: clamp(30px, 8vw, 42px); }
  .atlas-intro p { margin-top: .45em; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .district-area image, .district-area > path, .district-pins img { transition: none; }
}

html:has(.district-dialog:modal) { overflow: hidden; }
.district-dialog:modal {
  position: fixed; inset: 0; box-sizing: border-box;
  width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: max(64px, calc(env(safe-area-inset-top) + 52px)) 0 max(24px, env(safe-area-inset-bottom));
  border: 0; overflow: auto; overscroll-behavior: contain; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center;
  color: var(--paper);
  background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--district-color) 12%, #15121e), #15121e 65%);
}
.district-dialog::backdrop { background: #15121e; }
.district-close {
  position: fixed; z-index: 1;
  top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 48px; height: 48px; padding: 0;
  font: 34px/1 system-ui, sans-serif; color: var(--paper); background: #15121e;
}
.district-dialog-logo {
  display: block; width: min(64%, 280px); margin: auto auto 18px;
  filter: drop-shadow(0 2px 10px color-mix(in srgb, var(--district-color) 25%, transparent));
}
.district-dialog .district-story {
  position: static; width: min(100%, 640px); margin: 0 auto auto;
}
.district-dialog .district-story h3 {
  position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%);
}
.district-dialog .district-story video { width: 100%; margin: 0; }
.district-dialog .district-story p {
  width: auto; padding: 0; margin: 18px max(20px, env(safe-area-inset-left)) 0;
  font-size: clamp(17px, 4.4vw, 21px); line-height: 1.45;
}
@media (orientation: landscape) and (max-height: 540px) {
  .district-dialog:modal {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto;
    align-content: center; gap: 12px 24px; padding: 20px max(64px, env(safe-area-inset-right)) 20px max(20px, env(safe-area-inset-left));
  }
  .district-dialog .district-story { display: contents; }
  .district-dialog-logo { grid-area: 1/2; width: min(90%, 190px); margin: 0 auto; }
  .district-dialog .district-story video { grid-area: 1/1/3/2; }
  .district-dialog .district-story p { grid-area: 2/2; margin: 0; font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .district-dialog:modal { animation: district-enter .22s ease-out; }
  @keyframes district-enter { from { opacity: 0; transform: translateY(8px); } }
}
