:root {
  --paper: #8ad1e3;
  --paper-soft: #8acee3;
  --ink: #1a1918;
  --ink-soft: #363330;
  --sage: #6b7a63;
  --sage-deep: #4f5c49;
  --gold: #a98a4e;
  --line: #bcd7de;
  --white: #fffdf8;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sage-deep); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Subtle texture wash */
.texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 20% 10%, rgba(107,122,99,0.05), transparent 45%),
                     radial-gradient(circle at 85% 80%, rgba(169,138,78,0.06), transparent 45%);
}

nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: clamp(1.2rem, 4vw, 2.5rem);
  padding: 0.9rem 1rem;
  background: rgba(246,243,236,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-family: "Source Serif 4", serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.3rem 0.1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
nav a:hover, nav a:focus-visible { color: var(--sage-deep); border-color: var(--gold); }
nav a.current { color: var(--sage-deep); border-color: var(--sage-deep); }

/* Home page hero */
header.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(3rem, 8vw, 5.5rem) 1.5rem clamp(2.5rem, 6vw, 4rem);
}

/* Her Story page hero */
header.page-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(2.6rem, 7vw, 4rem) 1.5rem clamp(1.6rem, 4vw, 2.2rem);
}

.eyebrow {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--sage-deep);
  margin: 0 0 0.6rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards;
}

h1.name {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  letter-spacing: 0.01em;
  margin: 0 0 0.3rem;
  color: var(--ink);
  opacity: 0;
  animation: fadeUp 0.9s ease 0.15s forwards;
}

h1.page-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 0.01em;
  margin: 0 0 0.4rem;
  color: var(--ink);
}

.branch {
  width: 130px;
  height: auto;
  margin: 0.6rem auto 1.8rem;
  color: var(--sage);
  opacity: 0;
  animation: fadeUp 0.9s ease 0.3s forwards;
}

.portrait-wrap {
  position: relative;
  width: clamp(200px, 34vw, 280px);
  height: clamp(200px, 34vw, 280px);
  margin: 0 auto 2rem;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.45s forwards;
}

.portrait-frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(44,43,40,0.35);
  background: linear-gradient(160deg, #dfe3d9, #eeeadf);
}

.portrait-frame img,
.portrait-frame .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--sage-deep);
}
.placeholder .monogram {
  font-family: "Cormorant Garamond", serif;
  font-size: 3.2rem;
  font-weight: 500;
}
.placeholder .hint {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  max-width: 140px;
  text-align: center;
}

.dates {
  font-family: "Source Serif 4", serif;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.6s forwards;
}
.dates .sep {
  display: inline-block;
  margin: 0 0.7em;
  color: var(--gold);
}
.dates .label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 0.15rem;
}
.dates-row {
  display: inline-flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

main { position: relative; z-index: 1; }

section {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(2.4rem, 6vw, 4rem) 1.5rem;
}

section + section { border-top: 1px solid var(--line); }

h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  text-align: center;
  margin: 0 0 1.4rem;
  color: var(--ink);
}

.life-text {
  font-size: 1.08rem;
  color: var(--ink-soft);
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

/* Her Story narrative sections */
.story-text {
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.story-text p { margin: 0 0 1rem; }
.story-text p:last-child { margin-bottom: 0; }

.fact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.6rem 1.9rem;
  margin-top: 0.4rem;
}

.fact-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0;
}
.fact-row + .fact-row { border-top: 1px dashed var(--line); }
.fact-label {
  flex: 0 0 120px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage-deep);
  padding-top: 0.15rem;
}
.fact-value { color: var(--ink); }

/* Gallery */
#gallery { max-width: 980px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-top: 1.5rem;
  transition: opacity 0.35s ease;
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gallery-grid.fading { opacity: 0; }

.gallery-item {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

.gallery-item.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.6rem;
  cursor: default;
}
.gallery-item.empty:hover img { transform: none; }

.gallery-controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.gallery-arrow {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--sage-deep);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.gallery-arrow:hover { background: var(--paper-soft); border-color: var(--gold); }

.gallery-page-indicator {
  font-family: "Source Serif 4", serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  min-width: 84px;
  text-align: center;
  white-space: nowrap;
}

/* Slideshow page */
main.slideshow-page {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 130px);
}

#slideshow {
  max-width: 1000px;
  width: 100%;
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.slideshow-stage {
  max-width: 900px;
  margin: 0 auto;
}

.slideshow-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  cursor: pointer;
  box-shadow: 0 18px 40px -18px rgba(44,43,40,0.35);
}

.slideshow-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.4s ease;
}

.slideshow-main.fading img { opacity: 0; }

.slideshow-thumbs {
  display: flex;
  flex-direction: row;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1rem;
}

.slideshow-thumb {
  flex: 0 0 auto;
  width: clamp(72px, 16vw, 130px);
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  cursor: pointer;
}

.slideshow-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.slideshow-thumb:hover img { transform: scale(1.05); }
.slideshow-thumb.fading img { opacity: 0; }

@media (max-width: 560px) {
  .slideshow-thumbs { gap: 0.5rem; }
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30,29,26,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(90vw, 900px);
  max-height: 85vh;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
}
footer .flourish {
  width: 60px;
  color: var(--sage);
  margin: 0 auto 1rem;
}

#top { scroll-margin-top: 70px; }
section { scroll-margin-top: 70px; }
