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

:root {
  --ink: #2a1f18;
  --cocoa: #4a3328;
  --umber: #7a5c4e;
  --dusty: #a68472;
  --parchment: #f2ebe0;
  --cream: #faf6ef;
  --gold: #b8956a;

  /* --font-display: 'Cinzel', serif; */
  --font-body: 'Cormorant Garamond', serif;
  --font-display: 'Cormorant Garamond', serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  background: var(--parchment);
  color: var(--ink);
  overflow-x: hidden;
}

/* ══════════════════════════════════
   TRANSLATION
   All [data-lang] elements are hidden by default.
   JS adds .lang-active to the matching language.
══════════════════════════════════ */
[data-lang] {
  display: none !important;
}
[data-lang].lang-active {
  display: revert !important;
}

/* Elements that must be inline when visible */
span[data-lang].lang-active,
a[data-lang].lang-active {
  display: inline !important;
}

/* ══════════════════════════════════
   LANGUAGE BUTTONS
══════════════════════════════════ */
.lang-toggle {
  display: flex;
  gap: 8px;
}
.lang-btn {
  background: none;
  border: 1px solid var(--dusty);
  color: var(--umber);
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 2px;
  transition: all 0.2s;
}
.lang-btn.active,
.lang-btn:hover {
  background: var(--cocoa);
  border-color: var(--cocoa);
  color: var(--cream);
}

/* ══════════════════════════════════
   ENVELOPE SCENE
══════════════════════════════════ */
#envelope-scene {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 32px;
  z-index: 100;
  background: radial-gradient(ellipse at center, #e8ddd0 0%, #d4c6b8 100%);
  transition:
    opacity 0.8s ease,
    visibility 0.8s;
}
#envelope-scene.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.lang-toggle-env {
  position: absolute;
  top: 24px;
  right: 24px;
}

.envelope-wrap {
  width: min(360px, 88vw);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.envelope {
  position: relative;
  width: 100%;
  padding-bottom: 66%;
  filter: drop-shadow(0 16px 48px rgba(74, 51, 40, 0.3));
  transition: transform 0.3s ease;
}
.envelope-wrap:hover .envelope {
  transform: translateY(-5px);
}

.env-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #ede4d6 0%, #e0d4c2 100%);
  border-radius: 3px 3px 6px 6px;
}
.env-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(175deg, #d8ccba 0%, #cbbfab 100%);
  clip-path: polygon(0 100%, 50% 0%, 100% 100%);
}
.env-left {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 52%;
  background: linear-gradient(95deg, #d5c9b5 0%, #c8bbaa 100%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.env-right {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52%;
  background: linear-gradient(85deg, #c8bbaa 0%, #d5c9b5 100%);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(170deg, #f0e8d8 0%, #e4d8c6 100%);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}
.envelope-wrap.opening .env-flap {
  transform: rotateX(180deg);
}

.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 35% 35%, #8b4a2a, #5c2d12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 10px rgba(74, 40, 18, 0.5),
    inset 0 1px 3px rgba(255, 190, 130, 0.3);
  z-index: 10;
  transition: transform 0.3s ease;
}
.wax-seal::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 190, 130, 0.35);
}
.envelope-wrap:hover .wax-seal {
  transform: translate(-50%, -50%) scale(1.07);
}
.env-monogram {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  color: rgba(255, 215, 170, 0.9);
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}
.env-hint {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 17px;
  color: var(--umber);
  opacity: 0.85;
  text-align: center;
}

/* ══════════════════════════════════
   INVITATION CARD
══════════════════════════════════ */
#invitation {
  min-height: 100vh;
  background: var(--cream);
  opacity: 0;
  transform: translateY(32px) scale(0.98);
  transition:
    opacity 0.9s ease 0.2s,
    transform 0.9s ease 0.2s;
  pointer-events: none;
  display: none;
}
#invitation.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.card-inner {
  max-width: 660px;
  margin: 0 auto;
  padding: 56px 40px 80px;
}

.lang-toggle-card {
  display: flex;
  justify-content: center;
  margin-bottom: 44px;
}

/* ── Floral Monogram ── */
.monogram-section {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 1s ease 0.4s forwards;
}
.monogram-section img {
  width: 220px;
  height: auto;
  opacity: 0.9;
}

/* ── Names ── */
.names-section {
  text-align: center;
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeUp 1s ease 0.7s forwards;
}
.name-main {
  font-family: var(--font-display);
  font-size: clamp(24px, 5.5vw, 38px);
  font-weight: 500;
  color: var(--cocoa);
  letter-spacing: 5px;
  text-transform: uppercase;
}
.name-and {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 300;
  color: var(--umber);
  margin: 6px 0;
  display: block;
  letter-spacing: 2px;
}

