:root {
  --slate: #40515c;
  /* Inset panels (map frame, embeds, camera tiles) sit inside the glass card, so
     this tracks the card rather than the old lighter slate. */
  --slate-deep: #1f282f;
  --mist: #f0f2f2;
  --text-on-slate: #e9edef;
  /* Lifted from #c3cdd3: cards are now translucent, and over the bright parts of
     the snow photo the old value fell to 4.1:1. This holds 4.6:1 worst case. */
  --soft-on-slate: #ced8dd;
  --focus: #d7e9f2;

  /* Back to the default card colour at 14% show-through. That combination only
     works because the card's backdrop-filter dims what passes through it — the
     photo stays bright where you actually see it, and only the part behind the
     glass is darkened. Measured against the real asset: the blurred backdrop
     peaks at rgb(236,239,244), not white, which is where the headroom came from.
     Worst case holds 6.7:1 white, 4.6:1 secondary, 4.4:1 accent. */
  --card-bg: rgba(64, 81, 92, .86);
  --radius: 4px;

  /* Ice blue. 4.5:1 on the card, and the only place it is actual text is the
     filled buttons, where the rgba(0,0,0,.22) fill takes it to 6.2:1. Everywhere
     else it is a border, underline or focus ring — non-text indicators at a 3:1
     threshold. Fails on the white header (1.48:1), so the nav stays slate. */
  --accent: #a8dcef;
  --lift: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: "Jost", "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--slate);
  background: var(--mist);
  min-height: 100vh;
}

/* ---------- header / nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 56px);
  box-shadow: 0 1px 8px rgba(64, 81, 92, .12);
}
header a.home { display: block; }
header img { height: 62px; width: auto; display: block; }

/* Scoped to `header` throughout — the FAQ's jump-link list is also a <nav>, and
   unscoped rules hid it entirely at mobile widths. */
/* flex-wrap matters for the no-JS path: without it the four inline links overflow
   a phone viewport sideways instead of wrapping onto a second line. */
header nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(14px, 2.2vw, 30px);
}
header nav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .15s ease;
}
header nav a:hover, header nav a.here { border-bottom-color: var(--slate); }
header nav a.portal { letter-spacing: .14em; font-size: 12.5px; }

/* ---------- mobile nav ---------- */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 11px 9px;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--slate);
  border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Collapse only once JS is present, so a no-JS phone still gets a usable nav. */
@media (max-width: 900px) {
  body.nav-js .nav-toggle { display: flex; }
  body.nav-js header nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 10px;
    box-shadow: 0 12px 24px rgba(64, 81, 92, .18);
    display: none;
  }
  body.nav-js header nav[data-open] { display: flex; }
  body.nav-js header nav a {
    padding: 14px clamp(20px, 5vw, 56px);
    border-bottom: 0;
    border-left: 3px solid transparent;
  }
  body.nav-js header nav a:hover,
  body.nav-js header nav a.here { border-left-color: var(--slate); }
}

@media (max-width: 620px) {
  header { gap: 12px; padding: 12px 14px; }
  header img { height: 40px; }
}

/* ---------- layout ---------- */
.backdrop {
  /* Plain scrolling background is the baseline: correct on phones, where a fixed
     backdrop is both janky and where iOS has long mishandled it. */
  background: url("assets/snow-bg.jpg") center / cover no-repeat;
  padding: clamp(28px, 6vh, 72px) 20px clamp(40px, 8vh, 88px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
  position: relative;
  isolation: isolate;
}

/* Parallax: a fixed backdrop layer drifting a bounded distance across the whole
   page, rather than a per-pixel scroll multiplier that would run out of image on
   a long page. Desktop only, and only when motion is welcome. */
@media (min-width: 760px) and (prefers-reduced-motion: no-preference) {
  .backdrop { background: none; }
  .backdrop::before {
    content: "";
    position: fixed;
    inset: -18vh 0;
    z-index: -1;
    background: url("assets/snow-bg.jpg") center / cover no-repeat;
    transform: translate3d(0, var(--par, 0px), 0);
    will-change: transform;
  }
}

.card {
  width: min(var(--measure, 1160px), 100%);
  background: var(--card-bg);
  /* brightness() is what makes a default-coloured card legible at 14% — it dims
     the backdrop behind the glass without touching the photo around it. */
  backdrop-filter: blur(16px) saturate(112%) brightness(.72);
  -webkit-backdrop-filter: blur(16px) saturate(112%) brightness(.72);
  color: var(--text-on-slate);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 52px) clamp(24px, 4vw, 60px);
  /* Two shadows read as a panel above a surface; one reads as a drop shadow. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .09),
    0 2px 4px rgba(22, 32, 38, .18),
    0 16px 40px rgba(22, 32, 38, .30);
}
/* Without backdrop-filter, translucency over a busy photo just looks muddy. */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .card { background: var(--slate); }
}
/* Names the page for screen readers and search engines on layouts that have no
   visible page title — every card here is a peer, so promoting one card's
   heading to h1 would misdescribe the page. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Cards go wide, but prose does not — long measure is what makes a wide layout
   read as unfinished. Headings and grids span; paragraphs stay at ~68ch. */
