/* Austin Tolls — "Violet Crown".
 *
 * Every value here comes from `tokens.css`, which is loaded first. No hex
 * literal belongs in this file: the two themes (dusk, day) work from one
 * stylesheet precisely because components only ever name semantic tokens.
 *
 * The five signature motifs from the design system, and where they live:
 *   The Plate         .btn and .rate-pill — amber chip, ink text
 *   The Token ring    .brand-mark, .legend-dot
 *   The Lane divider  .lane-divider, the rule under a section head
 *   The Dusk gradient .hero — once per view, never behind body copy
 *   The Silhouette    the shipped SVGs; never redrawn in CSS
 */

:root {
  --wrap: 1180px;
}

/* Chart series, derived from the ramp rather than invented. `rate-chart.js`
   reads these, so the SVG and the legend swatches beside it cannot drift
   apart. The posted rate is the accent; the weekday baseline is violet *and
   dashed*, so the two are told apart by shape as well as by hue. */
:root, [data-theme="dusk"] {
  --at-chart-actual: var(--at-amber-500);
  --at-chart-trend:  var(--at-violet-300);
  --at-chart-grid:   var(--at-violet-600);
  --at-chart-axis:   var(--at-text-faint);
  --at-chart-now:    var(--at-text-muted);
  --at-chart-surface: var(--at-violet-800);
  /* Map dots. A variable price is the accent; a fixed one is a quiet violet,
     because it is a different kind of number and never borrows the amber. */
  --at-map-variable: var(--at-accent);
  --at-map-fixed:    var(--at-violet-300);
  --at-map-closed:   var(--at-rate-up);
  /* Amber *text*. On dusk that is the accent itself; on limestone the
     guardrail forbids amber type below 24px, so day borrows Crown Violet.
     The amber keyline around a tag stays on both — a 1.5px rule is
     decoration, not type. */
  --at-accent-text: var(--at-accent);
}
[data-theme="day"] {
  --at-chart-actual: var(--at-amber-600);
  --at-chart-trend:  var(--at-violet-500);
  --at-chart-grid:   var(--at-sand);
  --at-chart-axis:   var(--at-text-faint);
  --at-chart-now:    var(--at-text-muted);
  --at-chart-surface: var(--at-white);
  --at-map-variable: var(--at-accent);
  --at-map-fixed:    var(--at-violet-500);
  --at-map-closed:   var(--at-rate-up);
  --at-accent-text: var(--at-link);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--at-bg);
  color: var(--at-text);
  font: var(--at-text-body);
  -webkit-font-smoothing: antialiased;
  transition: background var(--at-dur) var(--at-ease), color var(--at-dur) var(--at-ease);
}

a { color: var(--at-link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--at-focus-ring); border-radius: var(--at-radius-sm); }

h1 { font: var(--at-text-h1); margin: 0; }
h2 { font: var(--at-text-h2); margin: 0; }
h3 { font: var(--at-text-h3); margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--at-space-5); }
.muted { color: var(--at-text-muted); }
.small { font: var(--at-text-small); }
.tabular { font-variant-numeric: tabular-nums; }

/* The caption rule: road names in lists, table headers, stat labels. */
.cap, .stat-label, .direction-label, .sign-entry, table.rates th {
  font: var(--at-text-caption);
  letter-spacing: var(--at-tracking-caption);
  text-transform: uppercase;
  color: var(--at-text-muted);
}

/* Rates are always mono and always tabular, so a column of prices lines up. */
.rate, .stat-value, td.price, td.pbm, .chart-tip-row, .rate-pill {
  font-family: var(--at-font-mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--at-accent); color: var(--at-on-accent);
  padding: var(--at-space-3) var(--at-space-4);
  border-radius: 0 0 var(--at-radius-md) 0;
  font-weight: 800; text-transform: uppercase; letter-spacing: var(--at-tracking-plate);
}
.skip-link:focus { left: 0; }

/* ---------- Motifs ---------- */

/* The Plate: amber chip, ink text, radius-md. The one call-to-action device. */
.plate {
  background: var(--at-accent); color: var(--at-on-accent);
  border-radius: var(--at-radius-md); font-weight: 800;
  text-transform: uppercase; letter-spacing: var(--at-tracking-plate);
}

