:root {
  color-scheme: light;
  --bg: #eef6fb;
  --surface: #ffffff;
  --ink: #132534;
  --muted: #607789;
  --line: #d8e7ef;
  --brand: #1284a6;
  --brand-dark: #07546f;
  --sky: #5db7de;
  --sun: #f7b733;
  --rain: #367dc2;
  --shadow: 0 22px 58px rgba(28, 73, 105, 0.16);
  font-family:
    Barlow, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(247, 183, 51, 0.18), transparent 24rem),
    linear-gradient(180deg, #e6f5fb 0%, var(--bg) 36%, #f7fbfd 100%);
  color: var(--ink);
}

.hero {
  min-height: 54vh;
  display: grid;
  align-content: space-between;
  padding: 24px clamp(18px, 5vw, 72px) 56px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(5, 31, 48, 0.88), rgba(11, 91, 121, 0.52)),
    url("https://images.unsplash.com/photo-1530025809667-1f4bcff8e60f?auto=format&fit=crop&w=1800&q=80")
      center / cover;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar strong {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.refresh-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

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

.refresh-button:disabled {
  cursor: progress;
  opacity: 0.68;
  transform: none;
}

.hero-content {
  width: min(720px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfeeff;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: clamp(2.6rem, 7vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-content p:last-child {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.6;
}

.subscribe-band {
  background: linear-gradient(135deg, #051f30 0%, #0b5b79 100%);
  padding: 48px clamp(18px, 5vw, 72px);
}

.subscribe-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.subscribe-text {
  flex: 1 1 300px;
  color: #fff;
}

.subscribe-text h2 {
  margin: 0 0 10px;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.subscribe-text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 440px;
}

.subscribe-form {
  flex: 1 1 340px;
}

.subscribe-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subscribe-row input[type="email"] {
  flex: 1 1 220px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.subscribe-row input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.subscribe-row input[type="email"]:focus {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.15);
}

.subscribe-row button {
  min-height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 6px;
  background: var(--sun);
  color: #051f30;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.subscribe-row button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.subscribe-row button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.subscribe-msg {
  margin: 10px 0 0;
  font-size: 0.88rem;
  min-height: 1.2em;
  color: rgba(255, 255, 255, 0.85);
}

.subscribe-msg.error {
  color: #ff8a80;
}

.subscribe-msg.ok {
  color: #a5f3c8;
}

.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;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 48px;
  perspective: 1200px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
}

.status-row span:first-child {
  color: var(--ink);
  font-weight: 700;
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.weather-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(230, 245, 253, 0.9)),
    var(--surface);
  box-shadow:
    0 22px 34px rgba(31, 85, 122, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: rotateX(0deg) rotateY(0deg) translateY(0);
  transform-style: preserve-3d;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.weather-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 32%),
    radial-gradient(circle at 86% 10%, rgba(247, 183, 51, 0.22), transparent 7rem);
  pointer-events: none;
}

.weather-card:hover {
  box-shadow:
    0 30px 42px rgba(31, 85, 122, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: rotateX(2deg) rotateY(-2deg) translateY(-5px);
}

.weather-card > * {
  position: relative;
  z-index: 1;
}

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.state-name {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.25;
}

.capital {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.badge {
  min-width: 44px;
  padding: 7px 9px;
  border-radius: 999px;
  background: #dff3fb;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(7, 84, 111, 0.12);
}

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

.temperature strong {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 3.5rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--brand-dark);
  text-shadow: 0 8px 18px rgba(54, 125, 194, 0.18);
}

.condition {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.summary {
  margin: 0;
  color: #31485a;
  line-height: 1.5;
}

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

.metrics div {
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(216, 231, 239, 0.8);
}

.metrics dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.metrics dd {
  margin: 0;
  font-weight: 800;
}

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.4s infinite;
}

.placeholder {
  height: 14px;
  border-radius: 999px;
  background: #e6eeea;
}

.placeholder.title {
  width: 70%;
  height: 22px;
}

.placeholder.temp {
  width: 46%;
  height: 56px;
}

.placeholder.text {
  width: 100%;
}

.placeholder.short {
  width: 64%;
}

.error {
  border-color: #f0b7a9;
  background: #fff8f6;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 58vh;
    padding: 18px 16px 42px;
  }

  .topbar {
    align-items: flex-start;
  }

  .refresh-button {
    padding: 0 14px;
  }

  h1 {
    font-size: clamp(2.4rem, 16vw, 4.6rem);
  }

  main {
    width: min(100% - 24px, 1180px);
  }

  .status-row {
    display: grid;
  }
}
