/* ============================================================
   STREET LEVEL — a city journal
   The issue is laid out as one night-time block of storefronts.
   ============================================================ */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --night: #1a1930;
  --night-deep: #12111f;
  --night-soft: #25233d;
  --brick: #2d2233;
  --brick-dark: #241b2c;
  --paper: #f5ead4;
  --paper-bright: #fbf5e8;
  --paper-dim: #e9daba;
  --ink: #211d2c;
  --ink-soft: #5b5260;
  --ink-faint: #776b72;
  --amber: #f2b95d;
  --amber-pale: #ffe7b3;
  --sign-blue: #22324d;
  --sign-red: #c24e3c;
  --places: #6fae9b;
  --places-deep: #2f6b5c;
  --food: #e7a13c;
  --food-deep: #8a5a12;
  --movement: #7c9fdd;
  --movement-deep: #33558f;
  --people: #d97a63;
  --people-deep: #8a3a2b;
  --culture: #b78bd4;
  --culture-deep: #6a3f86;
  --font-sign: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Literata", Georgia, serif;
  --font-ui: "Literata", Georgia, serif;
  --page-pad: clamp(20px, 4vw, 56px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

body.detail-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--amber-pale);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(13, 11, 23, 0.88);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ============================================================
   Masthead: a sign on the wall above the block
   ============================================================ */

.masthead {
  position: relative;
  overflow: hidden;
  background: var(--brick-dark);
  isolation: isolate;
}

.sky {
  position: absolute;
  inset: 0 0 auto;
  height: 190px;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 76% 100%, rgba(183, 139, 212, 0.24), transparent 55%),
    radial-gradient(ellipse at 22% 88%, rgba(242, 185, 93, 0.12), transparent 48%),
    linear-gradient(180deg, #12142a 0%, #1c1a36 54%, #332744 100%);
}

.moon {
  position: absolute;
  top: 38px;
  left: 8%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f7eccf;
  box-shadow: 0 0 34px 10px rgba(247, 236, 207, 0.18);
}

.moon::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 11px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #16162c;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--paper);
  opacity: 0.7;
}

.star-a {
  top: 54px;
  left: 27%;
}

.star-b {
  top: 92px;
  left: 36%;
  width: 3px;
  height: 3px;
  opacity: 0.45;
}

.star-c {
  top: 42px;
  left: 58%;
}

.star-d {
  top: 108px;
  left: 64%;
  opacity: 0.4;
}

.star-e {
  top: 76px;
  left: 90%;
  width: 3px;
  height: 3px;
  opacity: 0.55;
}

.water-tower {
  position: absolute;
  right: 4%;
  bottom: 24px;
  width: 210px;
  color: #0e1022;
  opacity: 0.85;
}

.wire {
  position: absolute;
  height: 1px;
  background: rgba(245, 234, 212, 0.22);
  transform-origin: left center;
}

.wire-a {
  width: 44%;
  top: 70px;
  left: 18%;
  transform: rotate(-4deg);
}

.wire-b {
  width: 40%;
  top: 118px;
  left: 48%;
  transform: rotate(3deg);
}

.masthead::before {
  content: "";
  position: absolute;
  top: 146px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background-color: var(--brick);
  background-image:
    radial-gradient(ellipse at 22% 9%, rgba(242, 185, 93, 0.17), transparent 42%),
    linear-gradient(0deg, rgba(10, 8, 18, 0.42), transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(12, 9, 18, 0.42) 27px 30px),
    repeating-linear-gradient(90deg, transparent 0 76px, rgba(12, 9, 18, 0.42) 76px 79px),
    linear-gradient(180deg, #38273d, #271e30 72%, #211a2a);
  box-shadow: inset 0 16px 36px rgba(0, 0, 0, 0.38);
}

.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  z-index: 1;
  background:
    repeating-linear-gradient(90deg, rgba(245, 234, 212, 0.1) 0 1px, transparent 1px 74px),
    linear-gradient(180deg, #33304b, #26233c);
  border-top: 2px solid #45405f;
}

.masthead-inner {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 112px));
  margin: 0 auto;
  padding: 178px 0 44px;
}

.brand-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.brand-block {
  position: relative;
  min-width: 0;
}

.sign-post {
  position: absolute;
  z-index: 0;
  top: -34px;
  left: 54px;
  width: 9px;
  height: 90px;
  background: linear-gradient(90deg, #3b364f, #625b78 44%, #302b42);
  border: 2px solid #191625;
  z-index: -1;
}

.street-sign {
  position: relative;
  z-index: 2;
  margin: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  transform: rotate(-1.2deg);
  filter: drop-shadow(0 20px 26px rgba(7, 6, 14, 0.5));
}

.sign-plate {
  position: relative;
  display: block;
  padding: 18px clamp(22px, 3vw, 40px) 24px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.5), transparent 40%),
    var(--paper);
  color: var(--sign-blue);
  border: 4px solid #1c2434;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.5),
    inset 0 0 24px rgba(108, 88, 48, 0.1),
    0 8px 0 rgba(13, 11, 22, 0.35);
}

