:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --ink: #11110f;
  --muted: #68635a;
  --line: #1e1c18;
  --soft-line: #d6d0c4;
  --panel: #fffdf7;
  --rain: #2f6f9f;
  --warn: #b45622;
  --ok: #336b44;
  --shadow: 0 18px 60px rgba(37, 30, 20, 0.08);
  font-family:
    ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 320px),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 18px;
}

.eyebrow,
.stamp,
.muted,
footer,
.section-head p,
.status-line span,
.metric-grid p,
.metric-grid span,
.day p,
.trend-row span {
  color: var(--muted);
}

.eyebrow,
.stamp {
  margin: 0;
  font-size: 13px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(44px, 12vw, 112px);
  line-height: 0.85;
  letter-spacing: 0;
}

.search {
  margin-top: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.search label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 13px 14px;
  border-radius: 0;
  outline: none;
  box-shadow: var(--shadow);
}

input:focus {
  border-color: var(--rain);
}

.search-row button,
.chips button,
.search-actions button,
.tabs button {
  border: 2px solid var(--line);
  background: var(--panel);
  min-height: 44px;
  padding: 0 14px;
}

.search-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
  align-items: start;
}

.search-actions > button {
  min-height: 34px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips button {
  min-height: 34px;
  color: var(--muted);
}

.examples {
  margin-top: 10px;
}

.search.loading input {
  color: var(--muted);
}

.search-error {
  margin-top: 10px;
  color: var(--warn);
  font-size: 13px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.tabs button.active,
.search-row button:hover,
.chips button:hover,
.search-actions button:hover,
.search-actions button.favorite-on,
.favorite-on {
  background: var(--ink);
  color: var(--panel);
}

.view {
  display: none;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.view.active {
  display: block;
}

.headline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 20px;
  align-items: center;
  min-height: 170px;
}

.headline h2 {
  margin-top: 4px;
  font-size: clamp(70px, 18vw, 152px);
  line-height: 0.86;
}

.weather-mark {
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.weather-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.weather-mark path,
.weather-mark circle,
.weather-mark rect {
  vector-effect: non-scaling-stroke;
}

.icon-line,
.icon-ground,
.icon-frame {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.icon-frame {
  opacity: 0.34;
}

.icon-line.soft {
  opacity: 0.42;
}

.icon-sun {
  fill: #e5b845;
  stroke: var(--line);
  stroke-width: 2;
}

.icon-cloud {
  fill: #d8d4cc;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linejoin: miter;
}

.icon-rain {
  fill: none;
  stroke: var(--rain);
  stroke-width: 3;
  stroke-linecap: square;
}

.icon-bolt {
  fill: var(--warn);
  stroke: var(--line);
  stroke-width: 2;
  stroke-linejoin: miter;
}

.status-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  padding: 12px 0;
}

.status-line strong {
  color: var(--ok);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.metric-grid article {
  min-height: 118px;
  border: 2px solid var(--line);
  background: var(--panel);
  padding: 13px;
}

.metric-grid strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 25px;
}

.metric-grid .warn strong {
  color: var(--ok);
}

.metric-grid .active-warn strong {
  color: var(--warn);
  font-size: 18px;
  line-height: 1.2;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 34px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.timeline li,
.trend-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) max-content max-content max-content;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--soft-line);
  min-height: 54px;
  padding: 10px 0;
}

.timeline strong {
  color: var(--rain);
}

.hour-temp {
  color: var(--ink);
  white-space: nowrap;
}

.bar {
  height: 9px;
  border: 2px solid var(--line);
  background: var(--panel);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--rain);
}

.days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.day {
  appearance: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border: 2px solid var(--line);
  background: var(--panel);
  padding: 15px;
  min-height: 190px;
  box-shadow: inset 0 0 0 0 var(--panel);
}

.day:hover,
.day.active,
.day:focus-visible {
  background: var(--ink);
  border-color: var(--line);
  color: var(--panel);
  box-shadow: inset 0 0 0 2px var(--panel);
  outline: none;
}

.day:hover p,
.day:hover dt,
.day.active p,
.day.active dt,
.day:focus-visible p,
.day:focus-visible dt {
  color: #d8d4cc;
}

.day h3 {
  margin: 0 0 18px;
  font-size: 23px;
}

.day strong {
  display: block;
  margin-bottom: 10px;
  font-size: 30px;
}

.day dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin: 18px 0 0;
}

.day dt,
.day dd {
  margin: 0;
}

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

.day-detail-slot {
  margin-top: 10px;
}

.day-detail-slot[hidden] {
  display: none;
}

.day-detail {
  border: 2px solid var(--line);
  background: rgba(255, 253, 247, 0.64);
  padding: 0 14px 12px;
  box-shadow: inset 0 0 0 1px rgba(30, 28, 24, 0.08);
}

.day-detail .timeline {
  border-top: 0;
}

.day-detail .timeline li {
  min-height: 39px;
  padding: 7px 0;
}

.day-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0 4px;
}

.day-detail-head p {
  color: var(--muted);
}

.trend-list {
  border-top: 1px solid var(--line);
}

.trend-row {
  grid-template-columns: 88px minmax(0, 1fr) minmax(92px, max-content) minmax(72px, max-content);
}

.trend-row > :nth-child(3),
.trend-row > :nth-child(4) {
  white-space: nowrap;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 2px solid var(--line);
  margin-top: 28px;
  padding-top: 14px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 22px, 980px);
    padding-top: 18px;
  }

  .topbar,
  .section-head,
  footer {
    display: block;
  }

  .stamp,
  footer span + span {
    display: block;
    margin-top: 8px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-actions {
    grid-template-columns: 1fr;
  }

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

  .weather-mark {
    width: 104px;
  }

  .metric-grid,
  .days {
    grid-template-columns: 1fr 1fr;
  }

  .timeline li,
  .trend-row {
    grid-template-columns: 62px minmax(0, 1fr) max-content;
  }

  .timeline li > :nth-child(3),
  .trend-row > :nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }

  .timeline li > :nth-child(4),
  .timeline li > :nth-child(5),
  .timeline li > :nth-child(6),
  .trend-row > :nth-child(4) {
    grid-column: 2;
  }

  .timeline li > :nth-child(4),
  .trend-row > :nth-child(4) {
    grid-row: 2;
  }

  .timeline li > :nth-child(5) {
    grid-row: 3;
  }

  .timeline li > :nth-child(6) {
    grid-row: 4;
  }
}

@media (max-width: 430px) {
  .metric-grid,
  .days {
    grid-template-columns: 1fr;
  }

  .tabs button {
    flex: 1 1 calc(50% - 8px);
  }
}
