html {
  scroll-behavior: smooth;
}

:root {
  --bg: #f6f7fb;
  --fg: #1f2330;
  --accent: #3b82f6;
  --muted: #6b7280;
  --card: #ffffff;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  transition: background 2s ease;
}

body.dark-sky header h1 {
  color: rgba(255, 255, 255, 0.95);
}

body.dark-sky .tagline,
body.dark-sky footer {
  color: rgba(255, 255, 255, 0.55);
}

.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: center;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a {
  display: block;
  padding: 1rem 1.25rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--accent);
}

header {
  text-align: center;
  padding: 4rem 1rem 2rem;
  scroll-margin-top: 60px;
}

header h1 {
  margin: 0;
  font-size: 3rem;
}

.tagline {
  color: var(--muted);
  margin-top: 0.5rem;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.intro {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

.output {
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 500;
  min-height: 1.5em;
}

.weather-section {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}

.weather-section h2 {
  margin-top: 0;
}

.weather-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.weather-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
}

.weather-card .day {
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.weather-card .icon {
  font-size: 1.8rem;
  line-height: 1;
  margin: 0.25rem 0;
}

.weather-card .temps {
  color: var(--fg);
  font-weight: 500;
}

.weather-card .temps span {
  color: var(--muted);
  font-weight: 400;
}

.weather-card .desc {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.weather-card .precip {
  color: var(--accent);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.weather-loading {
  color: var(--muted);
}

.content-section {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
  scroll-margin-top: 60px;
}

.content-section h2 {
  margin-top: 0;
}

.collage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 140px;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.collage-item {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.collage-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.collage-item--tall {
  grid-row: span 2;
}

.collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
  cursor: zoom-out;
  animation: lightbox-fade 0.2s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  margin: 0;
  border-radius: 6px;
}

.lightbox-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 600px) {
  .collage {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
  }
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
