/* ===== VARIABLES ===== */
:root {
  --terracotta: #C4704A;
  --terracotta-dark: #A05535;
  --terracotta-light: #E8A07A;
  --terracotta-pale: #F5E6DC;
  --terracotta-very-pale: #FBF4EF;
  --warm-white: #FEFAF6;
  --cream: #F7EFE5;
  --sand: #E8D9C8;
  --parchment: #DFC9A8;
  --brown-soft: #7D5A45;
  --text-dark: #2C1810;
  --text-mid: #6B4226;
  --text-light: #A0795A;
  --gold: #C9A96E;
  --gold-light: #E8D0A0;

  --font-display: 'Cinzel', serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Lato', sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--warm-white);
  color: var(--text-dark);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--text-dark);
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(196,112,74,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201,169,110,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(196,112,74,0.2) 0%, transparent 50%),
    linear-gradient(160deg, #1a0c06 0%, #2C1810 40%, #3d2214 100%);
  z-index: 0;
}

/* Texture grain */
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.4;
  z-index: 1;
}

/* Pétales flottants */
.petal {
  position: absolute;
  border-radius: 50% 0 50% 0;
  opacity: 0;
  animation: float-petal 12s ease-in-out infinite;
  z-index: 2;
}
.petal-1 { width: 12px; height: 18px; background: rgba(196,112,74,0.4); top: 15%; left: 10%; animation-delay: 0s; }
.petal-2 { width: 8px; height: 12px; background: rgba(201,169,110,0.35); top: 30%; left: 85%; animation-delay: 2s; }
.petal-3 { width: 15px; height: 22px; background: rgba(196,112,74,0.3); top: 60%; left: 20%; animation-delay: 4s; }
.petal-4 { width: 10px; height: 15px; background: rgba(201,169,110,0.4); top: 70%; left: 75%; animation-delay: 6s; }
.petal-5 { width: 7px; height: 11px; background: rgba(196,112,74,0.35); top: 45%; left: 50%; animation-delay: 8s; }

@keyframes float-petal {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  15% { opacity: 0.8; }
  85% { opacity: 0.4; }
  100% { opacity: 0; transform: translateY(-120px) rotate(180deg) translateX(40px); }
}

.hero-content {
  position: relative; z-index: 3;
  text-align: center;
  color: white;
  padding: 2rem;
  animation: hero-reveal 1.4s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes hero-reveal {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-pre {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  line-height: 1;
  color: var(--warm-white);
  text-shadow: 0 2px 40px rgba(196,112,74,0.4);
  margin-bottom: 1rem;
}

.hero-names {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-style: italic;
  color: var(--terracotta-light);
  margin: 0.5rem 0;
}

.hero-date {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0.85;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2rem;
}

.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 3; color: rgba(255,255,255,0.5);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ===== ORNAMENT ===== */
.divider-ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; color: var(--terracotta); margin: 1rem auto;
}
.divider-ornament span {
  display: block; height: 1px; width: 60px;
  background: linear-gradient(90deg, transparent, var(--terracotta), transparent);
}
.divider-ornament.small span { width: 40px; }
.divider-ornament svg { flex-shrink: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 2rem; border-radius: 2px;
  font-family: var(--font-sans); font-size: 0.82rem;
  font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: all 0.25s ease;
  border: 1px solid transparent;
}
.btn-solid {
  background: var(--terracotta); color: white; border-color: var(--terracotta);
}
.btn-solid:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(196,112,74,0.35); }
.btn-outline {
  background: transparent; color: white; border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; }
.section .btn-outline { color: var(--terracotta); border-color: var(--terracotta); }
.section .btn-outline:hover { background: var(--terracotta-pale); }
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.78rem; }
.btn-google { background: var(--terracotta); border-color: var(--terracotta); gap: 0.75rem; }
.btn-link { background: none; border: none; color: var(--text-light); font-size: 0.8rem; cursor: pointer; text-decoration: underline; }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 64px;
  background: rgba(254,250,246,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand);
  transform: translateY(-100%); transition: transform 0.4s ease;
}
.nav.visible { transform: translateY(0); }

