/* The traffic index . a control room: an asphalt page, a gantry of variable message signs, road-sign plates for the
   way around, a wall of live cameras with their counting loops painted on. */
:root {
  --asphalt: #131516;
  --tarmac: #1c1f22;
  --tarmac2: #24282c;
  --kerb: #353a40;
  --paint: #ecebe4;
  --paint2: #a9aca7;
  --paint3: #6f7470;
  --amber: #ffb21d;
  --sign-green: #0d6a3b;
  --sign-blue: #1f4fa2;
  --sign-brown: #6b3a1e;
  --jam: #ff4d3d;
  --clear: #36d17f;
  --line: #f4c300;
  --sans: 'Overpass', 'Segoe UI', Arial, sans-serif;
  --mono: 'Overpass Mono', Consolas, monospace;
  --gut: 22px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--asphalt); color: var(--paint);
  font: 400 16px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: var(--paint); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--line); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; }
p { margin: 0 0 0.8em; }
.mono, code { font-family: var(--mono); font-size: 0.88em; overflow-wrap: anywhere; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gut); }
.muted { color: var(--paint2); }
.small { font-size: 13px; }
.jam { color: var(--jam); }
.clear { color: var(--clear); }

/* lane paint: the page's dividers are road markings */
.lane { height: 6px; margin: 34px 0 26px; background: repeating-linear-gradient(90deg, var(--paint) 0 34px, transparent 34px 58px); opacity: 0.85; }
.lane.solid { background: var(--paint); height: 3px; }
.lane.yellow { background: repeating-linear-gradient(90deg, var(--line) 0 34px, transparent 34px 58px); }

