:root {
  --bg: #fffaf0;
  --ink: #070807;
  --muted: rgba(7, 8, 7, 0.62);
  --line: rgba(7, 8, 7, 0.14);
  --surface: rgba(255, 250, 240, 0.92);
  --surface-solid: #fffaf0;
  --signal: #f05a36;
  --signal-2: #ffe777;
  --night: #10171b;
  --night-ink: #f9f4ea;
  --radius-xl: 34px;
  --radius-lg: 24px;
  --shadow-soft: 0 30px 90px rgba(14, 16, 18, 0.16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #151515;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #fff7e8 0, #eae2d5 56%, #ddd3c7 100%);
  overflow-x: hidden;
}

button { font: inherit; }

.app-shell {
  position: relative;
  width: min(100vw, 480px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow-soft);
  isolation: isolate;
  transition: background-color 700ms var(--ease), color 700ms var(--ease);
}

.sky-plate {
  position: absolute;
  inset: 0;
  height: 58vh;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--signal) 93%, white), color-mix(in srgb, var(--signal-2) 30%, var(--signal)) 72%);
  transition: background 900ms var(--ease), height 900ms var(--ease);
  z-index: -2;
}

.sky-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02), rgba(255, 250, 240, 0.88) 96%),
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.18), transparent 34%);
}

.orb {
  position: absolute;
  border-radius: 999px;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.orb-main {
  width: 395px;
  height: 395px;
  right: -172px;
  top: 142px;
  background: var(--signal-2);
  opacity: 0.9;
  animation: orbDrift 13s var(--ease) infinite alternate;
}

.orb-shadow {
  width: 160px;
  height: 160px;
  left: -84px;
  top: 48px;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(1px);
  animation: orbDriftSmall 10s var(--ease) infinite alternate;
}

@keyframes orbDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-16px, 12px, 0) scale(1.035); }
}

@keyframes orbDriftSmall {
  from { transform: translate3d(0, 0, 0); opacity: 0.16; }
  to { transform: translate3d(20px, 10px, 0); opacity: 0.28; }
}

.topbar {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  gap: 14px;
  align-items: center;
  padding: calc(20px + var(--safe-top)) 24px 10px;
}

.icon-button, .bell-button, .place-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button, .bell-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: transform 350ms var(--ease), background 350ms var(--ease);
}

.icon-button:active, .bell-button:active, .place-button:active { transform: scale(0.96); }
.icon-button:hover, .bell-button:hover { background: rgba(255, 255, 255, 0.25); }

.icon-button span {
  display: block;
  width: 26px;
  height: 2px;
  background: currentColor;
  margin: 3px 0;
  transition: transform 500ms var(--ease);
}

.icon-button.is-loading span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.icon-button.is-loading span:nth-child(2) { transform: scaleX(0); }
.icon-button.is-loading span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.place-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 18px;
  font-weight: 780;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.chevron { font-size: 22px; line-height: 1; transform: translateY(-2px); }
.timestamp {
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: .04em;
}

.bell-button svg { width: 26px; height: 26px; fill: currentColor; }
.bell-button { position: relative; }
.bell-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  top: 12px;
  right: 11px;
  border-radius: 999px;
  background: currentColor;
  transform: scale(0);
  transition: transform 450ms var(--ease), background 450ms var(--ease);
}
.bell-button.is-active .bell-dot { transform: scale(1); }

main { padding-bottom: calc(24px + var(--safe-bottom)); }

.hero {
  min-height: 390px;
  padding: 60px 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.temperature-wrap {
  transform: translateY(6px);
  opacity: 0;
  animation: riseIn 850ms var(--ease) 120ms forwards;
}

.temperature {
  font-size: clamp(132px, 38vw, 186px);
  line-height: .82;
  letter-spacing: -.10em;
  font-weight: 230;
  font-variant-numeric: tabular-nums;
}

.condition {
  margin-top: 34px;
  font-size: 27px;
  font-weight: 790;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.felt {
  margin-top: 8px;
  font-size: 21px;
  color: var(--ink);
}

.risk-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding: 15px 22px;
  min-height: 56px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.88);
  color: color-mix(in srgb, var(--signal) 88%, black);
  font-weight: 820;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.10);
  transform: translateY(10px);
  opacity: 0;
  animation: riseIn 850ms var(--ease) 260ms forwards;
}

