:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-hover: #273449;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --border: #334155;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #1e293b 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem 1rem;
}

header {
  max-width: 1200px;
  margin: 0 auto 2rem;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.source {
  color: var(--muted);
  font-size: 0.85rem;
}

.source a {
  color: var(--accent);
  text-decoration: none;
}

.source a:hover {
  text-decoration: underline;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.city-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.2s, background 0.2s;
}

.city-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.city-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.city-name .coords {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.day {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.day:last-child {
  border-bottom: none;
}

.day-info .date {
  font-weight: 600;
  font-size: 1rem;
}

.day-info .condition {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.day-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.day-temps {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.temp-high {
  font-size: 1.25rem;
  font-weight: 600;
}

.temp-low {
  color: var(--muted);
  font-size: 0.95rem;
}

.day-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.day-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.loading,
.error {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  grid-column: 1 / -1;
}

.error {
  color: var(--red);
}

footer {
  max-width: 1200px;
  margin: 2rem auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
