/* =========================================================
   THE LOCAL LINE — a nocturnal city journal
   Type: Oswald (display / signage), Work Sans (body),
         IBM Plex Mono (route data & labels)
   ========================================================= */

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

@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 100 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 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0a0e13;
  --ink-2: #0e141b;
  --ink-3: #141c25;
  --paper: #f0f1e9;
  --paper-dim: #c8d0d2;
  --muted: #99a4ab;
  --line: rgba(240, 241, 233, 0.14);
  --line-strong: rgba(240, 241, 233, 0.28);
  --lime: #c9f83f;
  --lime-soft: rgba(201, 248, 63, 0.14);
  --lime-bright: #dcff70;
  --font-display: "Oswald", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --page-pad: 32px;
  --content: 1366px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(1000px 560px at 88% -12%, rgba(86, 131, 156, 0.2), transparent 64%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
}

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

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 300;
  padding: 10px 14px;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.18s var(--ease);
}

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

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 14, 19, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.masthead-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  min-height: 78px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  line-height: 1;
}

.brand-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-name {
  position: relative;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-accent {
  color: var(--lime);
}

.brand-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--lime);
  vertical-align: 0.28em;
}

.edition {
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.edition-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--paper-dim);
  font-size: 10px;
}

.signal {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(201, 248, 63, 0.12);
}

.edition-date {
  letter-spacing: 0.1em;
  text-transform: none;
  font-size: 9px;
  opacity: 0.8;
}

.masthead-actions {
  justify-self: end;
}

.saved-jump {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}

.saved-jump svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.saved-jump:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.saved-jump.has-saved {
  border-color: rgba(201, 248, 63, 0.55);
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 2px;
  background: rgba(240, 241, 233, 0.09);
  color: var(--paper-dim);
  font-size: 9px;
  letter-spacing: 0;
}

.saved-jump.has-saved .count-badge {
  background: var(--lime);
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Lead story ---------- */

.lead-wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(32px, 4.6vw, 68px);
  padding: 54px 0 50px;
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-stop {
  color: var(--lime);
}

.meta-rule {
  width: 24px;
  height: 1px;
  background: var(--line-strong);
}

.lead-title {
  margin: 22px 0 22px;
  max-width: 15ch;
  font-family: var(--font-display);
  font-size: clamp(46px, 5.4vw, 80px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.lead-dek {
  margin: 0;
  max-width: 46ch;
  font-size: 18px;
  line-height: 1.58;
  color: var(--paper-dim);
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 560px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead-meta .byline {
  color: var(--paper);
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 0.18s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn-lime {
  background: var(--lime);
  color: var(--ink);
}

.btn-lime:hover {
  background: var(--lime-bright);
}

.btn-outline {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--paper);
}

.btn-outline:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.lead-read-note {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead-media {
  margin: 0;
  min-width: 0;
}

.lead-frame {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--ink-3);
}

.lead-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 19, 0) 52%, rgba(10, 14, 19, 0.52) 100%),
    linear-gradient(90deg, rgba(10, 14, 19, 0.16), transparent 42%);
  pointer-events: none;
}

.lead-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  filter: saturate(0.88) contrast(1.06) brightness(0.92);
}

.lead-plate {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead-plate .plate-slash {
  opacity: 0.5;
}

.lead-media figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Control deck ---------- */

.control-deck {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(14, 20, 27, 0.62);
}

.control-inner {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 40px;
  align-items: end;
  max-width: var(--content);
  margin: 0 auto;
  padding: 20px var(--page-pad) 22px;
}

.deck-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

.deck-label span:first-child {
  color: var(--lime);
}

.deck-rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--line-strong);
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.45fr) 190px 228px;
  gap: 16px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field label,
.field-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.input-shell,
.select-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  pointer-events: none;
}

#search {
  width: 100%;
  height: 46px;
  padding: 0 46px 0 40px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

#search::placeholder {
  color: rgba(153, 164, 171, 0.74);
}

#search::-webkit-search-cancel-button {
  filter: invert(0.8);
}

.input-shell:focus-within #search {
  border-color: var(--lime);
  background: var(--ink-2);
}

.input-shell:focus-within .input-icon {
  stroke: var(--lime);
}

.key-hint {
  position: absolute;
  right: 11px;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  pointer-events: none;
}

#filter {
  width: 100%;
  height: 46px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14.5px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.18s var(--ease);
}