.sign-rule {
  position: absolute;
  left: clamp(22px, 3vw, 40px);
  right: clamp(22px, 3vw, 40px);
  bottom: 8px;
  height: 3px;
  background: var(--sign-red);
  opacity: 0.82;
}

.sign-word {
  display: block;
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: clamp(3.2rem, 7vw, 6.1rem);
  line-height: 0.9;
  letter-spacing: 0.012em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sign-subplate {
  display: inline-block;
  margin: 10px 0 0 18px;
  padding: 5px 14px 6px;
  background: var(--sign-blue);
  color: var(--paper);
  border: 2px solid #1c2434;
  font-family: var(--font-sign);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  transform: rotate(0.6deg);
}

.sign-rivet {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f9e2aa, #a67c39 62%, #5b421d);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.rivet-tl {
  top: 8px;
  left: 9px;
}

.rivet-tr {
  top: 8px;
  right: 9px;
}

.rivet-bl {
  bottom: 8px;
  left: 9px;
}

.rivet-br {
  bottom: 8px;
  right: 9px;
}

.lamp {
  position: absolute;
  top: -104px;
  right: -14px;
  width: clamp(100px, 11vw, 150px);
  color: #b99a62;
  z-index: 1;
}

.lamp svg {
  width: 100%;
  height: auto;
  display: block;
}

.lamp-glow {
  position: absolute;
  top: 62px;
  right: 30px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 185, 93, 0.26), transparent 68%);
  filter: blur(2px);
}

.issue-note {
  max-width: 430px;
  padding-bottom: 8px;
}

.issue-line {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.dek {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.35vw, 1.24rem);
  line-height: 1.55;
  color: #f0e4cd;
  max-width: 34ch;
}

.issue-rule {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 234, 212, 0.26);
  font-size: 13px;
  line-height: 1.5;
  color: #cbbda8;
}

/* Directory board */

.directory-board {
  margin-top: clamp(22px, 3vw, 34px);
  padding: 18px 22px 15px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px;
  box-shadow:
    9px 11px 0 rgba(9, 7, 16, 0.4),
    inset 0 0 0 4px rgba(255, 255, 255, 0.26);
}

.directory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 11px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(33, 29, 44, 0.22);
}

.directory-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.result-count {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: right;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(150px, 0.72fr) minmax(210px, 0.9fr);
  gap: 14px;
  align-items: end;
}

.control {
  min-width: 0;
}

.control-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: #514854;
}

.input-wrap,
.select-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #5f5562;
  pointer-events: none;
}

#search {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 38px;
  background: var(--paper-bright);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px;
  font-size: 15px;
}

#search::placeholder {
  color: #80747a;
}

#search:focus-visible,
#category:focus-visible,
.keyring-toggle:focus-visible {
  outline: 3px solid var(--amber-pale);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(33, 29, 44, 0.75);
}

#category {
  appearance: none;
  width: 100%;
  height: 48px;
  padding: 0 38px 0 12px;
  background: var(--paper-bright);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px;
  font-size: 15px;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--ink);
  pointer-events: none;
}

.keyring-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 10px;
  background: var(--paper-bright);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.keyring-toggle:hover {
  background: var(--paper-dim);
}

.keyring-toggle[aria-pressed="true"] {
  background: var(--sign-blue);
  color: var(--paper);
}

.keyring-toggle .key-icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.keyring-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}

#saved-toggle-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyring-toggle[aria-pressed="true"] .keyring-count {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--amber);
}

.directory-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed rgba(33, 29, 44, 0.25);
  min-height: 26px;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin: 0;
  font-size: 12px;
  color: #5d5360;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: -3px;
  border-radius: 50%;
  border: 1px solid rgba(33, 29, 44, 0.4);
}

.dot-places {
  background: var(--places);
}

.dot-food {
  background: var(--food);
}

.dot-movement {
  background: var(--movement);
}

.dot-people {
  background: var(--people);
}

.dot-culture {
  background: var(--culture);
}

.clear-filters {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: #8d3225;
  font-size: 12px;
  font-weight: 600;
}

.clear-filters:hover {
  color: var(--ink);
}

/* ============================================================
   The block: two rows of storefronts facing a road
   ============================================================ */

.block {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242, 185, 93, 0.05), transparent 44%),
    linear-gradient(180deg, #1a1930 0%, #18172c 76%, #151426 100%);
}

.street[hidden] {
  display: none;
}

.street {
  position: relative;
  width: min(1320px, calc(100% - 112px));
  margin: 0 auto;
  padding: 76px 0 48px;
}

.road {
  position: absolute;
  top: 36px;
  bottom: 36px;
  left: 50%;
  width: 130px;
  transform: translateX(-50%);
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(242, 185, 93, 0.12), transparent 38%),
    linear-gradient(180deg, #292640, #201e35 50%, #1c1a2f);
  border-left: 7px solid #3c3857;
  border-right: 7px solid #3c3857;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.4);
}

.road-dashes {
  position: absolute;
  top: 74px;
  bottom: 120px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    rgba(245, 234, 212, 0.5) 0 20px,
    transparent 20px 48px
  );
}

.crosswalk {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 116px;
  height: 34px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    90deg,
    rgba(245, 234, 212, 0.3) 0 10px,
    transparent 10px 22px
  );
}

