:root {
  --bg: #fafaf7;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --gap: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Site nav (top-right corner) */
.site-nav {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 1.25rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.site-nav a:hover { color: var(--fg); }

/* About page */
.about {
  max-width: 640px;
  margin: 0 auto 80px;
  padding: 0 24px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
}
.about p { margin: 0 0 1em; }
.about a { color: var(--fg); }

.map {
  margin: 32px 0;
  border-radius: 4px;
  overflow: hidden;
}
.map iframe {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  display: block;
}

/* Header */
header { text-align: center; padding: 56px 24px 24px; }
header h1 { margin: 0; font-weight: 400; font-size: 1.5rem; letter-spacing: 0.02em; }
header p { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

/* Carousel */
.carousel { max-width: 900px; margin: 0 auto; padding: 16px; }

.stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eee;
  overflow: hidden;
  border-radius: 2px;
}
.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 1;
  /* Outgoing photo: stay fully opaque underneath, then snap away only after the
     incoming one has finished fading in over it — a gapless crossfade (no dip to
     the stage background mid-transition). */
  transition: opacity 0s linear 600ms;
}
.stage img.active {
  opacity: 1;
  z-index: 2;                              /* incoming sits on top... */
  transition: opacity 600ms ease-in-out;  /* ...and fades in smoothly */
}

/* Carousel controls: one centered cluster below the image */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.ctrl {
  appearance: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms, color 150ms;
  touch-action: manipulation; /* no double-tap-to-zoom; fast repeat taps */
}
.ctrl:hover { background: rgba(0, 0, 0, 0.06); color: var(--fg); }
.ctrl:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.ctrl svg { width: 22px; height: 22px; display: block; }
#playpause svg { width: 19px; height: 19px; } /* filled icon reads larger; nudge down */

.caption {
  text-align: center;
  padding: 14px 8px 4px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.weather { color: #999; font-size: 0.8rem; }
.note {
  color: var(--fg);
  font-style: italic;
  font-size: 0.9rem;
  margin-top: 6px;
  display: block;
  white-space: pre-line;
}
.counter {
  text-align: center;
  color: #aaa;
  font-size: 0.75rem;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Divider */
.divider {
  text-align: center;
  color: #ccc;
  margin: 48px 0 24px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  max-width: 900px;
  margin: 0 auto 80px;
  padding: 0 16px;
}
.grid button {
  appearance: none;
  background: #eee;
  border: none;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  touch-action: manipulation; /* no double-tap-to-zoom on thumbnails */
}
.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 250ms ease;
}
.grid button:hover img { transform: scale(1.04); }
.grid button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* Footer */
footer { text-align: center; color: #bbb; font-size: 0.75rem; padding: 24px 16px 48px; }

/* Mobile */
@media (max-width: 600px) {
  header { padding: 32px 16px 16px; }
  .grid { gap: 2px; }
}
