:root {
  --bg: #faf6f0;
  --ink: #2a1f1a;
  --rose: #c97268;
  --rose-deep: #8e3a31;
  --gold: #b08b4f;
  --paper: #fffdf8;
  --shadow: 0 12px 40px rgba(60, 30, 20, 0.18);
  --shadow-soft: 0 4px 18px rgba(60, 30, 20, 0.08);
  --serif: 'Cormorant Garamond', 'Hoefler Text', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Slideshow timing — kept in sync with JS */
  --slide-fade: 1.6s;
  --slide-kb: 7s;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ============ HERO ============ */
#hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: #000;
}

.slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #000;
}

/* ============ SLIDE ============ */
.slide {
  position: absolute;
  inset: 0;
  background-color: #000;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.0) translate(0, 0);
  transform-origin: center;
  transition: opacity var(--slide-fade) ease, transform var(--slide-fade) ease;
  will-change: opacity, transform;
  display: block;
}

/* Single-image landscape: cover */
.slide[data-mode="single-cover"] {
  background-size: cover;
}

/* Single-image portrait (rare — only if odd portrait left over): contain */
.slide[data-mode="single-contain"] {
  background-size: contain;
}

/* Pair of portraits side-by-side */
.slide[data-mode="pair"] {
  display: flex;
  gap: 0;
  background-image: none !important;
}

.slide[data-mode="pair"] .slide-half {
  flex: 1 1 50%;
  height: 100%;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-width: 0;
}

/* Active state: opacity + Ken Burns */
.slide.active {
  opacity: 1;
  animation: kbV1 var(--slide-kb) ease-out forwards;
}
.slide.active.kb-2 { animation-name: kbV2; }
.slide.active.kb-3 { animation-name: kbV3; }
.slide.active.kb-4 { animation-name: kbV4; }

@keyframes kbV1 {
  from { transform: scale(1.0)  translate(0, 0); }
  to   { transform: scale(1.10) translate(-1.5%, -1%); }
}
@keyframes kbV2 {
  from { transform: scale(1.10) translate(1.2%, -0.8%); }
  to   { transform: scale(1.0)  translate(0, 0); }
}
@keyframes kbV3 {
  from { transform: scale(1.05) translate(-1.5%, 0); }
  to   { transform: scale(1.05) translate(1.5%, 0); }
}
@keyframes kbV4 {
  from { transform: scale(1.05) translate(0, -1%); }
  to   { transform: scale(1.10) translate(0, 1%); }
}

/* ============ HERO HEADLINE (fades after 5s) ============ */
.hero-headline {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--paper);
  text-shadow: 0 2px 16px rgba(0,0,0,0.45);
  padding: 0 1.5rem;
  pointer-events: none;
  animation: heroIn 1.2s ease 0.3s both, heroOut 2s ease 5s forwards;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); visibility: hidden; }
}

.hero-headline.no-fade {
  animation: heroIn 1.2s ease 0.3s both;
}

.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: clamp(0.7rem, 1.5vw, 0.95rem);
  font-weight: 500;
  opacity: 0.92;
  margin-bottom: 1.5rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(3rem, 12vw, 8rem);
  line-height: 0.95;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.sub {
  font-family: var(--serif);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-style: italic;
  opacity: 0.95;
}

/* ============ HERO TOP/BOTTOM BARS ============ */
.hero-topbar, .hero-bottombar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  height: 5%;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 clamp(1rem, 3vw, 2rem);
  color: var(--paper);
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.6s ease, background 0.6s ease;
}

.hero-topbar {
  top: 0;
  justify-content: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent);
}

.hero-bottombar {
  bottom: 0;
  justify-content: space-between;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.hero-topbar > *, .hero-bottombar > * { pointer-events: auto; }

body.scrolled .hero-topbar,
body.scrolled .hero-bottombar,
body.headline-faded .hero-topbar,
body.headline-faded .hero-bottombar {
  opacity: 0.95;
}

.topbar-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.scroll-hint {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.scroll-hint:hover { opacity: 1; }
.scroll-hint svg {
  animation: nudge 1.8s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

#audio-toggle {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--paper);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

#audio-toggle:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

#audio-toggle.no-audio {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============ ALBUM ============ */
#album {
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 4rem);
  max-width: 1600px;
  margin: 0 auto;
}

.album-intro {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.album-intro h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--rose-deep);
  margin-bottom: 1rem;
}

.album-intro p {
  font-size: 1.05rem;
  color: var(--ink);
  opacity: 0.75;
}

.year-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 3rem;
  position: sticky;
  top: 0;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1rem;
  z-index: 10;
  border-radius: 12px;
}

.year-pill {
  background: transparent;
  border: 1px solid rgba(176, 139, 79, 0.3);
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.year-pill:hover {
  background: var(--rose);
  color: white;
  border-color: var(--rose);
}

.year-section {
  margin-bottom: 4rem;
  scroll-margin-top: 5rem;
}

.year-header {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--gold);
  margin-bottom: 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(176, 139, 79, 0.2);
  padding-bottom: 0.5rem;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .year-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
  }
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  background: #ebe2d6;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.thumb:hover img {
  transform: scale(1.04);
}

/* ============ FOOTER ============ */
#footer {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background: linear-gradient(to bottom, transparent, rgba(201, 114, 104, 0.08));
}

.signoff {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--rose-deep);
  margin-bottom: 2rem;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.share-buttons a, .share-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  color: var(--rose-deep);
  text-decoration: none;
  border: 1px solid rgba(201, 114, 104, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-soft);
}

.share-buttons a:hover, .share-buttons button:hover {
  background: var(--rose);
  color: white;
  transform: translateY(-2px);
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox[hidden] { display: none !important; }

.lb-content {
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}

#lb-img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lb-caption {
  margin-top: 1rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-family: var(--serif);
  font-style: italic;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,0.25);
}

.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .lb-prev, .lb-next { width: 40px; height: 40px; font-size: 1.5rem; }
}

/* ============ MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .slide.active { animation: none; }
  .scroll-hint svg { animation: none; }
  .hero-headline { animation: heroIn 0.3s ease both; }
  * { transition: none !important; }
}
