:root {
  color-scheme: light;
  --ink: #1c2833;
  --muted: #5f6b73;
  --card: rgba(255, 255, 255, 0.78);
  --card-strong: rgba(255, 255, 255, 0.94);
  --accent: #f08a5d;
  --accent-soft: rgba(240, 138, 93, 0.25);
  --accent-ink: #4f2c1d;
  --stroke: rgba(28, 40, 51, 0.12);
  --shadow: rgba(20, 32, 44, 0.2);
  --shadow-strong: rgba(20, 32, 44, 0.32);
  --radius: 22px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: "Spline Sans", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f3efe7, #f8f4ee);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.7;
}

body::before {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(79, 124, 172, 0.35), transparent 60%);
  top: -120px;
  right: -140px;
}

body::after {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(245, 185, 113, 0.45), transparent 65%);
  bottom: -160px;
  left: -120px;
}

body[data-theme="clear"] {
  --accent: #f5b971;
  --accent-soft: rgba(245, 185, 113, 0.26);
  --accent-ink: #5b3a1e;
}

body[data-theme="cloudy"] {
  --accent: #5f7f99;
  --accent-soft: rgba(95, 127, 153, 0.22);
  --accent-ink: #283642;
}

body[data-theme="rain"] {
  --accent: #4f7cac;
  --accent-soft: rgba(79, 124, 172, 0.23);
  --accent-ink: #23364d;
}

body[data-theme="snow"] {
  --accent: #7ca4c2;
  --accent-soft: rgba(124, 164, 194, 0.26);
  --accent-ink: #2a3b48;
}

body[data-theme="storm"] {
  --accent: #5a6675;
  --accent-soft: rgba(90, 102, 117, 0.25);
  --accent-ink: #2a2f36;
}

body[data-theme="fog"] {
  --accent: #8b9a9f;
  --accent-soft: rgba(139, 154, 159, 0.24);
  --accent-ink: #2d3639;
}

.app {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  position: relative;
  z-index: 1;
}

.panel {
  border-radius: var(--radius);
  padding: 28px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 45px var(--shadow);
  backdrop-filter: blur(12px);
}

.panel {
  background: var(--card-strong);
  animation: floatIn 0.8s ease both;
}

.panel__eyebrow {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.panel__title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.8rem;
  margin-top: 6px;
}

.search {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.search__label {
  font-weight: 600;
  color: var(--ink);
}

.search__controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search__input {
  border-radius: 16px;
  border: 1px solid var(--stroke);
  padding: 14px 16px;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px var(--accent-soft);
}

.btn--primary:hover {
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--stroke);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.95rem;
}

.status[data-state="loading"] {
  background: rgba(79, 124, 172, 0.12);
  color: #365271;
  border-color: rgba(79, 124, 172, 0.3);
}

.status[data-state="error"] {
  background: rgba(230, 92, 78, 0.12);
  color: #9b2c20;
  border-color: rgba(230, 92, 78, 0.3);
}

.status[data-state="ready"] {
  color: var(--ink);
}

.weather {
  margin-top: 22px;
  padding: 20px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--stroke);
  box-shadow: 0 18px 45px var(--shadow-strong);
  animation: fadeUp 0.6s ease;
}

.weather__overview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.weather__icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  box-shadow: 0 12px 24px var(--accent-soft);
}

.weather__icon svg {
  width: 44px;
  height: 44px;
}

.weather__temp {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.temp__value {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(2.4rem, 1.5rem + 2vw, 3.2rem);
}

.temp__unit {
  font-size: 1.3rem;
  color: var(--muted);
}

.weather__meta {
  grid-column: 2 / 3;
}

.weather__summary {
  font-weight: 600;
  font-size: 1.05rem;
}

.weather__location {
  color: var(--muted);
  margin-top: 4px;
}

.weather__grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248, 248, 248, 0.9);
  border: 1px solid var(--stroke);
  display: grid;
  gap: 6px;
}

.metric__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric__value {
  font-weight: 600;
  font-size: 1.05rem;
}

@media (max-width: 900px) {
  body {
    padding: 24px;
  }

  .panel {
    padding: 22px;
  }

  .weather__overview {
    grid-template-columns: 1fr;
    text-align: left;
  }

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

@media (max-width: 600px) {
  body {
    padding: 18px;
  }

  .search__controls {
    grid-template-columns: 1fr;
  }

  .weather__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}