:root {
  --bg: #f8f5fb;
  --bg2: #eaf7fb;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(255, 255, 255, 0.7);
  --line-strong: rgba(142, 168, 206, 0.42);
  --text: #172033;
  --sub: #657387;
  --muted: #8b98aa;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --fresh: #0f9f83;
  --warm: #f59e0b;
  --aurora-pink: rgba(255, 151, 213, 0.28);
  --aurora-lilac: rgba(193, 166, 255, 0.22);
  --aurora-cyan: rgba(123, 218, 232, 0.2);
  --glass-edge: rgba(255, 255, 255, 0.86);
  --shadow: 0 22px 54px rgba(80, 91, 120, 0.16);
  --scroll-progress: 0;
  --scroll-shift-y: 0px;
  --noise-x: 0px;
  --noise-y: 0px;
  --pointer-x: 0;
  --pointer-y: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    linear-gradient(115deg, rgba(255, 173, 221, 0.18), transparent 28%, rgba(128, 213, 231, 0.16) 62%, transparent 88%),
    linear-gradient(235deg, rgba(198, 176, 255, 0.2), transparent 36%, rgba(255, 220, 235, 0.16) 74%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -18vh -14vw;
  pointer-events: none;
  z-index: -2;
  filter: blur(32px);
  opacity: 0.78;
}

body::before {
  background:
    linear-gradient(105deg, transparent 10%, var(--aurora-pink) 30%, var(--aurora-lilac) 48%, transparent 72%),
    linear-gradient(16deg, transparent 16%, var(--aurora-cyan) 52%, transparent 82%);
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

body::after {
  background:
    linear-gradient(76deg, transparent 18%, rgba(255, 236, 249, 0.5) 36%, rgba(175, 218, 255, 0.2) 58%, transparent 82%),
    linear-gradient(148deg, transparent 22%, rgba(255, 177, 225, 0.2) 45%, transparent 72%);
  opacity: 0.58;
  animation: auroraDrift 24s ease-in-out infinite alternate-reverse;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(115deg, rgba(255,255,255,0.26), transparent 32%, rgba(255,255,255,0.12) 66%, transparent),
    radial-gradient(rgba(23, 32, 51, 0.06) 0.6px, transparent 0.6px);
  background-size: 18px 18px;
  opacity: 0.34;
  transform: translate3d(var(--noise-x), calc(var(--noise-y) + var(--scroll-shift-y)), 0);
  transition: transform 0.24s ease-out;
  will-change: transform;
}

.container {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 28px 24px 56px;
  display: grid;
  gap: 18px;
}

.flow-section {
  position: relative;
  display: grid;
  gap: 16px;
}

.overview-panel {
  padding-top: 0;
}

.glass {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.34)),
    linear-gradient(320deg, rgba(255, 173, 221, 0.16), transparent 38%, rgba(136, 211, 232, 0.13));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(105, 135, 180, 0.12),
    var(--shadow);
  backdrop-filter: blur(24px) saturate(175%) contrast(104%);
  -webkit-backdrop-filter: blur(24px) saturate(175%) contrast(104%);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.glass::before,
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.glass::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.78), transparent 28%, rgba(255, 179, 225, 0.14) 48%, transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.28), transparent 42%);
  opacity: 0.66;
}

.glass::after {
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.22) 18%, transparent 36%),
    linear-gradient(270deg, rgba(255, 161, 218, 0.12), transparent 38%, rgba(105, 189, 225, 0.12));
  opacity: 0.72;
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(105, 135, 180, 0.14),
    0 28px 64px rgba(80, 91, 120, 0.18);
  transform: translateY(-2px);
}

.panel-fill {
  display: flex;
  flex-direction: column;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  color: #0f172a;
}

h2 {
  margin-bottom: 44px;
  font-size: 28px;
  color: #162033;
}

h3 {
  margin-bottom: 20px;
  font-size: 21px;
  color: #1f2a3d;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--fresh);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-heading h3 {
  margin-bottom: 0;
}

.mono {
  color: #3b4a60;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  gap: 16px;
}