#filter:hover,
.select-shell:focus-within #filter {
  border-color: var(--lime);
}

#filter option {
  background: var(--ink-2);
  color: var(--paper);
}

.select-chevron {
  position: absolute;
  right: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  pointer-events: none;
}

.saved-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

.saved-toggle svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.saved-toggle:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.saved-toggle[aria-pressed="true"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
  font-weight: 500;
}

.saved-toggle[aria-pressed="true"] svg {
  fill: var(--ink);
  stroke: var(--ink);
}

/* ---------- Route / story list ---------- */

.route {
  max-width: var(--content);
  margin: 0 auto;
  padding: 52px var(--page-pad) 88px;
  scroll-margin-top: 92px;
}

.route-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow span {
  color: var(--lime);
  padding: 0 2px;
}

.route-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.005em;
}

.result-count {
  margin: 0 0 3px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.story-list {
  position: relative;
  margin: 8px 0 0 12px;
  border-left: 1px solid var(--line);
}

.story {
  position: relative;
  padding: 24px 0 24px 30px;
  border-bottom: 1px solid var(--line);
}

.story::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(201, 248, 63, 0.035), transparent 54%);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
  pointer-events: none;
}

.story:hover::after {
  opacity: 1;
}

.stop-dot {
  position: absolute;
  left: -5px;
  top: 34px;
  z-index: 2;
  width: 9px;
  height: 9px;
  border: 1px solid var(--lime);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px var(--ink);
  pointer-events: none;
  transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.story:hover .stop-dot,
.story:focus-within .stop-dot {
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(201, 248, 63, 0.18);
}

.story-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 26px;
}

.story-open {
  position: absolute;
  inset: -24px 0 -24px -30px;
  z-index: 3;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.story-open:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.story-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-3);
  transition: border-color 0.18s var(--ease);
}

.story-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(10, 14, 19, 0.02), rgba(10, 14, 19, 0.28));
  pointer-events: none;
}

.story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.05) brightness(0.88);
  transition: transform 0.35s var(--ease), filter 0.25s var(--ease);
}

.story:hover .story-thumb,
.story:focus-within .story-thumb {
  border-color: rgba(201, 248, 63, 0.7);
}

.story:hover .story-thumb img,
.story:focus-within .story-thumb img {
  transform: scale(1.035);
  filter: saturate(0.94) contrast(1.05) brightness(0.95);
}

.story-copy {
  min-width: 0;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.story-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--paper-dim);
}

.story-cat::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--lime);
}

.saved-flag {
  color: var(--lime);
}

.story-copy h3 {
  margin: 0 0 7px;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.002em;
  text-wrap: pretty;
  transition: color 0.18s var(--ease);
}

.story:hover h3,
.story:focus-within h3 {
  color: var(--lime);
}

.story-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  max-width: 72ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.story-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.story-arrow svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.story:hover .story-arrow,
.story:focus-within .story-arrow {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
  transform: translateX(2px);
}

.loading-note {
  margin: 0;
  padding: 34px 0 34px 30px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Empty state ---------- */

.empty-state {
  margin-top: 24px;
  padding: 64px 40px;
  border: 1px dashed var(--line-strong);
  background: rgba(14, 20, 27, 0.55);
}

.empty-code {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lime);
}

.empty-state h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 500;
  line-height: 1.02;
}

.empty-state > p:not(.empty-code) {
  margin: 0 0 24px;
  max-width: 48ch;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-line {
  position: relative;
  max-width: var(--content);
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--lime), var(--line-strong) 32%, var(--line) 100%);
}

.terminus {
  position: absolute;
  left: calc(var(--page-pad) + 8px);
  top: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px var(--ink);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  max-width: var(--content);
  margin: 0 auto;
  padding: 48px var(--page-pad) 64px;
}