.nav-logo {
  font-family: var(--font-display); font-size: 1.1rem;
  letter-spacing: 0.2em; color: var(--terracotta); font-weight: 600;
}
.nav-links {
  display: flex; list-style: none; gap: 2rem;
}
.nav-links a {
  font-family: var(--font-sans); font-size: 0.78rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-mid); text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--terracotta); }
.nav-owner-btn {
  background: none; border: 1px solid var(--sand); border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer; font-size: 1rem;
  color: var(--text-light); transition: all 0.2s;
}
.nav-owner-btn:hover { border-color: var(--terracotta); color: var(--terracotta); }

/* ===== SECTIONS ===== */
.section { padding: 6rem 2rem; }
.section-light { background: var(--terracotta-very-pale); }
.section-inner { max-width: 1100px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-label {
  font-family: var(--font-sans); font-size: 0.78rem;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--terracotta); margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400; color: var(--text-dark);
  letter-spacing: 0.05em; margin-bottom: 1rem;
}
.section-desc { font-family: var(--font-serif); font-size: 1.1rem; color: var(--text-mid); font-style: italic; }

/* ===== TIMELINE ===== */
.timeline {
  position: relative; max-width: 800px; margin: 0 auto;
  padding: 1rem 0;
}
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 1px; background: linear-gradient(to bottom, transparent, var(--terracotta-light), var(--terracotta), var(--terracotta-light), transparent);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex; align-items: flex-start; gap: 2rem;
  margin-bottom: 3rem; position: relative;
  animation: slide-in 0.6s ease both;
  animation-delay: var(--delay, 0s);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
.timeline-item.right { flex-direction: row-reverse; }
.timeline-item.right { animation-name: slide-in-right; }
@keyframes slide-in-right { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

.timeline-time {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  color: var(--terracotta); min-width: 80px; text-align: right;
  padding-top: 0.5rem; letter-spacing: 0.05em;
}
.timeline-item.right .timeline-time { text-align: left; }

.timeline-dot {
  position: absolute; left: 50%; top: 0.8rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--terracotta); border: 3px solid var(--warm-white);
  box-shadow: 0 0 0 2px var(--terracotta-light);
  transform: translateX(-50%); flex-shrink: 0; z-index: 2;
}

.timeline-card {
  flex: 1; background: white;
  padding: 1.4rem 1.8rem; border-radius: 4px;
  border: 1px solid var(--sand); border-left: 3px solid var(--terracotta);
  box-shadow: 0 4px 20px rgba(196,112,74,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.timeline-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(196,112,74,0.15); }
.timeline-item.right .timeline-card { border-left: 1px solid var(--sand); border-right: 3px solid var(--terracotta); }

.timeline-icon { font-size: 1.5rem; margin-bottom: 0.4rem; }
.timeline-card h3 {
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  color: var(--text-dark); letter-spacing: 0.05em; margin-bottom: 0.3rem;
}
.timeline-card p { font-family: var(--font-serif); font-size: 1rem; color: var(--text-mid); }
.timeline-sub { font-size: 0.88rem; color: var(--text-light); font-style: italic; }

/* ===== QR + CONNECT ===== */
.qr-connect-wrapper {
  display: flex; gap: 3rem; justify-content: center; align-items: flex-start;
  flex-wrap: wrap; margin-bottom: 4rem;
}

.qr-card {
  background: white; border: 1px solid var(--sand);
  border-radius: 4px; padding: 2rem;
  text-align: center; box-shadow: 0 4px 20px rgba(196,112,74,0.08);
  flex: 0 0 220px;
}
.qr-box {
  width: 160px; height: 160px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); border: 1px solid var(--sand);
}
.qr-box canvas { display: block; }
.qr-label { font-size: 0.82rem; color: var(--text-light); line-height: 1.5; }

