:root {
  color-scheme: dark;
  --background: #101114;
  --surface: #1b1c20;
  --surface-high: #25262b;
  --surface-highest: #303137;
  --primary: #b7c9ff;
  --on-primary: #17305f;
  --secondary: #a8d5ba;
  --text: #e4e2e7;
  --muted: #c5c5cd;
  --outline: #8e9099;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle at 72% -10%, rgba(90, 121, 190, 0.18), transparent 35rem),
    radial-gradient(circle at 4% 24%, rgba(77, 139, 105, 0.1), transparent 28rem);
}

a { color: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

.view[hidden] { display: none; }

.back-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(183, 201, 255, 0.1);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease;
}

.back-button:hover { background: rgba(183, 201, 255, 0.18); }

.location-index,
.location-detail,
.error-view { min-height: 100vh; }

.index-hero,
.detail-hero,
.error-view {
  width: min(100% - 40px, 1320px);
  margin-inline: auto;
  padding: clamp(80px, 13vh, 150px) 0 clamp(52px, 8vh, 96px);
}

.detail-hero { padding-top: clamp(48px, 8vh, 92px); }

.overline {
  margin: 0 0 16px;
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.17em;
}

h1 {
  max-width: 1050px;
  margin: 0;
  font-size: clamp(4.5rem, 12vw, 10.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.hero-copy {
  max-width: 620px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  line-height: 1.55;
}

.location-list {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  width: min(100% - 40px, 1320px);
  margin: 0 auto;
  padding-bottom: 112px;
}

.location-card {
  position: relative;
  grid-column: span 6;
  min-height: clamp(340px, 48vw, 620px);
  overflow: hidden;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  isolation: isolate;
  transition: transform 220ms cubic-bezier(.2, 0, 0, 1), box-shadow 220ms ease;
}

.location-card:only-child { grid-column: 1 / -1; }

.location-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

.location-card:focus-visible,
.photo:focus-visible,
.icon-button:focus-visible,
.lightbox-arrow:focus-visible,
.back-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.location-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.2, 0, 0, 1);
}

.location-card:hover img { transform: scale(1.025); }

.location-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, rgba(9, 10, 13, 0.08) 20%, rgba(9, 10, 13, 0.88) 100%);
}

.location-card-copy {
  position: absolute;
  right: clamp(24px, 4vw, 52px);
  bottom: clamp(24px, 4vw, 52px);
  left: clamp(24px, 4vw, 52px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.location-card h2 {
  margin: 6px 0 0;
  font-size: clamp(2.3rem, 5vw, 5.2rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.location-meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.location-arrow {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.35rem;
}

.back-button { gap: 10px; margin-bottom: clamp(48px, 8vh, 88px); }

#album-list {
  width: min(100% - 40px, 1320px);
  margin: 0 auto;
  padding-bottom: 112px;
}

.album {
  margin-top: 36px;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 32px;
  background: var(--surface);
}

.album:first-child { margin-top: 0; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 16px);
}

.photo {
  position: relative;
  grid-column: span 4;
  min-height: 220px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: var(--surface-high);
  cursor: zoom-in;
}

.photo:nth-child(5n + 1),
.photo.featured { grid-column: span 8; }

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--ratio, 4 / 3);
  object-fit: cover;
  transition: transform 420ms cubic-bezier(.2, 0, 0, 1), filter 180ms ease;
}

.photo:hover img { transform: scale(1.02); filter: brightness(0.9); }

.photo-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 64px 18px 16px;
  color: white;
  font-size: 0.8rem;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.68));
  opacity: 0;
  transition: opacity 180ms ease;
}

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

.status { grid-column: 1 / -1; color: var(--muted); }

footer {
  display: flex;
  justify-content: flex-end;
  padding: 48px clamp(20px, 4vw, 64px);
  border-top: 1px solid rgba(197, 197, 205, 0.1);
  color: var(--muted);
  font-size: 0.82rem;
}

footer a { color: var(--primary); text-decoration: none; }

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  background: rgba(8, 9, 11, 0.98);
  color: white;
}

.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; }
.lightbox::backdrop { background: rgba(8, 9, 11, 0.84); }
.lightbox figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; margin: 0; }

.lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 56px 16px 16px;
}

.lightbox-stage img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: calc(100dvh - 144px);
  object-fit: contain;
}

.lightbox-loading { position: absolute; color: rgba(255,255,255,.56); font-size: .8rem; }

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  min-height: 80px;
  padding: 20px 16px 24px;
  color: rgba(255,255,255,.86);
}

.lightbox-context { color: rgba(255,255,255,.56); font-size: .76rem; }

.icon-button,
.lightbox-arrow {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  cursor: pointer;
  font-size: 1.5rem;
}

.lightbox-close {
  position: fixed;
  z-index: 20;
  top: 12px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(48, 49, 55, 0.92);
  font-size: 2rem;
}

.lightbox-arrow:hover,
.lightbox-close:hover { color: white; background-color: var(--surface-highest); }

@media (max-width: 760px) {
  .location-index,
  .location-detail { min-height: 100vh; }
  .index-hero,
  .detail-hero,
  .error-view,
  .location-list,
  #album-list { width: min(100% - 28px, 1320px); }
  .index-hero { padding-top: 84px; }
  h1 { font-size: clamp(4.2rem, 22vw, 7rem); }
  .location-card,
  .location-card:only-child { grid-column: 1 / -1; min-height: 440px; }
  .location-card-copy { align-items: center; }
  .album { padding: 18px; border-radius: 24px; }
  .photo,
  .photo:nth-child(5n + 1),
  .photo.featured { grid-column: span 12; border-radius: 16px; }
  .photo-label { opacity: 1; }
  .lightbox[open] { grid-template-columns: 42px 1fr 42px; }
  .lightbox-stage { padding-inline: 0; }
  .lightbox figcaption { flex-direction: column; gap: 6px; }
  footer { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo img,
  .location-card,
  .location-card img { transition: none; }
}
