:root {
  --navy: #122c91;
  --blue: #2a6fdb;
  --turquoise: #48d6d2;
  --aqua: #81e9e6;
  --cream: #fefcbf;
  --ink: #10204f;
  --muted: #7d86a4;
  --soft-text: #9aa2ba;
  --surface: rgba(255, 255, 255, 0.96);
  --search-bg: #f4f7ff;
  --line: rgba(18, 44, 145, 0.09);
  --shadow: 0 30px 80px rgba(18, 44, 145, 0.14);
  --radius: 22px;
  --font: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 12% 10%, rgba(129, 233, 230, 0.32), transparent 29rem),
    radial-gradient(circle at 92% 86%, rgba(254, 252, 191, 0.7), transparent 32rem),
    linear-gradient(135deg, #f7f9ff 0%, #f6fdff 50%, #fffef4 100%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(72, 214, 210, 0.55);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 70px 24px;
  overflow: hidden;
  position: relative;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  opacity: 0.7;
}

.page-shell::before {
  width: 170px;
  height: 170px;
  top: -45px;
  right: 7%;
  border: 28px solid rgba(42, 111, 219, 0.08);
}

.page-shell::after {
  width: 120px;
  height: 120px;
  left: 4%;
  bottom: 2%;
  background: linear-gradient(140deg, rgba(72, 214, 210, 0.15), rgba(254, 252, 191, 0.42));
}

.weather-app {
  width: min(100%, 980px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 122px;
  gap: 42px;
  padding: 34px 48px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 34px;
  display: inline-block;
}

.brand-mark span {
  position: absolute;
  width: 21px;
  height: 21px;
  border-radius: 5px;
  transform: rotate(45deg);
  box-shadow: 0 6px 12px rgba(18, 44, 145, 0.1);
}

.brand-mark span:nth-child(1) {
  left: 1px;
  top: 1px;
  background: var(--blue);
}

.brand-mark span:nth-child(2) {
  left: 17px;
  top: 1px;
  background: var(--turquoise);
}

.brand-mark span:nth-child(3) {
  left: 9px;
  top: 15px;
  background: var(--cream);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.brand-name span {
  color: var(--blue);
}

.city-shortcuts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 31px;
  min-width: 0;
}

.city-link {
  position: relative;
  padding: 6px 0 13px;
  background: transparent;
  color: var(--soft-text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
}

.city-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--turquoise);
  transform: translateX(-50%) scale(0);
  transition: transform 180ms ease;
}

.city-link:hover {
  color: var(--blue);
  transform: translateY(-1px);
}

.city-link.is-active {
  color: var(--blue);
  font-weight: 600;
}

.city-link.is-active::after {
  transform: translateX(-50%) scale(1);
}

.search-section {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 0 48px 37px;
  border-bottom: 1px solid var(--line);
}

.search-form {
  position: relative;
}

.search-form input {
  width: 100%;
  height: 60px;
  padding: 0 58px 0 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--search-bg);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  caret-color: var(--blue);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-form input::placeholder {
  color: #a1a9bd;
  font-weight: 400;
}

.search-form input:focus {
  background: #fff;
  border-color: rgba(42, 111, 219, 0.24);
  box-shadow: 0 8px 24px rgba(18, 44, 145, 0.08);
  outline: none;
}

.search-button {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: transparent;
  color: #8e98b3;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 180ms ease, background 180ms ease;
}

.search-button:hover {
  color: var(--blue);
  background: rgba(72, 214, 210, 0.12);
}

.search-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.current-button {
  height: 60px;
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 23px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(42, 111, 219, 0.22);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.current-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(42, 111, 219, 0.27);
  filter: saturate(1.08);
}

.current-button:active {
  transform: translateY(0);
}

.current-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.current-button .location-dot {
  fill: var(--cream);
  stroke: none;
}

.status-message {
  max-height: 0;
  overflow: hidden;
  padding: 0 48px;
  color: #9a4e3b;
  font-size: 13px;
  opacity: 0;
  transition: max-height 220ms ease, padding 220ms ease, opacity 220ms ease;
}

.status-message.is-visible {
  max-height: 70px;
  padding-top: 14px;
  opacity: 1;
}

.status-message.is-loading {
  color: var(--blue);
}

.current-weather {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 42px 48px 34px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--turquoise);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.current-copy h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: clamp(36px, 5vw, 47px);
  line-height: 1.08;
  letter-spacing: -2px;
}

.weather-summary,
.weather-details {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.weather-details strong {
  color: var(--blue);
  font-weight: 600;
}

.temperature-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  min-width: 260px;
}