.card h1, .card h2 {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .22em;
  line-height: 1.4;
  color: #fff;
}
.card h1 { font-size: clamp(21px, 2.6vw, 30px); margin-bottom: 20px; letter-spacing: .1em; }
.card h2 { font-size: clamp(18px, 2vw, 24px); margin-bottom: 24px; letter-spacing: .16em; }
.card p {
  font-size: 15.5px;
  font-weight: 300;
  line-height: 1.75;
  max-width: 68ch;
}
.card .lede {
  margin-bottom: 26px;
  font-size: clamp(15.5px, 1.3vw, 17px);
  max-width: 62ch;
}
.card .accepting { margin-bottom: 4px; }

/* ---------- hero ---------- */
.hero { display: grid; gap: clamp(26px, 3vw, 48px); align-items: start; }
.hero h1 { font-size: clamp(24px, 3vw, 36px); }
.hero .lede { margin-bottom: 0; }
/* A hero can carry more than one lede paragraph; without this they abut, since
   the rule above zeroes the spacing .card .lede would otherwise provide. */
.hero .lede + .lede { margin-top: 18px; }
.hero-status .cta { margin-top: 26px; }
@media (min-width: 940px) {
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); }
  .hero-status {
    padding-left: clamp(24px, 2.5vw, 40px);
    border-left: 1px solid rgba(255, 255, 255, .25);
  }
}

/* ---------- multi-column blocks ---------- */
/* The single narrow column made short pages scroll forever. These let a group of
   Q&A items or steps sit side by side once there's room. */