/* The Lane divider: the road's centreline, one per section boundary. */
.lane-divider {
  height: 5px; border: 0; border-radius: 3px; opacity: 0.9; margin: 0;
  background: repeating-linear-gradient(90deg,
    var(--at-accent) 0 28px, transparent 28px 56px);
}

/* The Dusk gradient: hero moments only, and never behind body copy. */
.hero {
  background: var(--at-dusk-gradient);
  border-radius: var(--at-radius-lg);
  padding: var(--at-space-7) var(--at-space-6);
  color: var(--at-limestone);
  position: relative; overflow: hidden;
}
.hero h1 { font: var(--at-text-display); color: var(--at-limestone); max-width: 16ch; }
.hero p { color: rgba(250, 247, 241, 0.85); max-width: 46ch; margin: var(--at-space-4) 0 0; }
.hero .updated-bar { background: rgba(23, 16, 43, 0.32); border-color: rgba(250, 247, 241, 0.28); color: var(--at-limestone); }
.hero-actions { display: flex; gap: var(--at-space-3); flex-wrap: wrap; margin-top: var(--at-space-5); align-items: center; }
/* The one permitted flourish: the sun glint on the badge behind the headline. */
.hero-mark {
  position: absolute; right: -40px; bottom: -60px; width: 320px; height: 320px;
  opacity: 0.16; pointer-events: none;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--at-surface);
  border-bottom: 1px solid var(--at-border);
  position: sticky; top: 0; z-index: 40;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--at-space-5); min-height: 66px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand-lockup { display: block; height: 38px; width: auto; }
/* One lockup per theme: the wordmark is Limestone on dusk, Ink on day. */
[data-theme="day"] .brand-lockup.on-dusk { display: none; }
.brand-lockup.on-day { display: none; }
[data-theme="day"] .brand-lockup.on-day { display: block; }

.site-nav { display: flex; gap: var(--at-space-5); flex-wrap: wrap; align-items: stretch; }
.site-nav a {
  color: var(--at-text-muted); font-weight: 600; font-size: 0.9375rem;
  padding: 10px 2px 12px; position: relative;
  transition: color var(--at-dur-fast) var(--at-ease);
}
.site-nav a:hover { color: var(--at-text); text-decoration: none; }
/* Nav: the active item gets a single lane dash under it. */
.site-nav a.active { color: var(--at-text); }
.site-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 3px; border-radius: 2px; background: var(--at-accent);
}

/* ---------- Page furniture ---------- */

.page-head { padding: var(--at-space-7) 0 var(--at-space-4); }
.page-head h1 { margin: 0 0 var(--at-space-2); }
.page-head p { margin: 0; color: var(--at-text-muted); max-width: 66ch; }

.section { padding: var(--at-space-3) 0 var(--at-space-6); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--at-space-4); flex-wrap: wrap; margin-bottom: var(--at-space-4);
}

