:root {
  color-scheme: dark;
  --bg: #08111f;
  --surface: #101c2c;
  --surface-2: #152338;
  --text: #f7f9fc;
  --muted: #9cacbf;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #73b9ff;
  --accent-deep: #147ce5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.015em;
}
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 82% 2%, rgba(20, 124, 229, 0.24), transparent 32rem),
    radial-gradient(circle at 8% 40%, rgba(73, 179, 213, 0.12), transparent 28rem);
  pointer-events: none;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; }
.brand-mark { color: var(--accent); font-size: 25px; transform: rotate(-20deg); }
.units { color: var(--muted); font-size: 13px; }

.hero { padding: 72px 0 48px; max-width: 780px; }
.eyebrow, .label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1 { margin: 0 0 32px; font-size: clamp(44px, 8vw, 78px); line-height: 0.98; letter-spacing: -0.055em; }
.search {
  width: min(680px, 100%);
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 7px 7px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 35, 56, 0.82);
  box-shadow: 0 18px 45px rgba(0,0,0,0.22);
  backdrop-filter: blur(18px);
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-icon { color: var(--muted); font-size: 24px; }
.search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 17px; }
.search input::placeholder { color: #8291a4; }
.search button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--accent-deep);
  color: white;
  font-weight: 650;
}
.search button:hover { background: #248bf2; }
.search button:active { transform: scale(0.98); }
.search button:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.status {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}
.status.error { color: #ffb4ad; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.status.error .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.weather { display: grid; gap: 72px; animation: reveal .35s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.current-card {
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 28, 44, 0.80);
  box-shadow: 3px 5px 30px rgba(0,0,0,0.22);
  backdrop-filter: blur(18px);
}
.location-row, .section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
h2 { margin: 0; font-size: clamp(26px, 4vw, 40px); line-height: 1.08; letter-spacing: -0.035em; }
.updated, .section-heading > p { margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.current-main { display: flex; align-items: flex-end; gap: clamp(24px, 5vw, 72px); padding: 54px 0; }
.temperature-wrap { display: flex; align-items: center; line-height: .75; }
.weather-icon { margin-right: 22px; color: var(--accent); font-size: clamp(58px, 10vw, 100px); filter: drop-shadow(0 8px 20px rgba(115,185,255,.2)); }
.temperature { font-size: clamp(88px, 17vw, 168px); font-weight: 600; letter-spacing: -0.09em; }
.degree { align-self: flex-start; margin: 2px 0 0 8px; color: var(--accent); font-size: clamp(38px, 7vw, 64px); }
.condition-wrap { padding-bottom: 8px; }
.condition { margin: 0 0 7px; font-size: clamp(22px, 4vw, 34px); font-weight: 650; }
.range { margin: 0; color: var(--muted); font-size: 16px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.metric { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; padding: 25px 26px 0; }
.metric:first-child { padding-left: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-icon { grid-row: 1 / 3; align-self: center; color: var(--accent); font-size: 28px; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 19px; }

.forecast-section { padding-bottom: 24px; }
.section-heading { margin-bottom: 22px; }
.forecast-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; padding: 2px 2px 18px; scrollbar-color: var(--surface-2) transparent; }
.forecast-day { min-width: 110px; padding: 21px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; }
.forecast-day.today { background: var(--surface-2); border-color: rgba(115,185,255,.45); }
.day-name { margin: 0; font-size: 14px; font-weight: 700; }
.day-date { margin: 4px 0 18px; color: var(--muted); font-size: 12px; }
.day-icon { display: block; min-height: 43px; color: var(--accent); font-size: 32px; }
.day-condition { min-height: 34px; margin: 12px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.day-temps { margin: 0; font-size: 15px; font-weight: 700; }
.day-temps span { color: var(--muted); font-weight: 500; }
footer { padding: 42px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
footer a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1120px); }
  .hero { padding: 52px 0 36px; }
  .current-main { align-items: flex-start; flex-direction: column; padding: 44px 0; }
  .metrics { grid-template-columns: 1fr; }
  .metric { padding: 18px 0; }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }
  .updated { display: none; }
}
@media (max-width: 440px) {
  .search { border-radius: 12px; padding-left: 14px; }
  .search button { padding: 0 15px; }
  .weather-icon { margin-right: 12px; }
  .temperature { font-size: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