/* ── Photo ── */
.photo-section {
  margin: 0 -20px 48px;
  opacity: 0;
  animation: fadeUp 1s ease 0.9s forwards;
}
.photo-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  border-radius: 2px;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(12%) brightness(1.02);
}
.photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e4d8cc 0%, #cfc3b5 50%, #e4d8cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
}
.photo-placeholder p {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--dusty);
  text-transform: uppercase;
}
.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 60%,
    rgba(42, 31, 24, 0.1) 100%
  );
}
.photo-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(184, 149, 106, 0.65);
  border-style: solid;
}
.photo-corner.tl {
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
}
.photo-corner.tr {
  top: 10px;
  right: 10px;
  border-width: 1px 1px 0 0;
}
.photo-corner.bl {
  bottom: 10px;
  left: 10px;
  border-width: 0 0 1px 1px;
}
.photo-corner.br {
  bottom: 10px;
  right: 10px;
  border-width: 0 1px 1px 0;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 32px 0;
  opacity: 0;
  animation: fadeUp 1s ease 1s forwards;
}
.divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.divider .gem {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
}
.divider .gem-sm {
  width: 3px;
  height: 3px;
  background: var(--dusty);
  transform: rotate(45deg);
  opacity: 0.6;
  margin: 0 -6px;
}

/* ── Invite text ── */
.invite-text {
  text-align: center;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 1s ease 1.1s forwards;
}
.invite-text p {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.8vw, 11px);
  letter-spacing: 3.5px;
  color: var(--umber);
  line-height: 2.2;
  text-transform: uppercase;
}

/* ── Date ── */
.date-section {
  text-align: center;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 1s ease 1.2s forwards;
}
.date-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
}
.date-num {
  font-family: var(--font-body);
  font-size: clamp(40px, 9vw, 60px);
  font-weight: 300;
  color: var(--cocoa);
  line-height: 1;
  letter-spacing: 2px;
}
.date-sep {
  width: 1px;
  height: 44px;
  background: var(--gold);
  opacity: 0.6;
}
.date-label {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.8vw, 11px);
  letter-spacing: 3px;
  color: var(--dusty);
  text-transform: uppercase;
  margin-top: 6px;
}

/* ── Countdown ── */
.countdown-section {
  text-align: center;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeUp 1s ease 1.3s forwards;
}
.countdown-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--dusty);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.countdown-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
}
.countdown-item {
  text-align: center;
}
.countdown-num {
  font-family: var(--font-body);
  font-size: clamp(30px, 7vw, 44px);
  font-weight: 300;
  color: var(--cocoa);
  line-height: 1;
  min-width: 52px;
  display: block;
  letter-spacing: 1px;
}
.countdown-unit {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--dusty);
  text-transform: uppercase;
  margin-top: 5px;
  display: block;
}
.countdown-sep {
  font-family: var(--font-body);
  font-size: 28px;
  color: var(--dusty);
  align-self: flex-start;
  margin-top: 6px;
  opacity: 0.6;
}

/* ── Location ── */
.details-section {
  text-align: center;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 1s ease 1.35s forwards;
}
.location-link {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.8vw, 11px);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cocoa);
  text-decoration: none;
  border-bottom: 1px solid var(--dusty);
  transition:
    color 0.2s,
    border-color 0.2s;
  display: inline-block;
  line-height: 2;
}
.location-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.location-icon {
  font-size: 10px;
  margin-right: 5px;
}

/* ── Bank (ES only) ── */
.bank-section {
  background: linear-gradient(
    135deg,
    rgba(74, 51, 40, 0.04),
    rgba(184, 149, 106, 0.08)
  );
  border: 1px solid rgba(184, 149, 106, 0.25);
  border-radius: 3px;
  padding: 24px;
  text-align: center;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 1s ease 1.4s forwards;
}
.bank-title {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--dusty);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.bank-num {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 300;
  color: var(--cocoa);
  letter-spacing: 2px;
}
.bank-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  color: var(--umber);
  margin-top: 10px;
  line-height: 1.7;
}

/* ── RSVP ── */
.rsvp-section {
  text-align: center;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 1s ease 1.45s forwards;
}
.rsvp-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(16px, 3vw, 20px);
  color: var(--umber);
  line-height: 1.8;
  margin-bottom: 16px;
}
.rsvp-contact {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cocoa);
  text-transform: uppercase;
  margin-top: 12px;
}
.rsvp-contact a {
  color: var(--cocoa);
  text-decoration: none;
  border-bottom: 1px solid var(--dusty);
  transition: all 0.2s;
}
.rsvp-contact a:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ── Music ── */
.music-player {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  opacity: 0;
  animation: fadeIn 1s ease 2s forwards;
}
.music-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cocoa);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(42, 31, 24, 0.4);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.music-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 26px rgba(42, 31, 24, 0.5);
}
.music-btn svg {
  width: 18px;
  height: 18px;
  color: var(--cream);
}
.music-tooltip {
  position: absolute;
  bottom: 58px;
  right: 0;
  background: var(--cocoa);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s;
  pointer-events: none;
}
.music-player:hover .music-tooltip {
  opacity: 1;
  transform: translateY(0);
}
.music-playing .music-btn {
  background: var(--gold);
}

@keyframes noteDance {
  0%,
  100% {
    transform: translateY(0) rotate(-10deg);
    opacity: 1;
  }
  50% {
    transform: translateY(-7px) rotate(10deg);
    opacity: 0.5;
  }
}
.music-playing .note-icon {
  animation: noteDance 1.5s ease-in-out infinite;
}

/* ── Animations ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .card-inner {
    padding: 36px 20px 60px;
  }
  .photo-section {
    margin: 0 -8px 36px;
  }
  .countdown-grid {
    gap: 12px;
  }
  .date-display {
    gap: 10px;
  }
  .monogram-section img {
    width: 180px;
  }
}
