:root {
  color-scheme: light;
  --paper: #f3efe4;
  --paper-deep: #e8e0cf;
  --ink: #153349;
  --ink-soft: #547080;
  --line: rgba(21, 51, 73, 0.18);
  --line-strong: rgba(21, 51, 73, 0.42);
  --heat: #ef6b3a;
  --sky: #74b7ca;
  --rain: #287da0;
  --shadow: 0 24px 70px rgba(37, 54, 65, 0.12);
  --display: "Baskerville", "Songti SC", serif;
  --body: "Avenir Next", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #d7d2c8;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.8), transparent 27rem),
    radial-gradient(circle at 85% 12%, rgba(116, 183, 202, 0.3), transparent 31rem),
    #d7d2c8;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.23;
  background-image: radial-gradient(rgba(21, 51, 73, 0.65) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  pointer-events: none;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 36px));
  min-height: calc(100vh - 36px);
  margin: 18px auto;
  overflow: hidden;
  border: 1px solid rgba(21, 51, 73, 0.24);
  border-radius: 30px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.48), transparent 40%),
    var(--paper);
  box-shadow: var(--shadow);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 18px 34px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.06em;
}

.brand-copy {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.masthead-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.data-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 12px;
}

.data-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky);
  content: "";
  box-shadow: 0 0 0 4px rgba(116, 183, 202, 0.14);
}

.data-status[data-state="cached"]::before {
  background: #c18a39;
}

.data-status[data-state="error"]::before {
  background: var(--heat);
}

.refresh-button {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.refresh-button:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.refresh-button i {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.refresh-button[aria-busy="true"] i {
  animation: spin 900ms linear infinite;
}

.location-heading {
  padding: 66px 8% 36px;
}

.eyebrow,
.section-index {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 92px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.94;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0;
  font-family: var(--display);
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.location-suffix {
  white-space: nowrap;
}

.offline-notice,
.error-message {
  width: fit-content;
  margin: 18px 0 0;
  padding: 10px 14px;
  border-left: 3px solid #c18a39;
  background: rgba(193, 138, 57, 0.08);
  color: #765321;
  font-size: 13px;
}

.error-message {
  border-color: var(--heat);
  color: #983e22;
}

.current-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr 1fr auto;
  gap: 30px;
  align-items: center;
  min-height: 310px;
  padding: 46px 8%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.46), transparent 55%),
    rgba(232, 224, 207, 0.42);
}

.temperature-lockup {
  display: flex;
  gap: 22px;
  align-items: flex-end;
}

.current-temperature {
  font-family: var(--display);
  font-size: clamp(92px, 14vw, 168px);
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.75;
}

.current-condition {
  padding-bottom: 8px;
  color: var(--heat);
  font-family: var(--display);
  font-size: 28px;
}

.current-details {
  margin: 27px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.weather-mark {
  position: relative;
  width: 220px;
  height: 220px;
  margin: auto;
}

.weather-orbit,
.weather-core,
.weather-cloud,
.weather-rain {
  position: absolute;
  display: block;
}

.weather-orbit {
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.orbit-one {
  animation: orbit 18s linear infinite;
  clip-path: polygon(0 0, 56% 0, 56% 100%, 0 100%);
}

.orbit-two {
  inset: 18px;
  border-style: dashed;
  opacity: 0.55;
  animation: orbit 25s linear reverse infinite;
}

.weather-core {
  top: 64px;
  left: 64px;
  width: 92px;
  height: 92px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--heat);
  box-shadow: inset 0 0 0 15px var(--paper);
  transition: background 300ms ease, transform 300ms ease;
}

.weather-cloud {
  right: 38px;
  bottom: 57px;
  width: 90px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: 30px;
  background: var(--paper);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.weather-cloud::before,
.weather-cloud::after {
  position: absolute;
  bottom: 17px;
  border: 1px solid var(--ink);
  border-bottom: 0;
  border-radius: 50px 50px 0 0;
  background: var(--paper);
  content: "";
}

.weather-cloud::before {
  left: 15px;
  width: 36px;
  height: 30px;
}

.weather-cloud::after {
  right: 13px;
  width: 29px;
  height: 22px;
}

.weather-rain {
  right: 54px;
  bottom: 31px;
  width: 57px;
  height: 19px;
  opacity: 0;
  background: repeating-linear-gradient(110deg, transparent 0 8px, var(--rain) 9px 11px);
  transition: opacity 300ms ease;
}

.weather-mark[data-condition="partly-cloudy"] .weather-cloud,
.weather-mark[data-condition="cloudy"] .weather-cloud,
.weather-mark[data-condition="fog"] .weather-cloud,
.weather-mark[data-condition="rain"] .weather-cloud,
.weather-mark[data-condition="snow"] .weather-cloud,
.weather-mark[data-condition="storm"] .weather-cloud {
  opacity: 1;
  transform: translateY(0);
}

.weather-mark[data-condition="cloudy"] .weather-core,
.weather-mark[data-condition="fog"] .weather-core {
  background: var(--sky);
  transform: translate(-18px, -10px);
}

.weather-mark[data-condition="rain"] .weather-rain,
.weather-mark[data-condition="storm"] .weather-rain {
  opacity: 1;
}

.model-note {
  align-self: end;
  margin: 0;
  padding-left: 15px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0 8%;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 26px 28px;
  border-right: 1px solid var(--line);
}

.summary-item:first-child {
  padding-left: 0;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-label {
  color: var(--ink-soft);
  font-size: 11px;
}

.summary-value,
.summary-item strong {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 400;
}

.chart-panel {
  padding: 64px 8%;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.chart-range {
  margin: 0;
  color: var(--heat);
  font-family: var(--display);
  font-size: 21px;
}

.temperature-chart {
  min-height: 240px;
  padding: 18px 20px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(rgba(21, 51, 73, 0.04) 1px, transparent 1px);
  background-size: 100% 40px;
}

.temperature-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.temperature-line {
  fill: none;
  stroke: var(--heat);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  stroke-dasharray: 1100;
  animation: draw-line 1.2s ease both;
}

.chart-guide {
  stroke: var(--line);
  stroke-dasharray: 3 6;
}

.chart-label {
  fill: var(--ink-soft);
  font-family: var(--body);
  font-size: 10px;
}

.scroll-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.hourly-detail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 34px 0 18px;
}

.hourly-detail-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
}

.hour-list {
  display: grid;
  grid-auto-columns: 174px;
  grid-auto-flow: column;
  gap: 12px;
  margin: 0 -3px;
  padding: 3px 3px 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--line-strong) transparent;
  list-style: none;
}

.hour-card {
  position: relative;
  display: flex;
  min-height: 342px;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.35);
  scroll-snap-align: start;
}

