/* ---------- Tokens ---------- */
:root {
  --off-white: #f8f4ee;
  --linen: #efe7da;
  --beige: #e4d8c6;
  --taupe: #b4a290;
  --taupe-dark: #8f7c68;
  --brown: #5c4632;
  --brown-deep: #3c2e21;
  --terracotta: #b9744f;
  --terracotta-dark: #9c5e3d;
  --text: #4a3c30;
  --text-soft: #83705d;
  --border: rgba(92, 70, 50, 0.14);
  --shadow: 0 10px 30px rgba(60, 46, 33, 0.12);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", sans-serif;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--off-white);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--off-white);
  background: linear-gradient(160deg, var(--brown) 0%, var(--taupe-dark) 55%, var(--terracotta-dark) 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero--photo { background-blend-mode: overlay; }
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(40, 30, 22, 0.35) 0%, rgba(40, 30, 22, 0.55) 100%);
}
.hero__content { position: relative; padding: 0 1.5rem; max-width: 46rem; }
.hero__kicker {
  font-family: var(--sans);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--beige);
  margin: 0 0 1.1rem;
}
.hero__names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5rem);
  margin: 0;
  letter-spacing: 0.01em;
}
.hero__date {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--beige);
  margin: 0.6rem 0 0;
}
.hero__divider { margin: 1.8rem auto 0; opacity: 0.8; }
.hero__divider svg { stroke: var(--beige); fill: var(--beige); }
.hero__divider line { stroke-width: 1; }

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--beige);
  text-decoration: none;
  font-size: 1.3rem;
  opacity: 0.8;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

.nav-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.nav-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--off-white);
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Nav ---------- */
.sitenav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 244, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.sitenav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  gap: 1.9rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.sitenav__inner::-webkit-scrollbar { display: none; }
.sitenav__inner a {
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  white-space: nowrap;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.sitenav__inner a:hover,
.sitenav__inner a.active {
  color: var(--terracotta-dark);
  border-color: var(--terracotta);
}

/* ---------- Intro ---------- */
.intro {
  max-width: 42rem;
  margin: 5rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}
.intro h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--brown-deep);
  margin: 0 0 1rem;
}
.intro p {
  color: var(--text-soft);
  font-size: 1.02rem;
  margin: 0;
}

/* ---------- Sections / gallery ---------- */
.gallery-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.2rem 1.5rem 1rem;
  scroll-margin-top: 4.5rem;
}
.gallery-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.6rem;
}
.gallery-section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--brown-deep);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.gallery-section__count {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text-soft);
  letter-spacing: 0.03em;
}

.btn {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--off-white);
  background: var(--brown);
  border: 1px solid var(--brown);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); }
.btn:active { transform: scale(0.97); }
.btn--ghost {
  background: transparent;
  color: var(--brown);
}
.btn--ghost:hover { background: var(--brown); color: var(--off-white); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 160px;
  grid-auto-flow: dense;
  gap: 10px;
}
.gallery-grid__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--linen);
  cursor: pointer;
  grid-row: span 1;
}
.gallery-grid__item.is-portrait { grid-row: span 2; }
.gallery-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.4s ease;
  opacity: 0;
}
.gallery-grid__item img.loaded { opacity: 1; }
.gallery-grid__item:hover img { transform: scale(1.045); }
.gallery-grid__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(60,46,33,0) 60%, rgba(60,46,33,0.28) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gallery-grid__item:hover::after { opacity: 1; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 5rem 1.5rem;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.site-footer p { margin: 0.25rem 0; }
.site-footer p:last-child { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--taupe-dark); margin-top: 0.6rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30, 22, 16, 0.94);
  display: flex;
  flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  color: var(--beige);
}
.lightbox__counter { font-size: 0.85rem; letter-spacing: 0.05em; }
.lightbox__actions { display: flex; gap: 0.6rem; }
.lightbox__btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--off-white);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox__btn:hover { background: rgba(255,255,255,0.22); }
.lightbox__close { font-size: 1rem; line-height: 1; padding: 0.5rem 0.75rem; }

.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4rem 1.2rem;
  min-height: 0;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--off-white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.lightbox__prev { left: 1.2rem; }
.lightbox__next { right: 1.2rem; }

/* ---------- Zip toast ---------- */
.zip-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  background: var(--brown-deep);
  color: var(--off-white);
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}
.zip-toast[hidden] { display: none; }
.zip-toast__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--off-white);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .sitenav { display: none; }
  .sitenav.is-open { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--off-white); overflow-y: auto; padding-top: 5rem; }
  .sitenav.is-open .sitenav__inner { flex-direction: column; gap: 1.4rem; padding: 1.5rem 2rem; }
  .sitenav.is-open .sitenav__inner a { font-size: 1.05rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: 120px; gap: 6px; }
  .lightbox__stage { padding: 0 3.2rem 1rem; }
  .lightbox__nav { width: 38px; height: 38px; font-size: 1.3rem; }
  .gallery-section__head { flex-direction: column; align-items: flex-start; }
}

/* ---------- Dark mode: keep the warm palette, don't invert ---------- */
@media (prefers-color-scheme: dark) {
  body { background: var(--off-white); color: var(--text); }
}