.footer-brand {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.footer-note {
  margin: 0;
  max-width: 44ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.footer-meta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-meta p {
  margin: 0;
}

.footer-edition {
  margin-top: 12px !important;
  color: var(--lime);
}

.footer-end {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--page-pad) 40px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-end-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.footer-end-dot {
  width: 7px;
  height: 7px;
  border: 1px solid var(--lime);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(201, 248, 63, 0.12);
}

.footer-end-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.footer-top {
  flex: 0 0 auto;
  color: var(--paper-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.footer-top:hover {
  color: var(--lime);
  border-color: var(--lime);
}

/* ---------- Reading room (detail) ---------- */

.detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 80% -6%, rgba(86, 131, 156, 0.16), transparent 62%),
    var(--ink);
  animation: detail-in 0.32s var(--ease);
}

.detail[hidden] {
  display: none;
}

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

.detail-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 19, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.detail-bar-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.detail-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
}

.detail-slash {
  color: var(--lime);
  padding: 0 2px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-button,
.close-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

.save-button svg,
.close-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.save-button:hover,
.close-button:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.save-button[aria-pressed="true"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
  font-weight: 500;
}

.save-button[aria-pressed="true"] svg {
  fill: var(--ink);
  stroke: var(--ink);
}

.save-button[aria-pressed="true"]:hover {
  background: var(--lime-bright);
  color: var(--ink);
}

.detail-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(201, 248, 63, 0.45) transparent;
}

.detail-article {
  max-width: 828px;
  margin: 0 auto;
  padding: 60px 32px 110px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 13px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-meta .meta-stop {
  color: var(--lime);
}

.detail-title {
  margin: 22px 0 20px;
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 66px);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.004em;
  text-wrap: balance;
}

.detail-dek {
  margin: 0;
  max-width: 52ch;
  font-size: 20px;
  line-height: 1.55;
  color: var(--paper-dim);
}

.detail-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 28px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-byline .byline {
  color: var(--paper);
}

.detail-figure {
  margin: 38px 0 44px;
}

.detail-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  filter: saturate(0.86) contrast(1.05) brightness(0.92);
}

.detail-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 9px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-body {
  max-width: 64ch;
}

.detail-body p {
  margin: 0 0 25px;
  font-size: 18.5px;
  line-height: 1.72;
  color: #dde2e1;
}

.detail-body p:first-child {
  font-size: 21px;
  line-height: 1.62;
  color: var(--paper);
}

.detail-body p:first-child::first-letter {
  float: left;
  margin: 7px 10px 0 0;
  font-family: var(--font-display);
  font-size: 3.9em;
  font-weight: 500;
  line-height: 0.72;
  color: var(--lime);
}

.detail-end {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 54px 0 38px;
  max-width: 64ch;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-end-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line-strong);
}

.detail-end-mark {
  flex: 0 0 auto;
  color: var(--lime);
}

.detail-back {
  padding-top: 8px;
}

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

@media (max-width: 1120px) {
  .masthead-inner {
    grid-template-columns: 1fr auto;
  }

  .edition {
    display: none;
  }

  .control-inner {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 26px;
  }

  .controls {
    grid-template-columns: minmax(220px, 1fr) 170px 210px;
    gap: 12px;
  }

  .lead-title {
    font-size: clamp(46px, 5.6vw, 70px);
  }
}

