/* Austin Tolls — the palette leans on real Texas toll signage: highway green,
   near-black gantry panels, amber LED digits. */

:root {
  --bg: #0d1117;
  --bg-raised: #151b23;
  --bg-sunken: #090d13;
  --panel: #11161d;
  --border: #232c38;
  --border-bright: #33404f;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --text-faint: #6b7887;
  --green: #0f7b3f;
  --green-bright: #22a45d;
  --amber: #ffc23d;
  --amber-dim: #d99a1f;
  --red: #f2545b;
  --blue: #4c9aff;
  --radius: 10px;
  --radius-lg: 14px;
  --wrap: 1180px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-dim); }
.small { font-size: 0.85rem; }
.tabular { font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--amber); color: #000; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

.site-header {
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 62px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-shield {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--green); color: #fff;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  border: 2px solid var(--green-bright);
}
.brand-text { letter-spacing: -0.01em; }
.brand-text strong { color: var(--amber); font-weight: 700; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-dim); padding: 7px 13px; border-radius: 7px;
  font-size: 0.93rem; font-weight: 500;
}
.site-nav a:hover { background: var(--bg-raised); color: var(--text); text-decoration: none; }
.site-nav a.active { background: var(--bg-raised); color: var(--amber); }

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

.page-head { padding: 34px 0 18px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -0.02em; }
.page-head p { margin: 0; color: var(--text-dim); max-width: 66ch; }

.section { padding: 12px 0 34px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }

.updated-bar {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; color: var(--text-dim);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright);
  box-shadow: 0 0 0 0 rgba(34,164,93,0.7); animation: pulse 2.4s infinite;
}
.pulse.stale { background: var(--red); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,164,93,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(34,164,93,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,164,93,0); }
}

.flash {
  margin: 16px 0; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--border-bright); background: var(--bg-raised);
}
.flash-success { border-color: var(--green-bright); }
.flash-error { border-color: var(--red); }

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

.facility-block { margin-bottom: 40px; }
.facility-title {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.facility-title h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.01em; }
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.badge-variable { background: rgba(255,194,61,0.14); color: var(--amber); border: 1px solid rgba(255,194,61,0.35); }
.badge-fixed { background: rgba(76,154,255,0.12); color: var(--blue); border: 1px solid rgba(76,154,255,0.3); }
.badge-closed { background: rgba(242,84,91,0.15); color: var(--red); border: 1px solid rgba(242,84,91,0.4); }

.direction-group { margin-top: 22px; }
.direction-label {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-faint); font-weight: 700; margin-bottom: 10px;
}

.sign-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 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;
}

/* An overhead gantry sign: dark panel, entry label, one amber price per exit. */
.sign {
  background: linear-gradient(180deg, #0a0e14 0%, #05080c 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 6px 20px rgba(0,0,0,0.35);
}
.sign-head {
  padding: 12px 16px; border-bottom: 1px solid #1c2531;
  background: rgba(15,123,63,0.13);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sign-entry { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.sign-name { font-size: 1.05rem; font-weight: 650; color: #fff; margin-top: 1px; }
.sign-dir {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  color: var(--green-bright); border: 1px solid rgba(34,164,93,0.4);
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.sign-rows { display: flex; flex-direction: column; }
.sign-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 16px; border-bottom: 1px solid #141b24;
}
.sign-row:last-child { border-bottom: 0; }
.sign-dest { font-size: 0.93rem; color: #d7e0ea; }
.sign-dest small { display: block; color: var(--text-faint); font-size: 0.76rem; margin-top: 2px; }
.sign-price {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  color: var(--amber); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255,194,61,0.35); white-space: nowrap;
}
.sign-price.closed { color: var(--red); font-size: 1rem; text-shadow: none; letter-spacing: 0.05em; }
.sign-price .pbm { display: block; font-size: 0.7rem; color: var(--text-faint); text-shadow: none; font-weight: 500; text-align: right; margin-top: 1px; }
.rate-flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: rgba(255,194,61,0.22); } 100% { background: transparent; } }

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

.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
}
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card h3 a { color: var(--text); }
.card-meta { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); }
.stat-value { font-family: var(--mono); font-size: 1.15rem; color: var(--amber); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
table.rates { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 560px; }
table.rates th, table.rates td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.rates th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); font-weight: 700; background: var(--bg-sunken);
  position: sticky; top: 0;
}
table.rates tbody tr:last-child td { border-bottom: 0; }
table.rates tbody tr:hover { background: rgba(255,255,255,0.02); }
td.price { font-family: var(--mono); color: var(--amber); font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
td.price.closed { color: var(--red); }
td.pbm { font-family: var(--mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }

.trend { font-family: var(--mono); font-size: 0.8rem; }
.trend.up { color: var(--red); }
.trend.down { color: var(--green-bright); }
.trend.flat { color: var(--text-faint); }

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

.chart-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.chart { width: 100%; height: 260px; display: block; }
.chart-empty { color: var(--text-faint); text-align: center; padding: 60px 20px; }
.range-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.range-tabs a {
  padding: 5px 12px; border-radius: 7px; font-size: 0.85rem;
  border: 1px solid var(--border); color: var(--text-dim);
}
.range-tabs a:hover { text-decoration: none; border-color: var(--border-bright); color: var(--text); }
.range-tabs a.active { background: var(--amber); color: #10140c; border-color: var(--amber); font-weight: 600; }

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

#toll-map { height: min(70vh, 640px); border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-sunken); }
.map-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 0.85rem; color: var(--text-dim); }
.legend-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

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

.form-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; max-width: 620px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 0.8rem; color: var(--text-faint); margin-top: 5px; }
input[type=text], input[type=email], input[type=url], input[type=number], select {
  width: 100%; padding: 10px 12px; font-size: 0.95rem; font-family: inherit;
  background: var(--bg-sunken); border: 1px solid var(--border-bright);
  border-radius: 8px; color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber); }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 8px; border: 0;
  background: var(--amber); color: #10140c; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: #ffcf63; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: transparent; border: 1px solid var(--border-bright); color: var(--text); }
.btn-secondary:hover { background: var(--bg-raised); }
.form-status { margin-top: 14px; padding: 12px 14px; border-radius: 8px; display: none; }
.form-status.ok { display: block; background: rgba(34,164,93,0.14); border: 1px solid var(--green-bright); }
.form-status.err { display: block; background: rgba(242,84,91,0.12); border: 1px solid var(--red); }

.checkbox-row { display: flex; gap: 12px; flex-wrap: wrap; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.88rem; }
.checkbox-row input { accent-color: var(--amber); }

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

.site-footer { border-top: 1px solid var(--border); background: var(--bg-sunken); margin-top: 50px; padding: 30px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer-brand { margin: 0 0 6px; font-size: 1rem; }
.footer-brand strong { color: var(--amber); }
.footer-inner > div { max-width: 52ch; }
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 30px; font-size: 1.2rem; }
.prose li { margin-bottom: 7px; }
.prose code {
  font-family: var(--mono); font-size: 0.86em; background: var(--bg-sunken);
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .header-inner { min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
  .sign-price { font-size: 1.3rem; }
}

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