:root {
  color-scheme: light;
  --ink: #173236;
  --muted: #62777a;
  --line: rgba(23, 50, 54, 0.12);
  --paper: #f6f3eb;
  --glass: rgba(255, 255, 255, 0.58);
  --sea: #8fbebc;
  --fog: #dce9e7;
  --sun: #f7ce72;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.95), transparent 35rem),
    linear-gradient(145deg, #d7e7e5 0%, var(--paper) 52%, #e8ddc8 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  pointer-events: none;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 46px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  color: var(--ink);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.06em;
  text-decoration: none;
}

.wordmark b {
  color: #e78c54;
}

.live-pill {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(40, 69, 72, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-pill i {
  width: 8px;
  height: 8px;
  background: #e78c54;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(231, 140, 84, 0.14);
}

.live-pill.is-stale i {
  background: #a97545;
  box-shadow: 0 0 0 4px rgba(169, 117, 69, 0.14);
}

.hero {
  padding: clamp(70px, 12vw, 145px) 0 clamp(44px, 8vw, 85px);
}

.eyebrow {
  margin: 0 0 14px;
  color: #537174;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 9vw, 7.8rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.88;
}

.summary {
  max-width: 670px;
  margin: 28px 0 0;
  color: #405d60;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  line-height: 1.5;
}

.observation-meta {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.85rem;
}

.dot {
  opacity: 0.45;
}

.board {
  padding: clamp(22px, 4vw, 42px);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(51, 74, 75, 0.12);
  backdrop-filter: blur(22px);
}

.board-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.refresh {
  padding: 9px 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.refresh:hover {
  background: rgba(255, 255, 255, 0.65);
}

.time-scrubber {
  margin: -4px 0 24px;
  padding: 15px 17px 13px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
}

.time-scrubber-heading,
.time-scrubber-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.time-scrubber-heading label {
  color: #405d60;
  font-size: 0.78rem;
  font-weight: 750;
}

.time-scrubber output {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}

.time-scrubber input {
  width: 100%;
  height: 30px;
  margin: 5px 0 0;
  direction: rtl;
  accent-color: #e78c54;
  cursor: ew-resize;
}

.time-scrubber input:disabled {
  cursor: wait;
  opacity: 0.5;
}

.time-scrubber-scale {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 650;
}

.grid-scroll {
  position: relative;
  overflow: hidden;
  padding: 12px;
  background:
    linear-gradient(rgba(246, 243, 235, 0.08), rgba(246, 243, 235, 0.08)),
    url("/westside-map.png") center / 100% 100% no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 19px;
}

.fog-grid {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: clamp(72px, 9vw, 98px) 11% clamp(96px, 11vw, 116px) 12%;
}

.region-grid {
  display: grid;
  height: clamp(340px, 46vw, 520px);
  grid-template-columns: 28fr 29fr 43fr;
  gap: 3px;
  min-width: 0;
}

.street-overlay {
  position: absolute;
  inset: clamp(72px, 9vw, 98px) 11% clamp(96px, 11vw, 116px) 12%;
  z-index: 3;
  pointer-events: none;
}

.street-line {
  position: absolute;
  color: #334b4d;
  background: rgba(210, 171, 63, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 244, 199, 0.5);
}

.street-line span {
  position: absolute;
  padding: 2px 4px;
  background: rgba(249, 224, 143, 0.96);
  border: 1px solid rgba(165, 127, 32, 0.2);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(78, 68, 38, 0.13);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.street-line-vertical {
  top: 0;
  bottom: 0;
  left: var(--boundary-position);
  width: 2px;
  transform: translateX(-1px);
}

.street-line-vertical span {
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.street-line-vertical:nth-child(2) span {
  top: 52%;
}

.street-line-vertical:nth-child(4) span {
  top: 70%;
}

.cell {
  position: relative;
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 7px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.cell:hover,
.cell:focus {
  z-index: 2;
  outline: none;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(42, 67, 69, 0.14);
}

.cell .emoji {
  font-size: clamp(2.7rem, 7vw, 4.6rem);
  filter: saturate(0.88);
}

.cell .corridor-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  color: rgba(23, 50, 54, 0.74);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.cell[data-condition="fog"] {
  background: linear-gradient(145deg, rgba(173, 198, 198, 0.84), rgba(225, 235, 233, 0.72));
}

.cell[data-condition="edge"] {
  background: linear-gradient(145deg, rgba(219, 228, 219, 0.79), rgba(249, 224, 171, 0.66));
}

.cell[data-condition="clear"] {
  background: linear-gradient(145deg, rgba(253, 224, 159, 0.72), rgba(255, 247, 222, 0.68));
}

.cell[data-condition="overcast"] {
  background: linear-gradient(145deg, rgba(194, 207, 210, 0.72), rgba(229, 233, 231, 0.76));
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 25px;
  color: var(--muted);
  font-size: 0.77rem;
}

.legend span {
  white-space: nowrap;
}

.legend b {
  margin-right: 4px;
  font-size: 1rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 4px 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

footer p {
  margin: 0;
}

footer > p:last-child {
  max-width: 390px;
  text-align: right;
}

footer > p:last-child a {
  color: inherit;
}

.map-credit {
  margin-top: 4px;
}

.map-credit a {
  color: inherit;
}

@media (max-width: 650px) {
  .shell {
    width: min(calc(100% - 24px), 1120px);
    padding-top: 18px;
  }

  .hero {
    padding-top: 66px;
  }

  .observation-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .dot {
    display: none;
  }

  .board {
    padding: 17px 12px 20px;
    border-radius: 21px;
  }

  .board-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding-inline: 5px;
  }

  .grid-scroll {
    padding: 6px;
    border-radius: 14px;
  }

  .time-scrubber {
    margin: -2px 5px 18px;
    padding: 13px 13px 11px;
  }

  .fog-grid {
    padding: 72px 11% 96px 12%;
  }

  .street-overlay {
    inset: 72px 11% 96px 12%;
  }

  .street-line span {
    padding: 2px 3px;
    font-size: 0.46rem;
    letter-spacing: 0.01em;
  }

  .cell {
    border-radius: 5px;
  }

  .cell .emoji {
    font-size: 2.35rem;
  }

  .cell .corridor-label {
    right: 3px;
    bottom: 5px;
    left: 3px;
    font-size: 0.48rem;
  }

  .legend {
    gap: 8px 13px;
    margin-top: 18px;
    padding-inline: 5px;
    font-size: 0.68rem;
  }

  footer {
    flex-direction: column;
  }

  footer > p:last-child {
    text-align: left;
  }
}

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