/* Layout: a civic record under an evening sky. One wide dusk band on top, then calm single-column sections
   with data blocks; the accent is the last light over the hills, used only for live figures and links. */
:root { padding-top: env(safe-area-inset-top, 0px);
  --ink: #1b2733;          /* slate of the hills at dusk */
  --ink-2: #4a5866;
  --ink-3: #6f7c88;
  --paper: #f4f6f5;        /* cool morning fog, faint green */
  --panel: #ffffff;
  --rule: #d9dfe0;
  --dusk: #c8741e;         /* last light; accent */
  --dusk-soft: #f6e3cc;
  --good: #2f7d4f;
  --warn: #a8641a;
  --bar: #3f6f8c;          /* bay blue, chart bars */
  --bar-muted: #b8c6cf;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #e7ecef; --ink-2: #b4bfc8; --ink-3: #8b98a3;
    --paper: #12191f; --panel: #1a232b; --rule: #2c3842;
    --dusk: #eb9a45; --dusk-soft: #3a2a19;
    --good: #6cc391; --warn: #e6a659;
    --bar: #7fb0cf; --bar-muted: #3a4c58;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7ecef; --ink-2: #b4bfc8; --ink-3: #8b98a3;
  --paper: #12191f; --panel: #1a232b; --rule: #2c3842;
  --dusk: #eb9a45; --dusk-soft: #3a2a19;
  --good: #6cc391; --warn: #e6a659;
  --bar: #7fb0cf; --bar-muted: #3a4c58;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--body);
}
.wrap {
  max-width: 1040px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--dusk); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--dusk); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; max-width: 65ch; }
