:root {
  color-scheme: light;
  --ink: #061942;
  --muted: #52607b;
  --line: rgba(10, 28, 70, 0.16);
  --white: #ffffff;
  --blue: #1769e0;
  --lizard: #83a64d;
  --danger: #991b1b;
  --warning: #9a3412;
  --shadow: 0 24px 70px rgba(8, 23, 58, 0.18);
  --radius: 16px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 207, 99, 0.34), transparent 29%),
    radial-gradient(circle at 82% 8%, rgba(74, 164, 255, 0.3), transparent 31%),
    linear-gradient(135deg, #f9fbff 0%, #edf5ff 48%, #f7f8fb 100%);
}

button {
  font: inherit;
}

a {
  color: var(--blue);
  font-weight: 750;
  text-underline-offset: 3px;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 105, 224, 0.28);
  outline-offset: 3px;
}

.page {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.app-shell {
  min-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid rgba(12, 32, 73, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  min-height: 110px;
  padding: 26px 30px 22px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 24px;
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
}

.brand,
.place,
.location-button,
.metric,
.mini-stat {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(131, 166, 77, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 194, 39, 0.16), transparent 30%),
    rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 22px rgba(8, 23, 58, 0.08);
}

.brand-mark img {
  width: 37px;
  height: 37px;
  display: block;
  object-fit: contain;
}

.place-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.place {
  min-width: 0;
  gap: 14px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 850;
  white-space: nowrap;
}

.place span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-tabs {
  min-height: 42px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 4px;
}

.day-tab {
  min-width: 88px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: #52607b;
  background: transparent;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.day-tab.is-active {
  color: #fff;
  background: #1769e0;
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.18);
}

.day-tab:hover {
  color: #0b2a6a;
  background: rgba(23, 105, 224, 0.08);
}

.day-tab.is-active:hover {
  color: #fff;
  background: #1769e0;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.location-button {
  min-height: 56px;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid rgba(19, 45, 92, 0.16);
  border-radius: 14px;
  color: #0b2a6a;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.location-button:hover {
  transform: translateY(-1px);
  border-color: rgba(131, 166, 77, 0.52);
  background: #fff;
}

.location-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.status-strip {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 30px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.status-strip > div {
  min-width: 0;
}

.status-message,
.current-conditions-label,
.last-loaded-label {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.status-message {
  font-weight: 750;
}

.status-message--info {
  color: #1e3a8a;
}

.status-message--success {
  color: #356612;
}

.status-message--error {
  color: var(--danger);
}

.last-loaded-label {
  color: var(--muted);
  text-align: right;
}

.current-conditions-label {
  margin-top: 4px;
  color: #31405f;
  font-weight: 650;
}

.alerts-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px 18px;
  align-items: center;
  padding: 12px 30px;
  border-top: 1px solid rgba(251, 146, 60, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.9)),
    linear-gradient(90deg, rgba(251, 146, 60, 0.1), transparent);
}

.alerts-banner strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warning);
}

.alerts-banner strong::before {
  content: "!";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #f97316;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
}

.alerts-banner span {
  color: #7c2d12;
  font-size: 14px;
}

.text-button {
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 850;
  cursor: pointer;
}