@media (max-width: 920px) {
  .control-inner {
    display: block;
    padding-top: 18px;
  }

  .deck-label {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  .deck-rule {
    width: 50px;
    flex: 0 0 50px;
  }

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

  .lead {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 36px 0 40px;
  }

  .lead-copy {
    display: contents;
  }

  .route-meta {
    order: 1;
  }

  .lead-title {
    order: 2;
    max-width: 17ch;
    font-size: clamp(44px, 8.3vw, 68px);
    margin: 17px 0 16px;
  }

  .lead-dek {
    order: 3;
    max-width: 54ch;
  }

  .lead-media {
    order: 4;
    margin-top: 28px;
  }

  .lead-frame {
    aspect-ratio: 16 / 10;
  }

  .lead-frame img {
    object-position: center 58%;
  }

  .lead-meta {
    order: 5;
    margin-top: 24px;
  }

  .lead-actions {
    order: 6;
    margin-top: 18px;
  }

  .story-inner {
    grid-template-columns: 132px minmax(0, 1fr) 36px;
    gap: 22px;
  }

  .story-copy h3 {
    font-size: 26px;
  }

  .story-summary {
    -webkit-line-clamp: 2;
  }

  .footer-inner {
    flex-direction: column;
    gap: 26px;
  }

  .footer-meta {
    text-align: left;
  }

  .footer-end {
    padding-bottom: 32px;
  }
}

@media (max-width: 680px) {
  :root {
    --page-pad: 20px;
  }

  .masthead-inner {
    min-height: 64px;
    gap: 12px;
  }

  .brand-kicker {
    font-size: 8px;
    letter-spacing: 0.16em;
  }

  .brand-name {
    font-size: 21px;
  }

  .brand-dot {
    width: 5px;
    height: 5px;
    margin-left: 5px;
  }

  .saved-jump {
    height: 36px;
    padding: 0 9px;
    gap: 6px;
    font-size: 9px;
  }

  .saved-jump svg {
    width: 14px;
    height: 14px;
  }

  .count-badge {
    min-width: 18px;
    height: 18px;
    font-size: 8px;
  }

  .lead-wrap {
    padding: 0 20px;
  }

  .lead {
    padding: 28px 0 34px;
  }

  .route-meta {
    gap: 7px 10px;
    font-size: 9.5px;
    letter-spacing: 0.11em;
  }

  .meta-rule {
    width: 14px;
  }

  .lead-title {
    max-width: 100%;
    margin: 14px 0 14px;
    font-size: clamp(39px, 11.6vw, 52px);
    line-height: 1;
  }

  .lead-dek {
    font-size: 16.5px;
    line-height: 1.55;
  }

  .lead-media {
    margin-top: 22px;
  }

  .lead-frame {
    aspect-ratio: 4 / 3;
  }

  .lead-media figcaption {
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .lead-meta {
    margin-top: 20px;
    padding-top: 13px;
    font-size: 9px;
    line-height: 1.6;
  }

  .lead-actions {
    margin-top: 16px;
    gap: 12px;
  }

  .btn {
    min-height: 46px;
    font-size: 10.5px;
    padding: 0 16px;
  }

  .lead-read-note {
    font-size: 8.5px;
  }

  .control-inner {
    padding: 16px 20px 18px;
  }

  .controls {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .field-search {
    grid-column: auto;
  }

  .field-topic,
  .field-saved {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .field-topic label {
    margin-bottom: 0;
  }

  .field-saved {
    gap: 7px;
  }

  .route {
    padding: 38px 20px 64px;
  }

  .route-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
  }

  .route-head h2 {
    font-size: 27px;
  }

  .result-count {
    margin: 0;
  }

  .story-list {
    margin-left: 4px;
  }

  .story {
    padding: 18px 0 18px 20px;
  }

  .story-open {
    inset: -18px 0 -18px -20px;
  }

  .stop-dot {
    top: 27px;
    left: -5px;
    width: 8px;
    height: 8px;
  }

  .story-inner {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 15px;
    align-items: start;
  }

  .story-thumb {
    aspect-ratio: 1 / 1;
  }

  .story-arrow {
    display: none;
  }

  .story-meta {
    gap: 3px 9px;
    margin-bottom: 5px;
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .story-copy h3 {
    margin-bottom: 5px;
    font-size: 21px;
    line-height: 1.08;
  }

  .story-summary {
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  .empty-state {
    padding: 40px 22px;
  }

  .empty-state h3 {
    font-size: 30px;
  }

  .footer-inner {
    padding: 36px 20px 52px;
  }

  .footer-line {
    margin: 0 20px;
  }

  .terminus {
    left: 8px;
  }

  .footer-note {
    font-size: 13px;
  }

  .footer-end {
    padding: 0 20px 32px;
    font-size: 8.5px;
  }

  .detail-bar {
    min-height: 60px;
    padding: 0 14px;
    gap: 10px;
  }

  .detail-bar-title {
    display: none;
  }

  .detail-actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .save-button,
  .close-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 8.5px;
    letter-spacing: 0.06em;
    gap: 7px;
  }

  .save-button svg,
  .close-button svg {
    width: 14px;
    height: 14px;
  }

  .detail-article {
    padding: 34px 20px 74px;
  }

  .detail-title {
    font-size: clamp(36px, 10.5vw, 46px);
    margin: 16px 0 16px;
    line-height: 1.01;
  }

  .detail-meta {
    font-size: 8.5px;
    letter-spacing: 0.12em;
  }

  .detail-dek {
    font-size: 17.5px;
    line-height: 1.55;
  }

  .detail-byline {
    margin-top: 22px;
    font-size: 8.5px;
  }

  .detail-figure {
    margin: 28px 0 32px;
  }

  .detail-figure img {
    aspect-ratio: 4 / 3;
  }

  .detail-body p {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 22px;
  }

  .detail-body p:first-child {
    font-size: 19px;
  }

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

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

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

  .detail {
    animation: none;
  }
}