.hour-card:first-child {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.hour-time {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
}

.hour-day {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hour-condition {
  min-height: 40px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 16px;
}

.hour-card:first-child .hour-day,
.hour-card:first-child .hour-condition,
.hour-card:first-child .hour-feels,
.hour-card:first-child .hour-metric dt {
  color: rgba(243, 239, 228, 0.68);
}

.hour-temperature {
  margin-top: 16px;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.06em;
}

.hour-feels {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.hour-rain {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: center;
  margin-top: 18px;
}

.hour-rain-bar {
  position: relative;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.hour-rain-bar::after {
  display: block;
  width: var(--rain-width);
  height: 100%;
  border-radius: inherit;
  background: var(--rain);
  content: "";
}

.hour-rain-value {
  font-size: 10px;
}

.hour-metrics {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.hour-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.hour-metric dt,
.hour-metric dd {
  margin: 0;
  font-size: 9px;
}

.hour-metric dt {
  color: var(--ink-soft);
}

.hour-metric dd {
  font-weight: 700;
  white-space: nowrap;
}

.hour-card-skeleton {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.18));
  background-size: 200% 100%;
  animation: skeleton 1.5s linear infinite;
}

.footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 8%;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.footer p {
  margin-bottom: 0;
}

.footer a {
  text-underline-offset: 3px;
}

.privacy-note {
  letter-spacing: 0.08em;
}

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

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

@keyframes draw-line {
  from { stroke-dashoffset: 1100; }
  to { stroke-dashoffset: 0; }
}

@keyframes skeleton {
  to { background-position: -200% 0; }
}

@media (max-width: 760px) {
  .page-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .masthead {
    min-height: 75px;
    padding: 14px 20px;
  }

  .brand-copy,
  .data-status {
    display: none;
  }

  .location-heading {
    padding: 48px 22px 28px;
  }

  h1 {
    font-size: clamp(44px, 14vw, 67px);
  }

  .current-panel {
    grid-template-columns: 1fr 108px;
    min-height: 265px;
    padding: 38px 22px;
  }

  .temperature-lockup {
    display: block;
  }

  .current-temperature {
    font-size: clamp(90px, 31vw, 130px);
  }

  .current-condition {
    display: block;
    margin-top: 20px;
    font-size: 22px;
  }

  .current-details {
    max-width: 210px;
    line-height: 1.75;
    word-break: keep-all;
  }

  .weather-mark {
    width: 108px;
    height: 108px;
  }

  .orbit-two {
    inset: 10px;
  }

  .weather-core {
    top: 32px;
    left: 32px;
    width: 44px;
    height: 44px;
    box-shadow: inset 0 0 0 7px var(--paper);
  }

  .weather-cloud {
    right: 15px;
    bottom: 26px;
    width: 54px;
    height: 20px;
  }

  .weather-cloud::before {
    left: 9px;
    bottom: 11px;
    width: 23px;
    height: 19px;
  }

  .weather-cloud::after {
    right: 8px;
    bottom: 11px;
    width: 19px;
    height: 14px;
  }

  .weather-rain {
    right: 21px;
    bottom: 10px;
    width: 41px;
    height: 15px;
  }

  .model-note {
    display: none;
  }

  .summary-list {
    padding: 0 22px;
    overflow-x: auto;
  }

  .summary-item {
    min-width: 150px;
    padding: 21px 18px;
  }

  .summary-item:first-child {
    padding-left: 0;
  }

  .chart-panel {
    padding: 48px 22px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .temperature-chart {
    min-height: 190px;
    padding: 8px 5px 0;
  }

  .hour-list {
    margin-right: -22px;
    padding-right: 22px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 30px 22px calc(30px + env(safe-area-inset-bottom));
  }
}

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