/* Secaucus Atlas. Anchor in DESIGN.md: a 1950s USGS quad of the Meadowlands at dusk. */
:root {
  --paper: #F4EFE4;
  --paper-2: #EBE3D3;
  --paper-3: #E0D5C0;
  --ink: #16212B;
  --ink-2: #3A4753;
  --muted: #5E6A72;
  --rule: #CFC3AC;
  --contour: #8A5A3B;
  --marsh: #3E6B5C;
  --river: #2D5F7A;
  --reed: #B89B6A;
  --brick: #9A4B37;
  --accent: #E2943B;
  --accent-ink: #8C4F0E;
  --on-accent: #1A1206;
  --focus: #1F6FEB;
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 24px -12px rgba(22, 33, 43, .28);
  --r: 6px;
  --r-in: 4px;
  --fs: 1.0625rem;
  --display: "Bricolage Grotesque", "Noto Sans", system-ui, sans-serif;
  --body: "Literata", "Noto Serif", Georgia, serif;
  --ease-in: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.4, 0, 1, 1);
  --ease-move: cubic-bezier(.2, 0, 0, 1);
  --bar-h: 56px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0F1820;
  --paper-2: #16222C;
  --paper-3: #1E2C37;
  --ink: #EDE6D6;
  --ink-2: #C9C1B0;
  --muted: #9FB0B8;
  --rule: #2C3B47;
  --contour: #C99872;
  --marsh: #7FB09C;
  --river: #7DB3D0;
  --reed: #CDB283;
  --brick: #D98B74;
  --accent-ink: #F2B36A;
  --focus: #79B8FF;
  --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 10px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root.big { --fs: 1.25rem; }