.road-lamp {
  position: absolute;
  top: 92px;
  left: 50%;
  width: 88px;
  transform: translateX(-50%);
  color: #46405f;
  filter: drop-shadow(0 0 16px rgba(242, 185, 93, 0.12));
}

.road-cat {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 92px;
  transform: translateX(-50%);
  color: #443f5b;
}

.blocks {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 190px;
  row-gap: 76px;
  align-items: end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.premises {
  min-width: 0;
  width: 100%;
  max-width: 566px;
}

.premises:nth-child(odd) {
  justify-self: end;
}

.premises:nth-child(even) {
  justify-self: start;
}

.premises[hidden] {
  display: none !important;
}

.loading-note {
  grid-column: 1 / -1;
  padding: 40px 0;
  font-family: var(--font-body);
  font-size: 18px;
  color: #cbbda8;
  text-align: center;
}

/* Storefronts */

.shop {
  --cat: var(--places);
  --cat-deep: var(--places-deep);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 14px 16px 0 rgba(8, 7, 16, 0.46);
  isolation: isolate;
  transition: box-shadow 0.25s ease;
}

.shop::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  bottom: -14px;
  height: 10px;
  background: linear-gradient(180deg, #3d3854, #2b2740);
  border: 2px solid #171523;
  z-index: -1;
}

.shop--places {
  --cat: var(--places);
  --cat-deep: var(--places-deep);
}

.shop--food {
  --cat: var(--food);
  --cat-deep: var(--food-deep);
}

.shop--movement {
  --cat: var(--movement);
  --cat-deep: var(--movement-deep);
}

.shop--people {
  --cat: var(--people);
  --cat-deep: var(--people-deep);
}

.shop--culture {
  --cat: var(--culture);
  --cat-deep: var(--culture-deep);
}

.signboard {
  position: relative;
  cursor: pointer;
  padding: 16px 18px 18px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.42), transparent 42%),
    var(--paper);
  border-bottom: 2px solid var(--ink);
}

.shop-title {
  margin: 0;
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: clamp(1.55rem, 2.15vw, 2.05rem);
  line-height: 1.02;
  letter-spacing: 0.004em;
  color: var(--ink);
  text-wrap: balance;
}

.shop--culture .signboard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background:
    radial-gradient(circle at center, #ffedb8 2px, rgba(242, 185, 93, 0.9) 3px, transparent 4.5px) 0 0 / 22px 9px repeat-x,
    var(--cat-deep);
}

.premises[data-story="story-03"] .signboard {
  background:
    repeating-linear-gradient(180deg, rgba(33, 29, 44, 0.035) 0 4px, transparent 4px 7px),
    linear-gradient(115deg, rgba(255, 255, 255, 0.42), transparent 42%),
    var(--paper);
}

.awning {
  position: relative;
  cursor: pointer;
  height: 30px;
  background-color: var(--cat);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 30px,
    rgba(255, 255, 255, 0.28) 30px 60px
  );
  border-bottom: 2px solid var(--ink);
  z-index: 2;
}

.awning::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 9px;
  background: radial-gradient(circle at 11px -1px, var(--cat) 9px, transparent 10px);
  background-size: 22px 10px;
  background-repeat: repeat-x;
  pointer-events: none;
}

.awning-label {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  padding: 1px 7px 2px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.front {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 12px;
  padding: 18px 16px 0;
}

.window {
  position: relative;
  margin: 0;
  cursor: pointer;
  height: 212px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: #141322;
}

.window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.82);
  transition: filter 0.3s ease;
}

.window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cat);
  mix-blend-mode: color;
  opacity: 0.28;
  pointer-events: none;
}

.window-glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.2) 0 16%, transparent 30% 64%, rgba(255, 255, 255, 0.08) 82%, transparent 92%),
    linear-gradient(180deg, transparent 55%, rgba(14, 12, 24, 0.48) 100%);
  pointer-events: none;
}

.window-panes {
  position: absolute;
  inset: 0;
  z-index: 3;
  box-shadow: inset 0 0 0 6px rgba(20, 17, 30, 0.34);
  background:
    linear-gradient(to right, transparent calc(50% - 1px), rgba(245, 234, 212, 0.38) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to bottom, transparent calc(62% - 1px), rgba(245, 234, 212, 0.32) calc(62% - 1px) calc(62% + 1px), transparent calc(62% + 1px));
  pointer-events: none;
}

