:root {
  --navy: #122c91;
  --blue: #2a6fdb;
  --turquoise: #48d6d2;
  --aqua: #81e9e6;
  --cream: #fefcbf;

  --ink: #171d43;
  --muted: #7b829c;
  --soft-text: #9ba1b4;
  --surface: #ffffff;
  --search-bg: #f7f9fc;
  --line: #edf0f5;
  --error: #b42318;
  --shadow:
    0 26px 72px rgba(18, 44, 145, 0.12),
    0 4px 14px rgba(18, 44, 145, 0.05);
  --font: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 11% 8%, rgba(129, 233, 230, 0.36) 0 90px, transparent 91px),
    radial-gradient(circle at 91% 89%, rgba(254, 252, 191, 0.76) 0 125px, transparent 126px),
    linear-gradient(135deg, #f6fbff 0%, #f8f5ff 48%, #fffdf2 100%);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.page-shell {
  display: grid;
  min-height: 100vh;
  padding: 58px 24px;
  place-items: center;
}

.weather-app {
  width: min(100%, 880px);
  overflow: hidden;
  padding: 36px 42px 26px;
  background: var(--surface);
  border: 1px solid rgba(18, 44, 145, 0.06);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 29px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  transform: rotate(45deg);
}

.brand-mark span {
  display: block;
  border-radius: 3px;
}

.brand-mark span:nth-child(1) {
  background: var(--navy);
}

.brand-mark span:nth-child(2) {
  background: var(--blue);
}

.brand-mark span:nth-child(3) {
  background: var(--turquoise);
}

.brand-mark span:nth-child(4) {
  background: var(--cream);
}

.brand-name {
  white-space: nowrap;
}

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

.city-link {
  position: relative;
  min-height: 44px;
  padding: 11px 0;
  color: var(--soft-text);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 180ms ease;
}

.city-link:hover,
.city-link.is-active {
  color: var(--blue);
}

.city-link.is-active {
  font-weight: 600;
}

.search-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-form {
  position: relative;
}

.search-form input {
  width: 100%;
  height: 52px;
  padding: 0 57px 0 18px;
  color: var(--ink);
  background: var(--search-bg);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.search-form input::placeholder {
  color: #979daf;
}

.search-form input:hover {
  background: #f4f8fb;
  border-color: #e1ebf0;
}

.search-form input:focus {
  background: #ffffff;
  border-color: var(--turquoise);
  box-shadow: 0 0 0 4px rgba(72, 214, 210, 0.15);
  outline: none;
}

.search-button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border-radius: 7px;
  place-items: center;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.search-button:hover {
  color: var(--navy);
  background: rgba(129, 233, 230, 0.27);
}

.search-button svg,
.current-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.current-button {
  display: inline-flex;
  min-width: 130px;
  height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  color: #ffffff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 8px;
  box-shadow: 0 10px 21px rgba(42, 111, 219, 0.2);
  font-size: 14px;
  font-weight: 600;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.current-button:hover {
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 13px 26px rgba(18, 44, 145, 0.22);
  transform: translateY(-1px);
}

.location-dot {
  fill: currentColor;
  stroke: none;
}

.status-message {
  min-height: 23px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.status-message.is-visible {
  opacity: 1;
}

.status-message.is-visible:not(.is-loading) {
  color: var(--error);
}

.current-weather {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 29px 0 0;
  border-top: 1px solid var(--line);
  transition: opacity 180ms ease;
}

.current-copy {
  min-width: 0;
}

.current-copy h1 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: clamp(38px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.052em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

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

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

.temperature-panel {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.current-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-right: 10px;
  place-items: center;
}

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

.temperature {
  color: var(--ink);
  font-size: clamp(68px, 10vw, 92px);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.unit {
  margin: 5px 0 0 8px;
  color: var(--blue);
  font-size: 21px;
  font-weight: 600;
}

.forecast-section {
  margin-top: 42px;
  transition: opacity 180ms ease;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.forecast-day {
  position: relative;
  min-width: 0;
  padding: 7px 12px 4px;
  text-align: center;
}

.forecast-day + .forecast-day::before {
  position: absolute;
  top: 11px;
  bottom: 9px;
  left: 0;
  width: 1px;
  content: "";
  background: var(--line);
}

.forecast-name {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.forecast-icon {
  display: grid;
  width: 45px;
  height: 45px;
  margin: 0 auto 7px;
  place-items: center;
}

.weather-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-sun {
  fill: rgba(254, 252, 191, 0.88);
  stroke: var(--blue);
}

.icon-cloud {
  fill: #edfafa;
  stroke: var(--navy);
}

.icon-rain {
  stroke: var(--blue);
}

.icon-snow {
  stroke: var(--turquoise);
}

.icon-fog {
  stroke: var(--muted);
}

.icon-bolt {
  fill: var(--cream);
  stroke: var(--blue);
}

.forecast-temperatures {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
}

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

.forecast-low {
  color: #a1a6b6;
}

.app-footer {
  margin-top: 35px;
  padding-top: 22px;
  color: #9ca1b1;
  border-top: 1px solid var(--line);
  font-size: 11px;
  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;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript-message {
  margin: 20px;
  color: var(--error);
  text-align: center;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 30px 16px;
  }

  .weather-app {
    padding: 29px 24px 24px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
  }

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

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

  .current-weather {
    align-items: flex-end;
  }

  .current-icon {
    width: 62px;
    height: 62px;
    margin-right: 4px;
  }

  .forecast-day {
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (max-width: 560px) {
  body {
    background: #ffffff;
  }

  .page-shell {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .weather-app {
    min-height: 100vh;
    padding: 24px 18px 20px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

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

  .search-section {
    grid-template-columns: 1fr;
  }

  .current-button {
    width: 100%;
  }

  .current-weather {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
    padding-top: 25px;
  }

  .temperature-panel {
    align-self: flex-end;
  }

  .forecast-section {
    overflow-x: auto;
    margin-top: 36px;
    padding-bottom: 5px;
  }

  .forecast-grid {
    min-width: 500px;
  }

  .app-footer {
    margin-top: 29px;
  }
}

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