:root.easy { --body: "Atkinson Hyperlegible", "Noto Sans", system-ui, sans-serif; --display: "Atkinson Hyperlegible", "Noto Sans", system-ui, sans-serif; }
:root[lang="hi"] { --body: "Literata", "Noto Sans Devanagari", serif; --display: "Bricolage Grotesque", "Noto Sans Devanagari", sans-serif; }
:root[lang="zh"] { --body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; --display: "Noto Sans SC", "PingFang SC", sans-serif; }
:root[lang="ko"] { --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; --display: "Noto Sans KR", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* paper grain, 3% */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="dark"] body::before { opacity: .05; }
main, header, footer { position: relative; z-index: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-in); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
h1 { font-weight: 800; }
h2 { font-weight: 800; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
h3 { font-weight: 700; font-size: 1.22em; letter-spacing: -.015em; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 1em; height: 1em; }
.ic.big { width: 32px; height: 32px; }
.ic.huge { width: 72px; height: 72px; color: var(--marsh); }
.num, .tm-year, .q-y, .when, table { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: 8px; top: -48px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: var(--r); }
.skip:focus { top: 8px; }

/* ---------------------------------------------------------------- top bar */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  height: var(--bar-h); padding: 0 12px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--rule);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 800 1.15rem/1 var(--display); letter-spacing: -.03em; color: var(--ink); flex: none; }
.brand .ic { color: var(--marsh); width: 24px; height: 24px; }
.brand-sub { font-weight: 500; color: var(--muted); }
.themebar { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; margin-left: 8px; mask-image: linear-gradient(90deg, #000 90%, transparent); }
.themebar::-webkit-scrollbar { display: none; }
.themebar a {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r);
  text-decoration: none; font: 600 .92rem/1 var(--display); color: var(--ink-2); white-space: nowrap;
  transition: background-color .12s var(--ease-in), color .12s var(--ease-in), transform .12s var(--ease-in);
}
.themebar a[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .themebar a:not([aria-current]):hover { background: var(--paper-2); color: var(--ink); } }
.themebar a:active { transform: scale(.97); }
.bar-tools { display: flex; gap: 4px; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; min-width: 40px; justify-content: center;
  padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper);
  color: var(--ink); font: 600 .9rem/1 var(--display); cursor: pointer;
  transition: background-color .12s var(--ease-in), transform .12s var(--ease-in), border-color .12s var(--ease-in);
}
@media (hover: hover) { .pill:hover { background: var(--paper-2); border-color: var(--ink-2); } }
.pill:active { transform: scale(.97); }
.pill:disabled { opacity: .45; cursor: not-allowed; }
.lang-now { min-width: 1.6em; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; overflow: hidden; }
.progress .fill { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.panel {
  position: absolute; right: 12px; top: calc(var(--bar-h) - 4px); width: min(320px, calc(100vw - 24px));
  display: grid; gap: 8px; padding: 16px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r); box-shadow: var(--shadow);
  animation: rise .26s var(--ease-in);
}
.panel label { font: 600 .85rem/1.2 var(--display); color: var(--muted); }
.panel select { font: 600 1rem/1 var(--display); padding: 10px; border-radius: var(--r-in); border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); }
.mt-note { font-size: .85rem; color: var(--muted); }
.opt {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--rule); border-radius: var(--r-in); background: var(--paper); color: var(--ink);
  font: 500 .95rem/1.2 var(--display); cursor: pointer; transition: background-color .12s var(--ease-in), transform .12s var(--ease-in);
}
.opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (hover: hover) { .opt:not([aria-pressed="true"]):hover { background: var(--paper-2); } }
.opt:active { transform: scale(.98); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fall { to { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: var(--r); font: 700 1rem/1 var(--display); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color .12s var(--ease-in), transform .12s var(--ease-in), box-shadow .12s var(--ease-in);
}
.btn-main { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 16px -8px rgba(140, 79, 14, .7); }
@media (hover: hover) { .btn-main:hover { background: #EDA552; } }
.btn-ghost { background: rgba(255,255,255,.08); color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); }
@media (hover: hover) { .btn-ghost:hover { background: rgba(255,255,255,.16); } }
.btn:active { transform: scale(.97); }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ---------------------------------------------------------------- hero: aerial time machine */
.hero { position: relative; min-height: min(88vh, 820px); display: grid; align-items: end; color: #F4EFE4; overflow: hidden; background: #16212B; }
.tm { position: absolute; inset: 0; }
.tm-stage { position: absolute; inset: 0; }
.tm-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .42s var(--ease-in), transform 8s var(--ease-move); }
.tm-stage img.next { opacity: 0; }
.tm-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,24,32,.1) 0%, rgba(15,24,32,.3) 40%, rgba(15,24,32,.9) 100%), linear-gradient(90deg, rgba(15,24,32,.55), transparent 60%); }
.tm-scrub {
  position: absolute; z-index: 3; right: 16px; top: 16px; display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px 12px;
  padding: 12px 14px; border-radius: var(--r); background: rgba(15, 24, 32, .72); border: 1px solid rgba(244, 239, 228, .14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tm-scrub input { grid-column: 1 / -1; width: min(300px, 70vw); accent-color: var(--accent); }
.tm-year { font: 800 2rem/1 var(--display); letter-spacing: -.03em; color: #fff; }
.tm-ticks { grid-column: 1 / -1; display: flex; justify-content: space-between; list-style: none; margin: 0; padding: 0; font: 600 .72rem/1 var(--display); color: rgba(244,239,228,.7); }
.tm-scrub .pill { justify-self: end; background: transparent; color: #fff; border-color: rgba(244,239,228,.3); }
.hero-in { position: relative; z-index: 2; width: min(1120px, 100% - 32px); margin: 0 auto; padding: 120px 0 56px; }
.hello { font: 700 1.05rem/1.2 var(--display); color: #F6B566; margin-bottom: 12px; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.hero h1, .hero-lede { text-shadow: 0 2px 24px rgba(15,24,32,.55); }
.hero h1 { font-size: clamp(2.8rem, 1.6rem + 6.4vw, 6.4rem); line-height: .98; letter-spacing: -.045em; max-width: 12ch; color: #fff; }
.hero-lede { font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); max-width: 52ch; margin-top: 20px; color: rgba(244, 239, 228, .9); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.tm-hint { font: 500 .78rem/1.2 var(--display); color: rgba(244,239,228,.75); }
.hero-credit { position: absolute; right: 16px; bottom: 12px; margin: 0; font: 500 .72rem/1.2 var(--display); }
.hero-credit a { color: rgba(244,239,228,.6); text-decoration: none; }
.hero-count { margin-top: 20px; font: 500 .9rem/1.3 var(--display); color: rgba(244, 239, 228, .7); }

/* ---------------------------------------------------------------- home sections */
.quickwrap, .index, .soon, .promo { padding: 64px 0; }
.quickwrap { border-bottom: 1px solid var(--rule); }
.quick { list-style: none; counter-reset: q; margin: 28px 0 0; padding: 0; display: grid; gap: 0; max-width: 72ch; }
.quick li { counter-increment: q; border-top: 1px solid var(--rule); }
.quick li:last-child { border-bottom: 1px solid var(--rule); }
.quick a { display: grid; grid-template-columns: 3.2rem 6.5rem 1fr; gap: 12px; align-items: baseline; padding: 16px 4px; text-decoration: none; transition: background-color .12s var(--ease-in); }
.quick a::before { content: counter(q, decimal-leading-zero); font: 800 1.4rem/1 var(--display); color: var(--reed); }
.q-y { font: 700 .95rem/1 var(--display); color: var(--contour); }
@media (hover: hover) { .quick a:hover { background: var(--paper-2); } }
@media (max-width: 560px) { .quick a { grid-template-columns: 2.6rem 1fr; } .q-y { grid-column: 2; } .quick a > span:last-child { grid-column: 2; } }

.soon { background: var(--paper-2); }
.soon-list { list-style: none; padding: 0; margin: 24px 0 16px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.soon-list li a { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 14px; text-decoration: none; border-radius: var(--r); background: var(--paper); border: 1px solid var(--rule); height: 100%; transition: transform .12s var(--ease-in), border-color .12s var(--ease-in); }
@media (hover: hover) { .soon-list li a:hover { border-color: var(--ink-2); transform: translateY(-2px); } }
.cal-tile { grid-row: span 2; display: grid; place-items: center; width: 56px; height: 60px; border-radius: var(--r-in); background: var(--ink); color: var(--paper); text-align: center; line-height: 1; }
.cal-tile b { font: 800 1.5rem/1 var(--display); }
.cal-tile small { font: 600 .72rem/1 var(--display); color: var(--accent); }
.soon-t { font: 700 1rem/1.25 var(--display); }
.soon-s { font-size: .88rem; color: var(--muted); }
.more-link { display: inline-flex; gap: 6px; align-items: center; font: 700 1rem/1 var(--display); color: var(--accent-ink); }

.sub { color: var(--muted); margin-top: 8px; max-width: 60ch; }

/* line map: one transit line per theme */
.lines { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 28px; }
.line { --c: var(--marsh); }
.tone-brick { --c: var(--brick); } .tone-marsh { --c: var(--marsh); } .tone-amber { --c: #C47A20; } .tone-river { --c: var(--river); } .tone-ink { --c: var(--ink-2); } .tone-reed { --c: #8C7444; }
:root[data-theme="dark"] .tone-amber { --c: var(--accent); } :root[data-theme="dark"] .tone-reed { --c: var(--reed); }
.line-name { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.25rem/1.1 var(--display); letter-spacing: -.02em; }
.line-name .ic { color: var(--c); }
.line-min { font: 500 .85rem/1 var(--display); color: var(--muted); margin-left: 4px; }
.stops { list-style: none; margin: 14px 0 0; padding: 0 0 0 2px; display: flex; flex-wrap: wrap; position: relative; }
.stops li { position: relative; }
.stops li::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 6px; background: var(--c); }
.stops li:first-child::before { left: 8px; border-radius: 3px 0 0 3px; }
.stops li:last-child::before { right: auto; width: 20px; border-radius: 0 3px 3px 0; }
.stops a { position: relative; display: grid; justify-items: start; gap: 8px; padding: 0 22px 8px 0; text-decoration: none; font: 600 .95rem/1.25 var(--display); max-width: 14ch; }
.stop { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 5px solid var(--c); transition: transform .15s var(--ease-in); }
@media (hover: hover) { .stops a:hover .stop { transform: scale(1.18); } .stops a:hover { color: var(--c); } }
.stops a:active .stop { transform: scale(.94); }

.promo-in { display: grid; gap: 16px; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 860px) { .promo-in { grid-template-columns: 1fr; } }
.promo-card {
  position: relative; display: grid; align-content: end; gap: 8px; min-height: 220px; padding: 24px; border-radius: var(--r);
  text-decoration: none; color: #F4EFE4; overflow: hidden; isolation: isolate;
  transition: transform .18s var(--ease-in), box-shadow .18s var(--ease-in);
}
.promo-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: inherit; }
.promo-map { background: linear-gradient(160deg, rgba(22,33,43,.2), rgba(22,33,43,.92)), url("/img/hero/map-promo.jpg") center/cover, #2D5F7A; }
.promo-flood { background: linear-gradient(160deg, #2D5F7A, #16212B); }
.promo-quiz { background: linear-gradient(160deg, #3E6B5C, #16212B); }
.promo-card .ic { color: var(--accent); }
.p-t { font: 800 1.5rem/1.1 var(--display); letter-spacing: -.02em; }
.p-s { color: rgba(244,239,228,.85); max-width: 40ch; }
@media (hover: hover) { .promo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); } }
.promo-card:active { transform: scale(.98); }

/* ---------------------------------------------------------------- theme pages */
.theme-head { --c: var(--marsh); padding: 72px 0 40px; border-bottom: 1px solid var(--rule); background:
  radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%); }
.th-in { width: min(1120px, 100% - 32px); margin: 0 auto; }
.th-ic { width: 40px; height: 40px; color: var(--c); margin-bottom: 16px; }
.theme-head h1 { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.6rem); letter-spacing: -.04em; max-width: 16ch; }
.th-lead { font-size: 1.15em; max-width: 58ch; margin-top: 16px; color: var(--ink-2); }
.toc { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule); text-decoration: none; font: 600 .92rem/1 var(--display); background: var(--paper); transition: background-color .12s var(--ease-in), transform .12s var(--ease-in); }
.toc a .ic { color: var(--c); }
@media (hover: hover) { .toc a:hover { background: var(--paper-2); } }
.toc a:active { transform: scale(.97); }

.chapter { width: min(1120px, 100% - 32px); margin: 0 auto; padding: 64px 0; border-bottom: 1px solid var(--rule); }
.ch-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.ch-ic { width: 40px; height: 40px; padding: 8px; border-radius: var(--r); background: var(--ink); color: var(--accent); flex: none; margin-top: 2px; }
.mins { display: flex; align-items: center; gap: 6px; margin-top: 8px; font: 500 .88rem/1 var(--display); color: var(--muted); }
.lede { max-width: 68ch; }
.lede .pts li { font-size: 1.08em; }
.pts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pts li { position: relative; padding-left: 1.2em; }
.pts li::before { content: ""; position: absolute; left: 0; top: .72em; width: .5em; height: 2px; background: var(--reed); }

.stories { display: grid; gap: 0; margin-top: 24px; }
.story { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 28px 0; border-top: 1px solid var(--rule); }
.story.has-fig { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; }
@media (max-width: 760px) { .story.has-fig { grid-template-columns: 1fr; } }
.story:target { animation: flash 1.6s var(--ease-in); }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
.st-fig { margin: 0; }
.st-fig img { border-radius: var(--r); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; background: var(--paper-3); }
.st-fig figcaption { font-size: .74rem; line-height: 1.35; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.st-body { max-width: 66ch; display: grid; gap: 10px; align-content: start; }
.when { font: 700 .9rem/1 var(--display); color: var(--contour); }
.place { font: 500 .9rem/1.3 var(--display); color: var(--muted); }
.st-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font: 500 .82rem/1.2 var(--display); color: var(--muted); }
.srcs a, .srcs span[title] { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 4px; border-radius: 4px; background: var(--paper-2); text-decoration: none; color: var(--ink-2); margin-left: 2px; }
@media (hover: hover) { .srcs a:hover { background: var(--ink); color: var(--paper); } }
.conf { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font: 600 .78rem/1.2 var(--display); }
.conf::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conf-documented { color: var(--marsh); background: color-mix(in srgb, var(--marsh) 12%, transparent); }
.conf-reported { color: var(--river); background: color-mix(in srgb, var(--river) 12%, transparent); }
.conf-tradition { color: var(--contour); background: color-mix(in srgb, var(--contour) 12%, transparent); }
.st-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tool, .onmap {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2); font: 600 .86rem/1 var(--display);
  cursor: pointer; text-decoration: none; transition: background-color .12s var(--ease-in), transform .12s var(--ease-in), color .12s var(--ease-in);
}
@media (hover: hover) { .tool:hover, .onmap:hover { background: var(--paper-2); color: var(--ink); } }
.tool:active, .onmap:active { transform: scale(.97); }

.more { margin-top: 0; border-top: 1px solid var(--rule); }
.more > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; margin: 16px 0; padding: 10px 16px; border-radius: var(--r);
  background: var(--ink); color: var(--paper); font: 700 .95rem/1 var(--display); cursor: pointer; transition: transform .12s var(--ease-in);
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary .ic { transition: transform .2s var(--ease-move); }
.more[open] > summary .ic { transform: rotate(180deg); }
.more > summary:active { transform: scale(.97); }
.more[open] > .stories { animation: rise .32s var(--ease-in); margin-top: 0; }

.subhead { margin-top: 36px; font-size: 1.4rem; }
.subnote { color: var(--muted); max-width: 66ch; margin-top: 8px; font-size: .95em; }

.numbers { width: 100%; max-width: 820px; margin-top: 32px; border-collapse: collapse; font-size: .95em; }
.numbers caption { text-align: left; font: 800 1.15rem/1.2 var(--display); margin-bottom: 8px; }
.numbers th, .numbers td { text-align: left; padding: 10px 12px 10px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.numbers th { font: 600 .95rem/1.3 var(--display); width: 34%; }
.numbers .num { font: 800 1.2rem/1.1 var(--display); color: var(--accent-ink); white-space: nowrap; }
.numbers .note { color: var(--muted); font-size: .9em; }
.numbers a { color: var(--muted); }
@media (max-width: 640px) {
  .numbers, .numbers tbody, .numbers tr, .numbers th, .numbers td { display: block; width: auto; }
  .numbers caption { display: block; }
  .numbers tr { border-top: 1px solid var(--rule); padding: 10px 0; }
  .numbers th, .numbers td { border: 0; padding: 2px 0; }
  .numbers .num { white-space: normal; }
  .numbers td, .numbers th { overflow-wrap: anywhere; }
}

.sources { margin-top: 24px; }
.sources > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 600 .92rem/1 var(--display); color: var(--muted); padding: 8px 0; }
.sources ol, .sources ul { font-size: .86rem; color: var(--ink-2); padding-left: 1.4em; display: grid; gap: 4px; margin: 8px 0 0; overflow-wrap: anywhere; }

.next { display: inline-flex; align-items: center; gap: 8px; margin-top: 32px; padding: 14px 18px; border-radius: var(--r); background: var(--paper-2); text-decoration: none; font: 500 1rem/1.2 var(--display); transition: background-color .12s var(--ease-in), transform .12s var(--ease-in); }
.next b { font-weight: 800; }
.next .ic { color: var(--accent-ink); transition: transform .15s var(--ease-in); }
@media (hover: hover) { .next:hover { background: var(--paper-3); } .next:hover .ic { transform: translateX(3px); } }
.next:active { transform: scale(.98); }

/* focus mode: one chapter at a time */
:root.focus body[data-page] main .chapter:not(.current), :root.focus .theme-head { display: none; }

/* ---------------------------------------------------------------- data widgets and charts */
.widget { margin-top: 24px; min-height: 120px; }
.skeleton { height: 280px; border-radius: var(--r); background: linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.chart { width: 100%; height: auto; overflow: visible; font-family: var(--display); }
.chart .axis line, .chart .grid line { stroke: var(--rule); }
.chart .axis text { fill: var(--muted); font-size: 12px; }
.chart .series { fill: none; stroke: var(--river); stroke-width: 2; }
.chart .series.alt { stroke: var(--brick); }
.chart .dot { fill: var(--river); }
.chart .trend { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 4; fill: none; }
.chart .bx { fill: var(--marsh); }
.chart .bx.hot { fill: var(--brick); }
.chart .mark line { stroke: var(--ink-2); stroke-dasharray: 2 3; }
.chart .mark text { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .hover-line { stroke: var(--ink); stroke-width: 1; }
.chart-wrap { position: relative; }
.chart-tip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: var(--r-in); background: var(--ink); color: var(--paper); font: 600 .82rem/1.3 var(--display); white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.chart-tip.on { opacity: 1; }
.facts { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 0; max-width: 820px; }
.facts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.facts b { font: 800 1.05rem/1.2 var(--display); color: var(--accent-ink); text-align: right; }
.facts small { grid-column: 1 / -1; color: var(--muted); }
.weak { margin-top: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--paper-2); font-size: .9em; }
.weak h4 { margin: 0 0 6px; font: 700 .95rem/1.2 var(--display); display: flex; gap: 8px; align-items: center; }
.weak ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.chart-src { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 600 .85rem/1.2 var(--display); color: var(--ink-2); margin: 12px 0 0; padding: 0; list-style: none; }
.legend i { display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--river); }
.legend .l-trend i { background: var(--accent); } .legend .l-alt i { background: var(--brick); }

/* timeline */
.tl { position: relative; margin-top: 24px; padding-left: 28px; list-style: none; }
.tl::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: linear-gradient(var(--brick), var(--reed), var(--marsh), var(--river)); }
.tl-era { margin: 28px 0 8px -28px; font: 800 1.1rem/1.2 var(--display); color: var(--contour); }
.tl li.tl-i { position: relative; padding: 8px 0; }
.tl li.tl-i::before { content: ""; position: absolute; left: -25px; top: 15px; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink-2); }
.tl a { display: grid; grid-template-columns: 6.5rem 1fr; gap: 12px; text-decoration: none; }
.tl .y { font: 800 1rem/1.4 var(--display); color: var(--ink); }
@media (hover: hover) { .tl a:hover span:last-child { text-decoration: underline; } }

/* flood widget */
.flood { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .flood { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: start; }
  .flood-ctl { position: sticky; top: 72px; }
  .flood > .next { grid-column: 1 / -1; }
}
.flood-canvas { position: relative; border-radius: var(--r); overflow: hidden; background: #0F1820; aspect-ratio: 4 / 3; }
.flood-canvas canvas, .flood-canvas img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flood-ctl { display: grid; gap: 8px; }
.flood-ctl input { width: 100%; accent-color: var(--river); }
.flood-read { font: 800 1.4rem/1.2 var(--display); }
.flood-stops { display: flex; flex-wrap: wrap; gap: 8px; }
.flood-stops button { font: 600 .85rem/1 var(--display); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; transition: background-color .12s var(--ease-in), transform .12s var(--ease-in); }
.flood-stops button[aria-pressed="true"] { background: var(--river); color: #fff; border-color: var(--river); }
.flood-stops button:active { transform: scale(.97); }
.warn { font-size: .88rem; color: var(--muted); }

/* ---------------------------------------------------------------- map page */
body[data-page="map"] .foot { display: none; }
.mapwrap { position: relative; height: calc(100dvh - var(--bar-h)); }
.mapwrap .map { position: absolute; inset: 0; background: var(--paper-2); }
.map-ui { position: absolute; z-index: 5; left: 12px; top: 12px; display: grid; gap: 8px; max-width: min(420px, calc(100% - 24px)); }
.seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.seg-b { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 40px; border: 0; border-radius: var(--r-in); background: transparent; color: var(--ink-2); font: 600 .88rem/1 var(--display); cursor: pointer; white-space: nowrap; transition: background-color .12s var(--ease-in), color .12s var(--ease-in), transform .12s var(--ease-in); }
.seg-b[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .seg-b:not([aria-pressed="true"]):hover { background: var(--paper-2); } }
.seg-b:active { transform: scale(.97); }
.map-panel:empty { display: none; }
.map-panel { padding: 14px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shadow); display: grid; gap: 10px; animation: rise .26s var(--ease-in); }
.map-panel label { font: 600 .85rem/1.2 var(--display); color: var(--muted); }
.map-panel input[type=range] { width: 100%; accent-color: var(--accent); }
.map-panel select { font: 600 .95rem/1 var(--display); padding: 8px; border-radius: var(--r-in); border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); }
.map-big { font: 800 1.6rem/1 var(--display); letter-spacing: -.02em; }
.map-card {
  position: absolute; z-index: 6; right: 12px; bottom: 24px; width: min(380px, calc(100% - 24px)); max-height: 60vh; overflow: auto;
  border-radius: var(--r); background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shadow); animation: rise .3s var(--ease-in);
}
.map-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-radius: var(--r) var(--r) 0 0; }
.map-card .mc-in { padding: 16px; display: grid; gap: 8px; }
.map-card .mc-x { position: absolute; right: 8px; top: 8px; background: var(--paper); }
@media (max-width: 640px) { .map-card { left: 12px; right: 12px; width: auto; bottom: 12px; } }
.maplibregl-popup-content { font-family: var(--display); }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; background: var(--c, var(--marsh)); border: 2px solid #fff; box-shadow: 0 4px 10px -4px rgba(0,0,0,.6); cursor: pointer; transition: transform .15s var(--ease-in); padding: 0; }
.pin .ic { transform: rotate(45deg); color: #fff; width: 15px; height: 15px; }
@media (hover: hover) { .pin:hover { transform: rotate(-45deg) scale(1.15); } }
.pin[aria-pressed="true"] { transform: rotate(-45deg) scale(1.25); border-color: var(--accent); }
.map-fail { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; padding: 24px; }

/* ---------------------------------------------------------------- quiz, about, 404 */
.quiz, .about { padding: 64px 0; }
.quiz h1, .about h1, .nf h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem); letter-spacing: -.04em; }
.quizbox { margin-top: 28px; max-width: 720px; }
.qcard { display: grid; gap: 16px; animation: rise .32s var(--ease-in); }
.qn { font: 600 .9rem/1 var(--display); color: var(--muted); }
.qq { font: 800 clamp(1.4rem, 1.1rem + 1.4vw, 2rem)/1.15 var(--display); letter-spacing: -.02em; }
.qopts { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.qopt { width: 100%; text-align: left; padding: 14px 16px; min-height: 52px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 600 1rem/1.3 var(--display); cursor: pointer; transition: background-color .12s var(--ease-in), transform .12s var(--ease-in), border-color .12s var(--ease-in); }
@media (hover: hover) { .qopt:not(:disabled):hover { border-color: var(--ink-2); background: var(--paper-2); } }
.qopt:active { transform: scale(.98); }
.qopt:disabled { cursor: default; }
.qopt.right { background: color-mix(in srgb, var(--marsh) 18%, var(--paper)); border-color: var(--marsh); }
.qopt.wrong { background: color-mix(in srgb, var(--brick) 14%, var(--paper)); border-color: var(--brick); }
.qfb { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--r); background: var(--paper-2); animation: rise .26s var(--ease-in); }
.qscore { font: 800 clamp(2.4rem, 1.6rem + 4vw, 4.4rem)/1 var(--display); letter-spacing: -.04em; color: var(--accent-ink); }
.prose { max-width: 68ch; display: grid; gap: 14px; margin-top: 20px; }
.prose h2 { font-size: 1.5rem; margin-top: 16px; }
.credits { display: grid; gap: 6px; }
.nf { padding: 96px 0; text-align: center; display: grid; justify-items: center; gap: 16px; }

