/* ═══════════════════════════════════════════════════
   Wedding Invitation — Dark Cinematic Theme
   ═══════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────── */
:root {
  --gold:       #C9A96E;
  --gold-dim:   rgba(201,169,110,0.18);
  --gold-line:  rgba(201,169,110,0.3);
  --gold-glow:  rgba(201,169,110,0.08);
  --bg:         #060504;
  --surface:    #100d08;
  --text:       #F2EAD8;
  --text-muted: rgba(242,234,216,0.55);
  --text-dim:   rgba(242,234,216,0.28);
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  background: #000;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Language Toggle ────────────────────────────── */
.lang-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(6,5,4,0.7);
  border: 1px solid var(--gold-line);
  border-radius: 100px;
  padding: 5px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.25s ease;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--gold);
  font-weight: 400;
}

.lang-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.lang-sep {
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  margin: 0 5px;
  line-height: 1;
  user-select: none;
}

/* ── Language System ────────────────────────────── */
.pl { display: none; }
.de { display: inline; }

body[data-lang="pl"] .pl { display: inline; }
body[data-lang="pl"] .de { display: none; }

/* Block-level bilingual elements (countdown labels, button text) */
body[data-lang="pl"] .pl.cd-lbl { display: block; }
.pl.cd-lbl { display: none; }

body[data-lang="pl"] .pl.btn-text { display: inline; }
.pl.btn-text { display: none; }

/* ── INTRO OVERLAY ──────────────────────────────── */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s var(--ease-out);
}

#intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

#intro-overlay[hidden] {
  display: none;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
}

.intro-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.intro-names {
  font-family: 'Pinyon Script', cursive;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  color: var(--gold);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.intro-amp {
  font-size: 0.65em;
  color: var(--gold-line);
}

.intro-play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-line);
  background: var(--gold-dim);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0.5rem 0;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  animation: intro-pulse 2.8s ease-in-out infinite;
}

.intro-play-btn svg {
  margin-left: 4px; /* optical center for play triangle */
}

.intro-play-btn:hover {
  background: rgba(201,169,110,0.25);
  border-color: var(--gold);
  transform: scale(1.07);
  animation: none;
}

.intro-play-btn:active {
  transform: scale(0.97);
}

@keyframes intro-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold-dim); }
  50%       { box-shadow: 0 0 0 14px transparent; }
}

.intro-hint {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Light theme overrides for intro */
body.theme-light #intro-overlay {
  background: var(--bg);
}

/* ── VIDEO SECTION ──────────────────────────────── */
#video-section {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#video-section[hidden] {
  display: none;
}

#video-section.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in;
}

/* Desktop decorative background */
.video-bg-deco {
  display: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(20,14,8,1) 0%, rgba(6,5,4,1) 70%),
    radial-gradient(ellipse at 30% 70%, rgba(201,169,110,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(201,169,110,0.03) 0%, transparent 50%);
  z-index: 0;
}

/* Video container — mobile: fullscreen */
.video-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Video fallback monogram */
.video-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.video-fallback.visible {
  display: flex;
}

/* Sound hint */
.sound-hint {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(6,5,4,0.6);
  border: 1px solid var(--gold-line);
  border-radius: 100px;
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.sound-hint.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Video controls bar */
.video-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Control button base */
.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(6,5,4,0.65);
  border: 1px solid var(--gold-line);
  border-radius: 100px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.ctrl-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201,169,110,0.08);
}

