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

:root {
  --gold: #C9A84C;
  --gold-light: #E8C96A;
  --gold-dim: rgba(201,168,76,0.15);
  --dark: #111010;
  --surface: #1a1916;
  --surface2: #221f1b;
  --text: #f0ece4;
  --text-muted: rgba(240,236,228,0.45);
  --text-mid: rgba(240,236,228,0.7);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  cursor: default;
}

/* ── MUSIC PLAYER ── */

#player {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(17,16,16,0.85);
  border: 0.5px solid rgba(201,168,76,0.3);
  border-radius: 50px;
  padding: 0.6rem 1.2rem 0.6rem 0.7rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s;
}

#player:hover {
  border-color: var(--gold);
}

#play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 14px;
  flex-shrink: 0;
}

#play-btn:hover {
  background: var(--gold-dim);
}

#player-label {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 200;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eq-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
}

.eq-bars span {
  width: 2px;
  background: var(--gold);
  border-radius: 1px;
  animation: eq 0.8s ease-in-out infinite alternate;
  opacity: 0;
}

.eq-bars span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.eq-bars span:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.eq-bars span:nth-child(3) { height: 14px; animation-delay: 0.3s; }
.eq-bars span:nth-child(4) { height: 8px;  animation-delay: 0.45s; }

.eq-bars.playing span {
  opacity: 1;
}

@keyframes eq {
  from { transform: scaleY(0.3); }
  to   { transform: scaleY(1); }
}

/* ── HERO ── */

#hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(20%) brightness(0.75);
  transition: transform 8s ease;
}

#hero:hover .hero-img {
  transform: scale(1.03);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(17,16,16,0.1) 0%,
    rgba(17,16,16,0.05) 40%,
    rgba(17,16,16,0.6) 70%,
    rgba(17,16,16,0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 clamp(1.5rem, 8vw, 7rem) clamp(3rem, 7vh, 5rem);
}

.hero-eyebrow {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 1s 0.3s forwards;
}

.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text);
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 1.1s 0.5s forwards;
}

.hero-name em {
  font-style: italic;
  color: var(--gold-light);
}

.hero-divider {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 1.5rem 0;
  opacity: 0;
  animation: fadeUp 1s 0.8s forwards;
}

.hero-tagline {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: clamp(13px, 1.5vw, 16px);
  letter-spacing: 0.08em;
  color: var(--text-mid);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 1s 1s forwards;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,168,76,0.4);
  padding-bottom: 4px;
  transition: border-color 0.3s, gap 0.3s;
  opacity: 0;
  animation: fadeUp 1s 1.2s forwards;
}

.hero-cta:hover {
  border-color: var(--gold);
  gap: 1.1rem;
}

.hero-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}

.hero-cta:hover svg {
  transform: translateX(4px);
}

/* ── MESSAGE SECTION ── */

#message {
  padding: clamp(5rem, 12vh, 9rem) clamp(1.5rem, 8vw, 7rem);
  max-width: 900px;
  margin: 0 auto;
}

.section-label {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--gold);
  opacity: 0.4;
}

.message-quote {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  line-height: 1.55;
  color: var(--text);
  position: relative;
  padding-left: 2rem;
  border-left: 1px solid rgba(201,168,76,0.4);
}

.message-quote::before {
  content: '\201C';
  font-family: 'Cormorant Garamond', serif;
  font-size: 6rem;
  color: var(--gold);
  opacity: 0.2;
  position: absolute;
  top: -1.5rem;
  left: -0.5rem;
  line-height: 1;
}

/* ── GALLERY ── */

#gallery {
  padding: clamp(4rem, 10vh, 7rem) clamp(1.5rem, 5vw, 4rem);
}

.gallery-header {
  text-align: center;
  margin-bottom: 3rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4/5;
  background: var(--surface2);
  cursor: pointer;
}

.gallery-item:first-child {
  grid-row: span 1;
  aspect-ratio: 4/5;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(10%);
  transition: transform 0.6s ease, filter 0.4s;
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(17,16,16,0);
  transition: background 0.4s;
}