.eyebrow { font: 600 .74rem/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* preview ribbon */
.ribbon { background: var(--dusk-soft); color: var(--ink); font-size: .85rem; }
.ribbon .wrap { padding-block: 8px; }

/* header */
header.site { border-bottom: 1px solid var(--rule); background: var(--panel); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--panel); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-block: 12px; }
.brand { font-family: var(--display); font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.brand small { display: block; font: 400 .72rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; font-size: .92rem; }
nav a { color: var(--ink-2); text-decoration: none; }
nav a:hover { color: var(--dusk); }

/* hero */
.hero { position: relative; background: #2a2f3a; color: #fff; overflow: hidden; }
.hero .hero-img { display: block; width: 100%; height: clamp(300px, 46vw, 520px); object-fit: cover; object-position: center 72%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 280px), 1fr)); gap: 10px; }
.gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--rule); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.clip { margin: 18px 0 0; }
.clip video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #111; }
.gallery a:hover img { transform: scale(1.03); }
.hero .cap { position: absolute; inset: auto 0 0 0; padding-block: 28px; background: linear-gradient(transparent, rgba(10,14,20,.72)); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); color: #fff; }
.hero p { color: #e9e2d8; margin-top: 8px; font-size: 1.05rem; }
.hero .ph { position: absolute; top: 12px; right: max(16px, env(safe-area-inset-right, 0px)); font-size: .75rem; color: #f3e6d6; background: rgba(0,0,0,.35); padding: 4px 8px; border-radius: 3px; }

/* sections */
section.block { padding-block: 56px; border-bottom: 1px solid var(--rule); }
.head { display: grid; gap: 10px; margin-bottom: 28px; }
.head p { color: var(--ink-2); }

/* live figures */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.fig { background: var(--panel); padding: 20px 22px; display: grid; gap: 6px; align-content: start; }
.fig .val { font: 500 2.1rem/1.1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.fig .val .u { font-size: 1rem; color: var(--ink-3); margin: 0 .5rem 0 .15rem; }
.fig .note { font-size: .85rem; color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; width: fit-content; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.pill.chk { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }

/* chart */
.chart-card { background: var(--panel); border: 1px solid var(--rule); padding: 20px 20px 12px; margin-top: 24px; }
.chart-card .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.seg button { font: 600 .82rem var(--body); background: transparent; color: var(--ink-2); border: 0; padding: 6px 12px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chart-scroll { overflow-x: auto; }
svg.bars { display: block; width: 100%; min-width: 560px; height: auto; }
svg.bars text { fill: var(--ink-3); font: 11px var(--mono); }
svg.bars .grid { stroke: var(--rule); stroke-width: 1; }
svg.bars rect.b { fill: var(--bar); }
svg.bars rect.b.hot { fill: var(--dusk); }
svg.bars rect.hit { fill: transparent; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--paper); font: 12px/1.4 var(--mono); padding: 6px 8px; border-radius: 3px; z-index: 20; }
.caption { font-size: .82rem; color: var(--ink-3); margin-top: 8px; }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; margin-top: 28px; }
.list { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.row .when { font: 400 .85rem var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row .what { font-size: .95rem; }
.row .dur { font: 500 .9rem var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr auto; } .row .when { grid-column: 1 / -1; } }

/* 72 hour bar */
.stay { display: grid; gap: 8px; }
.track { position: relative; height: 18px; background: color-mix(in srgb, var(--bar-muted) 55%, transparent); }
.track .fill { position: absolute; inset: 0 auto 0 0; background: var(--bar); }
.track .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--dusk); }
.stay .meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: .85rem; color: var(--ink-2); }

.soon { background: var(--panel); border: 1px dashed var(--rule); padding: 22px; display: grid; gap: 10px; }
.method { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.method div { display: grid; gap: 6px; }
.method p { font-size: .95rem; color: var(--ink-2); }
footer { padding-block: 32px 48px; color: var(--ink-3); font-size: .85rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* detail pages */
.more { display: inline-block; margin-top: 18px; font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }
nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; margin-top: 14px; }
.days .d { aspect-ratio: 1; display: grid; place-items: center; font: 500 .72rem var(--mono); border-radius: 3px; background: var(--bar); color: #fff; position: relative; }
.days .d.partial { background: linear-gradient(135deg, var(--bar) 50%, var(--bar-muted) 50%); }
.days .d.gone { background: var(--bar-muted); color: var(--ink-2); }
.days .d.mark::after { content: ""; position: absolute; inset: auto 3px 2px; height: 3px; background: var(--dusk); border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; background: var(--bar); }
.legend i.gone { background: var(--bar-muted); }
.legend i.mark { background: var(--dusk); height: 4px; }
.kind { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.feature { margin: 0; }
.feature img { display: block; width: 100%; height: auto; }
/* keep headings visible below the sticky menu after an in-page jump */
section[id] { scroll-margin-top: 90px; }
.gallery figure, .feature { margin: 0; }
.gallery figure a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--rule); }
.shot { font-size: .8rem; color: var(--ink-3); margin-top: 4px; font-family: var(--mono); }
svg.bars rect.y { fill: var(--bar-muted); }
.chart-card .key { display: flex; gap: 14px; font-size: 13px; color: var(--ink-3); }
.chart-card .key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-card .key i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.chart-card .key .kb { background: var(--bar); }
.chart-card .key .ky { background: var(--bar-muted); }

/* Totals by period: segmented period control, one column per road, type bars, per-day bars */
.totals h3 .pill { vertical-align: middle; margin-left: 6px; font-family: var(--body); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: 500 .85rem var(--body); color: var(--ink-2); background: var(--panel); border: 0; border-left: 1px solid var(--rule); padding: 6px 12px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.tot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px 40px; margin-top: 12px; }
.tot h4 { font: 600 .74rem/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
.tot .val { font: 500 2.1rem/1.1 var(--mono); color: var(--ink); margin-right: 6px; }
.tot .note { font-size: .85rem; color: var(--ink-2); margin: 4px 0 0; }
.tbars { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.tbars li { display: grid; grid-template-columns: 8.5em 1fr 4.5em; gap: 10px; align-items: center; font-size: .88rem; }
.tbars .num { text-align: right; color: var(--ink); }
.tbars .track { height: 10px; }
.tbars i { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.tbars li.muted i { background: var(--bar-muted); }
.tbars li.muted span:first-child { color: var(--ink-3); }
.dlabel { margin-top: 18px; }
.dbars { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin-top: 6px; border-bottom: 1px solid var(--rule); }
.dbars span { flex: 1; height: 100%; display: flex; align-items: flex-end; max-width: 28px; }
.dbars i { display: block; width: 100%; background: var(--bar); border-radius: 3px 3px 0 0; }
.dbars span:last-child i { background: var(--bar-muted); }
.dbars span:hover i { background: var(--dusk); }
.dends { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 520px) {
  .seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .seg button { padding: 6px 2px; font-size: .8rem; }
}
.totals .ctrls { display: flex; flex-wrap: wrap; gap: 8px; }
.totals .top.sub { margin-top: 10px; }
.totals .ptitle { font-size: .9rem; color: var(--ink-2); }
.totals .key { display: flex; gap: 14px; font-size: 13px; color: var(--ink-3); }
.totals .tot-grid { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.totals .tbars { margin-top: 8px; }
@media (max-width: 520px) { .totals .ctrls { width: 100%; } }
/* "Both" view: My St (bay blue) beside Main St (dusk orange) */
.bars rect.b2 { fill: var(--dusk); }
.chart-card .key .k2, .totals .key .k2 { background: var(--dusk); display: inline-block; width: 12px; height: 12px; border-radius: 2px; }

/* day picker above the hourly chart (10-29) */
.chart-card .picks { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 10px; font-size: 13px; color: var(--ink-3); }
.chart-card .picks[hidden] { display: none; }
.chart-card .picks select { font: 600 .85rem var(--body); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 5px 8px; max-width: 100%; }
