:root {
  --bg: #050505;
  --surface: #0b0b0d;
  --surface-2: #121216;
  --forecast: #241626;
  --forecast-deep: #180f1a;
  --line: #343038;
  --line-soft: rgb(255 255 255 / 10%);
  --white: #f8f7f3;
  --muted: #aaa6ab;
  --muted-2: #777278;
  --red: #ed1b24;
  --yellow: #ffbd1a;
  --yellow-hot: #ffd55c;
  --max: 1500px;
  --mono: "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  font-synthesis: none;
}

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

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
  scrollbar-color: #6d6870 var(--bg);
  scrollbar-width: thin;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
}

::selection {
  background: var(--yellow);
  color: #080808;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #151218;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #151218;
  border-radius: 99px;
  background: #777278;
}

.shell {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  transform: translateY(-160%);
  background: var(--yellow);
  color: #050505;
  font-weight: 900;
  text-decoration: none;
  transition: transform 100ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.route-progress {
  position: fixed;
  z-index: 1001;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--yellow);
  box-shadow: 0 0 12px var(--yellow);
  opacity: 0;
  transition: width 180ms ease, opacity 120ms ease;
}

.route-progress.is-loading {
  width: 72%;
  opacity: 1;
}

.route-progress.is-complete {
  width: 100%;
  opacity: 0;
}

.weather-app {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 24px 24px 0 0;
  margin-top: 8px;
  margin-bottom: 0;
  padding: 0;
  background: #000;
}

.last-refresh {
  position: absolute;
  z-index: 10;
  top: 12px;
  right: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 5px 8px;
  background: rgb(0 0 0 / 78%);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.notice {
  border-bottom: 1px solid var(--line);
  padding: 11px 18px;
  background: #17141a;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.notice--error {
  background: #28090d;
  color: var(--white);
}

.current-hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 290px;
  align-items: center;
  padding: 20px clamp(28px, 10vw, 145px);
  background: #000;
}

.current-column {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
}

.hero-temperature {
  margin-bottom: 0;
  font-size: clamp(78px, 9vw, 128px);
  font-weight: 300;
  letter-spacing: -0.09em;
  line-height: 0.9;
}

.hero-feels,
.hero-condition {
  margin: 10px 0 0;
  font-size: clamp(15px, 1.5vw, 21px);
}

.hero-feels strong {
  font-weight: 800;
}

.hero-condition {
  max-width: 360px;
  text-align: center;
}

.current-metrics {
  display: grid;
  gap: 4px;
  margin-top: 15px;
}

.current-metrics p {
  display: grid;
  grid-template-columns: 28px auto 1fr;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  font-size: clamp(14px, 1.35vw, 19px);
  white-space: nowrap;
}

.current-metrics p > span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--white);
  font-size: 19px;
  text-align: center;
}