.connect-card {
  background: white; border: 1px solid var(--sand);
  border-radius: 4px; padding: 2rem;
  box-shadow: 0 4px 20px rgba(196,112,74,0.08);
  flex: 1; min-width: 280px; max-width: 420px;
}
.connect-card h3 {
  font-family: var(--font-display); font-size: 1.2rem;
  color: var(--text-dark); margin-bottom: 0.5rem; letter-spacing: 0.05em;
}
.connect-card p { font-size: 0.92rem; color: var(--text-mid); margin-bottom: 1.5rem; }

.guest-profile {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.5rem; padding: 0.75rem;
  background: var(--terracotta-very-pale); border-radius: 4px;
}
.guest-profile img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.guest-name { font-weight: 400; font-size: 0.95rem; color: var(--text-dark); }
.guest-sub { font-size: 0.78rem; color: var(--text-light); }

.upload-zone {
  border: 2px dashed var(--sand); border-radius: 4px;
  padding: 2rem; text-align: center; cursor: pointer;
  transition: all 0.25s ease; background: var(--warm-white);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--terracotta); background: var(--terracotta-very-pale); }
.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-zone p { font-size: 0.9rem; color: var(--text-mid); margin-bottom: 0.25rem; }
.upload-sub { font-size: 0.8rem; color: var(--text-light); margin: 0.25rem 0 0.75rem; }

.progress-bar { height: 4px; background: var(--sand); border-radius: 2px; margin: 1rem 0 0.5rem; overflow: hidden; }
.progress-fill { height: 100%; background: var(--terracotta); border-radius: 2px; transition: width 0.3s ease; width: 0%; }
#progressLabel { font-size: 0.82rem; color: var(--text-light); }

/* ===== GALLERY ===== */
.gallery-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sand);
  font-size: 0.85rem; color: var(--text-mid);
}

.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.gallery-empty {
  grid-column: 1/-1; text-align: center; padding: 4rem;
  font-family: var(--font-serif); font-size: 1.1rem; font-style: italic;
  color: var(--text-light);
}

.gallery-item {
  position: relative; aspect-ratio: 1;
  background: var(--sand); border-radius: 4px; overflow: hidden;
  cursor: pointer; border: 1px solid var(--sand);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery-item:hover { transform: scale(1.02); box-shadow: 0 8px 25px rgba(196,112,74,0.2); }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; }