.pill-mark {
  width: 8px;
  height: 28px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 12px 0 0 color-mix(in srgb, currentColor 45%, transparent);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 24px 26px;
}

.metric-card {
  min-height: 96px;
  padding: 10px 0;
  opacity: 0;
  transform: translateY(14px);
  animation: riseIn 750ms var(--ease) forwards;
}
.metric-card:nth-child(1) { animation-delay: 320ms; }
.metric-card:nth-child(2) { animation-delay: 400ms; }
.metric-card:nth-child(3) { animation-delay: 480ms; }

.metric-card h2,
.night-panel h2,
.hourly-panel h2,
.alert-panel h2,
.source-panel h2 {
  margin: 0 0 7px;
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: .09em;
  font-weight: 820;
}

.metric-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.metric-card span {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.metric-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  position: relative;
}

.metric-icon.wind::before,
.metric-icon.wind::after {
  content: "";
  position: absolute;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
}
.metric-icon.wind::before { top: 7px; width: 25px; }
.metric-icon.wind::after { top: 16px; width: 17px; }
.metric-icon.drop {
  border: 3px solid var(--ink);
  border-radius: 17px 17px 17px 4px;
  transform: rotate(-45deg) scale(.75);
}
.metric-icon.gauge {
  border: 3px solid var(--ink);
  border-radius: 999px;
}
.metric-icon.gauge::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 3px;
  top: 11px;
  left: 10px;
  transform-origin: 1px 50%;
  transform: rotate(-38deg);
  background: var(--ink);
  border-radius: 999px;
}

.night-panel,
.hourly-panel,
.alert-panel,
.source-panel {
  margin: 0;
  padding: 28px 24px;
  transform: translateY(24px);
  opacity: 0;
  animation: riseIn 850ms var(--ease) forwards;
}

.night-panel {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 20px;
  align-items: center;
  min-height: 224px;
  background: radial-gradient(circle at 78% 0%, rgba(255, 255, 255, 0.08), transparent 32%), var(--night);
  color: var(--night-ink);
  border-radius: 30px 30px 0 0;
  animation-delay: 520ms;
}

.night-panel p {
  margin: 22px 0 24px;
  font-size: 31px;
  line-height: 1.18;
  letter-spacing: -.035em;
  font-weight: 330;
}

.night-details {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(249, 244, 234, 0.88);
  font-size: 17px;
}

.moon-glyph {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--signal-2);
  box-shadow: inset -10px 0 0 rgba(16, 23, 27, .98);
}

.night-min {
  border-left: 1px solid rgba(249, 244, 234, 0.26);
  padding-left: 26px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.night-min strong {
  font-size: 76px;
  line-height: .82;
  font-weight: 240;
  letter-spacing: -.08em;
  font-variant-numeric: tabular-nums;
}
.night-min span {
  margin-top: 16px;
  color: rgba(249, 244, 234, 0.76);
  font-weight: 760;
  letter-spacing: .08em;
}

.hourly-panel,
.source-panel {
  background: rgba(255, 250, 240, .96);
}
.hourly-panel {
  border-radius: 30px 30px 0 0;
  margin-top: -24px;
  animation-delay: 620ms;
}
.hourly-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, 1fr);
  gap: 10px;
  overflow-x: auto;
  margin: 24px -8px -8px;
  padding: 0 8px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.hourly-strip::-webkit-scrollbar { display: none; }