.vector-icon {
  width: 1em;
  height: 1em;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vector-icon .icon-fill {
  fill: currentColor;
  stroke: none;
}

.current-metrics strong {
  font-weight: 850;
  text-transform: none;
}

.weather-icon {
  position: relative;
  display: inline-flex;
  width: 68px;
  height: auto;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 54px;
  line-height: 1;
}

.weather-icon::before {
  display: block;
  flex: 0 0 auto;
  line-height: 1;
}

.weather-icon--large {
  width: clamp(108px, 12vw, 150px);
  height: auto;
  font-size: clamp(92px, 10.5vw, 132px);
}

.weather-icon--clear::before {
  width: 78%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
}

.weather-icon--clear-night::before {
  color: #edf3ff;
  content: "☾";
}

.weather-icon--partly-cloudy::before {
  position: absolute;
  top: 5%;
  left: 4%;
  width: 62%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
}

.weather-icon--partly-cloudy::after {
  position: absolute;
  right: -2%;
  bottom: 7%;
  width: 76%;
  height: 54%;
  background:
    radial-gradient(circle at 50% 38%, var(--white) 0 32%, transparent 33%),
    radial-gradient(circle at 23% 63%, var(--white) 0 24%, transparent 25%),
    radial-gradient(circle at 80% 66%, var(--white) 0 21%, transparent 22%),
    linear-gradient(to top, var(--white) 0 44%, transparent 45%);
  content: "";
}

.weather-icon--partly-cloudy-night::before {
  content: "☁️";
  filter: drop-shadow(14px -13px 0 #43c5ec);
}

.weather-icon--cloudy::before {
  content: "☁️";
}

.weather-icon--rain::before {
  content: "🌧️";
}

.weather-icon--storm::before {
  content: "⛈️";
}

.weather-icon--snow::before {
  content: "🌨️";
}

.radar-panel {
  border-top: 1px solid var(--line-soft);
  background: #08080a;
}

.imagery-frame {
  margin: 0;
}

.imagery-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 7 / 3;
  background: #020202;
  box-shadow: inset 0 1px var(--line-soft), inset 0 -1px var(--line-soft);
}

.leaflet-map {
  position: absolute;
  inset: 0;
  background: #d8d6cf;
}

.leaflet-container {
  font-family: var(--sans);
}

.leaflet-control-attribution {
  background: rgb(0 0 0 / 78%) !important;
  color: var(--muted);
  font-size: 8px !important;
}

.leaflet-control-attribution a {
  color: var(--white);
}

.imagery-stage figcaption {
  position: absolute;
  z-index: 1000;
  top: 14px;
  left: 14px;
  border-radius: 8px;
  padding: 8px 11px;
  background: rgb(5 5 5 / 84%);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.imagery-loader {
  position: absolute;
  z-index: 1100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: #09090b;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.imagery-loader span {
  width: 44px;
  height: 44px;
  border: 4px solid #2b292e;
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.imagery-loader p {
  margin: 0;
}

.imagery-timeline {
  min-height: 34px;
  padding: 4px 18px;
}

.timeline {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline input {
  width: 100%;
  accent-color: var(--yellow);
}

.forecast-board {
  background: var(--forecast);
}

.daily-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(270px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 76px;
  border-top: 1px solid rgb(255 255 255 / 8%);
  padding: 8px 18px;
}

.daily-summary__text h3 {
  margin-bottom: 2px;
  font-size: clamp(18px, 1.9vw, 25px);
}

.daily-summary__text p {
  margin: 0;
  font-size: clamp(15px, 1.6vw, 21px);
}

.weather-icon--daily {
  width: 54px;
  height: auto;
  font-size: 46px;
}

.daily-summary__values {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(15px, 2.5vw, 34px);
  font-size: clamp(17px, 1.9vw, 25px);
}

.daily-summary__values p {
  margin: 0;
  white-space: nowrap;
}

.daily-summary__rain,
.hour-card__metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.daily-summary__rain .vector-icon {
  width: 0.72em;
  height: 0.72em;
}

.hourly-strip {
  display: grid;
  grid-auto-columns: 118px;
  grid-auto-flow: column;
  overflow-x: auto;
  border-block: 1px solid rgb(255 255 255 / 10%);
  scrollbar-color: #99949c #1a171c;
}

.hour-card {
  display: flex;
  min-height: 254px;
  align-items: center;
  flex-direction: column;
  border-right: 1px solid rgb(255 255 255 / 13%);
  padding: 12px 10px;
}

.hour-card__time {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 850;
  white-space: nowrap;
}

.weather-icon--hourly {
  width: 58px;
  height: auto;
  margin: 10px 0 7px;
  font-size: 47px;
}

.hour-card__temperature {
  margin-bottom: 9px;
  font-size: 24px;
  font-weight: 850;
}

.hour-card__metric {
  margin: 3px 0;
  font-size: 16px;
  white-space: nowrap;
}

.hour-card__metric .vector-icon {
  width: 17px;
  height: 17px;
}

.hour-card__wind {
  color: #dedade;
}

.hour-card__wind-icon {
  transform-origin: center;
}

.forecast-details,
.station-details {
  border-top: 1px solid var(--line-soft);
  background: var(--forecast-deep);
}

.forecast-details summary,
.station-details summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 850;
  text-transform: uppercase;
}

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line-soft);
}

.forecast-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: #121015;
  font-size: 11px;
}

.forecast-table th,
.forecast-table td {
  height: 38px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
}

.forecast-table thead th {
  background: #201b22;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.forecast-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 180px;
  background: #19151b;
  text-align: left;
}

.station-details {
  background: #09090b;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 20px 22px;
}

.detail-section {
  min-width: 0;
}

.detail-section h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.detail-list {
  border: 1px solid var(--line);
  margin: 0;
  background: #101014;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 8px 11px;
}

.detail-row + .detail-row {
  border-top: 1px solid var(--line-soft);
}

.detail-row dt {
  color: var(--muted);
}

.detail-row dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.noscript {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  left: 20px;
  border: 1px solid var(--red);
  padding: 16px;
  background: #21080b;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .current-hero {
    padding-inline: 28px;
  }

  .daily-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .daily-summary__values {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(calc(100% - 16px), var(--max));
  }

  .weather-app {
    border-radius: 16px 16px 0 0;
  }

  .last-refresh {
    top: 8px;
    right: 10px;
    font-size: 8px;
  }

  .current-hero {
    grid-template-columns: 1fr 1fr;
    min-height: 300px;
    padding: 20px 12px;
  }

  .hero-temperature {
    font-size: clamp(64px, 21vw, 100px);
  }

  .hero-feels,
  .hero-condition {
    margin-top: 9px;
    font-size: 13px;
  }

  .weather-icon--large {
    width: 82px;
    height: auto;
    font-size: 70px;
  }

  .current-metrics {
    gap: 5px;
    margin-top: 18px;
  }

  .current-metrics p {
    grid-template-columns: 20px auto 1fr;
    font-size: 13px;
  }

  .current-metrics p > span {
    font-size: 16px;
  }

  .imagery-stage {
    aspect-ratio: 7 / 3;
  }

  .imagery-stage figcaption {
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .imagery-timeline {
    padding-inline: 12px;
  }

  .daily-summary {
    gap: 10px;
    padding: 9px 12px;
  }

  .daily-summary__text p {
    font-size: 14px;
  }

  .weather-icon--daily {
    width: 50px;
    height: auto;
    font-size: 43px;
  }

  .daily-summary__values {
    gap: 13px;
    font-size: 16px;
  }

  .hour-card {
    min-height: 250px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    padding-inline: 12px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
