:root {
  color-scheme: dark;
  --gallery-blue: #3a86ff;
  --gallery-blue-dark: #2667cc;
  --gallery-bg: #111;
  --gallery-panel: #191919;
  --gallery-muted: #b8c7db;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: #fff;
  background: var(--gallery-bg);
  text-align: center;
}

body.lightbox-open { overflow: hidden; }

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 12px 10px;
  background: #070707;
  border-bottom: 2px solid var(--gallery-blue);
}

.nav a {
  display: inline-block;
  margin: 6px 10px;
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible,
.nav a[aria-current="page"] { color: var(--gallery-blue); }

.hero-banner {
  overflow: hidden;
  width: 100%;
  background: #000;
  border-bottom: 5px solid var(--gallery-blue);
}

.hero-banner img { display: block; width: 100%; height: auto; }

.gallery-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 38px 20px 64px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gallery-blue);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 2px;
  line-height: 1.08;
  text-transform: uppercase;
}

.subtitle {
  max-width: 720px;
  margin: 14px auto 26px;
  color: var(--gallery-muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.year-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
}

.year-selector-label {
  color: #fff;
  font-weight: 800;
}

.year-selector-select {
  min-height: 44px;
  padding: 10px 42px 10px 16px;
  border: 1px solid var(--gallery-blue);
  border-radius: 999px;
  color: #fff;
  background: #0d1b2a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.year-selector-select:hover,
.year-selector-select:focus-visible {
  background: var(--gallery-blue-dark);
  outline: none;
}

.filter-bar { margin: 0 0 16px; }

.filter-button,
.gallery-home-link {
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--gallery-blue);
  border-radius: 999px;
  color: #fff;
  background: #0d1b2a;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible,
.gallery-home-link:hover,
.gallery-home-link:focus-visible,
.filter-button.is-active {
  color: #fff;
  background: var(--gallery-blue-dark);
  outline: none;
}

@media (max-width: 480px) {
  .year-selector {
    align-items: stretch;
    flex-direction: column;
  }

  .year-selector-select {
    width: 100%;
  }
}

.gallery-status {
  min-height: 24px;
  margin: 0 0 20px;
  color: var(--gallery-muted);
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.photo-card {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 13px;
  color: inherit;
  background: var(--gallery-panel);
  box-shadow: 0 0 16px rgba(0, 0, 0, .45);
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.photo-card:hover,
.photo-card:focus-visible {
  z-index: 1;
  transform: translateY(-3px);
  border-color: rgba(58, 134, 255, .7);
  box-shadow: 0 0 24px rgba(58, 134, 255, .3);
  outline: none;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0b0b;
}

.photo-card::after {
  content: "View photo";
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .72);
  font-size: .74rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity .2s ease;
}

.photo-card:hover::after,
.photo-card:focus-visible::after { opacity: 1; }

.noscript-message {
  padding: 20px;
  border: 1px solid var(--gallery-blue);
  border-radius: 10px;
  background: #0d1b2a;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 76px 54px;
  background: rgba(0, 0, 0, .94);
}

.lightbox.is-open { display: flex; }

.lightbox-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(100%, 1500px);
  height: min(100%, 94vh);
  margin: 0;
}

.lightbox-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox-caption {
  min-height: 38px;
  padding: 12px 8px 0;
  color: #d7e6ff;
  font-size: .9rem;
}

.lightbox-control {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  color: #fff;
  background: rgba(13, 27, 42, .9);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-control:hover,
.lightbox-control:focus-visible { background: var(--gallery-blue-dark); outline: 2px solid #fff; }
.lightbox-close { top: 18px; right: 18px; font-size: 1.6rem; }
.lightbox-previous { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }

footer {
  padding: 22px;
  color: #aaa;
  background: #0a0a0a;
  font-size: .9rem;
}

@media (max-width: 760px) {
  .nav a { margin: 5px 7px; font-size: .82rem; }
  .gallery-shell { padding: 30px 12px 46px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lightbox { padding: 64px 10px 76px; }
  .lightbox-previous { left: 18px; top: auto; bottom: 14px; transform: none; }
  .lightbox-next { right: 18px; top: auto; bottom: 14px; transform: none; }
  .lightbox-close { top: 10px; right: 10px; }
}

@media (max-width: 420px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

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