.gallery-item .item-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(44,24,16,0.7) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.25s ease; display: flex; flex-direction: column; justify-content: flex-end; padding: 0.75rem;
}
.gallery-item:hover .item-overlay { opacity: 1; }
.item-owner { font-size: 0.78rem; color: white; font-family: var(--font-sans); }
.item-delete {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(0,0,0,0.5); color: white; border: none; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: 0.75rem;
  display: none; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.item-delete:hover { background: rgba(196,112,74,0.9); }
.gallery-item:hover .item-delete.visible { display: flex; }
.video-badge {
  position: absolute; top: 0.5rem; left: 0.5rem;
  background: rgba(196,112,74,0.9); color: white;
  font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 2px;
  letter-spacing: 0.1em;
}

/* ===== SLIDESHOW ===== */
.slideshow-container { max-width: 860px; margin: 0 auto; }
.slideshow-placeholder {
  background: #1a0c06; border-radius: 4px; overflow: hidden;
  min-height: 480px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.slideshow-lock {
  text-align: center; color: rgba(255,255,255,0.6); padding: 3rem;
}
.slideshow-lock span { font-size: 2.5rem; display: block; margin-bottom: 1rem; }
.slideshow-lock p { font-family: var(--font-serif); font-style: italic; margin-bottom: 1.5rem; }
.slideshow-guest-view { width: 100%; }
.slideshow-screen {
  position: relative; background: black;
  aspect-ratio: 16/9; overflow: hidden;
}
.slide-img-wrap { position: absolute; inset: 0; }
.slide-img-wrap img, .slide-img-wrap video {
  width: 100%; height: 100%; object-fit: contain;
  transition: opacity 0.6s ease;
}
.slide-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white; padding: 2rem 1.5rem 1rem;
  font-family: var(--font-serif); font-style: italic; font-size: 0.95rem;
}
.slide-counter {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(0,0,0,0.5); color: white;
  padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.78rem;
}
.slideshow-controls {
  display: flex; justify-content: center; align-items: center;
  gap: 1rem; padding: 1.2rem; background: rgba(0,0,0,0.85);
}
.ctrl-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; font-size: 1rem; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.ctrl-btn:hover { background: var(--terracotta); border-color: var(--terracotta); }
.ctrl-play { width: 56px; height: 56px; font-size: 1.2rem; }

/* ===== OWNER PANEL ===== */
.owner-panel {
  margin-top: 2rem; background: white; border: 1px solid var(--sand);
  border-radius: 4px; padding: 2rem;
  box-shadow: 0 4px 20px rgba(196,112,74,0.08);
}
.owner-panel h3 {
  font-family: var(--font-display); font-size: 1.1rem;
  color: var(--text-dark); margin-bottom: 1.5rem; letter-spacing: 0.05em;
}
.owner-panel-body { display: grid; gap: 1.5rem; }
.owner-section label {
  display: block; font-size: 0.78rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--text-light); margin-bottom: 0.75rem;
}
.music-list { min-height: 60px; background: var(--warm-white); border: 1px solid var(--sand); border-radius: 4px; padding: 0.75rem; margin-bottom: 0.75rem; }
.music-hint { font-size: 0.85rem; color: var(--text-light); font-style: italic; }
.music-track { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; font-size: 0.88rem; }
.music-track-name { color: var(--text-mid); }
.music-track button { background: none; border: none; color: var(--text-light); cursor: pointer; }
.owner-options { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.toggle-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--text-mid); cursor: pointer; }
.owner-actions { display: flex; gap: 1rem; }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; font-size: 1.1rem; transition: background 0.2s;
}
.lightbox-close:hover { background: var(--terracotta); }
.lightbox-content { max-width: 90vw; max-height: 80vh; }
.lightbox-content img, .lightbox-content video { max-width: 90vw; max-height: 78vh; object-fit: contain; }
.lightbox-meta { color: rgba(255,255,255,0.6); font-size: 0.85rem; margin-top: 1rem; font-style: italic; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.2s ease;
}
.modal-box {
  background: white; padding: 2.5rem; border-radius: 4px;
  max-width: 420px; width: 90%; border-top: 3px solid var(--terracotta);
}
.modal-box h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.75rem; letter-spacing: 0.05em; }
.modal-box p { font-size: 0.92rem; color: var(--text-mid); margin-bottom: 1.5rem; }
.input-field {
  width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--sand); border-radius: 2px;
  font-size: 0.95rem; margin-bottom: 1.5rem; outline: none;
  transition: border-color 0.2s; font-family: var(--font-sans);
}
.input-field:focus { border-color: var(--terracotta); }
.modal-actions { display: flex; gap: 1rem; justify-content: flex-end; }
.modal-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 1rem; }
.modal-hint code { background: var(--cream); padding: 0.1rem 0.4rem; border-radius: 2px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--text-dark); color: white;
  text-align: center; padding: 4rem 2rem;
}
.footer .divider-ornament { color: var(--terracotta); margin-bottom: 2rem; }
.footer .divider-ornament span { background: linear-gradient(90deg, transparent, var(--terracotta-light), transparent); }
.footer-names { font-family: var(--font-serif); font-size: 2rem; font-style: italic; color: var(--terracotta-light); }
.footer-date { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.3em; color: var(--gold); margin: 0.5rem 0 1.5rem; }
.footer-love { font-size: 0.85rem; color: rgba(255,255,255,0.4); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .timeline::before { left: 20px; }
  .timeline-item, .timeline-item.right { flex-direction: column; padding-left: 50px; }
  .timeline-time { text-align: left !important; }
  .timeline-dot { left: 20px; }
  .timeline-item.right .timeline-card { border-left: 3px solid var(--terracotta) !important; border-right: 1px solid var(--sand) !important; }
  .nav-links { display: none; }
  .hero-cta { flex-direction: column; align-items: center; }
  .qr-connect-wrapper { flex-direction: column; align-items: center; }
  .qr-card { flex: none; width: 100%; max-width: 280px; }
}