.updated-bar {
  display: inline-flex; align-items: center; gap: var(--at-space-2);
  background: var(--at-surface-raised); border: 1px solid var(--at-border);
  border-radius: var(--at-radius-round); padding: 6px 14px;
  font: var(--at-text-small); color: var(--at-text-muted);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--at-rate-down);
  animation: pulse 2.4s infinite;
}
.pulse.stale { background: var(--at-rate-up); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 7px transparent; opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

.flash {
  margin: var(--at-space-4) 0; padding: var(--at-space-3) var(--at-space-4);
  border-radius: var(--at-radius-md); border: 1px solid var(--at-border);
  border-left: 4px solid var(--at-accent); background: var(--at-surface-raised);
}
.flash-success { border-left-color: var(--at-rate-down); }
.flash-error { border-left-color: var(--at-rate-up); }

/* ---------- Express lane signs ---------- */

.facility-block { margin-bottom: var(--at-space-7); }
.facility-title {
  display: flex; align-items: center; gap: var(--at-space-3);
  flex-wrap: wrap; margin-bottom: var(--at-space-1);
}

/* Tag: radius-sm outline chip in caption type — DYNAMIC, FIXED, CLOSED. */
.badge {
  display: inline-block; padding: 4px 9px 2px;
  border: 1.5px solid var(--at-border); border-radius: var(--at-radius-sm);
  font: var(--at-text-caption); letter-spacing: var(--at-tracking-caption);
  text-transform: uppercase; color: var(--at-text-muted);
}
.badge-variable { color: var(--at-accent-text); border-color: var(--at-accent); }
.badge-closed { color: var(--at-rate-up); border-color: var(--at-rate-up); }

.direction-group { margin-top: var(--at-space-5); }
.direction-label { color: var(--at-text-faint); margin-bottom: var(--at-space-3); }

.sign-grid {
  display: grid; gap: var(--at-space-4);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  /* Signs carry different numbers of destinations; let each size to its own
     content rather than stretching to the tallest in the row. */
  align-items: start;
}

/* A road card standing in for an overhead gantry: surface, radius-lg, 1px
   border. Depth on dusk comes from the border, never from a shadow. */
.sign {
  background: var(--at-surface);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius-lg);
  overflow: hidden;
  box-shadow: var(--at-shadow);
}
.sign-head {
  padding: var(--at-space-3) var(--at-space-4);
  border-bottom: 1px solid var(--at-border);
  background: var(--at-surface-raised);
  display: flex; align-items: center; justify-content: space-between; gap: var(--at-space-3);
}
.sign-entry { color: var(--at-text-faint); }
.sign-name { font: var(--at-text-h3); color: var(--at-text); margin-top: 2px; }
.sign-dir {
  font: var(--at-text-caption); letter-spacing: var(--at-tracking-caption);
  text-transform: uppercase; color: var(--at-text-muted);
  border: 1.5px solid var(--at-border); border-radius: var(--at-radius-sm);
  padding: 4px 8px 2px; white-space: nowrap;
}
.sign-rows { display: flex; flex-direction: column; }
.sign-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--at-space-4);
  padding: var(--at-space-3) var(--at-space-4);
  border-bottom: 1px solid var(--at-border);
}
.sign-row:last-child { border-bottom: 0; }
.sign-dest { font-weight: 600; }
.sign-dest small { display: block; font: var(--at-text-small); color: var(--at-text-muted); font-weight: 400; margin-top: 2px; }
.sign-link { color: var(--at-link); }

/* The Rate pill: the price itself is a Plate, and only the price. The by-mail
   figure sits beneath it in the quiet colour — amber is the call to action, so
   a second amber number beside every first one would spend it for nothing. */
