:root {
  --ivory: #FBF1E7;
  --ivory-dim: #F3E5D6;
  --wine: #6E1E2E;
  --wine-dark: #4A121D;
  --rose: #C98A93;
  --gold: #B78A4D;
  --gold-light: #E4C489;
  --ink: #2B1418;

  --serif: "Cormorant Garamond", "Georgia", serif;
  --script: "Parisienne", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--wine-dark);
  color: var(--ink);
  font-family: var(--serif);
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, var(--wine) 0%, var(--wine-dark) 70%);
  z-index: 0;
}

/* Marco mobile-only: en pantallas anchas queda centrado como "vitrina" */
.phone {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--ivory);
  box-shadow: 0 0 60px rgba(0,0,0,0.45);
  overflow: hidden;
}

.scene {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  position: relative;
}

.scene--letter {
  display: none;
  justify-content: flex-start;
  min-height: auto;
  padding-bottom: 64px;
}
.scene--letter.is-visible { display: flex; }

/* ---------- BRAND ---------- */
.brand {
  width: 100%;
  max-width: 220px;
  margin-bottom: 12px;
}
.brand__img {
  display: block;
  width: 100%;
  height: auto;
}
.brand__caption {
  margin: 0 0 4px;
  font-family: var(--script);
  font-size: 2.4rem;
  color: var(--wine);
}

/* ---------- HINT ---------- */
.hint {
  margin: 0 0 22px;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--wine);
  opacity: 0.75;
  font-style: italic;
}

/* ---------- SOBRE ---------- */
.envelope {
  position: relative;
  width: 240px;
  height: 160px;
  margin-top: 20px;
}

.envelope__shadow {
  position: absolute;
  bottom: -18px;
  left: 10%;
  width: 80%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.25), transparent 70%);
  filter: blur(2px);
}

.envelope__back,
.envelope__letter-peek,
.envelope__front-left,
.envelope__front-right,
.envelope__flap {
  position: absolute;
}

.envelope__back {
  inset: 0;
  background: linear-gradient(160deg, var(--wine) 0%, var(--wine-dark) 100%);
  border-radius: 3px;
}

.envelope__letter-peek {
  top: -6px;
  left: 6%;
  width: 88%;
  height: 40px;
  background: var(--ivory);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.15);
  z-index: 1;
}

.envelope__flap {
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 120px solid transparent;
  border-right: 120px solid transparent;
  border-top: 90px solid var(--wine);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
  z-index: 3;
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: none;
}

.envelope__front-left {
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-bottom: 90px solid var(--wine-dark);
  border-right: 120px solid transparent;
  z-index: 2;
}

.envelope__front-right {
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-bottom: 90px solid var(--wine-dark);
  border-left: 120px solid transparent;
  z-index: 2;
}

.seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 60%, #8a6733 100%);
  box-shadow: 0 3px 6px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  animation: pulse 2.4s ease-in-out infinite;
}

.seal__heart {
  color: var(--wine-dark);
  font-size: 1.1rem;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 3px 6px rgba(0,0,0,0.4), 0 0 0 0 rgba(183,138,77,0.5); }
  50% { box-shadow: 0 3px 6px rgba(0,0,0,0.4), 0 0 0 8px rgba(183,138,77,0); }
}

.envelope__to {
  margin-top: 28px;
  width: 100%;
  text-align: center;
  font-size: 1.4rem;
  color: var(--ivory);
  letter-spacing: 0.02em;
}
.envelope__to em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-family: var(--script);
  font-size: 2.3rem;
  line-height: 1.15;
  color: var(--gold-light);
}

/* ---------- CARTA ---------- */
.letter {
  width: 100%;
  padding: 40px 26px 10px;
}

.letter__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--gold);
}
.letter__divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.letter__divider i { font-style: normal; font-size: 0.9rem; }
.letter__divider--end { margin: 30px 0 0; }

.letter__title {
  font-family: var(--script);
  font-size: 1.9rem;
  line-height: 1.3;
  color: var(--wine);
  text-align: center;
  margin: 0 0 24px;
  font-weight: 400;
}

.photos {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}

.polaroid {
  background: #fff;
  padding: 8px 8px 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  width: 130px;
  margin: 0;
}
.polaroid--1 { transform: rotate(-6deg); }
.polaroid--2 { transform: rotate(5deg); margin-top: 10px; }
.polaroid--3 {
  width: 160px;
  margin: 8px auto 0;
  transform: rotate(-3deg);
}

.polaroid__img {
  aspect-ratio: 1 / 1;
  background: var(--ivory-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.polaroid__img img,
.polaroid__img video { width: 100%; height: 100%; object-fit: cover; }
.polaroid__placeholder {
  font-size: 0.75rem;
  color: var(--rose);
  font-style: italic;
}
.polaroid figcaption {
  text-align: center;
  font-size: 0.75rem;
  color: var(--wine);
  margin-top: 8px;
  font-style: italic;
}

.letter__body {
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--ink);
}
.letter__body p { margin: 0 0 16px; }
.letter__body--closing { margin-top: 8px; }
.letter__signature {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--script);
  font-size: 1.8rem;
  color: var(--wine);
}
.letter__signature-icon {
  width: 100%;
  max-width: 330px;
  height: auto;
}

/* ---------- MOMENTOS (scroll) ---------- */
.moment {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 40px 0;
}
.moment--reverse { flex-direction: row-reverse; }

.moment__photo-wrap {
  flex: 0 0 auto;
  margin: 0;
}
.polaroid--moment {
  width: 155px;
  transform: rotate(-4deg);
}
.moment--reverse .polaroid--moment { transform: rotate(4deg); }

.moment__text {
  flex: 1;
  font-size: 1.2rem;
  line-height: 1.65;
}
.moment__text p { margin: 0 0 8px; }
.moment__label {
  font-family: var(--script);
  font-size: 1.55rem;
  color: var(--wine);
  margin-bottom: 6px !important;
}

/* ---------- PÉTALOS AMBIENTALES ---------- */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -20px;
  color: var(--rose);
  opacity: 0.55;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .seal { animation: none; }
  .petals { display: none; }
}
