@import-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/dm-mono-regular.woff2') format('woff2'); }
-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/dm-mono-medium.woff2') format('woff2'); }
-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('assets/fonts/newsreader.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #071411;
  --panel: #0d201c;
  --panel-2: #132a25;
  --ink: #f4f0df;
  --muted: #aebeb6;
  --grid: #274039;
  --mint: #6ce5c8;
  --amber: #ffd166;
  --coral: #ff7867;
  --shadow: rgba(0, 0, 0, .32);
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f0df;
  --panel: #fffdf4;
  --panel-2: #e9e4d1;
  --ink: #10211d;
  --muted: #50655d;
  --grid: #c9c4b2;
  --mint: #007b68;
  --amber: #a45f00;
  --coral: #b6382c;
  --shadow: rgba(23, 47, 40, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.55; }
button, a { font: inherit; }
a { color: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }

.skip-link { position: fixed; inset: 10px auto auto 10px; z-index: 20; transform: translateY(-150%); background: var(--amber); color: #111; padding: .6rem 1rem; }
.skip-link:focus { transform: none; }
.topbar { position: sticky; inset-block-start: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: .9rem clamp(1rem, 4vw, 4rem); border-bottom: 1px solid var(--grid); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; font: 500 .78rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; gap: 4px; }
.brand-mark i { display: block; width: 26px; height: 4px; border-radius: 5px; background: var(--mint); }
.brand-mark i:last-child { width: 18px; background: var(--amber); }
nav { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.5rem); }
nav a, .text-button { border: 0; padding: .2rem 0; background: transparent; color: var(--muted); text-decoration: none; font: 500 .7rem var(--mono); letter-spacing: .04em; cursor: pointer; }
nav a:hover, .text-button:hover { color: var(--mint); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--grid); border-radius: 50%; background: var(--panel); cursor: pointer; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.hero { min-height: 86vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); align-items: center; gap: clamp(3rem, 8vw, 8rem); padding: clamp(5rem, 10vw, 10rem) clamp(1rem, 7vw, 7rem); background-image: radial-gradient(circle at 75% 35%, color-mix(in srgb, var(--mint) 12%, transparent), transparent 30%), linear-gradient(var(--grid) 1px, transparent 1px); background-size: auto, 100% 12rem; }
.eyebrow, .section-number { margin: 0 0 1rem; color: var(--mint); font: 500 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 900px; margin: 0; font-size: clamp(3.1rem, 7.2vw, 7.8rem); line-height: .92; letter-spacing: -.055em; text-wrap: balance; }
h1 em { color: var(--mint); font-weight: 400; }
.dek { max-width: 720px; margin: 2rem 0; color: var(--muted); font-size: clamp(1.1rem, 1.8vw, 1.45rem); }
.dek strong { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.primary-button, .secondary-button { min-height: 48px; padding: .75rem 1.1rem; border: 1px solid var(--mint); border-radius: 2px; text-decoration: none; font: 500 .75rem var(--mono); cursor: pointer; }
.primary-button { background: var(--mint); color: var(--bg); }
.secondary-button { background: transparent; color: var(--ink); }
.departure-board { padding: 1.1rem; border: 1px solid #31433e; border-radius: 4px; background: #101916; color: #f8f3dc; box-shadow: 0 30px 80px var(--shadow); font-family: var(--mono); transform: rotate(1deg); }
.board-header, .board-row { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .5rem; border-bottom: 1px dashed #3c4c47; }
.board-header { color: #8fa29b; font-size: .65rem; letter-spacing: .1em; }
.board-row span { color: #bbc7c2; font-size: .72rem; }
.board-row strong { color: #fff8d5; font-size: 1.1rem; }
.board-row.accent strong { color: #ffd166; }
.departure-board > p { margin: .9rem .5rem .2rem; color: #8fa29b; font-size: .58rem; }

.answer-band, .limits-band { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 8vw, 8rem); padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 7vw, 7rem); background: var(--mint); color: #09231d; }
h2 { margin: 0; font-size: clamp(2.3rem, 5vw, 5.3rem); line-height: .98; letter-spacing: -.04em; text-wrap: balance; }
.answer-band .section-number { color: #174c41; }
.answer-copy { max-width: 740px; font-size: clamp(1.2rem, 2vw, 1.65rem); }
.answer-copy p:first-child { margin-top: 0; }
.caveat { padding-top: 1.5rem; border-top: 1px solid #2d8e78; font-size: 1rem; }

.section-shell { padding: clamp(5rem, 9vw, 9rem) clamp(1rem, 7vw, 7rem); }
.section-heading { max-width: 1000px; margin-bottom: 3rem; }
.section-heading.compact { max-width: 820px; }
.section-heading > p:last-child { max-width: 760px; color: var(--muted); font-size: 1.12rem; }
.line-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .5rem 0 1rem; scrollbar-color: var(--mint) transparent; }
.line-tabs button { flex: 0 0 auto; min-height: 46px; padding: .65rem 1rem; border: 1px solid var(--grid); border-radius: 999px; background: transparent; font: 500 .68rem var(--mono); cursor: pointer; }
.line-tabs button[aria-selected='true'] { border-color: var(--mint); background: var(--mint); color: var(--bg); }
.line-card { display: grid; grid-template-columns: minmax(240px, .55fr) minmax(300px, 1.45fr); gap: clamp(2rem, 7vw, 7rem); align-items: center; margin-top: 2rem; padding: clamp(1.2rem, 4vw, 3rem); border: 1px solid var(--grid); background: var(--panel); }
.big-number { margin: .2rem 0; font: 600 clamp(4rem, 9vw, 8rem)/.9 var(--serif); letter-spacing: -.07em; }
.big-number small { color: var(--mint); font-size: .35em; }
.line-summary > p:nth-child(3) { color: var(--muted); }
.metric-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.metric-pair div { padding-top: .8rem; border-top: 1px solid var(--grid); }
.metric-pair span { display: block; color: var(--muted); font: .62rem var(--mono); }
.metric-pair strong { font: 500 .9rem var(--mono); }
.waffle { display: grid; grid-template-columns: repeat(40, 1fr); gap: clamp(2px, .25vw, 5px); }
.waffle i { aspect-ratio: 1; border-radius: 1px; background: color-mix(in srgb, var(--mint) 78%, var(--ink)); transition: transform .25s, background .25s; }
.waffle i.late { background: var(--amber); transform: scale(.78); }
.waffle-key { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; color: var(--muted); font: .65rem var(--mono); }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: .4rem; background: var(--mint); }
.dot.late { background: var(--amber); }
.commuter-note { display: flex; gap: .8rem; align-items: flex-start; max-width: 850px; margin-top: 1.5rem; color: var(--muted); }
.commuter-note svg { flex: 0 0 24px; margin-top: .2rem; fill: none; stroke: var(--amber); stroke-width: 1.8; }
.commuter-note p { margin: 0; }
.commuter-note strong { color: var(--ink); }

.trend { background: var(--panel); }
.chart-card, .calendar-card { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--grid); background: var(--bg); box-shadow: 0 20px 50px var(--shadow); }
.chart-toolbar { display: flex; justify-content: space-between; align-items: start; gap: 2rem; }
.chart-toolbar h3, .calendar-card h3 { margin: 0; font-size: 1.4rem; }
.chart-toolbar p, .calendar-card p { margin: .2rem 0; color: var(--muted); font-size: .9rem; }
.trend-chart { width: 100%; overflow: visible; }
.chart-grid { stroke: var(--grid); stroke-width: 1; }
.chart-axis { fill: var(--muted); font: 12px var(--mono); }
.chart-line { fill: none; stroke: var(--mint); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: var(--bg); stroke: var(--mint); stroke-width: 4; cursor: pointer; }
.chart-point:hover, .chart-point:focus { fill: var(--amber); stroke: var(--amber); }

.incidents { background-image: radial-gradient(circle at 90% 40%, color-mix(in srgb, var(--coral) 10%, transparent), transparent 28%); }
.incident-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 1rem; }
.incident-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: .5rem; margin-top: 2rem; }
.month { min-width: 0; text-align: center; }
.month-bar { height: 115px; display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; padding: .5rem; border-bottom: 1px solid var(--grid); background: linear-gradient(to top, color-mix(in srgb, var(--panel) 80%, transparent), transparent); }
.incident-mark { width: 18px; height: 18px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px color-mix(in srgb, var(--coral) 15%, transparent); }
.month-label { display: block; margin-top: .6rem; color: var(--muted); font: .58rem var(--mono); }
.impact-card { display: flex; flex-direction: column; align-items: start; justify-content: end; min-height: 300px; padding: 2rem; border: 0; background: var(--coral); color: #21100d; text-align: left; cursor: pointer; transition: transform .2s; }
.impact-card:hover { transform: translateY(-4px); }
.impact-card span, .impact-card small { font: 500 .66rem var(--mono); }
.impact-card strong { font-size: clamp(3rem, 6vw, 6rem); line-height: 1; letter-spacing: -.05em; }
.impact-card p { margin: .2rem 0 1.5rem; }

.rule-grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; padding: 1px; background: var(--grid); }
.rule-grid li { padding: clamp(1.5rem, 3vw, 3rem); background: var(--bg); }
.rule-grid span { color: var(--mint); font: .7rem var(--mono); }
.rule-grid h3 { min-height: 2.4em; margin: 1rem 0; font-size: 1.6rem; line-height: 1.1; }
.rule-grid p { color: var(--muted); font-size: .95rem; }
.limits-band { background: var(--amber); color: #271a00; }
.limits-band .section-number { color: #704800; }
.limits-band h2 { font-size: clamp(2.3rem, 4vw, 4.6rem); }
.limits-band p { max-width: 700px; }

footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem clamp(1rem, 7vw, 7rem); color: var(--muted); font: .65rem var(--mono); }
dialog { width: min(760px, calc(100vw - 2rem)); max-height: min(780px, calc(100vh - 2rem)); padding: clamp(1.2rem, 4vw, 3rem); border: 1px solid var(--grid); background: var(--panel); color: var(--ink); box-shadow: 0 30px 100px #0009; }
dialog::backdrop { background: #020806d9; backdrop-filter: blur(6px); }
.dialog-close { position: sticky; float: right; inset-block-start: 0; width: 44px; height: 44px; border: 1px solid var(--grid); border-radius: 50%; background: var(--bg); cursor: pointer; font: 1.5rem var(--mono); }
#dialog-content h2 { margin: 2rem 0 1rem; font-size: 2.5rem; }
#dialog-content h3 { margin-top: 2rem; }
#dialog-content p, #dialog-content li { color: var(--muted); }
.source-list { list-style: none; padding: 0; }
.source-list li { padding: 1rem 0; border-top: 1px solid var(--grid); }
.source-list a { color: var(--mint); }
.source-meta { font: .65rem var(--mono); }
.tooltip { position: fixed; z-index: 30; max-width: 230px; padding: .6rem .75rem; border: 1px solid var(--grid); background: var(--ink); color: var(--bg); box-shadow: 0 8px 30px var(--shadow); pointer-events: none; font: .68rem var(--mono); }
.noscript { margin: 0; padding: 1rem; background: var(--amber); color: #211; text-align: center; }
.reveal { animation: rise .7s both; }
.reveal:nth-child(2) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }

@media (max-width: 850px) {
  nav a { display: none; }
  .hero, .answer-band, .limits-band, .line-card, .incident-layout { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 5rem; }
  .departure-board { transform: none; }
  .line-card { align-items: start; }
  .waffle { grid-template-columns: repeat(25, 1fr); }
  .rule-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: .3rem; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .topbar { padding-inline: .8rem; }
  .brand > span:last-child { display: none; }
  nav { gap: .7rem; }
  .line-card { padding: 1rem; }
  .waffle { grid-template-columns: repeat(20, 1fr); gap: 3px; }
  .metric-pair { grid-template-columns: 1fr; }
  .chart-toolbar { display: block; }
  .chart-toolbar button { margin-top: 1rem; }
  .month-label { writing-mode: vertical-rl; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
