/* Kerbside — a street directory for one ordinary street */

@font-face {
  font-family: "DM Serif Display";
  src: url("assets/dm-serif.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F2EFE9;
  --surface: #E7E1D6;
  --field: #FBF9F5;
  --ink: #1A1817;
  --muted: #5E5750;
  --accent: #9E3B2C;
  --accent-ink: #F7F3EC;
  --accent-on-dark: #E0977F;
  --night: #1A1817;
  --night-ink: #EEE8DE;
  --night-muted: #B8B0A4;
  --rule: rgba(26, 24, 23, 0.2);
  --rule-dark: rgba(238, 232, 222, 0.22);

  --f-display: "DM Serif Display", "Bodoni 72", Didot, Georgia, serif;
  --f-text: "Literata", Charter, "Iowan Old Style", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --gutter: clamp(20px, 3.4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 200ms;
  --r: 2px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 1344px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 50;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 16px; outline-color: var(--night-ink); }

/* ---------- Shared type ---------- */

.kicker {
  font-family: var(--f-text);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker--dark { color: var(--accent-on-dark); }

.section-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(44px, 5.6vw, 84px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-top: 12px;
}
.section-title:focus { outline: none; }
.section-dek {
  margin-top: 16px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 18px;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--r);
  font-family: var(--f-text);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), transform 150ms var(--ease), border-color var(--t) var(--ease);
}
.btn span { transition: transform var(--t) var(--ease); }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:focus-visible { outline-color: var(--accent-on-dark); outline-offset: 3px; }
.btn--paper { background: var(--accent-ink); color: var(--ink); border-color: var(--accent-ink); }
.btn--paper:focus-visible { outline-color: var(--accent-ink); outline-offset: 4px; }

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-block: 12px;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 100% 1px no-repeat;
  transition: background-size var(--t) var(--ease), color var(--t) var(--ease);
}
.textlink:active { transform: scale(0.97); }
.textlink:focus-visible { outline: none; background-size: 100% 3px; color: var(--accent-on-dark); }
.textlink--dark { color: var(--night-ink); }

/* ---------- Fascia (hero) ---------- */

.fascia {
  position: relative;
  background:
    radial-gradient(120% 70% at 85% 0%, rgba(158, 59, 44, 0.22), transparent 60%),
    var(--night);
  color: var(--night-ink);
  padding-bottom: 72px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  border-bottom: 1px solid var(--rule-dark);
}
.edition {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--night-muted);
  white-space: nowrap;
}
.edition__issue { color: var(--night-ink); margin-right: 8px; }
.nav { margin-left: auto; min-width: 0; }
.nav__list { display: flex; gap: 4px; }
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 16px;
  color: var(--night-ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(var(--accent-on-dark), var(--accent-on-dark)) 50% calc(100% - 8px) / 0 2px no-repeat;
  transition: background-size var(--t) var(--ease), color var(--t) var(--ease);
}
.nav__link:focus-visible { outline: 2px solid var(--accent-on-dark); outline-offset: -2px; }
.nav__link:active { transform: scale(0.97); }

.saved-jump {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--rule-dark);
  border-radius: var(--r);
  background: transparent;
  color: var(--night-ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease), transform 150ms var(--ease);
}
.saved-jump:active { transform: scale(0.97); }
.saved-jump:focus-visible { outline-color: var(--accent-on-dark); }
.saved-jump__count {
  min-width: 28px;
  padding: 4px 6px;
  background: var(--night-ink);
  color: var(--night);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0;
  text-align: center;
}