.ill-tag {
  position: absolute;
  left: 9px;
  bottom: 9px;
  z-index: 4;
  padding: 2px 6px 3px;
  background: rgba(245, 234, 212, 0.92);
  color: var(--ink);
  border: 1px solid rgba(33, 29, 44, 0.65);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.doorway {
  position: relative;
  min-width: 0;
}

.door {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 212px;
  padding: 0;
  background: var(--paper-bright);
  color: var(--ink);
  border: 2px solid var(--ink);
  overflow: hidden;
  text-align: center;
}

.door-glass {
  position: absolute;
  inset: 9px 9px 44px;
  background:
    linear-gradient(142deg, rgba(255, 255, 255, 0.42) 0 24%, transparent 46%),
    linear-gradient(180deg, var(--cat), var(--cat-deep));
  border: 1.5px solid rgba(33, 29, 44, 0.6);
  opacity: 0.92;
}

.door-sign {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  padding: 1px 10px 2px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-family: var(--font-sign);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.door-handle {
  position: absolute;
  top: 55%;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe5a4, #a67c39 66%, #5b421d);
  border: 1px solid #3b2b13;
  z-index: 2;
}

.door:hover .door-glass {
  filter: brightness(1.13);
}

.door:focus-visible {
  outline: 3px solid var(--amber-pale);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(13, 11, 23, 0.88);
}

.key-tag {
  position: absolute;
  z-index: 5;
  top: -13px;
  right: -12px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(8, 7, 16, 0.35);
  transform: rotate(10deg);
}

.key-tag svg {
  width: 19px;
  height: 19px;
}

.premises[data-saved="true"] .key-tag {
  display: flex;
}

.premises[data-saved="true"] .shop {
  box-shadow:
    14px 16px 0 rgba(242, 185, 93, 0.2),
    0 0 42px rgba(242, 185, 93, 0.07);
}

.premises[data-saved="true"] .window img {
  filter: grayscale(0.82) sepia(0.18) contrast(1.05) brightness(0.88);
}

.shop:hover .window img {
  filter: grayscale(0.7) sepia(0.1) contrast(1.06) brightness(0.9);
}

.counter {
  display: grid;
  gap: 12px;
  padding: 14px 18px 18px;
  background: linear-gradient(180deg, var(--paper), #eddfc2);
}

.summary {
  margin: 0;
  max-width: 48ch;
  overflow-wrap: break-word;
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.52;
  color: #332c38;
}

.byline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-top: 9px;
  border-top: 1px dashed rgba(33, 29, 44, 0.34);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

.byline .read-time {
  white-space: nowrap;
}

/* Individual premises: small architectural differences */

.premises[data-story="story-01"] .window {
  border-radius: 110px 110px 0 0;
}

.premises[data-story="story-01"] .window-panes {
  box-shadow: inset 0 0 0 8px rgba(20, 17, 30, 0.32);
}

.premises[data-story="story-02"] .window,
.premises[data-story="story-02"] .door {
  height: 184px;
  min-height: 184px;
}

.premises[data-story="story-02"] .awning {
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 48px,
    rgba(255, 255, 255, 0.32) 48px 96px
  );
}

.premises[data-story="story-03"] .window,
.premises[data-story="story-03"] .door {
  height: 198px;
  min-height: 198px;
}

.premises[data-story="story-03"] .door-glass {
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 12px),
    linear-gradient(180deg, var(--cat), var(--cat-deep));
}

.premises[data-story="story-04"] .window,
.premises[data-story="story-04"] .door {
  height: 190px;
  min-height: 190px;
}

.premises[data-story="story-04"] .awning {
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 24px,
    rgba(255, 255, 255, 0.42) 24px 48px
  );
}

.premises[data-story="story-05"] .window,
.premises[data-story="story-05"] .door {
  height: 218px;
  min-height: 218px;
}

.premises[data-story="story-05"] .door-glass {
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 241, 193, 0.55), transparent 7%),
    radial-gradient(circle at 70% 62%, rgba(199, 125, 255, 0.55), transparent 8%),
    linear-gradient(160deg, #2a1f45, #5a2f63 55%, #8f3c58);
}

.premises[data-story="story-06"] .window,
.premises[data-story="story-06"] .door {
  height: 196px;
  min-height: 196px;
}

.premises[data-story="story-06"] .window-panes {
  background:
    linear-gradient(to right, transparent calc(50% - 1px), rgba(245, 234, 212, 0.24) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(135deg, transparent 0 17px, rgba(245, 234, 212, 0.12) 17px 18px, transparent 18px 34px);
  box-shadow: inset 0 0 0 6px rgba(20, 17, 30, 0.28);
}

.premises[data-story="story-07"] .window,
.premises[data-story="story-07"] .door {
  height: 174px;
  min-height: 174px;
}

.premises[data-story="story-07"] .awning {
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 18px,
    rgba(255, 255, 255, 0.3) 18px 36px
  );
}

.premises[data-story="story-08"] .window,
.premises[data-story="story-08"] .door {
  height: 206px;
  min-height: 206px;
}

.premises[data-story="story-08"] .shop-title {
  text-decoration: underline wavy rgba(106, 63, 134, 0.45) 2px;
  text-underline-offset: 5px;
}

/* First-load light switch: one orchestrated moment */

@media (prefers-reduced-motion: no-preference) {
  .premises .window img {
    animation: window-on 0.44s ease-out both;
  }

  .premises .awning {
    animation: awning-on 0.4s ease-out both;
  }
}

@keyframes window-on {
  from {
    opacity: 0.18;
    filter: grayscale(1) brightness(0.42) contrast(1.2);
  }
  to {
    opacity: 1;
  }
}