/* ---------------------------------------------------------------- search, toast, footer */
.search { width: min(640px, calc(100% - 24px)); max-height: 80vh; padding: 0; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--ink); box-shadow: var(--shadow); margin-top: 72px; }
.search[open] { animation: rise .26s var(--ease-in); }
.search::backdrop { background: rgba(15, 24, 32, .5); }
.search-in { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.search-in input { flex: 1; border: 0; background: transparent; color: var(--ink); font: 600 1.1rem/1.4 var(--display); padding: 8px 0; min-width: 0; }
.search-in input:focus { outline: none; }
.results { list-style: none; margin: 0; padding: 6px; overflow: auto; max-height: calc(80vh - 70px); }
.results a { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-in); text-decoration: none; }
.results a small { color: var(--muted); font: 500 .82rem/1.2 var(--display); }
.results a mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 2px; }
@media (hover: hover) { .results a:hover { background: var(--paper-2); } }
.results a:focus-visible { background: var(--paper-2); }
.results .empty { padding: 20px 12px; color: var(--muted); }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: var(--r); background: var(--ink); color: var(--paper); font: 600 .95rem/1.2 var(--display); transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); }
.toast.on { opacity: 1; transform: translate(-50%, 0); transition: opacity .3s var(--ease-in), transform .3s var(--ease-in); }