.ctrl-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Mute button — square-ish, 44px touch target */
.mute-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Skip button — initially hidden */
.skip-btn {
  padding: 0 1rem;
  height: 44px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.skip-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Loading ring */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-loading.visible {
  opacity: 1;
}

.loading-ring {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gold-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Desktop: portrait video → contain (no pixelation); landscape video → cover (fills screen) */
@media (min-width: 768px) {
  .video-bg-deco { display: none; }
  .video-container video {
    object-fit: contain;
    max-height: 100vh;
  }
  .video-container video.landscape-video {
    object-fit: cover;
  }
}

/* ── Light Theme ────────────────────────────────── */
body.theme-light {
  --bg:         #FFFDF9;
  --surface:    #F5EFE6;
  --text:       #3D2620;
  --text-muted: rgba(61,38,32,0.6);
  --text-dim:   rgba(61,38,32,0.35);
  --gold:       #E8826A;
  --gold-dim:   rgba(232,130,106,0.15);
  --gold-line:  rgba(232,130,106,0.3);
  --gold-glow:  rgba(232,130,106,0.07);
  background: var(--bg);
}

body.theme-light #main-section {
  background: var(--bg);
}

body.theme-light .main-bg {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232,130,106,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(232,130,106,0.04) 0%, transparent 45%);
}

body.theme-light .btn-primary {
  color: #fff;
}

body.theme-light .lang-toggle {
  background: rgba(255,253,249,0.85);
  border-color: var(--gold-line);
}

body.theme-light .ctrl-btn {
  background: rgba(255,253,249,0.75);
  color: #3D2620;
}

body.theme-light .sound-hint {
  background: rgba(255,253,249,0.8);
  color: var(--gold);
}

/* ── MAIN SECTION ───────────────────────────────── */
#main-section {
  position: relative;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

#main-section[hidden] {
  display: none;
}

/* Decorative radial background */
.main-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,169,110,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(201,169,110,0.03) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 60%, rgba(201,169,110,0.025) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Main content wrapper */
.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  padding: 3rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  text-align: center;

  /* Initial hidden state — slides in */
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.main-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Eyebrow ────────────────────────────────────── */
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Monogram Circle ────────────────────────────── */
.monogram-circle {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Gold Divider ───────────────────────────────── */
.gold-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 280px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--gold-line);
}

.divider-diamond {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ── Couple Names ───────────────────────────────── */
.couple-names {
  font-weight: normal;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
}

.name {
  font-family: 'Pinyon Script', cursive;
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
}

.name-amp {
  font-family: 'Pinyon Script', cursive;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  color: var(--gold);
  line-height: 1.4;
  align-self: center;
}

/* ── Event Details ──────────────────────────────── */
.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}

.event-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--text-muted);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-align: left;
}

.detail-icon {
  stroke: var(--gold);
  flex-shrink: 0;
  margin-top: 3px;
  opacity: 0.7;
}

/* ── Countdown ──────────────────────────────────── */
.countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.countdown-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.countdown {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.cd-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(56px, 14vw, 80px);
}

.cd-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.cd-lbl {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.35rem;
  display: block;
}

.cd-sep {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 300;
  color: var(--gold-line);
  line-height: 1;
  padding-top: 0.1em;
  align-self: flex-start;
  user-select: none;
}

/* ── Action Buttons ─────────────────────────────── */
.action-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0 1.75rem;
  min-height: 44px;
  background: var(--gold);
  color: #060504;
  border: none;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 20px rgba(201,169,110,0.25);
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(201,169,110,0.35);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  min-height: 44px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--gold-line);
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.74rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.btn-ghost:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-glow);
}

.btn-ghost:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn-text {
  display: inline;
}

/* ── Footer ─────────────────────────────────────── */
.page-footer {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  line-height: 1.6;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(201,169,110,0.1);
  width: 100%;
  max-width: 320px;
  text-align: center;
}

/* ── Reduced Motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .loading-ring {
    animation: none;
    border-color: var(--gold);
  }

  .main-content {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #video-section.fade-out {
    transition: none;
  }
}

/* ── Responsive tweaks ──────────────────────────── */
@media (max-width: 420px) {
  .main-content {
    gap: 1.4rem;
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .couple-names {
    gap: 0.2rem 0.4rem;
  }

  .cd-item {
    min-width: 52px;
  }

  .countdown {
    gap: 0.1rem;
  }

  .event-detail-item {
    font-size: 0.85rem;
  }

  .lang-toggle {
    top: 0.875rem;
    right: 0.875rem;
  }
}

@media (min-width: 480px) {
  .action-btns {
    flex-direction: row;
    justify-content: center;
  }
}