.qa-grid { display: grid; gap: clamp(24px, 2.6vw, 40px); }
.qa-grid > .qa { margin: 0; }
.qa-grid > .qa + .qa { margin-top: 0; }
@media (min-width: 760px) {
  .qa-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.qa-grid .qa p { max-width: none; }

/* Two cards side by side — form beside the map, forecast beside chain controls. */
.split {
  width: min(var(--measure, 1160px), 100%);
  display: grid;
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
}
/* Side-by-side cards get tighter padding; the page-level clamp is tuned for a
   full-width card and eats too much of a half-width one. */
.split > .card {
  width: 100%;
  padding: clamp(24px, 2.4vw, 40px) clamp(22px, 2.6vw, 42px);
}
/* Unconditional: a grid item defaults to min-width:auto, so in the single-column
   phone layout the map's 520px min-content would push the page sideways. */
.split > * { min-width: 0; }

/* Two cards stacked inside one column of a .split. */
.stack { display: grid; gap: clamp(24px, 3vw, 44px); align-content: start; }

@media (min-width: 940px) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Stretch the stacked column and let its last card absorb the slack, so the
     bottom edge lines up with the tall card beside it instead of stopping short. */
  .split.wide-left { align-items: stretch; }
  .split.wide-left .stack { align-content: stretch; grid-template-rows: auto 1fr; }
  .split.wide-left .stack > .card { display: flex; flex-direction: column; }
  .split.wide-left .stack > .card > .map-note { margin-top: auto; padding-top: 20px; }
  /* The service-area map needs ~520px before its street labels stop being
     legible, so it takes the larger column. */
  .split.wide-right { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .split.wide-left { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
}

.cta {
  display: inline-block;
  margin-top: 34px;
  color: #fff;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  border: 1.5px solid rgba(255, 255, 255, .55);
  border-radius: var(--radius);
  padding: 13px 30px;
  transition: background .15s ease, color .15s ease;
}
.cta {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 0, 0, .22);
}
.cta:hover { background: var(--accent); color: #16202a; }

/* ---------- Q&A blocks ---------- */
.qa { margin-left: clamp(0px, 3vw, 26px); }
.qa + .qa { margin-top: 26px; }
/* A .qa following body copy (rather than a section heading) needs its own gap. */
.card > p + .qa { margin-top: 30px; }
/* Sentence case here is what creates the hierarchy — when the sub-heads were
   also uppercase and tracked, every level of the page shouted at one volume. */
.qa h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  color: #fff;
  margin-bottom: 8px;
}
.qa p { font-size: 14.5px; color: var(--soft-on-slate); }

.card p a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.card p a:hover { text-decoration-color: #fff; }

/* ---------- service area map ---------- */
.map-frame {
  display: block;
  border-radius: var(--radius);
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: var(--slate-deep);
  cursor: zoom-in;
  /* Below ~520px the street labels stop being readable, so pan instead of shrink. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.map-frame img { display: block; width: 100%; min-width: 520px; height: auto; }

/* ---------- map lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 33, 39, .93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
}
.lb img {
  display: block;
  max-width: min(1000px, 100%);
  max-height: 86vh;
  width: auto;
  height: auto;
  background: var(--slate-deep);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.lb-close {
  position: absolute;
  top: clamp(10px, 2vw, 22px);
  right: clamp(10px, 2vw, 22px);
  width: 46px;
  height: 46px;
  font-family: inherit;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .4);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lb-close:hover { background: #fff; color: var(--slate); }
body.lb-open { overflow: hidden; }

/* ---------- storm notice ---------- */
.storm { border-left: 3px solid var(--accent); }
.storm h2 { margin-bottom: 16px; }
.storm p + p { margin-top: 14px; }

/* ---------- embedded plow tracker ---------- */
.embed {
  margin-top: 4px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  background: var(--slate-deep);
  line-height: 0;
}
.embed iframe {
  display: block;
  width: 100%;
  height: clamp(340px, 52vh, 520px);
  border: 0;
}
.map-note {
  font-size: 13px;
  font-weight: 300;
  color: var(--soft-on-slate);
  margin-top: 12px;
  line-height: 1.6;
}

/* The sticky header would otherwise cover the heading an anchor lands on. */
[id] { scroll-margin-top: 96px; }

/* ---------- live conditions ---------- */
.alert-card { border-left: 4px solid var(--accent); }

.feed { margin-top: 4px; }
.feed-msg { font-size: 14.5px; font-weight: 300; color: var(--soft-on-slate); }

.periods, .chains, .alerts { list-style: none; padding: 0; margin: 0; }
.periods > li, .chains > li, .alerts > li {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.periods > li:first-child, .chains > li:first-child, .alerts > li:first-child {
  border-top: 0;
  padding-top: 4px;
}

.p-when, .c-route, .a-head {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #fff;
}
.p-temp {
  font-size: 30px;
  font-weight: 300;
  color: #fff;
  line-height: 1.2;
  margin: 6px 0 2px;
}
.p-what { font-size: 15.5px; font-weight: 400; color: var(--text-on-slate); }
.p-meta {
  font-size: 13px;
  font-weight: 300;
  color: var(--soft-on-slate);
  margin-top: 4px;
}
.p-detail {
  font-size: 14px !important;
  font-weight: 300;
  color: var(--soft-on-slate);
  margin-top: 8px;
}
.c-status, .a-text {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-on-slate);
  margin-top: 5px;
}

/* ---------- cameras ---------- */
.cams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}
@media (max-width: 560px) { .cams { grid-template-columns: 1fr; } }
.cam { margin: 0; }
.cam a { display: block; background: var(--slate-deep); border-radius: var(--radius); overflow: hidden; }
.cam img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  /* contain, not cover: Caltrans burns the camera name and timestamp into the
     bottom of the frame, and cropping it would remove the only proof of freshness. */
  object-fit: contain;
  background: var(--slate-deep);
}
.cam figcaption {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  margin-top: 8px;
}
.cam figcaption span {
  display: block;
  font-size: 11.5px;
  font-weight: 300;
  letter-spacing: .08em;
  text-transform: none;
  color: var(--soft-on-slate);
  margin-top: 3px;
}

/* ---------- forms ---------- */
.quote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quote-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .quote-grid { grid-template-columns: 1fr; } }