.alerts-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.alert-card {
  padding: 12px 14px;
  border: 1px solid rgba(251, 146, 60, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.alert-card--severe {
  border-color: rgba(220, 38, 38, 0.34);
  background: rgba(254, 242, 242, 0.86);
}

.alert-card--moderate {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(255, 251, 235, 0.88);
}

.alert-card h3,
.alert-card p {
  margin: 0;
}

.alert-card h3 {
  font-size: 15px;
}

.alert-card p {
  margin-top: 6px;
  color: #7c2d12;
  font-size: 13px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 640px;
}

.quad {
  position: relative;
  min-height: 320px;
  padding: 26px 40px;
  overflow: hidden;
  isolation: isolate;
  border-top: 1px solid rgba(255, 255, 255, 0.62);
}

.quad:nth-child(odd) {
  border-right: 1px solid rgba(255, 255, 255, 0.72);
}

.quad::before,
.quad::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.quad::before {
  inset: 0;
  background: var(--sky);
}

.quad::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 31%;
  opacity: var(--haze, 0.78);
  background:
    linear-gradient(to top, rgba(5, 17, 41, var(--silhouette, 0.18)), transparent 72%),
    radial-gradient(ellipse at 20% 82%, rgba(255, 255, 255, 0.65), transparent 7%),
    linear-gradient(90deg, transparent, rgba(4, 18, 39, 0.18) 18%, transparent 19% 36%, rgba(4, 18, 39, 0.16) 37% 52%, transparent 53%);
}

.morning {
  --sky:
    radial-gradient(circle at 18% 84%, #fff9c3 0 2.5%, transparent 3%),
    linear-gradient(164deg, #d9ebff 0%, #f4f8ff 46%, #ffd9b5 79%, #ffc47a 100%);
}

.afternoon {
  --sky:
    radial-gradient(circle at 82% 2%, rgba(255, 255, 255, 0.92) 0 4%, transparent 11%),
    radial-gradient(circle at 82% 0%, rgba(255, 255, 255, 0.7), transparent 22%),
    radial-gradient(ellipse at 85% 82%, rgba(255, 255, 255, 0.86), transparent 21%),
    linear-gradient(155deg, #82cfff 0%, #ccefff 58%, #ecf9ff 100%);
}

.evening {
  --sky:
    radial-gradient(circle at 20% 90%, #ffdc75 0 2.8%, transparent 3.2%),
    linear-gradient(158deg, #d9b8de 0%, #f3b2b7 44%, #ffbd66 76%, #ff8b45 100%);
  --silhouette: 0.26;
}

.overnight {
  --sky:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 10%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 73% 21%, rgba(255, 255, 255, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 56% 44%, rgba(255, 255, 255, 0.62) 0 1px, transparent 2px),
    linear-gradient(158deg, #08265c 0%, #063f85 52%, #021c42 100%);
  --haze: 0.98;
  --silhouette: 0.34;
  color: #fff;
}

.quad--passed,
.quad--unavailable {
  color: rgba(6, 25, 66, 0.76);
}

.quad--passed::before,
.quad--unavailable::before {
  filter: grayscale(0.18) saturate(0.72);
}

.overnight.quad--passed,
.overnight.quad--unavailable {
  color: rgba(255, 255, 255, 0.78);
}

.quad--passed .weather-art,
.quad--unavailable .weather-art {
  opacity: 0.54;
}

.quad-content {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.8fr);
  grid-template-rows: auto 1fr auto;
  gap: 10px 16px;
}

.time {
  grid-column: 1 / -1;
}

.time h2 {
  margin: 0 0 5px;
  font-size: 25px;
  line-height: 1.1;
  font-weight: 850;
}

.time p {
  margin: 0;
  color: currentColor;
  opacity: 0.86;
  font-size: 15px;
  font-weight: 750;
}

.temperature {
  grid-column: 1;
  grid-row: 2 / span 2;
  align-self: end;
}

.temp {
  font-size: clamp(66px, 7.2vw, 96px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0;
}

.condition {
  margin: 14px 0 10px;
  font-size: 23px;
  font-weight: 850;
}

.note {
  max-width: 310px;
  margin: 0;
  color: currentColor;
  opacity: 0.9;
  font-size: 16px;
  line-height: 1.38;
  font-weight: 560;
}

.weather-art {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  width: min(142px, 100%);
  min-height: 106px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 14px 18px rgba(13, 26, 58, 0.16));
}

.stats {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  display: grid;
  gap: 10px;
  min-width: 168px;
}

.metric {
  gap: 12px;
}

.metric svg {
  flex: 0 0 auto;
}

.metric-label {
  color: currentColor;
  opacity: 0.78;
  font-size: 12px;
  font-weight: 750;
}

.metric-value {
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
}

.bottom-strip {
  min-height: 120px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid var(--line);
}

.mini-stat {
  justify-content: center;
  gap: 16px;
  padding: 16px 14px;
}

.mini-stat + .mini-stat {
  border-left: 1px solid var(--line);
}

.mini-stat span {
  display: block;
}

.mini-label {
  color: #233352;
  font-size: 14px;
  font-weight: 760;
}

.mini-stat:first-child .mini-label,
.mini-stat:first-child .mini-value {
  color: #3f6212;
}

.mini-value {
  margin-top: 4px;
  color: #071942;
  font-size: 17px;
  line-height: 1.28;
  font-weight: 820;
}

.site-footer {
  padding: 14px 30px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

.sun-core {
  fill: #ffc227;
}

.sun-ray {
  stroke: #ffb200;
  stroke-linecap: round;
  stroke-width: 7;
}

.cloud {
  fill: rgba(255, 255, 255, 0.94);
}

.moon {
  fill: #fff6b2;
}

.overnight .moon {
  fill: #fff;
}

.overnight .cloud {
  fill: rgba(255, 255, 255, 0.9);
}

svg {
  display: block;
}

.release-badge {
  position: fixed;
  right: 12px;
  bottom: 10px;
  z-index: 20;
  padding: 4px 7px;
  border: 1px solid rgba(19, 33, 61, 0.08);
  border-radius: 999px;
  color: rgba(19, 33, 61, 0.54);
  background: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .place-row {
    flex-wrap: wrap;
  }

  .actions {
    justify-content: flex-start;
  }

  .status-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .last-loaded-label {
    text-align: left;
  }
}

@media (max-width: 760px) {
  body {
    background: #f7fbff;
  }

  .page {
    padding: 0;
  }

  .app-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    min-height: 0;
    padding: 22px 18px 14px;
    gap: 18px;
  }

  .brand {
    font-size: 22px;
    justify-content: space-between;
  }

  .brand::after {
    content: "";
    width: 23px;
    height: 15px;
    background:
      linear-gradient(#12336d, #12336d) 0 0 / 100% 2px no-repeat,
      linear-gradient(#12336d, #12336d) 0 7px / 100% 2px no-repeat,
      linear-gradient(#12336d, #12336d) 0 14px / 100% 2px no-repeat;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand-mark img {
    width: 31px;
    height: 31px;
  }

  .place {
    font-size: 20px;
  }

  .day-tabs {
    min-height: auto;
    padding-left: 10px;
    gap: 3px;
  }

  .day-tab {
    min-width: 76px;
    min-height: 30px;
    font-size: 13px;
  }

  .location-button {
    width: 100%;
    justify-content: center;
    min-height: 38px;
    border-radius: 10px;
  }

  .status-strip,
  .alerts-banner {
    padding: 10px 18px;
  }

  .status-strip {
    gap: 7px;
  }

  .status-message,
  .current-conditions-label,
  .last-loaded-label {
    font-size: 13px;
  }

  .alerts-banner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .forecast-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .quad {
    min-height: 165px;
    padding: 17px 20px;
    border-right: 0 !important;
  }

  .quad::after {
    display: none;
  }

  .quad-content {
    grid-template-columns: minmax(0, 1fr) 90px 86px;
    grid-template-rows: auto 1fr;
    align-items: center;
    gap: 10px;
  }

  .time {
    grid-column: 1;
    align-self: start;
  }

  .time h2 {
    font-size: 13px;
  }

  .time p {
    font-size: 11px;
  }

  .temperature {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }

  .temp {
    font-size: 47px;
  }

  .condition {
    margin: 8px 0 0;
    font-size: 13px;
  }

  .note {
    display: none;
  }

  .weather-art {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 86px;
    min-height: 88px;
  }

  .stats {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: stretch;
    min-width: 0;
    gap: 12px;
  }

  .metric {
    gap: 7px;
  }

  .metric-label {
    display: none;
  }

  .metric-value {
    margin: 0;
    font-size: 12px;
  }

  .bottom-strip {
    min-height: 104px;
    grid-template-columns: repeat(5, 1fr);
  }

  .mini-stat {
    padding: 12px 4px;
    gap: 5px;
    flex-direction: column;
    text-align: center;
  }

  .mini-label {
    font-size: 10px;
  }

  .mini-value {
    font-size: 11px;
  }

  .mini-stat svg {
    width: 28px;
    height: 28px;
  }

  .release-badge {
    right: 8px;
    bottom: 6px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .weather-art svg {
    animation: float 5.5s ease-in-out infinite;
  }

  .afternoon .weather-art svg {
    animation-delay: -1.8s;
  }

  .evening .weather-art svg {
    animation-delay: -3.1s;
  }

  @keyframes float {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-6px);
    }
  }
}
