:root {
  --bg: #080f14;
  --surface: #121824;
  --surface-elevated: #1e2a38;
  --muted: #8fa1b3;
  --text: #ffffff;
  --accent: #00f0ff;
  --border: rgba(255, 255, 255, 0.18);
  --radius: 1.25rem;
  --shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
}

body {
  max-width: 1440px;
  min-width: 0;
  margin: 0 auto;
  padding: 1.25rem;
  background-color: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

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

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto 1.35rem;
  max-width: 72rem;
}

.site-header h1 {
  margin-bottom: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 72rem;
  margin: 0;
  padding: 0.15rem 0;
}

.site-nav a {
  position: relative;
  padding: 0.25rem 0;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.site-nav a.is-active {
  color: var(--text);
}

.site-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: -0.45rem;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background-color: var(--accent);
  content: "";
}

.site-nav a:hover {
  border-color: transparent;
  color: var(--text);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  color: var(--text);
}

main {
  max-width: 72rem;
  margin: 0 auto;
}

.weather-hero {
  --theme-overlay: rgba(8, 15, 20, 0.25);
  position: relative;
  isolation: isolate;
  min-height: 38rem;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface-elevated);
  box-shadow: var(--shadow);
}

.weather-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 15, 20, 0.12) 0%, var(--theme-overlay) 38%, rgba(8, 15, 20, 0.7) 100%);
  content: "";
}

.theme-clear {
  --theme-overlay: rgba(17, 48, 66, 0.2);
}

.theme-partly-cloudy {
  --theme-overlay: rgba(8, 15, 20, 0.25);
}

.theme-cloudy {
  --theme-overlay: rgba(15, 23, 34, 0.4);
}

.theme-rain {
  --theme-overlay: rgba(8, 29, 42, 0.48);
}

.theme-thunder {
  --theme-overlay: rgba(10, 12, 26, 0.58);
}

.theme-snow {
  --theme-overlay: rgba(72, 95, 113, 0.28);
}

.theme-fog {
  --theme-overlay: rgba(93, 109, 121, 0.32);
}

.weather-summary {
  min-width: 0;
}

.location {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: clamp(1.6rem, 5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1;
}

.sample-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  margin: 0 0 1.2rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(0, 240, 255, 0.42);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.status-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 0.35rem rgba(0, 240, 255, 0.45);
}

.temperature {
  margin-bottom: 0.3rem;
  font-size: clamp(4.75rem, 14vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.1em;
  line-height: 0.95;
}

.weather-status {
  margin-bottom: 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.375rem);
  font-weight: 600;
}

.weather-note {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  opacity: 0.82;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.weather-controls {
  display: grid;
  gap: 0.75rem;
  max-width: 34rem;
  margin-top: 1.25rem;
}

.city-control {
  display: grid;
  gap: 0.35rem;
}

.city-control label {
  color: var(--muted);
  font-size: 0.8rem;
}

.city-control select,
.weather-action-button {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 0.8rem;
  background: rgba(18, 24, 36, 0.72);
  color: var(--text);
  font: inherit;
}

.city-control select {
  padding: 0.6rem 0.75rem;
}

.weather-action-button {
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.weather-action-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.city-control select:focus-visible,
.weather-action-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.weather-action-button:disabled,
.city-control select:disabled {
  cursor: wait;
  opacity: 0.58;
}

.weather-feedback {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.weather-feedback[data-state="loading"]::before {
  content: "↻ ";
}

.weather-feedback[data-state="success"]::before {
  content: "✓ ";
}

.weather-feedback[data-state="error"]::before {
  content: "! ";
}

.weather-feedback[data-state="error"] {
  color: var(--text);
  font-weight: 600;
}

.weather-hero.is-loading .weather-figure img {
  opacity: 0.82;
}

.weather-figure {
  position: absolute;
  z-index: -2;
  inset: 0;
  min-width: 0;
  height: auto;
  margin: 0;
  overflow: hidden;
  background-color: var(--surface-elevated);
}

.weather-figure::after {
  display: none;
}

.weather-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.weather-figure figcaption {
  position: absolute;
  right: 1.25rem;
  bottom: 1rem;
  z-index: 1;
  color: rgba(244, 248, 252, 0.78);
  font-size: 0.75rem;
}

.weather-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.metric {
  min-width: 0;
  position: relative;
  padding: 1rem 3.2rem 1rem 3.25rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(18, 24, 36, 0.48);
  backdrop-filter: blur(0.65rem);
  -webkit-backdrop-filter: blur(0.65rem);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
}

.metric-icon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.metric::before {
  position: absolute;
  right: 0.9rem;
  bottom: 0.85rem;
  width: 1.5rem;
  height: 0.15rem;
  border-radius: 999px;
  background-color: var(--accent);
  content: "";
  opacity: 0.72;
}

.metric:last-child {
  grid-column: auto;
}

.metric-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.upcoming-features,
.content-surface {
  margin-bottom: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background-color: transparent;
}

.upcoming-features {
  display: grid;
  gap: 0.8rem;
}

.upcoming-features h2,
.content-surface h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.upcoming-features p:last-child,
.content-surface p:last-child {
  margin-bottom: 0;
}

.upcoming-features li + li {
  margin-top: 0.35rem;
}

.upcoming-features ul {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.upcoming-features li {
  position: relative;
  padding: 0.7rem 0 0.7rem 0.9rem;
  border-left: 2px solid var(--border);
  color: var(--text);
}

.upcoming-features li::before {
  position: absolute;
  top: 1.15rem;
  left: -0.3rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background-color: var(--accent);
  content: "";
}

.upcoming-features li + li {
  margin-top: 0;
}

.site-footer {
  max-width: 72rem;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 760px) {
  body {
    padding: 2.5rem;
  }

  .weather-hero {
    min-height: 42rem;
    padding: 2.5rem;
  }

  .weather-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .weather-controls {
    grid-template-columns: minmax(12rem, 1.2fr) auto;
    align-items: end;
  }

  .weather-action-button {
    width: auto;
  }

  .weather-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-surface {
    padding: 2rem;
  }

  .upcoming-features {
    padding: 1.5rem 0;
  }

  .upcoming-features ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

}