@keyframes awning-on {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

/* Empty state */

.empty-state {
  position: relative;
  width: min(660px, calc(100% - 40px));
  margin: 24px auto 58px;
  padding: 0 34px 34px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 13px 15px 0 rgba(8, 7, 16, 0.42);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-shop {
  position: relative;
  height: 156px;
  margin: 0 -34px 26px;
  overflow: hidden;
  background: linear-gradient(180deg, #252339, #1c1a2d);
  border-bottom: 2px solid var(--ink);
}

.empty-awning {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  background: repeating-linear-gradient(90deg, #514b68 0 26px, #3b3650 26px 52px);
  border-bottom: 2px solid #171523;
}

.empty-window {
  position: absolute;
  top: 48px;
  left: 34px;
  width: 44%;
  height: 78px;
  background: linear-gradient(135deg, #444059, #2d2a40);
  border: 2px solid #171523;
  box-shadow: inset 0 0 0 5px rgba(245, 234, 212, 0.08);
}

.empty-door {
  position: absolute;
  top: 48px;
  right: 34px;
  width: 74px;
  height: 78px;
  background: #413c56;
  border: 2px solid #171523;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-family: var(--font-sign);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
}

.empty-state p {
  max-width: 46ch;
  overflow-wrap: break-word;
  margin: 0 auto 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: #453b48;
}

.reset-button {
  padding: 11px 18px;
  background: var(--sign-blue);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 4px 4px 0 rgba(33, 29, 44, 0.22);
}

.reset-button:hover {
  background: #2f4566;
}

.end-of-block[hidden] {
  display: none;
}

.end-of-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(1320px, calc(100% - 112px));
  margin: 0 auto;
  padding: 42px 0 76px;
  color: #cbbda8;
  text-align: center;
}

.bench {
  width: 170px;
  color: #4b4563;
}

.end-line {
  margin: 0;
  font-family: var(--font-sign);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #e7d8bf;
}

.top-link {
  color: #cbbda8;
  font-size: 13px;
  text-underline-offset: 4px;
}

.top-link:hover {
  color: var(--paper);
}

/* Footer */

.site-footer {
  background: var(--night-deep);
  border-top: 1px solid rgba(245, 234, 212, 0.16);
  padding: 48px 0 64px;
}

.footer-inner {
  width: min(1240px, calc(100% - 112px));
  margin: 0 auto;
}

.footer-brand {
  margin: 0 0 12px;
  font-family: var(--font-sign);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--paper);
}

.footer-note {
  max-width: 72ch;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #b9ad9c;
}

.credits {
  margin-top: 24px;
  max-width: 72ch;
  font-size: 12.5px;
  color: #9f9488;
}

.credits summary {
  width: fit-content;
  cursor: pointer;
  color: #cbbda8;
  text-underline-offset: 3px;
}

.credits summary:hover {
  color: var(--paper);
}

.credits p {
  margin: 10px 0 0;
  line-height: 1.6;
}

.credits a {
  color: var(--amber);
  text-underline-offset: 3px;
}

.noscript-note {
  margin: 0;
  padding: 22px;
  background: var(--amber-pale);
  color: var(--ink);
  text-align: center;
  font-weight: 600;
}

/* ============================================================
   The room behind the door: article view
   ============================================================ */

.story-dialog {
  --cat: var(--places);
  --cat-deep: var(--places-deep);
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #17162a;
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}

.story-dialog[open] {
  display: block;
}

.story-dialog::backdrop {
  background: rgba(8, 7, 15, 0.82);
}

.detail-view {
  min-height: 100%;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(242, 185, 93, 0.08), transparent 40%),
    #17162a;
}

@media (prefers-reduced-motion: no-preference) {
  .story-dialog[open] .detail-view {
    animation: room-in 0.36s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }
}

@keyframes room-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 clamp(16px, 4vw, 46px);
  background: #141326;
  border-bottom: 1px solid rgba(245, 234, 212, 0.18);
  color: var(--paper);
}

.detail-brand {
  margin: 0;
  font-family: var(--font-sign);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(245, 234, 212, 0.5);
  border-radius: 2px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease;
}

.back-button svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.back-button:hover {
  background: var(--paper);
  color: var(--ink);
}

.detail-room {
  display: grid;
  grid-template-columns: minmax(340px, 44%) minmax(0, 1fr);
  align-items: start;
}

.detail-scene {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: calc(100vh - 64px);
  margin: 0;
  padding: clamp(56px, 7vw, 92px) clamp(24px, 4vw, 56px) 34px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242, 185, 93, 0.14), transparent 48%),
    repeating-linear-gradient(90deg, rgba(245, 234, 212, 0.035) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, #201e38, #17162a 72%);
  border-right: 1px solid rgba(245, 234, 212, 0.12);
}

.detail-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cat);
  opacity: 0.075;
  mix-blend-mode: screen;
  pointer-events: none;
}