/* house number sits left of the street, so the pair reads "1234 Laurelwood Drive" */
.quote-grid .house { grid-column: 1 / 2; }
.quote-grid .street { grid-column: 2 / -1; }
@media (max-width: 560px) {
  .quote-grid .house, .quote-grid .street { grid-column: 1 / -1; }
}

.group-label {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #fff;
  margin-top: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--soft-on-slate);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  color: #fff;
  /* Darker than the card, not lighter. A light fill on a translucent dark card
     lifted the field surface enough to push placeholders to 3.8:1; recessing it
     restores 5.4:1 and reads as an inset control besides. */
  background: rgba(0, 0, 0, .15);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: var(--radius);
  padding: 11px 12px;
  transition: border-color .15s ease;
}
/* The UA default placeholder was ~3.2:1 here, which is why the comments box read
   as unreadable. Against the recessed field this now clears 5.4:1. */
.field input::placeholder, .field textarea::placeholder {
  color: #ced8dd;
  opacity: 1;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c3cdd3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.field select:disabled { opacity: .45; cursor: not-allowed; }
.field select option { color: #2e3b44; background: #fff; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, .22);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"] {
  border-color: #ffb4a8;
}

.quote-submit {
  font-family: inherit;
  cursor: pointer;
  margin-top: 26px;
  color: #fff;
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  border: 1.5px solid rgba(255, 255, 255, .55);
  border-radius: var(--radius);
  padding: 13px 30px;
  transition: background .15s ease, color .15s ease;
}
.quote-submit { color: var(--accent); border-color: var(--accent); background: rgba(0, 0, 0, .22); }
.quote-submit:hover:not(:disabled) { background: var(--accent); color: #16202a; }
.quote-submit:disabled { opacity: .5; cursor: wait; }

.quote-status {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 1.4em;
}
.quote-status.err { color: #ffcfc6; }
.quote-status.ok { color: #d3f0dd; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------- footer ---------- */
footer {
  background: var(--mist);
  text-align: center;
  padding: 40px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
footer a, footer div {
  color: var(--slate);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
footer .fine {
  font-size: 11px;
  letter-spacing: .18em;
  color: #8b99a2;
  margin-top: 10px;
}

/* The uppercase, wide-tracked email address is ~392px on its own and pushed the
   whole document into horizontal scroll on phones. Tighten it below the fold. */
@media (max-width: 620px) {
  footer { padding: 32px 16px 40px; }
  footer a, footer div { font-size: 12px; letter-spacing: .1em; overflow-wrap: anywhere; }
  footer .fine { font-size: 10.5px; letter-spacing: .08em; }
}

/* ---------- single-message pages (404, portal) ---------- */
.centered { align-items: center; justify-content: center; min-height: 60vh; }
/* A single short message doesn't need the full site measure — at 1160px the
   card reads as mostly empty. */
.centered .card { text-align: center; --measure: 760px; }
/* .card p caps the measure but doesn't centre the block, so centred text was
   sitting left of the card's midline. */
.centered .card p { margin-inline: auto; }
.centered .card p + p { margin-top: 18px; }
.centered .code {
  font-size: 13px;
  letter-spacing: .34em;
  color: var(--soft-on-slate);
  margin-bottom: 18px;
}
.centered .links {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.centered .links .cta { margin-top: 0; }

/* ---------- focus ---------- */
/* Keyboard focus was relying on the UA default, which all but vanished against
   the slate cards. Two rules so it reads on both the white chrome and the cards. */
:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 3px;
}
.card :focus-visible,
.lb :focus-visible,
.backdrop :focus-visible {
  outline-color: var(--accent);
}

/* ---------- motion ---------- */
.cta, .quote-submit { transition: background .15s ease, color .15s ease, transform .15s ease; }
.cta:hover, .quote-submit:hover:not(:disabled) { transform: translateY(-1px); }

/* Nav underline sweeps in rather than snapping on. */
@media (min-width: 901px) {
  header nav a { position: relative; border-bottom-color: transparent; }
  header nav a::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 0;
    height: 2px;
    background: var(--slate);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .24s var(--lift);
  }
  header nav a:hover::after, header nav a.here::after { transform: scaleX(1); }
}

.cam a, .map-frame, .embed {
  transition: transform .28s var(--lift), box-shadow .28s var(--lift);
}
.cam a:hover, .map-frame:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(22, 32, 38, .34);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