.wordmark {
  margin-top: clamp(16px, 2.4vw, 32px);
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(80px, 21vw, 320px);
  line-height: 0.82;
  letter-spacing: -0.035em;
  color: var(--night-ink);
  white-space: nowrap;
}
.wordmark__paint { display: block; padding-bottom: 0.04em; }
.wordmark__paint span {
  display: inline-block;
  animation: paint-in 700ms var(--ease) both;
}
.wordmark__paint span:nth-child(2) { animation-delay: 70ms; }
.wordmark__paint span:nth-child(3) { animation-delay: 140ms; }
.wordmark__paint span:nth-child(4) { animation-delay: 210ms; }
.wordmark__paint span:nth-child(5) { animation-delay: 280ms; }
.wordmark__paint span:nth-child(6) { animation-delay: 350ms; }
.wordmark__paint span:nth-child(7) { animation-delay: 420ms; }
.wordmark__paint span:nth-child(8) { animation-delay: 490ms; }
@keyframes paint-in {
  from { opacity: 0; transform: translateY(0.12em); }
  to { opacity: 1; transform: none; }
}

/* the fascia's painted lining: a double rule */
.strap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 4px double var(--rule-dark);
  font-size: 15px;
}
.strap__lede {
  grid-column: 1 / span 5;
  font-family: var(--f-display);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.strap__note {
  grid-column: 7 / -1;
  align-self: end;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--night-muted);
}

.lead {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
  align-items: start;
}
.lead__plate {
  grid-column: 1 / span 5;
  position: relative;
  margin-bottom: -184px;
  z-index: 2;
  animation: settle 900ms var(--ease) 300ms both;
}
.lead__plate img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 24px 48px rgba(26, 24, 23, 0.28);
}
.lead__plate figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 10px;
  background: var(--night);
  color: var(--night-muted);
  font-family: var(--f-mono);
  font-size: 12px;
}
@keyframes settle {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.lead__text {
  grid-column: 6 / span 5;
  padding-top: 8px;
  animation: settle 700ms var(--ease) 420ms both;
}
.lead__title {
  margin-top: 12px;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(36px, 3.7vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.lead__dek {
  margin-top: 16px;
  max-width: 44ch;
  color: var(--night-muted);
  font-size: 18px;
}
.lead__meta {
  margin-top: 16px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--night-muted);
}
.lead__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 32px;
}

/* the hanging sign */
.sign {
  grid-column: 11 / -1;
  position: relative;
  padding-top: 40px;
}
.sign::before, .sign::after {
  content: "";
  position: absolute;
  top: -48px;
  width: 1px;
  height: 92px;
  background: var(--night-muted);
}
.sign::before { left: 24%; }
.sign::after { right: 24%; }
.sign__board {
  position: relative;
  padding: 20px 16px 16px;
  background: var(--accent-ink);
  color: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: inset 0 0 0 4px var(--accent-ink), inset 0 0 0 5px var(--accent);
  transform-origin: 50% -44px;
  animation: swing 2.4s var(--ease) 600ms both;
}
@keyframes swing {
  0% { transform: rotate(-7deg); }
  30% { transform: rotate(4deg); }
  55% { transform: rotate(-2deg); }
  78% { transform: rotate(1deg); }
  100% { transform: rotate(0deg); }
}
/* a second name so the swing can replay after the entrance has finished */
@keyframes swing-again {
  0% { transform: rotate(-6deg); }
  30% { transform: rotate(4deg); }
  55% { transform: rotate(-2deg); }
  78% { transform: rotate(1deg); }
  100% { transform: rotate(0deg); }
}
.sign.is-nudged .sign__board { animation: swing-again 1.6s var(--ease) both; }
.sign__head {
  font-family: var(--f-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.sign__list { margin-top: 8px; font-size: 14px; line-height: 1.3; }
.sign__list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-block: 6px;
  border-bottom: 1px dotted var(--rule);
}
.sign__list li:last-child { border-bottom: 0; }
.sign__num {
  min-width: 2ch;
  font-family: var(--f-mono);
  font-size: 15px;
  text-align: right;
}
.sign__saved { color: var(--accent); font-weight: 600; }

/* ---------- Directory ---------- */

.directory { padding-block: 64px 128px; }
.directory__head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  min-height: 140px;
}
.directory__head > * { grid-column: 6 / -1; }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-top: 48px;
  background: var(--bg);
  border-block: 1px solid var(--ink);
}
.toolbar__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) auto minmax(0, 3fr);
  gap: 24px;
  align-items: end;
  padding-block: 16px;
}
.field { display: grid; gap: 6px; }
.field__label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: var(--field);
  font-size: 18px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.field__input::placeholder { color: var(--muted); opacity: 1; }