.sign-price {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  gap: var(--at-space-1); white-space: nowrap;
}
.rate-pill {
  background: var(--at-accent); color: var(--at-on-accent);
  border-radius: var(--at-radius-md); padding: 8px 14px 6px;
  font: var(--at-text-rate); font-family: var(--at-font-mono);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.sign-price.closed .rate-pill {
  background: transparent; color: var(--at-rate-up);
  border: 1.5px solid var(--at-rate-up);
  font: var(--at-text-caption); font-family: var(--at-font-sans);
  letter-spacing: var(--at-tracking-plate);
  text-transform: uppercase; padding: 7px 11px 5px;
}
.sign-price .pbm {
  font: var(--at-text-small); font-family: var(--at-font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--at-text-faint); text-align: right;
}
.sign-price.closed .pbm { display: none; }
.rate-flash .rate-pill, .rate-pill.rate-flash { animation: flash 1.4s var(--at-ease); }
@keyframes flash {
  0% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

/* ---------- Cards & tables ---------- */

.card-grid { display: grid; gap: var(--at-space-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--at-surface); border: 1px solid var(--at-border);
  border-radius: var(--at-radius-lg); padding: var(--at-space-5);
  box-shadow: var(--at-shadow);
}
.card h3 { margin: 0 0 var(--at-space-1); }
.card h3 a { color: var(--at-text); }
.card-meta { display: flex; gap: var(--at-space-5); margin-top: var(--at-space-4); flex-wrap: wrap; }
.stat-value { font: var(--at-text-rate); font-variant-numeric: tabular-nums; color: var(--at-text); margin-top: var(--at-space-1); }

.table-wrap {
  overflow-x: auto; border: 1px solid var(--at-border);
  border-radius: var(--at-radius-lg); background: var(--at-surface);
}
table.rates { width: 100%; border-collapse: collapse; font: var(--at-text-small); min-width: 560px; }
table.rates th, table.rates td {
  padding: var(--at-space-3) var(--at-space-4); text-align: left;
  border-bottom: 1px solid var(--at-border);
}
table.rates th { background: var(--at-surface-raised); position: sticky; top: 0; }
table.rates tbody tr:last-child td { border-bottom: 0; }
td.price { color: var(--at-text); font-weight: 600; white-space: nowrap; }
td.price.closed { color: var(--at-rate-up); }
td.pbm { color: var(--at-text-muted); }

/* Trend is never colour alone — the arrow and the words carry it too. */
.trend { font: var(--at-text-small); font-weight: 600; color: var(--at-text-muted); }
.trend.up { color: var(--at-rate-up); }
.trend.down { color: var(--at-rate-down); }
.trend.flat { color: var(--at-text-faint); }

/* ---------- Chart ---------- */

.chart-card {
  background: var(--at-surface); border: 1px solid var(--at-border);
  border-radius: var(--at-radius-lg); padding: var(--at-space-5); position: relative;
  box-shadow: var(--at-shadow);
}
/* Both charts read under the pointer, so a touch drag across either must
   still scroll the page rather than being swallowed as a hover. */
.chart { width: 100%; height: 260px; display: block; touch-action: pan-y; }
/* Axis labels are drawn by rate-chart.js; the faces come from here so the
   chart is set in the same two typefaces as everything around it. */
.chart text { font-family: var(--at-font-sans); }
.chart text.axis-rate { font-family: var(--at-font-mono); font-variant-numeric: tabular-nums; }
.chart-day { height: 300px; }
.chart-empty { color: var(--at-text-faint); text-align: center; padding: var(--at-space-8) var(--at-space-5); }

.chart-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--at-space-4); flex-wrap: wrap; margin-bottom: var(--at-space-4);
}
.chart-legend { display: flex; gap: var(--at-space-5); flex-wrap: wrap; font: var(--at-text-small); color: var(--at-text-muted); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
/* Identity is never colour alone: the actual rate is a solid rule, the
   comparison line a dashed one, matching how each is drawn in the chart. */
.legend-swatch { display: inline-block; width: 16px; height: 3px; border-radius: 2px; flex: none; }
.legend-swatch.actual { background: var(--at-chart-actual); }
.legend-swatch.trend {
  background: var(--at-chart-trend);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 9px);
  mask-image: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 9px);
}
.chart-summary { margin: 0; }
.chart-summary .trend { margin-left: var(--at-space-1); }

.chart-tip {
  position: absolute; top: 0; pointer-events: none; z-index: 5;
  display: none; min-width: 118px;
  background: var(--at-surface-raised); border: 1px solid var(--at-border);
  border-radius: var(--at-radius-md); padding: var(--at-space-2) var(--at-space-3);
  font: var(--at-text-small); color: var(--at-text);
}
.chart-tip.on { display: block; }
.chart-tip-time { color: var(--at-text-faint); font-family: var(--at-font-sans); font-size: 0.76rem; margin-bottom: var(--at-space-1); }
.chart-tip-row { display: flex; align-items: center; gap: 7px; }

.chart-table { margin-top: var(--at-space-4); }
.chart-table summary { cursor: pointer; font: var(--at-text-small); color: var(--at-text-muted); }
.chart-table summary:hover { color: var(--at-text); }
.chart-table table.rates { min-width: 380px; }

.day-nav, .range-tabs { display: flex; gap: var(--at-space-2); flex-wrap: wrap; }
.day-nav a, .range-tabs a {
  padding: 7px 13px 5px; border-radius: var(--at-radius-sm);
  font: var(--at-text-caption); letter-spacing: var(--at-tracking-caption);
  text-transform: uppercase;
  border: 1.5px solid var(--at-border); color: var(--at-text-muted); white-space: nowrap;
  transition: color var(--at-dur-fast) var(--at-ease), border-color var(--at-dur-fast) var(--at-ease);
}
.day-nav a:hover, .range-tabs a:hover { text-decoration: none; border-color: var(--at-text-faint); color: var(--at-text); }
.range-tabs a.active {
  background: var(--at-accent); color: var(--at-on-accent);
  border-color: var(--at-accent); font-weight: 800;
  letter-spacing: var(--at-tracking-plate);
}

/* ---------- Map ---------- */