.gallery-item:hover .overlay {
  background: rgba(17,16,16,0.2);
}

.swipe-hint {
  display: none;
}

@media (min-width: 641px) {
  .gallery-grid {
    align-items: start;
  }

  .gallery-item,
  .gallery-item:first-child {
    aspect-ratio: auto;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }

  .gallery-item img {
    height: auto;
    object-fit: contain;
    border-radius: 16px;
  }
}

/* ── FINAL NOTE ── */

#final-note {
  padding: clamp(5rem, 12vh, 9rem) clamp(1.5rem, 8vw, 7rem);
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.final-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.final-ornament span {
  width: 40px;
  height: 1px;
  background: var(--gold);
  opacity: 0.4;
}

.final-ornament svg {
  color: var(--gold);
  opacity: 0.7;
  width: 20px;
  height: 20px;
}

.final-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 3rem;
}

.final-signature {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--gold);
  letter-spacing: 0.02em;
}

.final-from {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ── FOOTER ── */

footer {
  padding: 2.5rem clamp(1.5rem, 5vw, 4rem);
  border-top: 0.5px solid rgba(201,168,76,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.footer-brand strong {
  color: var(--gold);
  font-weight: 400;
}

.footer-cta {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-cta:hover {
  color: var(--gold);
}

/* ── REVEAL ANIMATIONS ── */

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

@keyframes swipeHint {
  0%, 100% {
    transform: translate(-50%, -50%) translateX(-7px);
  }
  50% {
    transform: translate(-50%, -50%) translateX(7px);
  }
}

@keyframes hintIntro {
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes hintFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── MOBILE ── */

@media (max-width: 640px) {
  #gallery {
    padding-top: clamp(4rem, 9vh, 6rem);
    padding-bottom: clamp(5rem, 10vh, 7rem);
  }

  .gallery-header {
    margin-bottom: 2rem;
  }

  .gallery-grid {
    position: relative;
    display: block;
    width: min(100%, 340px);
    margin: 0 auto;
    touch-action: pan-y;
    user-select: none;
  }

  .swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid rgba(232,201,106,0.45);
    border-radius: 999px;
    background: rgba(17,16,16,0.72);
    color: var(--gold-light);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.34);
    pointer-events: none;
    animation:
      hintIntro 0.5s ease forwards,
      swipeHint 1.1s ease-in-out 0.5s infinite;
    opacity: 0;
    transform: translate(-50%, -50%);
  }

  .swipe-hint svg {
    width: 15px;
    height: 15px;
  }

  .gallery-grid.has-swiped .swipe-hint {
    animation: hintFadeOut 0.2s ease forwards;
  }

  .gallery-item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    aspect-ratio: auto;
    border-radius: 0;
    cursor: grab;
    box-shadow: none;
    background: transparent;
    overflow: visible;
    transform: scale(calc(1 - (var(--stack-index, 0) * 0.045))) rotate(calc(var(--stack-index, 0) * -1.4deg));
    transform-origin: center bottom;
    opacity: 0;
    pointer-events: none;
    z-index: calc(10 - var(--stack-index, 0));
    transition: transform 0.35s ease;
  }

  .gallery-item img {
    height: auto;
    border-radius: 14px;
    box-shadow: 0 22px 45px rgba(0,0,0,0.38);
  }

  .gallery-item .overlay {
    display: none;
  }

  .gallery-item.is-next,
  .gallery-item.is-third {
    opacity: 0.42;
  }

  .gallery-item.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  .gallery-item.is-dragging {
    cursor: grabbing;
    transition: none;
  }

  .gallery-item.is-exiting {
    opacity: 0;
    pointer-events: none;
    transform: translateX(var(--exit-x, 120%)) rotate(var(--exit-rotation, 12deg));
  }

  #player {
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    justify-content: flex-start;
    width: auto;
    border: 0.5px solid rgba(201,168,76,0.3);
    border-radius: 50px;
    padding: 0.65rem 1rem 0.65rem 0.75rem;
  }

  #player-label {
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  footer {
    justify-content: center;
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
    text-align: center;
  }
}
