*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --text: #14181f;
  --navy: #0f2340;
  --navy-deep: #091629;
  --accent: #f5c400;
  --muted: #5b6270;
  --stone: #ece8e1;
  --tile-bg: #e2ddd4;
  --gap: 10px;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--navy-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  /* Soft stone background: fine paper grain + gentle light from the top */
  background-color: var(--stone);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 60% at 50% 0%, #faf8f4 0%, rgba(250, 248, 244, 0) 70%),
    linear-gradient(180deg, #f3f0ea 0%, #e7e2d9 100%);
  background-attachment: scroll, fixed, fixed;
}

body.lb-open {
  overflow: hidden;
}

/* Header */
.site-header {
  position: relative;
  text-align: center;
  color: #fff;
  padding: calc(36px + env(safe-area-inset-top)) 20px 34px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 14px),
    radial-gradient(90% 120% at 50% -10%, #1d3a66 0%, rgba(29, 58, 102, 0) 65%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-bottom: 5px solid var(--accent);
  box-shadow: 0 6px 24px rgba(9, 22, 41, 0.25);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 7.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.tagline {
  margin: 12px 0 0;
  font-size: clamp(1rem, 3.8vw, 1.3rem);
  font-weight: 500;
  font-style: italic;
  color: rgba(255, 255, 255, 0.88);
}

/* Gallery */
main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 12px 48px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 4px 22px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy);
}

.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(15, 35, 64, 0), rgba(15, 35, 64, 0.35));
}

.section-title::after {
  background: linear-gradient(90deg, rgba(15, 35, 64, 0.35), rgba(15, 35, 64, 0));
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

@media (min-width: 600px) {
  :root { --gap: 18px; }
  main { padding: 44px 20px 64px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
  :root { --gap: 22px; }
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

.gallery li {
  margin: 0;
}

/* Each photo sits in a white frame like a mounted print */
.tile {
  display: block;
  width: 100%;
  padding: 5px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
  box-shadow:
    0 1px 2px rgba(20, 24, 31, 0.08),
    0 6px 18px rgba(20, 24, 31, 0.10);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  background: var(--tile-bg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tile img.loaded {
  opacity: 1;
}

@media (hover: hover) {
  .tile:hover {
    transform: translateY(-3px);
    box-shadow:
      0 2px 4px rgba(20, 24, 31, 0.08),
      0 14px 30px rgba(20, 24, 31, 0.18);
  }
}

.tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.gallery-status {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}

/* Footer */
.site-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  background: var(--navy-deep);
  border-top: 3px solid var(--accent);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

.site-footer p {
  margin: 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y pinch-zoom;
}

.lightbox[hidden] {
  display: none;
}

.lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lb-img {
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  object-fit: contain;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
}

@media (min-width: 700px) {
  .lb-img {
    max-width: calc(100vw - 140px);
    max-height: calc(100dvh - 80px);
  }
}

.lb-btn {
  position: absolute;
  z-index: 1;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-btn:hover,
.lb-btn:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.lb-btn:focus-visible {
  outline: 2px solid #fff;
}

.lb-close {
  top: calc(10px + env(safe-area-inset-top));
  right: 10px;
  font-size: 2rem;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
  padding-bottom: 4px;
}

.lb-prev { left: 10px; }
.lb-next { right: 10px; }

.lb-counter {
  position: absolute;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: #ddd;
  font-size: 0.9rem;
  pointer-events: none;
}

.lightbox.single .lb-prev,
.lightbox.single .lb-next,
.lightbox.single .lb-counter {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .tile img { transition: none; }
}