.scene-lamp {
  position: absolute;
  top: 0;
  left: 50%;
  width: 130px;
  height: 120px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.scene-cord {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 55px;
  transform: translateX(-50%);
  background: #0e0d19;
}

.scene-shade {
  position: absolute;
  top: 52px;
  left: 50%;
  width: 74px;
  height: 32px;
  transform: translateX(-50%);
  background: var(--cat-deep);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  border-bottom: 2px solid #0e0d19;
}

.scene-bulb {
  position: absolute;
  top: 84px;
  left: 50%;
  width: 13px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 45% 45% 50% 50%;
  background: var(--amber-pale);
  box-shadow: 0 0 34px 17px rgba(242, 185, 93, 0.25);
}

.detail-window {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.window-frame {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #0d0c17;
  border: 11px solid var(--paper);
  box-shadow:
    0 26px 50px rgba(4, 4, 10, 0.55),
    0 0 0 2px var(--ink);
}

.window-frame img {
  width: 100%;
  height: clamp(260px, 54vh, 540px);
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(0.82);
}

.window-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cat);
  mix-blend-mode: color;
  opacity: 0.3;
  pointer-events: none;
}

.window-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0.2) 0 18%, transparent 34% 70%, rgba(255, 255, 255, 0.06) 84%, transparent 92%),
    linear-gradient(180deg, transparent 58%, rgba(8, 7, 15, 0.52));
  pointer-events: none;
}

.window-mullion-v,
.window-mullion-h {
  position: absolute;
  z-index: 4;
  background: rgba(245, 234, 212, 0.38);
  pointer-events: none;
}

.window-mullion-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
}

.window-mullion-h {
  left: 0;
  right: 0;
  top: 64%;
  height: 2px;
}

.detail-caption {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #bdb1a0;
}

.scene-specks {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 12% 28%, rgba(245, 234, 212, 0.3) 0 1px, transparent 1.5px),
    radial-gradient(circle at 82% 62%, rgba(245, 234, 212, 0.24) 0 1px, transparent 1.5px),
    radial-gradient(circle at 66% 18%, rgba(245, 234, 212, 0.2) 0 1px, transparent 1.5px);
  pointer-events: none;
}

.detail-paper {
  position: relative;
  width: min(100% - clamp(24px, 4vw, 64px), 780px);
  margin: clamp(24px, 3.5vw, 54px) auto;
  padding: clamp(28px, 4.5vw, 62px);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.4), transparent 40%),
    var(--paper);
  border-top: 10px solid var(--cat);
  box-shadow: 0 28px 64px rgba(4, 4, 10, 0.5);
}

.detail-paper::before,
.detail-paper::after {
  content: "";
  position: absolute;
  top: -18px;
  width: 76px;
  height: 27px;
  background: var(--cat);
  opacity: 0.72;
  border: 1px solid rgba(33, 29, 44, 0.25);
  pointer-events: none;
}

.detail-paper::before {
  left: 34px;
  transform: rotate(-4deg);
}

.detail-paper::after {
  right: 34px;
  transform: rotate(3deg);
}

.article-head {
  border-bottom: 1px solid rgba(33, 29, 44, 0.18);
  padding-bottom: 26px;
}

.detail-category {
  display: inline-block;
  margin: 0 0 15px;
  padding: 3px 10px 4px;
  background: var(--cat);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.3;
}

#detail-title {
  margin: 0 0 18px;
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.2vw, 3.9rem);
  line-height: 0.99;
  letter-spacing: 0.003em;
  color: var(--ink);
  text-wrap: balance;
}

.detail-summary {
  max-width: 56ch;
  margin: 0 0 24px;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.52;
  color: #4a3f4c;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  padding: 12px 0;
  border-top: 1px solid rgba(33, 29, 44, 0.2);
  border-bottom: 1px solid rgba(33, 29, 44, 0.2);
}

.meta-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5f535c;
}

.meta-block > span:last-child,
.meta-block time {
  font-size: 13.5px;
  font-weight: 500;
  color: #322a39;
}

.save-toggle {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  margin-top: 22px;
  padding: 12px 14px;
  background: #eee0c3;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}

.save-toggle:hover {
  background: #e5d2ac;
}

.save-toggle[aria-pressed="true"] {
  background: var(--sign-blue);
  color: var(--paper);
}

.save-toggle .key-icon {
  width: 29px;
  height: 29px;
  flex: none;
  color: var(--ink);
  transition: transform 0.22s ease, color 0.18s ease;
}

.save-toggle[aria-pressed="true"] .key-icon {
  color: var(--amber);
  transform: rotate(-18deg);
}

.save-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.save-label {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

.save-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: #5f535c;
}

.save-toggle[aria-pressed="true"] .save-hint {
  color: #cfc4ad;
}

.detail-body {
  max-width: 62ch;
  overflow-wrap: break-word;
  margin-top: 30px;
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.72;
  color: #2b2632;
}

.detail-body p {
  margin: 0 0 1.1em;
}

.detail-body p:first-child {
  font-size: 1.15em;
  line-height: 1.65;
}

.detail-body p:last-child {
  margin-bottom: 0;
}

.article-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(33, 29, 44, 0.2);
}

.article-note {
  max-width: 52ch;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #5f535c;
}

.article-back {
  padding: 2px 0 3px;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
}

.article-back:hover {
  color: var(--sign-red);
  border-color: var(--sign-red);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
  .masthead-inner {
    width: calc(100% - 80px);
  }

  .street,
  .end-of-block,
  .footer-inner {
    width: calc(100% - 80px);
  }

  .blocks {
    column-gap: 150px;
  }

  .controls {
    grid-template-columns: minmax(0, 1.3fr) minmax(145px, 0.7fr) minmax(200px, 0.9fr);
    gap: 12px;
  }
}