.hour-card {
  scroll-snap-align: start;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 68px;
  padding: 8px 2px;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  animation: riseIn 650ms var(--ease) forwards;
}
.hour-card time {
  font-size: 17px;
  font-weight: 660;
}
.weather-glyph {
  position: relative;
  width: 32px;
  height: 32px;
  display: block;
}
.weather-glyph.sun {
  border: 3px solid var(--ink);
  border-radius: 999px;
}
.weather-glyph.sun::before {
  content: "";
  position: absolute;
  inset: -10px;
  background: repeating-conic-gradient(from 0deg, var(--ink) 0 5deg, transparent 5deg 22deg);
  mask: radial-gradient(circle, transparent 0 58%, #000 61% 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 61% 100%);
}
.weather-glyph.moon {
  border-radius: 999px;
  background: var(--ink);
  box-shadow: inset -10px 0 0 var(--surface-solid);
}
.weather-glyph.rain::before,
.weather-glyph.rain::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 3px;
  height: 23px;
  border-radius: 999px;
  background: var(--ink);
  transform: rotate(14deg);
}
.weather-glyph.rain::before { left: 9px; }
.weather-glyph.rain::after { right: 9px; box-shadow: -8px 6px 0 var(--ink); }
.weather-glyph.cloud::before,
.weather-glyph.cloud::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.weather-glyph.cloud::before {
  width: 31px;
  height: 14px;
  border-radius: 999px;
  left: 1px;
  top: 15px;
}
.weather-glyph.cloud::after {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  left: 7px;
  top: 6px;
  box-shadow: 11px 6px 0 -2px var(--ink);
}
.weather-glyph.storm {
  clip-path: polygon(47% 0, 90% 0, 62% 42%, 100% 42%, 32% 100%, 49% 55%, 15% 55%);
  background: var(--ink);
}
.hour-card strong {
  font-size: 26px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.hour-card small {
  color: var(--muted);
  font-size: 12px;
}

.alert-panel {
  display: grid;
  grid-template-columns: 54px 1fr 20px;
  align-items: center;
  gap: 12px;
  min-height: 116px;
  margin: 0;
  background: linear-gradient(135deg, #df241c, #f05a36);
  color: white;
  animation-delay: 720ms;
}
.alert-panel p { margin: 0; font-size: 16px; line-height: 1.35; }
.alert-symbol {
  width: 46px;
  height: 46px;
  border: 3px solid currentColor;
  clip-path: polygon(50% 0, 100% 90%, 0 90%);
}
.arrow { font-size: 42px; line-height: 1; transform: translateY(-2px); }

.source-panel {
  border-radius: 28px 28px 0 0;
  margin-top: -18px;
  animation-delay: 820ms;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.source-grid article {
  border-right: 1px solid var(--line);
  min-height: 98px;
  padding-right: 8px;
}
.source-grid article:last-child { border-right: 0; }
.source-grid strong,
.source-grid small { display: block; }
.source-grid strong { margin-top: 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }
.source-grid small { margin-top: 5px; color: var(--muted); line-height: 1.25; }
.source-icon {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
}
.source-icon.target { border: 3px solid var(--ink); border-radius: 999px; }
.source-icon.target::after { content: ""; position: absolute; inset: 7px; border: 3px solid var(--ink); border-radius: 999px; }
.source-icon.stack::before,
.source-icon.stack::after {
  content: "";
  position: absolute;
  left: 3px;
  width: 22px;
  height: 14px;
  border: 3px solid var(--ink);
  transform: rotate(45deg) skew(-10deg, -10deg);
}
.source-icon.stack::before { top: 0; }
.source-icon.stack::after { top: 10px; }
.source-icon.shield {
  background: var(--ink);
  clip-path: polygon(50% 0, 90% 14%, 90% 56%, 50% 100%, 10% 56%, 10% 14%);
}
.data-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(18px, var(--safe-bottom));
  width: min(430px, calc(100vw - 32px));
  transform: translate3d(-50%, 26px, 0);
  opacity: 0;
  pointer-events: none;
  padding: 15px 18px;
  border-radius: 999px;
  background: rgba(7, 8, 7, .92);
  color: #fffaf0;
  text-align: center;
  font-weight: 650;
  transition: transform 550ms var(--ease), opacity 550ms var(--ease);
}
.toast.is-visible { transform: translate3d(-50%, 0, 0); opacity: 1; }

@keyframes riseIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

[data-weather="night"] {
  --bg: #12191d;
  --ink: #f6efe3;
  --muted: rgba(246, 239, 227, 0.68);
  --surface-solid: #12191d;
  --line: rgba(246, 239, 227, 0.18);
  --signal: #1c2730;
  --signal-2: #ffe26b;
}
[data-weather="rain"] {
  --signal: #4775a6;
  --signal-2: #d9ecff;
}
[data-weather="cloud"] {
  --signal: #9ca6aa;
  --signal-2: #f0ede4;
}
[data-weather="storm"] {
  --signal: #26212f;
  --signal-2: #ffe46a;
}
[data-weather="heat"] {
  --signal: #ee4426;
  --signal-2: #ffe06b;
}

@media (min-width: 640px) {
  body { padding: 18px 0; }
  .app-shell { min-height: calc(100vh - 36px); border-radius: 38px; }
}

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