.weather-main {
  min-height: 250px;
  position: relative;
  overflow: hidden;
}

.weather-main::after {
  content: "";
  position: absolute;
  inset: auto 24px 24px auto;
  width: 140px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 159, 131, 0.55), rgba(255, 154, 218, 0.7), rgba(37, 99, 235, 0.5));
  filter: blur(0.2px);
  opacity: 0.48;
}

.temp-big {
  font-size: clamp(76px, 10vw, 118px);
  font-weight: 250;
  line-height: 0.9;
  letter-spacing: 0;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease, filter 0.2s ease;
}

.unit {
  margin-left: 6px;
  font-size: 28px;
  color: var(--sub);
  vertical-align: super;
}

.secondary {
  margin: 34px 0 0;
  color: var(--sub);
  font-size: 16px;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 14px;
}

.matrix label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.matrix strong {
  color: #1f2937;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.25;
  white-space: nowrap;
  word-break: keep-all;
}

.matrix > div {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: #f7fbff;
  border: 1px solid #e3edf6;
}

#metricWindSpeed {
  display: block;
  max-width: 100%;
  font-size: clamp(11px, 1.14vw, 18px);
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: clip;
}

.city-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

select,
button {
  min-height: 38px;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 6px 16px rgba(80, 91, 120, 0.1);
  outline: none;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

select:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 6px 16px rgba(31, 47, 70, 0.08);
}

select {
  min-width: 132px;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255, 231, 246, 0.9), rgba(229, 239, 255, 0.9));
  border-color: rgba(255, 255, 255, 0.82);
  color: #2450ad;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 215, 239, 0.94), rgba(217, 232, 255, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(190, 109, 175, 0.16);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  color: var(--muted);
  background: #edf2f7;
}

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

.city-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 6px;
  padding: 2px 2px 6px;
}

.city-card {
  min-height: 82px;
  padding: 14px;
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38)),
    linear-gradient(320deg, rgba(255, 179, 225, 0.14), transparent 54%, rgba(135, 211, 232, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 22px rgba(80, 91, 120, 0.08);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition:
    opacity 0.64s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.64s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  transition-delay: var(--card-delay);
}

.city-card:hover,
.city-card.active {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.82), rgba(255, 244, 251, 0.5)),
    linear-gradient(320deg, rgba(255, 162, 219, 0.22), transparent 52%, rgba(123, 202, 231, 0.18));
  border-color: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 16px 32px rgba(190, 109, 175, 0.13);
  transform: translateY(-3px);
}

.city-card.active {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    inset 0 0 18px rgba(255, 171, 221, 0.18),
    0 16px 32px rgba(190, 109, 175, 0.14);
}

.city-card div {
  margin-bottom: 12px;
  color: var(--sub);
  font-size: 14px;
}

.city-card strong {
  color: #0f172a;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.history {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-right: 4px;
}

.hist-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(248, 251, 255, 0.42)),
    linear-gradient(90deg, rgba(255, 181, 226, 0.12), transparent 44%, rgba(137, 210, 231, 0.1));
  color: #536275;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.56s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.56s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  transition-delay: var(--item-delay);
}

.hist-item:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.988);
  transition:
    opacity 0.78s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.78s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
  transition-delay: var(--delay);
  will-change: opacity, transform;
}

.reveal.in-view,
.city-card.in-view,
.hist-item.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.glass.reveal.in-view:hover,
.city-card.in-view:hover,
.city-card.in-view.active {
  transform: translateY(-3px) scale(1);
  transition-delay: 0ms;
}

@keyframes auroraDrift {
  from {
    transform: translate3d(-2vw, -1vh, 0) scale(1);
  }
  to {
    transform: translate3d(3vw, 2vh, 0) scale(1.04);
  }
}

@media (max-width: 900px) {
  .container {
    padding: 16px;
  }

  .glass:hover {
    transform: none;
  }

  .topbar,
  .city-row,
  .row-between {
    align-items: flex-start;
    flex-direction: column;
  }

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

  select {
    width: 100%;
  }

  .panel-fill {
    min-height: auto;
  }
}