@media (max-width: 980px) {
  .masthead-inner {
    padding-top: 152px;
  }

  .brand-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
    gap: 34px;
  }

  .sign-word {
    font-size: clamp(3rem, 7vw, 4.6rem);
  }

  .water-tower {
    width: 170px;
    opacity: 0.65;
  }

  .road {
    top: 28px;
    bottom: 28px;
    left: 0;
    width: 16px;
    transform: none;
    border-left: 0;
    border-right: 6px solid #3c3857;
    background: linear-gradient(180deg, #292640, #201e35 50%, #1c1a2f);
    box-shadow: none;
  }

  .road-dashes {
    top: 24px;
    bottom: 24px;
    left: 10px;
    width: 2px;
    transform: none;
    background: repeating-linear-gradient(
      to bottom,
      rgba(245, 234, 212, 0.45) 0 14px,
      transparent 14px 32px
    );
  }

  .crosswalk,
  .road-lamp,
  .road-cat {
    display: none;
  }

  .street,
  .end-of-block,
  .footer-inner {
    width: calc(100% - 40px);
  }

  .street {
    padding: 48px 0 30px 44px;
  }

  .blocks {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 58px;
  }

  .premises,
  .premises:nth-child(odd),
  .premises:nth-child(even) {
    justify-self: start;
    width: 100%;
    max-width: 680px;
  }

  .detail-room {
    grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
  }

  .detail-paper {
    width: min(100% - 28px, 760px);
    margin: 24px auto;
    padding: clamp(26px, 3.6vw, 42px);
  }
}

@media (max-width: 820px) {
  .masthead::before {
    top: 112px;
  }

  .sky {
    height: 150px;
  }

  .masthead-inner {
    width: calc(100% - 40px);
    padding: 132px 0 34px;
  }

  .brand-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  .sign-post {
    display: none;
  }

  .street-sign {
    transform: rotate(-1deg);
  }

  .sign-word {
    font-size: clamp(2.6rem, 9.2vw, 4.1rem);
  }

  .sign-plate {
    padding: 16px 22px 22px;
  }

  .issue-note {
    max-width: 560px;
    padding-bottom: 0;
  }

  .dek {
    max-width: 48ch;
    font-size: 1.05rem;
  }

  .lamp {
    top: -76px;
    right: 2px;
    width: 94px;
    opacity: 0.8;
  }

  .directory-board {
    margin-top: 18px;
  }

  .controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 11px;
  }

  .search-control {
    grid-column: 1 / -1;
  }

  .directory-foot {
    min-height: 22px;
  }

  .legend {
    font-size: 10.5px;
  }

  .detail-room {
    display: block;
  }

  .detail-scene {
    position: relative;
    top: auto;
    height: auto;
    padding: 58px 18px 24px;
    border-right: 0;
    border-bottom: 1px solid rgba(245, 234, 212, 0.12);
  }

  .scene-lamp {
    width: 100px;
    height: 96px;
  }

  .scene-cord {
    height: 40px;
  }

  .scene-shade {
    top: 38px;
    width: 60px;
    height: 26px;
  }

  .scene-bulb {
    top: 63px;
  }

  .window-frame {
    border-width: 8px;
  }

  .window-frame img {
    height: clamp(210px, 34vh, 320px);
  }

  .detail-caption {
    margin-top: 10px;
    text-align: center;
  }

  .footer-inner {
    width: calc(100% - 40px);
  }

  .detail-paper {
    width: 100%;
    margin: 0;
    padding: 30px 22px 38px;
    border-top-width: 8px;
  }

  .detail-paper::before,
  .detail-paper::after {
    top: -15px;
    width: 62px;
    height: 23px;
  }

  .detail-paper::before {
    left: 22px;
  }

  .detail-paper::after {
    right: 22px;
  }
}