.temperature-wrap {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.temperature {
  color: var(--ink);
  font-size: clamp(72px, 9vw, 94px);
  font-weight: 700;
  letter-spacing: -7px;
}

.unit {
  margin: 13px 0 0 7px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -1px;
}

.forecast-section {
  padding: 12px 48px 49px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.forecast-day {
  min-width: 0;
  padding: 16px 10px 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  text-align: center;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.forecast-day:hover {
  transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(129, 233, 230, 0.13), rgba(254, 252, 191, 0.22));
  border-color: rgba(72, 214, 210, 0.17);
  box-shadow: 0 12px 24px rgba(18, 44, 145, 0.07);
}

.forecast-name {
  margin: 0 0 13px;
  color: #8c96b0;
  font-size: 14px;
  font-weight: 500;
}

.forecast-icon {
  min-height: 51px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.forecast-temperatures {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
}

.forecast-high {
  color: var(--blue);
}

.forecast-low {
  color: #9ba4bb;
  font-weight: 500;
}

.app-footer {
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 22px 36px;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(129, 233, 230, 0.05), rgba(254, 252, 191, 0.13));
  color: #959db2;
  font-size: 12px;
  text-align: center;
}

.app-footer p {
  margin: 0;
}

.app-footer a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.weather-icon svg {
  display: block;
  overflow: visible;
}

.weather-icon--large svg {
  width: 82px;
  height: 82px;
}

.forecast-icon svg {
  width: 48px;
  height: 48px;
}

.icon-sun,
.icon-cloud,
.icon-rain,
.icon-snow,
.icon-fog,
.icon-bolt {
  vector-effect: non-scaling-stroke;
}

.icon-sun {
  fill: var(--cream);
  stroke: var(--navy);
  stroke-width: 2.1;
  stroke-linecap: round;
}

.icon-cloud {
  fill: #fff;
  stroke: var(--navy);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.icon-rain {
  fill: none;
  stroke: var(--turquoise);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.icon-snow {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.icon-fog {
  fill: none;
  stroke: #8f9ab4;
  stroke-width: 2.1;
  stroke-linecap: round;
}

.icon-bolt {
  fill: var(--cream);
  stroke: var(--navy);
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.weather-app.is-loading .current-weather,
.weather-app.is-loading .forecast-section {
  opacity: 0.5;
  pointer-events: none;
}

.weather-app.is-loading .search-button svg,
.weather-app.is-loading .current-button svg {
  animation: soft-spin 950ms linear infinite;
}

@keyframes soft-spin {
  to {
    transform: rotate(360deg);
  }
}

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

.noscript-message {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-family: var(--font);
  font-size: 13px;
}

@media (max-width: 840px) {
  .page-shell {
    padding: 36px 18px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 23px;
    padding: 29px 32px 24px;
  }

  .city-shortcuts {
    width: 100%;
    justify-content: flex-start;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .city-shortcuts::-webkit-scrollbar {
    display: none;
  }

  .search-section,
  .current-weather,
  .forecast-section {
    padding-left: 32px;
    padding-right: 32px;
  }

  .status-message {
    padding-left: 32px;
    padding-right: 32px;
  }

  .temperature-panel {
    min-width: 225px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    display: block;
    padding: 16px 12px 28px;
  }

  .weather-app {
    border-radius: 18px;
  }

  .app-header {
    min-height: auto;
    padding: 24px 22px 19px;
  }

  .brand-name {
    font-size: 18px;
  }

  .city-shortcuts {
    gap: 21px;
  }

  .city-link {
    font-size: 13px;
  }

  .search-section {
    grid-template-columns: 1fr 56px;
    gap: 10px;
    padding: 0 22px 27px;
  }

  .search-form input,
  .current-button {
    height: 54px;
  }

  .search-form input {
    padding-left: 18px;
  }

  .current-button {
    min-width: 56px;
    padding: 0;
  }

  .current-button span {
    display: none;
  }

  .current-button svg {
    width: 21px;
  }

  .status-message {
    padding-left: 22px;
    padding-right: 22px;
  }

  .current-weather {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 22px 27px;
  }

  .current-copy h1 {
    font-size: 40px;
  }

  .temperature-panel {
    min-width: 0;
    justify-content: flex-start;
  }

  .temperature {
    font-size: 78px;
  }

  .weather-icon--large svg {
    width: 74px;
    height: 74px;
  }

  .forecast-section {
    padding: 4px 14px 33px;
  }

  .forecast-grid {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    gap: 5px;
    overflow-x: auto;
    padding: 7px 8px 11px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 111, 219, 0.25) transparent;
  }

  .forecast-day {
    scroll-snap-align: start;
    padding-left: 7px;
    padding-right: 7px;
  }

  .forecast-name {
    font-size: 12px;
  }

  .forecast-temperatures {
    gap: 4px;
    font-size: 13px;
  }

  .app-footer {
    min-height: 78px;
    padding: 20px;
    line-height: 1.7;
  }
}

@media (max-width: 390px) {
  .brand-mark {
    width: 37px;
    transform: scale(0.9);
    transform-origin: left center;
  }

  .brand-name {
    font-size: 17px;
  }

  .current-copy h1 {
    font-size: 36px;
  }

  .weather-summary,
  .weather-details {
    font-size: 13px;
  }
}

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