.field__input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.field__select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231A1817' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 12px 12px 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), transform 150ms var(--ease);
}
.toggle:active { transform: scale(0.97); }
.toggle__box {
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 9px 9px 0 0;
  position: relative;
}
.toggle__count {
  min-width: 28px;
  padding: 2px 6px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--f-mono);
  font-size: 13px;
  text-align: center;
}
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.toggle[aria-pressed="true"] .toggle__box { background: var(--accent-on-dark); border-color: var(--accent-on-dark); }
.toggle[aria-pressed="true"] .toggle__count { background: var(--accent-on-dark); color: var(--ink); }

.toolbar__status {
  align-self: center;
  justify-self: end;
  padding-top: 20px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

/* rows: one door per story */
.doors { border-bottom: 1px solid var(--ink); }
.row {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 200px 120px;
  gap: 32px;
  align-items: center;
  padding: 32px 16px;
  border-top: 1px solid var(--rule);
  transition: background-color var(--t) var(--ease);
}
.row:first-child { border-top: 0; }
.row[hidden] { display: none; }
.row__main { min-width: 0; }
.row__title {
  margin-top: 8px;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.row__open {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  transition: text-decoration-color var(--t) var(--ease), color var(--t) var(--ease);
}
/* stretch the open control across the whole row */
.row__open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.row__open:focus { outline: none; }
.row__open:focus::after,
.row__open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -4px; }
.row:active { transform: scale(0.995); }
.row__summary {
  margin-top: 8px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.row__meta {
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.row__meta strong { display: block; font-family: var(--f-text); font-size: 15px; font-weight: 600; color: var(--ink); }
.row__cta {
  justify-self: end;
  display: grid;
  justify-items: end;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
}
.row__arrow { display: inline-block; transition: transform var(--t) var(--ease); }
.row__saved {
  display: none;
  padding: 2px 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.row.is-saved .row__saved { display: inline-block; }

/* the door glyph */
.door {
  position: relative;
  display: block;
  width: 76px;
  height: 108px;
  border: 2px solid var(--ink);
  border-bottom-width: 5px;
  border-radius: 38px 38px 0 0;
  background:
    radial-gradient(60% 40% at 50% 34%, #F3C9A8 0, var(--accent-on-dark) 30%, var(--accent) 64%, #4A1C14 100%);
  perspective: 380px;
}
.door__leaf {
  position: absolute;
  inset: 3px;
  display: grid;
  place-items: center;
  border-radius: 33px 33px 0 0;
  background: var(--ink);
  color: var(--night-ink);
  transform-origin: 0 50%;
  transition: transform 280ms var(--ease);
  box-shadow: inset 0 0 0 4px #2A2624, inset 0 0 0 5px rgba(238, 232, 222, 0.18);
}
.door__num {
  font-family: var(--f-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  transform: translateY(-8px);
}
.door__knob {
  position: absolute;
  right: 9px;
  top: 58%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-on-dark);
}
.row.is-saved .door__leaf { transform: rotateY(-34deg); }
.row:focus-within .door__leaf { transform: rotateY(-64deg); }

/* empty state */
.empty {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 48px 16px;
  border-bottom: 1px solid var(--ink);
}
.empty[hidden] { display: none; }
.empty__door .door { width: 96px; height: 136px; border-radius: 48px 48px 0 0; }
.empty__door .door__leaf { border-radius: 43px 43px 0 0; }
.empty__door .door__num { font-size: 40px; }
.empty__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.empty__text { margin-top: 8px; margin-bottom: 24px; max-width: 52ch; color: var(--muted); }

.noscript { padding: 32px 0; color: var(--muted); }

/* ---------- Interlude ---------- */

.interlude {
  background: var(--accent);
  color: var(--accent-ink);
  padding-block: 144px;
  overflow: clip;
}
.interlude__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
}
.interlude__side {
  grid-column: 1 / span 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  justify-self: start;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.interlude__body { grid-column: 3 / span 9; }
.interlude__quote p {
  font-family: var(--f-display);
  font-size: clamp(40px, 6vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-indent: -0.4em;
}
.fade-word { animation: fade-sign 7s ease-in-out infinite; }
@keyframes fade-sign {
  0%, 30%, 100% { opacity: 1; }
  55%, 70% { opacity: 0.62; }
}
.interlude__cite {
  margin-top: 32px;
  font-size: 16px;
}
.interlude__cite cite { font-style: normal; font-weight: 600; }
.interlude__body .btn { margin-top: 32px; }

/* ---------- Topics ---------- */

.topics { padding-block: 112px 96px; }
.topics__head { max-width: 760px; }
.topic-list { margin-top: 48px; border-top: 1px solid var(--ink); }
.topic {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 2fr) minmax(0, 5fr) auto;
  gap: 32px;
  align-items: center;
  width: 100%;
  padding: 24px 16px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  text-align: left;
  transition: background-color var(--t) var(--ease);
}
.topic:focus-visible { outline-offset: -3px; }
.topic:active { transform: scale(0.99); }
.topic__name {
  font-family: var(--f-display);
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1;
  letter-spacing: -0.025em;
  transition: color var(--t) var(--ease);
}
.topic__count { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.topic__titles { font-size: 16px; line-height: 1.5; color: var(--muted); }
.topic__titles span { display: block; }
.topic__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}
.topic__go span { display: inline-block; transition: transform var(--t) var(--ease); }
.topic.is-current .topic__name { color: var(--accent); }
.topic.is-current .topic__go { color: var(--accent); }

/* ---------- Colophon ---------- */

.colophon {
  background: var(--night);
  color: var(--night-ink);
  padding-block: 128px 48px;
  overflow: clip;
}
.colophon__close {
  font-family: var(--f-display);
  font-size: clamp(48px, 9.4vw, 140px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  padding-bottom: 48px;
  border-bottom: 4px double var(--rule-dark);
}
.colophon__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) minmax(0, 2fr);
  gap: 48px;
  padding-top: 48px;
}
.colophon__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.colophon__about p { margin-top: 16px; max-width: 58ch; color: var(--night-muted); font-size: 17px; }
.colophon__about .colophon__note { font-size: 15px; }
.colophon__label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--night-muted);
}
.credits { margin-top: 8px; }
.credits__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 10px;
  color: var(--night-ink);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--rule-dark);
  text-underline-offset: 4px;
  transition: text-decoration-color var(--t) var(--ease), color var(--t) var(--ease);
}
.credits__link:focus-visible { outline-color: var(--accent-on-dark); }
.credits__link:active { transform: scale(0.98); }
.colophon__end { display: grid; align-content: start; gap: 8px; }