/* ------------------------------------------------------------------ the gantry */
.gantry { background: linear-gradient(#2a2e33, #1f2226); border-bottom: 4px solid #0c0d0e; position: relative; }
.gantry::before { content: ''; display: block; height: 10px;
  background: repeating-linear-gradient(135deg, #5b6168 0 2px, transparent 2px 12px), linear-gradient(#3b4046, #3b4046) center / 100% 2px no-repeat; opacity: 0.8; }
.gantry .wrap { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding-top: 12px; padding-bottom: 14px; }
.plate { display: inline-flex; align-items: center; gap: 10px; border-radius: 8px; padding: 8px 14px; color: #fff; text-decoration: none; font-weight: 700;
  box-shadow: inset 0 0 0 2px #0000, inset 0 0 0 2px rgba(255,255,255,0.0); position: relative; }
.plate::after { content: ''; position: absolute; inset: 3px; border: 2px solid #fff; border-radius: 6px; pointer-events: none; }
.plate.green { background: var(--sign-green); }
.plate.blue { background: var(--sign-blue); }
.plate.brown { background: var(--sign-brown); }
.brand { font-size: 22px; letter-spacing: 0.06em; padding: 10px 18px; }
.brand svg { width: 28px; height: 28px; }
.vmsbox { background: #050505; border: 3px solid #3b4046; border-radius: 4px; padding: 6px; min-width: 0; }
.vmsbox canvas { display: block; width: 100%; height: auto; }
.signs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 430px; }
.signs a { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 7px 12px; justify-content: center; }
.signs a .ar { font-size: 15px; }
.signs a[aria-current] { outline: 3px solid var(--line); outline-offset: 2px; }
.signs a.wide { grid-column: 1 / -1; }
.signs a.wide .ar { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; font-size: 12px; font-style: italic; font-family: Georgia, 'Times New Roman', serif; line-height: 1; }
/* the docs: contents beside the text on wide screens */
.docgrid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 44px; align-items: start; margin-top: 8px; }
.toc { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 2px; border-left: 3px dashed var(--line); padding-left: 14px; }
.toc .tocl { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paint3); }
.toc a { color: var(--paint2); text-decoration: none; font-size: 14px; padding: 3px 0; }
.toc a:hover, .toc a:focus-visible { color: var(--amber); }
.docs article section { margin-top: 0; padding-bottom: 26px; border-bottom: 1px solid #23272b; margin-bottom: 26px; scroll-margin-top: 14px; }
.docs article section:last-child { border-bottom: 0; }
.docs article h3 { font-size: 22px; margin: 0 0 10px; text-wrap: balance; }
.docs article p, .docs article li, .docs article dd { max-width: 70ch; line-height: 1.6; color: var(--paint2); }
.docs article b { color: var(--paint); }
.docs article b.jam { color: var(--jam); }
.docs article b.clear { color: var(--clear); }
.docs article a { color: var(--amber); }
.docs article ul { padding-left: 20px; }
.docs article li { margin: 4px 0; }
.faq dt { font-weight: 700; color: var(--paint); margin-top: 14px; }
.faq dd { margin: 4px 0 0; }
.crown { background: var(--paint); color: #111; border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; }
.crown.on { background: var(--tarmac2); color: var(--paint); box-shadow: inset 0 0 0 2px var(--kerb); }
.gtools { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.crown.xsign { display: inline-grid; place-items: center; padding: 9px 11px; text-decoration: none; }
.crown.xsign:hover, .crown.xsign:focus-visible { background: #fff; }
.notice { background: #0c0d0e; color: var(--paint2); font-size: 14px; }
.notice .wrap { padding-top: 8px; padding-bottom: 8px; }
.notice b { color: var(--amber); font-weight: 600; }

main { padding-bottom: 40px; }
section { margin-top: 30px; }
section > h2 { font-size: 30px; margin: 0 0 12px; }
.lede { font-size: 18px; max-width: 70ch; color: var(--paint2); }
.lede b { color: var(--paint); }
.lede b.jam { color: var(--jam); }
.lede b.clear { color: var(--clear); }

/* ------------------------------------------------------------------ buttons, fields */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; padding: 12px 18px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 14px; text-decoration: none; }
.btn.jam { background: var(--jam); color: #1a0806; }
.btn.clear { background: var(--clear); color: #04140b; }
.btn.paint { background: var(--paint); color: #111; }
.btn.ghost { background: transparent; color: var(--paint); box-shadow: inset 0 0 0 2px var(--kerb); }
label.field { display: block; margin: 0 0 12px; }
label.field > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paint2); margin-bottom: 6px; }
input[type=text] { width: 100%; background: #0c0d0e; border: 0; border-bottom: 3px solid var(--kerb); color: var(--paint); font: 600 28px/1.2 var(--mono); padding: 8px 10px; outline: none; border-radius: 4px 4px 0 0; }
input[type=text]:focus { border-bottom-color: var(--line); }

/* ------------------------------------------------------------------ the camera wall */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 16px; }
.cam { position: relative; background: #000; border-radius: 3px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 0 0 1px #2a2e33; }
.cam video, .cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; background: #000; }
.cam svg.loops { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam svg.loops line { stroke: var(--amber); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.cam svg.loops line.cut { stroke: #000; stroke-width: 3; }
.osd { position: absolute; left: 6px; top: 6px; right: 6px; display: flex; justify-content: space-between; gap: 6px; font: 600 11px/1.3 var(--mono); text-transform: uppercase; }
.osd span { background: rgba(0,0,0,0.72); padding: 2px 6px; border-radius: 2px; }
.camfoot { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end;
  padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,0.85)); font-size: 12px; }
.camfoot .nm { font-weight: 700; font-size: 13px; line-height: 1.2; }
.camfoot .ct { font: 600 12px var(--mono); text-align: right; white-space: nowrap; }
.cam .state { position: absolute; right: 8px; top: 30px; font: 700 10px var(--mono); padding: 2px 6px; border-radius: 2px; background: rgba(0,0,0,0.7); color: var(--paint2); }
.cityrow { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 0; }
.cityrow h3 { font-size: 22px; }
.cityrow .muted { font-size: 14px; }

/* ------------------------------------------------------------------ boards (readings) */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.board > div { background: var(--tarmac); border-radius: 6px; padding: 12px 14px; border-top: 4px solid var(--kerb); }
.board dt { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paint2); }
.board dd { margin: 4px 0 0; font: 700 28px/1.15 var(--mono); }
.board dd small { display: block; font: 400 13px/1.35 var(--sans); color: var(--paint2); margin-top: 2px; }
.board .jamtop { border-top-color: var(--jam); }
.board .cleartop { border-top-color: var(--clear); }

/* the book: JAM against CLEAR */
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 8px; overflow: hidden; margin: 14px 0; }
.book > div { padding: 16px 18px; }
.book .j { background: #3a1210; }
.book .c { background: #0d2e1d; text-align: right; }
.book b { display: block; font: 800 34px/1 var(--mono); }
.book .j b { color: var(--jam); }
.book .c b { color: var(--clear); }
.book span { font-size: 13px; color: var(--paint2); }
.bar { height: 10px; display: flex; border-radius: 5px; overflow: hidden; background: var(--tarmac2); }
.bar i { display: block; height: 100%; }

/* ------------------------------------------------------------------ tables */
.scroll { overflow-x: auto; }
table.log { width: 100%; border-collapse: collapse; font-size: 14px; }
table.log th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paint2); padding: 8px 10px 6px 0; border-bottom: 2px solid var(--kerb); }
table.log td { padding: 8px 10px 8px 0; border-bottom: 1px solid #23272b; vertical-align: top; }
table.log td.num, table.log th.num { text-align: right; font-family: var(--mono); }
.pill { display: inline-block; font: 700 11px var(--mono); padding: 2px 7px; border-radius: 3px; letter-spacing: 0.06em; }
.pill.jam { background: var(--jam); color: #1a0806; }
.pill.clear { background: var(--clear); color: #04140b; }
.pill.push { background: var(--kerb); color: var(--paint); }
.pill.wait { background: transparent; color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }

/* ------------------------------------------------------------------ trade desk */
.desk { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.desk form { background: var(--tarmac); border-radius: 8px; padding: 18px; }
.desk h3 { font-size: 22px; margin-bottom: 4px; }
.desk .est { font-size: 14px; color: var(--paint2); margin: 10px 0 14px; min-height: 3em; }
.desk .est b { color: var(--paint); font-family: var(--mono); }

/* the chart */
.chart { width: 100%; height: auto; display: block; background: var(--tarmac); border-radius: 8px; }
.chart text { font: 11px var(--mono); fill: var(--paint2); }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: #050505; color: var(--paint); padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: baseline; border-left: 6px solid var(--amber); border-radius: 4px; }
.toast[data-kind=good] { border-left-color: var(--clear); }
.toast[data-kind=bad] { border-left-color: var(--jam); }
.toast span { flex: 1; }
.toast button { border: 0; background: none; color: var(--paint); }

footer { border-top: 4px solid #0c0d0e; background: #0f1112; color: var(--paint2); font-size: 13px; }
footer .wrap { padding-top: 18px; padding-bottom: 26px; }
footer .flinks { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 0 0 12px; font-size: 14px; font-weight: 700; }
footer .flinks a { color: var(--paint); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
footer .flinks a:hover, footer .flinks a:focus-visible { color: var(--amber); }

@media (max-width: 960px) {
  .gantry .wrap { grid-template-columns: 1fr auto; }
  .vmsbox { grid-column: 1 / -1; grid-row: 2; }
  .signs { grid-column: 1 / -1; grid-row: 3; }
  .desk { grid-template-columns: 1fr; }
  .docgrid { grid-template-columns: 1fr; gap: 18px; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .toc .tocl { flex-basis: 100%; }
}
@media (max-width: 560px) {
  :root { --gut: 16px; }
  .signs { max-width: none; }
  .signs a { justify-content: center; padding: 7px 6px; font-size: 12px; letter-spacing: 0.04em; }
  .brand { font-size: 18px; padding: 8px 12px; }
  .wall { grid-template-columns: 1fr; }
  section > h2 { font-size: 24px; }
  table.log.stack thead { display: none; }
  table.log.stack tr { display: block; border-bottom: 1px solid #23272b; padding: 6px 0; }
  table.log.stack td { display: flex; justify-content: space-between; border: 0; padding: 3px 0; }
  table.log.stack td::before { content: attr(data-l); font-size: 11px; color: var(--paint2); text-transform: uppercase; letter-spacing: 0.08em; }
}