.foot { padding: 48px 16px 64px; text-align: center; display: grid; gap: 10px; color: var(--muted); font: 500 .9rem/1.5 var(--display); border-top: 1px solid var(--rule); }
.foot a { color: var(--ink-2); }

.sharebox { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin-top: 4px; border-radius: var(--r); background: var(--paper-2); animation: rise .22s var(--ease-in); }

/* entrances */
.reveal { opacity: 0; transform: translateY(10px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .42s var(--ease-in), transform .42s var(--ease-in); }

@media (max-width: 720px) {
  .themebar span { display: none; }
  .themebar a { padding: 8px 10px; }
  .brand-sub { display: none; }
  .tm-scrub { left: 12px; right: 12px; top: auto; bottom: 12px; grid-template-columns: 1fr auto; }
  .tm-scrub input { width: 100%; }
  .hero-in { padding-bottom: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .tm-stage img { transform: none !important; }
}
@media print {
  .bar, .st-tools, .foot, .tm-scrub, .hero-cta, .promo { display: none; }
  .more > .stories { display: grid; }
}

/* ---------------- Secaucus at a glance: the ward drawing beside a filtered story list */
.glance { padding: 56px 0; border-top: 1px solid var(--rule); }
.glance-in { display: grid; gap: 24px; margin-top: 20px; }
@media (min-width: 880px) { .glance-in { grid-template-columns: minmax(0, 1.1fr) minmax(300px, 1fr); align-items: start; } .g-side { position: sticky; top: calc(var(--bar-h) + 16px); } }
.g-map { margin: 0; padding: 16px; background: var(--paper-2); border-radius: var(--r); background-image: repeating-radial-gradient(circle at 30% 40%, transparent 0 22px, color-mix(in srgb, var(--contour) 9%, transparent) 22px 23px); }
.g-map svg { display: block; width: 100%; height: auto; max-height: 72vh; }
.g-town { fill: none; stroke: var(--contour); stroke-width: 2.5; stroke-linejoin: round; }
.g-ward { fill: color-mix(in srgb, var(--paper) 70%, var(--reed)); stroke: var(--contour); stroke-width: 1; stroke-dasharray: 4 3; cursor: pointer; transition: fill .18s var(--ease-in); }
.g-ward[data-w="2"] { fill: color-mix(in srgb, var(--paper) 78%, var(--marsh)); }
.g-ward[data-w="3"] { fill: color-mix(in srgb, var(--paper) 78%, var(--river)); }
:root[data-theme="dark"] .g-ward { fill: color-mix(in srgb, var(--paper) 88%, var(--reed)); }
:root[data-theme="dark"] .g-ward[data-w="2"] { fill: color-mix(in srgb, var(--paper) 86%, var(--marsh)); }
:root[data-theme="dark"] .g-ward[data-w="3"] { fill: color-mix(in srgb, var(--paper) 86%, var(--river)); }
:root[data-theme="dark"] .g-ward.on { fill: color-mix(in srgb, var(--paper) 70%, var(--accent)); }
@media (hover: hover) { .g-ward:hover { fill: color-mix(in srgb, var(--paper) 55%, var(--reed)); } }
.g-ward.on { fill: color-mix(in srgb, var(--paper) 45%, var(--accent)); }
.g-wn { font: 800 28px/1 var(--display); fill: var(--ink); opacity: .35; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.g-dot { stroke: var(--paper); stroke-width: 1.5; cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .15s var(--ease-in), opacity .18s var(--ease-in); }
.g-dot.dim { opacity: .15; pointer-events: none; }
.g-dot.hot { transform: scale(1.8); stroke: var(--ink); }
.g-dot:focus-visible { outline: none; stroke: var(--focus); stroke-width: 3; }
.th-history { fill: var(--brick); background: var(--brick); }
.th-meadows { fill: var(--marsh); background: var(--marsh); }
.th-people { fill: var(--accent); background: var(--accent); }
.th-moving { fill: var(--river); background: var(--river); }
.th-town { fill: var(--ink); background: var(--ink); }
.th-ahead { fill: var(--reed); background: var(--reed); }
.g-lm { pointer-events: none; }
.g-lm rect { fill: var(--ink); }
.g-lm text { font: 700 13px/1 var(--display); fill: var(--ink); paint-order: stroke; stroke: var(--paper-2); stroke-width: 4px; stroke-linejoin: round; }
.g-map figcaption { margin-top: 8px; font: 500 .8rem/1.4 var(--display); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 .85rem/1 var(--display); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; transition: background-color .12s var(--ease-in), transform .12s var(--ease-in); }
@media (hover: hover) { .chip:hover { border-color: var(--contour); } }
.chip:active { transform: scale(.97); }
.chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.g-count { font: 700 1rem/1.3 var(--display); margin: 6px 0; font-variant-numeric: tabular-nums; }
.g-rep { display: inline-flex; align-items: center; gap: 6px; font: 600 .9rem/1.2 var(--display); color: var(--accent-ink); margin-bottom: 8px; }
.g-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; min-height: 330px; align-content: start; }
.g-card { display: grid; grid-template-columns: 10px 1fr; column-gap: 12px; row-gap: 2px; align-items: baseline; padding: 12px; border-radius: var(--r-in); color: var(--ink); text-decoration: none; transition: background-color .12s var(--ease-in); }
.g-card .sw { grid-row: span 2; align-self: center; }
.g-card b { font: 700 1rem/1.3 var(--display); }
.g-card small { color: var(--muted); font: 500 .82rem/1.3 var(--display); }
@media (hover: hover) { .g-card:hover { background: var(--paper-2); } }
.g-card:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.g-card.sel { background: color-mix(in srgb, var(--accent) 16%, var(--paper)); }
.g-pager { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font: 600 .85rem/1 var(--display); font-variant-numeric: tabular-nums; }
.g-pager .btn:disabled { opacity: .4; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .g-dot, .g-ward, .chip, .g-card { transition: none; } }