/* ---------- Reader (detail dialog) ---------- */

.reader {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.reader[open] { animation: reader-in 240ms var(--ease); }
.reader::backdrop { background: rgba(26, 24, 23, 0.7); }
@keyframes reader-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.reader__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-inline: var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--ink);
}
.reader__close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px 10px 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: transparent;
  font-size: 15px;
  font-weight: 650;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), transform 150ms var(--ease);
}
.reader__close:active { transform: scale(0.97); }
.reader__where { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

.save {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px 10px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 650;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), transform 150ms var(--ease);
}
.save:active { transform: scale(0.97); }
.save__mark {
  width: 14px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 7px 7px 0 0;
  transition: background-color var(--t) var(--ease);
}
.save[aria-pressed="true"] { background: transparent; color: var(--accent); }
.save[aria-pressed="true"] .save__mark { background: currentColor; }

.reader__article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr);
  gap: 48px;
  width: min(100% - 2 * var(--gutter), 1344px);
  margin-inline: auto;
  padding-block: 64px 96px;
}
.reader__rail { position: relative; }
.reader__num {
  position: sticky;
  top: 104px;
  display: block;
  text-align: right;
  font-family: var(--f-display);
  font-size: clamp(120px, 13vw, 200px);
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.reader__title {
  margin-top: 12px;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.reader__dek {
  margin-top: 20px;
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.45;
  color: var(--muted);
}
.reader__byline {
  margin-top: 24px;
  padding-block: 12px;
  border-block: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}
.reader__figure { margin-top: 40px; }
.reader__figure[hidden] { display: none; }
.reader__figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.reader__figure figcaption {
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.reader__body { margin-top: 40px; }
.reader__body p {
  max-width: 64ch;
  font-size: 19px;
  line-height: 1.7;
}
.reader__body p + p { margin-top: 1.1em; }
.reader__body p:first-child::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  font-family: var(--f-display);
  font-size: 4.3em;
  line-height: 0.82;
  color: var(--accent);
}
.reader__end {
  margin-top: 40px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.reader__end::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 14px;
  margin-right: 10px;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
  vertical-align: -1px;
}
.reader__next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 56px;
  border-top: 1px solid var(--ink);
}
.neighbour {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 44px;
  padding: 20px 16px 20px 0;
  border: 0;
  background: transparent;
  text-align: left;
  transition: background-color var(--t) var(--ease);
}
.neighbour--next {
  padding: 20px 0 20px 16px;
  border-left: 1px solid var(--rule);
  text-align: right;
}
.neighbour:active { transform: scale(0.98); }
.neighbour:focus-visible { outline-offset: -2px; }
.neighbour__dir {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.neighbour__title {
  font-family: var(--f-display);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  transition: color var(--t) var(--ease);
}

/* ---------- Hover (pointer devices only) ---------- */

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: #87301F; border-color: #87301F; }
  .btn--paper:hover { background: var(--night); color: var(--night-ink); border-color: var(--night); }
  .btn:hover span { transform: translateX(4px); }
  .textlink:hover { background-size: 100% 3px; }
  .nav__link:hover { background-size: calc(100% - 32px) 2px; color: #FFFFFF; }
  .saved-jump:hover { border-color: var(--night-ink); background: rgba(238, 232, 222, 0.08); }
  .sign:hover .sign__board { animation: swing-again 1.6s var(--ease) both; }
  .field__input:hover { border-color: var(--accent); }
  .toggle:hover { background: var(--surface); }
  .toggle[aria-pressed="true"]:hover { background: #33302D; }
  .row:hover { background: var(--surface); }
  .row:hover .door__leaf { transform: rotateY(-64deg); }
  .row:hover .row__open { text-decoration-color: currentColor; }
  .row:hover .row__arrow { transform: translateX(6px); }
  .topic:hover { background: var(--surface); }
  .topic:hover .topic__name { color: var(--accent); }
  .topic:hover .topic__go span { transform: translateX(6px); }
  .credits__link:hover { text-decoration-color: var(--night-ink); }
  .reader__close:hover { background: var(--ink); color: var(--bg); }
  .save:hover { background: #87301F; border-color: #87301F; }
  .save[aria-pressed="true"]:hover { background: var(--surface); color: var(--accent); }
  .neighbour:hover { background: var(--surface); }
  .neighbour:hover .neighbour__title { color: var(--accent); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .lead__plate { grid-column: 1 / span 6; grid-row: span 2; margin-bottom: -120px; }
  .lead__text { grid-column: 7 / -1; }
  .sign { grid-column: 7 / -1; padding-top: 24px; max-width: 280px; }
  .sign::before, .sign::after { display: none; }
  .row { grid-template-columns: 84px minmax(0, 1fr) 170px; }
  .row__cta { display: none; }
  .toolbar__inner { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) auto; }
  .toolbar__status { grid-column: 1 / -1; justify-self: start; padding-top: 0; text-align: left; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .topbar { flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .edition { flex: 1 1 auto; }
  .saved-jump { order: 2; }
  .nav {
    order: 3;
    flex: 0 0 calc(100% + 2 * var(--gutter));
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav__list { padding-inline: calc(var(--gutter) - 16px) 32px; width: max-content; }
  .wordmark { margin-top: 20px; }
  .strap { grid-template-columns: 1fr; gap: 8px; }
  .strap__lede, .strap__note { grid-column: 1; }
  .lead { grid-template-columns: 1fr; gap: 32px; margin-top: 32px; }
  .lead__plate, .lead__text, .sign { grid-column: 1; }
  .lead__plate { margin-bottom: 0; order: 2; }
  .sign { order: 3; }
  .lead__plate img { aspect-ratio: 3 / 2; }
  .sign { max-width: none; padding-top: 0; }
  .sign__board { animation: none; }
  .sign__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .sign__list li:nth-last-child(2) { border-bottom: 0; }
  .fascia { padding-bottom: 64px; }

  .directory { padding-block: 64px 96px; }
  .directory__head { display: block; min-height: 0; }
  .toolbar { position: static; margin-top: 32px; }
  .toolbar__inner { grid-template-columns: 1fr auto; gap: 16px; }
  .field--search { grid-column: 1 / -1; }
  .toolbar__status { grid-column: 1 / -1; }

  .row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px 20px;
    align-items: start;
    padding: 24px 0;
  }
  .row__meta { grid-column: 2; }
  .row__meta strong { display: inline; font-size: 14px; }
  .row__meta strong::after { content: " · "; font-weight: 400; color: var(--muted); }
  .door { width: 56px; height: 80px; border-radius: 28px 28px 0 0; }
  .door__leaf { border-radius: 23px 23px 0 0; }
  .door__num { font-size: 20px; transform: translateY(-4px); }
  .door__knob { right: 6px; width: 5px; height: 5px; }
  .row__summary { font-size: 16px; }

  .empty { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }

  .interlude { padding-block: 96px; }
  .interlude__grid { grid-template-columns: 1fr; gap: 24px; }
  .interlude__side { grid-column: 1; writing-mode: horizontal-tb; transform: none; }
  .interlude__body { grid-column: 1; }
  .interlude__quote p { text-indent: 0; }

  .topics { padding-block: 80px 64px; }
  .topic { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 20px 0; }
  .topic__name { grid-column: 1; }
  .topic__count { grid-column: 2; grid-row: 1; justify-self: end; }
  .topic__titles { grid-column: 1 / -1; }
  .topic__go { grid-column: 1 / -1; }

  .colophon { padding-block: 96px 40px; }
  .colophon__grid { grid-template-columns: 1fr; gap: 40px; }

  .reader__bar { gap: 8px; min-height: 64px; }
  .reader__where { display: none; }
  .reader__close, .save { gap: 8px; padding-inline: 12px; font-size: 14px; }
  .reader__article { grid-template-columns: 1fr; gap: 0; padding-block: 32px 64px; }
  .reader__num { position: static; text-align: left; font-size: 96px; }
  .reader__body p { font-size: 18px; }
  .reader__next { grid-template-columns: 1fr; }
  .neighbour, .neighbour--next { padding: 16px 0; border-left: 0; text-align: left; }
  .neighbour--next { border-top: 1px solid var(--rule); }
}

@media (max-width: 400px) {
  .edition__issue { margin-right: 4px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .wordmark__paint span, .lead__plate, .lead__text { animation: fade 1ms both !important; }
  .sign__board, .sign:hover .sign__board, .sign.is-nudged .sign__board { animation: none !important; transform: none; }
  .fade-word { animation: none !important; }
  .reader[open] { animation: fade 1ms both; }
  .btn:active, .toggle:active, .save:active, .reader__close:active, .row:active, .topic:active, .neighbour:active { transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