#toll-map {
  height: min(70vh, 640px); border-radius: var(--at-radius-lg);
  border: 1px solid var(--at-border); background: var(--at-surface);
}
.map-legend { display: flex; gap: var(--at-space-5); flex-wrap: wrap; margin-top: var(--at-space-4); font: var(--at-text-small); color: var(--at-text-muted); }
/* The Token ring: an amber rim offset by a gap of background colour. */
.legend-dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  margin-right: var(--at-space-2); vertical-align: -1px;
}
.legend-dot.variable { background: var(--at-map-variable); }
.legend-dot.fixed { background: var(--at-map-fixed); }
.legend-dot.closed { background: var(--at-map-closed); }

/* Leaflet's own chrome, brought onto the themed surface. Its stylesheet loads
   after this one, so every rule here is scoped through #toll-map to outrank
   it rather than relying on source order. */
#toll-map.leaflet-container { font-family: var(--at-font-sans); background: var(--at-surface); }
#toll-map .leaflet-popup-content-wrapper,
#toll-map .leaflet-popup-tip {
  background: var(--at-surface-raised); color: var(--at-text);
  border: 1px solid var(--at-border); box-shadow: none;
}
#toll-map .leaflet-popup-content-wrapper { border-radius: var(--at-radius-md); }
#toll-map .leaflet-popup-content { font: var(--at-text-small); margin: var(--at-space-3) var(--at-space-4); }
#toll-map a.leaflet-popup-close-button { color: var(--at-text-muted); }
#toll-map .leaflet-bar { border: 1px solid var(--at-border); border-radius: var(--at-radius-sm); overflow: hidden; }
#toll-map .leaflet-bar a {
  background: var(--at-surface-raised); color: var(--at-text);
  border-bottom-color: var(--at-border);
}
#toll-map .leaflet-bar a:hover { background: var(--at-surface); color: var(--at-accent-text); }
#toll-map .leaflet-tooltip {
  background: var(--at-surface-raised); color: var(--at-text);
  border: 1px solid var(--at-border); border-radius: var(--at-radius-sm);
  font: var(--at-text-small); box-shadow: none;
}
#toll-map .leaflet-tooltip::before { border-top-color: var(--at-border); }
#toll-map .leaflet-control-attribution {
  /* The surface, not the scrim: the scrim is a dark veil, and on the day
     theme's light tiles a dark veil is the wrong way round. */
  background: var(--at-surface); color: var(--at-text-faint);
  font: var(--at-text-caption); letter-spacing: 0; text-transform: none;
}
#toll-map .leaflet-control-attribution a { color: var(--at-text-muted); }
.map-pop-name { font-weight: 600; }
.map-pop-meta { color: var(--at-text-muted); }
.map-pop-rate {
  display: inline-block; margin-top: var(--at-space-2);
  font: var(--at-text-rate); font-variant-numeric: tabular-nums;
}

/* ---------- Forms ---------- */

.form-card {
  background: var(--at-surface); border: 1px solid var(--at-border);
  border-radius: var(--at-radius-lg); padding: var(--at-space-5); max-width: 620px;
  box-shadow: var(--at-shadow);
}
.field { margin-bottom: var(--at-space-4); }
.field label {
  display: block; font: var(--at-text-caption); letter-spacing: var(--at-tracking-caption);
  text-transform: uppercase; margin-bottom: var(--at-space-2); color: var(--at-text-muted);
}
.field .hint { font: var(--at-text-small); color: var(--at-text-faint); margin-top: var(--at-space-1); text-transform: none; letter-spacing: 0; }
input[type=text], input[type=email], input[type=url], input[type=number], select {
  width: 100%; padding: 12px 14px 10px;
  font: var(--at-text-rate); font-variant-numeric: tabular-nums;
  background: var(--at-surface-raised); border: 1.5px solid var(--at-border);
  border-radius: var(--at-radius-sm); color: var(--at-text);
}
select { font: 600 1rem/1.2 var(--at-font-sans); }
input:focus-visible, select:focus-visible {
  outline: none; box-shadow: var(--at-focus-ring); border-color: var(--at-accent);
}
.field-row { display: grid; gap: var(--at-space-4); grid-template-columns: 1fr 1fr; }