@media (max-width: 620px) {
  .sky {
    height: 124px;
  }

  .masthead::before {
    top: 96px;
  }

  .masthead-inner {
    padding: 108px 0 26px;
  }

  .brand-grid {
    gap: 20px;
  }

  .issue-rule {
    display: none;
  }

  .moon {
    top: 26px;
    left: 7%;
    width: 32px;
    height: 32px;
  }

  .moon::after {
    width: 32px;
    height: 32px;
    left: 9px;
  }

  .water-tower {
    width: 128px;
    bottom: 14px;
    right: 2%;
  }

  .sign-word {
    font-size: clamp(2.15rem, 10.6vw, 3.1rem);
  }

  .sign-plate {
    padding: 14px 16px 20px;
    border-width: 3px;
  }

  .sign-subplate {
    margin-left: 8px;
    font-size: 11px;
  }

  .sign-rule {
    left: 16px;
    right: 16px;
    height: 2px;
  }

  .issue-line {
    margin-bottom: 8px;
  }

  .dek {
    font-size: 1rem;
    line-height: 1.5;
  }

  .issue-rule {
    margin-top: 14px;
    padding-top: 10px;
    font-size: 12px;
  }

  .directory-board {
    padding: 14px 14px 12px;
  }

  .directory-head {
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .directory-title {
    font-size: 13px;
  }

  .result-count {
    font-size: 12px;
  }

  .controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .control-label {
    font-size: 12px;
  }

  #search,
  #category {
    font-size: 14px;
    height: 46px;
  }

  #category {
    padding-left: 10px;
    padding-right: 30px;
    font-size: 13.5px;
  }

  .keyring-toggle {
    font-size: 11.5px;
    height: 46px;
    padding: 0 7px;
    gap: 5px;
  }

  .keyring-toggle .key-icon {
    width: 17px;
    height: 17px;
  }

  .keyring-count {
    min-width: 20px;
    height: 20px;
  }

  .legend {
    display: none;
  }

  .directory-foot {
    display: none;
  }

  .directory-foot:has(.clear-filters:not([hidden])) {
    display: flex;
    justify-content: flex-end;
  }

  .street {
    width: calc(100% - 28px);
    padding: 38px 0 22px 34px;
  }

  .road {
    width: 13px;
  }

  .road-dashes {
    left: 8px;
  }

  .blocks {
    row-gap: 48px;
  }

  .shop-title {
    font-size: 1.55rem;
    line-height: 1.03;
  }

  .signboard {
    padding: 14px 14px 15px;
  }

  .front {
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 9px;
    padding: 14px 12px 0;
  }

  .window,
  .premises[data-story="story-01"] .window {
    height: 164px;
  }

  .premises[data-story="story-02"] .window,
  .premises[data-story="story-02"] .door,
  .premises[data-story="story-03"] .window,
  .premises[data-story="story-03"] .door,
  .premises[data-story="story-04"] .window,
  .premises[data-story="story-04"] .door,
  .premises[data-story="story-05"] .window,
  .premises[data-story="story-05"] .door,
  .premises[data-story="story-06"] .window,
  .premises[data-story="story-06"] .door,
  .premises[data-story="story-07"] .window,
  .premises[data-story="story-07"] .door,
  .premises[data-story="story-08"] .window,
  .premises[data-story="story-08"] .door {
    height: 164px;
    min-height: 164px;
  }

  .door {
    min-height: 164px;
  }

  .door-glass {
    inset: 8px 8px 40px;
  }

  .door-sign {
    bottom: 11px;
    font-size: 15px;
  }

  .ill-tag {
    font-size: 10px;
    left: 7px;
    bottom: 7px;
  }

  .counter {
    padding: 12px 14px 15px;
    gap: 10px;
  }

  .summary {
    font-size: 0.94rem;
    line-height: 1.48;
  }

  .byline {
    font-size: 11.5px;
  }

  .awning {
    height: 26px;
  }

  .awning-label {
    font-size: 10.5px;
    right: 9px;
  }

  .empty-state {
    width: calc(100% - 28px);
    padding: 0 20px 30px;
  }

  .empty-shop {
    margin: 0 -20px 22px;
    height: 130px;
  }

  .empty-window {
    left: 20px;
    width: 46%;
    height: 64px;
    top: 40px;
  }

  .empty-door {
    right: 20px;
    height: 64px;
    top: 40px;
    width: 58px;
  }

  .end-of-block {
    width: calc(100% - 40px);
    padding: 34px 0 60px;
  }

  .site-footer {
    padding: 38px 0 50px;
  }

  .footer-inner {
    width: calc(100% - 40px);
  }

  .detail-bar {
    height: 56px;
    padding: 0 14px;
  }

  .detail-brand {
    font-size: 17px;
    letter-spacing: 0.03em;
  }

  .back-button {
    padding: 7px 10px;
    font-size: 12.5px;
    min-height: 44px;
  }

  .back-button svg {
    width: 17px;
    height: 17px;
  }

  .detail-scene {
    padding: 50px 14px 22px;
  }

  .detail-caption {
    font-size: 11px;
  }

  #detail-title {
    font-size: clamp(2.1rem, 9.2vw, 2.9rem);
  }

  .detail-summary {
    font-size: 1.08rem;
  }

  .detail-meta {
    gap: 12px 20px;
  }

  .detail-body {
    font-size: 1.04rem;
    line-height: 1.7;
    margin-top: 26px;
  }

  .detail-body p:first-child {
    font-size: 1.06em;
  }

  .save-toggle {
    gap: 10px;
    padding: 11px 12px;
  }

  .save-toggle .key-icon {
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 380px) {
  .sign-word {
    font-size: 2.05rem;
  }

  .controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .keyring-toggle {
    font-size: 12px;
  }

  .keyring-count {
    margin-left: auto;
  }

  .detail-brand {
    font-size: 16px;
  }

  .back-button span {
    max-width: 128px;
  }
}

/* ============================================================
   Reduced motion and print
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .skip-link {
    transition: none;
  }
}

@media print {
  .masthead,
  .directory-board,
  .end-of-block,
  .site-footer,
  .detail-bar,
  .detail-scene {
    display: none !important;
  }

  body,
  .story-dialog,
  .detail-view,
  .detail-paper {
    background: #fff !important;
    color: #000 !important;
  }
}
