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

:root {
  --cream: #f5f0ea;
  --warm-white: #faf8f5;
  --charcoal: #2a2724;
  --muted: #8a8078;
  --gold: #c9a96e;
  --gold-light: #e8d5b0;
  --overlay-bg: rgba(30, 26, 22, 0.92);
}

html { scroll-behavior: auto; }

body {
  background: var(--warm-white);
  color: var(--charcoal);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
}

#hero-section {
  position: relative;
  background: var(--warm-white);
}

#hero-title {
  position: fixed;
  top: 50vh;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(3rem, 9vw, 7.5rem);
  letter-spacing: 0.04em;
  color: var(--charcoal);
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

#hero-title.nudge {
  animation: scroll-nudge 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes scroll-nudge {
  0%   { transform: translate(-50%, -50%); }
  35%  { transform: translate(-50%, calc(-50% + 10px)); }
  65%  { transform: translate(-50%, calc(-50% + 6px)); }
  100% { transform: translate(-50%, -50%); }
}

#hero-title .amp {
  color: var(--gold);
  font-style: normal;
  margin: 0 0.12em;
}

#hero-subtitle {
  position: fixed;
  top: 80vh;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: normal;
  font-size: clamp(2rem, 1vw, 1rem);
  letter-spacing: 0.04em;
  color: var(--charcoal);
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* Covers the gallery content while the title is still visible */
#hero-cover {
  position: fixed;
  inset: 0;
  background: var(--warm-white);
  z-index: 5;
  pointer-events: none;
}

/* ─── GALLERY ─────────────────────────────────────────────── */
#gallery-section {
  position: relative;
  z-index: 1;
  padding: 20px 20px 80px;
  background: var(--warm-white);
}

#gallery-grid {
  column-count: 5;
  column-gap: 12px;
}

@media (max-width: 1024px) { #gallery-grid { column-count: 4; } }
@media (max-width: 768px) { #gallery-grid { column-count: 3; } }
@media (max-width: 480px) { #gallery-grid { column-count: 1; } }

.gallery-item {
  border-radius: 15px;
  break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.04);
  min-height: 180px;
}

.gallery-item.loading {
  background: rgba(0, 0, 0, 0.08);
}

.gallery-item.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0) 100%);
  opacity: 0.5;
  animation: shimmer 1.3s infinite;
}

.gallery-item > img {
  width: 100%;
  display: block;
  opacity: 0;
  transform: scale(1);
  filter: saturate(0.95);
}

.gallery-item > img.loaded {
  animation: photo-pop 0.38s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

.gallery-item > img.settled {
  opacity: 1;
  transform: scale(1);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s;
}

.gallery-item:hover > img.settled {
  transform: scale(1.04);
  filter: saturate(1.05) brightness(0.88);
}

@keyframes photo-pop {
  0%   { opacity: 0; transform: scale(0.80); }
  55%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1.00); }
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s;
}

.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.zoom-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.85);
  background: rgba(42, 39, 36, 0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.zoom-btn:hover { transform: scale(1.12); background: rgba(201, 169, 110, 0.6); }

#gallery-empty {
  text-align: center;
  padding: 80px 20px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--muted);
  display: none;
}

/* ─── LIGHTBOX ────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
  padding: 24px;
}

#lightbox.active {
  opacity: 1;
  pointer-events: all;
}

#lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  display: block;
  opacity: 0;
  transition: opacity 0.4s;
}

#lightbox-img.loaded { opacity: 1; }

#lightbox-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 36px; height: 36px;
  border: 2px solid rgba(201,169,110,0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#lightbox-controls { display: flex; gap: 14px; }

.lb-btn {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 22px;
  border: 1px solid rgba(201,169,110,0.6);
  background: transparent;
  color: var(--gold-light);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lb-btn:hover { background: var(--gold); color: var(--charcoal); }

.lb-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(42,39,36,0.7);
  color: white;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.lb-close:hover { background: rgba(201,169,110,0.7); }

.lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(42,39,36,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  width: 44px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s;
  z-index: 101;
}

#lb-prev { left: 12px; }
#lb-next { right: 12px; }
.lb-arrow:hover { background: rgba(201,169,110,0.5); }

/* ─── CLOSING ─────────────────────────────────────────────── */
#closing {
  height: 400vh; /* enough for the slow parallax to reach center */
  background: var(--warm-white);
  position: relative;
}

#closing-inner {
  position: fixed;
  top: 50vh;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  pointer-events: none;
  z-index: 10;
  width: 100%;
}

#closing-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.6rem, 4.5vw, 3.6rem);
  color: var(--gold-light);
  text-align: center;
  line-height: 1.4;
  max-width: 800px;
  padding: 0 2rem;
  transition: color 1.6s ease;
}

#closing-text.visible { color: var(--charcoal); }

.closing-rule {
  width: 80px;
  height: 1px;
  background: var(--gold);
  opacity: 0.15;
  transition: opacity 1.2s ease 0.5s;
}

.closing-rule.visible { opacity: 1; }

/* ─── HAMBURGER BUTTON ────────────────────────────────────── */
#hamburger {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 300;
  width: 44px;
  height: 44px;
  background: rgba(250, 248, 245, 0.85);
  border: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
}

#hamburger:hover {
  background: rgba(250, 248, 245, 1);
  border-color: var(--gold);
  transform: scale(1.07);
}

#hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

/* Animate to X when menu is open */
body.menu-open #hamburger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open #hamburger span:nth-child(2) { opacity: 0; width: 0; }
body.menu-open #hamburger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── MENU OVERLAY ────────────────────────────────────────── */
#menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: rgba(42, 39, 36, 0.45);
  backdrop-filter: blur(2px);
}

body.menu-open #menu-overlay {
  pointer-events: all;
  opacity: 1;
}

#menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: var(--warm-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  gap: 2rem;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 8px 0 40px rgba(0,0,0,0.12);
}

body.menu-open #menu-panel {
  transform: translateX(0);
}

.menu-rule {
  width: 40px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

#menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid rgba(138, 128, 120, 0.12);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--charcoal);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.01em;
  transition: color 0.2s, padding-left 0.2s;
  text-align: left;
  width: 100%;
}

.menu-item:first-child {
  border-top: 1px solid rgba(138, 128, 120, 0.12);
}

.menu-item:hover {
  color: var(--gold);
  padding-left: 6px;
}

.menu-item-arrow {
  font-style: normal;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}

.menu-item:hover .menu-item-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

#menu-footer {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.menu-amp {
  color: var(--gold);
}

/* ─── KEEP SCROLLING HINT ─────────────────────────────────── */
#keep-scrolling {
  position: fixed;
  bottom: 40%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 2.2s ease 1.4s;
  white-space: nowrap;
}

#keep-scrolling.visible {
  opacity: 1;
}

#keep-scrolling.snap {
  transition: opacity 0.15s ease;
}

#keep-scrolling::after {
  content: '';
  display: block;
  margin: 8px auto 0;
  width: 1px;
  height: 24px;
  background: var(--gold);
  opacity: 0.6;
  animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.2; transform: scaleY(0.6); }
  50%       { opacity: 0.8; transform: scaleY(1); }
}

/* subtle grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 200;
  opacity: 0.4;
}