/* Plate button (primary): one per section. */
.btn {
  display: inline-block; padding: 14px 22px 12px;
  border-radius: var(--at-radius-md); border: 1.5px solid transparent;
  background: var(--at-accent); color: var(--at-on-accent);
  font: 800 0.9375rem/1 var(--at-font-sans);
  text-transform: uppercase; letter-spacing: var(--at-tracking-plate);
  cursor: pointer;
  transition: background var(--at-dur-fast) var(--at-ease), transform var(--at-dur-fast) var(--at-ease);
}
.btn:hover { background: var(--at-accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: transparent; border-color: var(--at-border); color: var(--at-text); }
.btn-secondary:hover { background: var(--at-surface-raised); }
.btn-quiet {
  background: none; border: 0; color: var(--at-link); padding: 0;
  text-transform: none; letter-spacing: 0; font-weight: 600;
}
.btn-quiet:hover { background: none; text-decoration: underline; }

/* Toast: raised surface, radius-md, amber left rail. */
.form-status {
  margin-top: var(--at-space-4); padding: var(--at-space-3) var(--at-space-4);
  border-radius: var(--at-radius-md); display: none;
  background: var(--at-surface-raised); border: 1px solid var(--at-border);
  border-left: 4px solid var(--at-accent);
}
.form-status.ok { display: block; border-left-color: var(--at-rate-down); }
.form-status.err { display: block; border-left-color: var(--at-rate-up); }

.checkbox-row { display: flex; gap: var(--at-space-3); flex-wrap: wrap; }
.checkbox-row label {
  display: inline-flex; align-items: center; gap: var(--at-space-2);
  font: var(--at-text-small); font-weight: 600;
  text-transform: none; letter-spacing: 0; color: var(--at-text); margin: 0;
}
.checkbox-row input { accent-color: var(--at-accent); }

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

.site-footer {
  border-top: 1px solid var(--at-border); background: var(--at-surface);
  margin-top: var(--at-space-8); padding: var(--at-space-6) 0;
}
.footer-inner { display: flex; justify-content: space-between; gap: var(--at-space-6); flex-wrap: wrap; }
.footer-lockup { height: 30px; width: auto; display: block; margin-bottom: var(--at-space-3); }
[data-theme="day"] .footer-lockup.on-dusk { display: none; }
.footer-lockup.on-day { display: none; }
[data-theme="day"] .footer-lockup.on-day { display: block; }
.footer-inner > div { max-width: 52ch; }
.footer-links { display: flex; flex-direction: column; gap: var(--at-space-2); }
.footer-links a { color: var(--at-text-muted); font: var(--at-text-small); }

/* The theme override.
   The reader's system chooses the theme; this is only for the times that guess
   is wrong, so it is set as a line of small print rather than as a control with
   a box around it competing with the navigation. Its own row *under* the two
   footer columns, because once those stack on a phone anything sitting above
   the footer links reads as one of them. */
.footer-tail { margin-top: var(--at-space-5); }
.theme-switch {
  display: inline-block;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: var(--at-text-small); font-family: var(--at-font-sans);
  color: var(--at-text-faint);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--at-border);
  transition: color var(--at-dur-fast) var(--at-ease),
              text-decoration-color var(--at-dur-fast) var(--at-ease);
}
.theme-switch:hover { color: var(--at-text-muted); text-decoration-color: currentColor; }
.theme-switch .on-dusk { display: inline; }
.theme-switch .on-day { display: none; }
[data-theme="day"] .theme-switch .on-dusk { display: none; }
[data-theme="day"] .theme-switch .on-day { display: inline; }

.prose { max-width: 68ch; }
/* Running text is the one place a link cannot be told apart by position, and
   --at-link sits close to --at-text-muted on dusk. Underline it. */
.prose a, .page-head p a, .card p a { text-decoration: underline; text-underline-offset: 3px; }
.prose h2 { margin-top: var(--at-space-6); font: var(--at-text-h3); }
.prose p { color: var(--at-text-muted); }
.prose li { margin-bottom: 7px; color: var(--at-text-muted); }
.prose code {
  font-family: var(--at-font-mono); font-size: 0.86em;
  background: var(--at-surface-raised); padding: 3px 7px 1px;
  border-radius: var(--at-radius-sm); border: 1px solid var(--at-border);
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .header-inner { min-height: 56px; padding-top: var(--at-space-2); padding-bottom: var(--at-space-2); }
  .hero { padding: var(--at-space-6) var(--at-space-5); }
  .hero-mark { display: none; }
  .site-nav { gap: var(--at-space-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
