/* ========================================
   PRELOAD - DISEÑO ELEGANTE DE BODA
   ======================================== */

/* Variables */
:root {
  --navy: #8E9C84;
  --gold: #9BAA8F;
  --gold-light: #B5C4A9;
  --gold-dark: #6F7D73;
  --diamond: #E6E1D8;
  --white: #F4F1EC;
  --cream: #FAF8F5;
  --black: #4F5A54;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: "Brooklyn";
  src: url("../fonts/Brooklyn.otf") format("opentype"), 
       url("../fonts/Brooklyn.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: "Bodoni";
  src: url("../fonts/Bodoni.otf") format("opentype"), 
       url("../fonts/Bodoni.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(135deg, var(--white) 0%, var(--cream) 50%, var(--white) 100%);
  color: var(--black);
  /* Soporte para Dynamic Island / Notch iPhone */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.seal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--white) 0%, var(--cream) 50%, var(--white) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  z-index: 10;
}

/* ========================================
   DECORACIONES DE HOJAS SVG - GRANDES
   ======================================== */
.leaf-decoration {
  position: absolute;
  width: auto;
  height: 100vh;
  z-index: 1;
  opacity: 0.9;
  transition: var(--transition);
}

.leaf-decoration img {
  width: auto;
  height: 100%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
}

.leaf-left {
  left: 0;
  top: 0;
  transform: translateX(-35%);
  animation: floatLeft 8s ease-in-out infinite;
}

.leaf-right {
  right: 0;
  top: 0;
  transform: translateX(35%);
  animation: floatRight 8s ease-in-out infinite;
}

@keyframes floatLeft {
  0%, 100% {
    transform: translateX(-35%) rotate(0deg);
  }
  50% {
    transform: translateX(-33%) rotate(1deg);
  }
}

@keyframes floatRight {
  0%, 100% {
    transform: translateX(35%) rotate(0deg);
  }
  50% {
    transform: translateX(37%) rotate(-1deg);
  }
}

/* ========================================
   CONTENIDO PRINCIPAL
   ======================================== */
.seal-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  max-width: 90%;
}

/* Texto superior */
.top-text {
  margin-bottom: 2rem;
  animation: fadeInDown 1s ease-out;
}

.small-text {
  font-family: "Bodoni", serif;
  font-size: 1.2rem;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-style: italic;
}

/* ========================================
   TEXTO DE LA INVITACIÓN
   ======================================== */
.invitation-text {
  text-align: center;
  color: var(--navy);
  animation: fadeInUp 1.2s ease-out;
}

.names-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.name {
  font-family: "Brooklyn", serif;
  font-size: 5.5rem;
  font-weight: 400;
  color: var(--navy);
  text-shadow: 0 2px 8px rgba(142, 156, 132, 0.12);
  line-height: 1.1;
}

/* Efecto Typewriter */
.name.typewriter {
  min-width: 50px;
  min-height: 1.2em;
  display: inline-block;
  border-right: 3px solid var(--gold);
  padding-right: 8px;
  animation: blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% {
    border-right-color: var(--gold);
  }
  50% {
    border-right-color: transparent;
  }
}

.ampersand {
  font-family: var();
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--gold);
  font-style: italic;
  margin: 0 0.8rem;
  animation: pulse-soft 3s infinite;
}

@keyframes pulse-soft {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}

/* Divisor con corazón */
.date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  gap: 1.2rem;
}

.date-divider .line {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.heart-icon {
  color: var(--gold);
  font-size: 1rem;
  animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.2);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.2);
  }
  70% {
    transform: scale(1);
  }
}

/* Fecha de la boda */
.wedding-date {
  font-family: "Bodoni", serif;
  font-size: 1.6rem;
  letter-spacing: 6px;
  font-weight: 400;
  color: var(--black);
  font-style: italic;
}

/* ========================================
   INSTRUCCIÓN MINIMALISTA CON TOOLTIP
   ======================================== */
.seal-instruction {
  position: relative;
  margin-top: 3rem;
  animation: fadeIn 2s ease-out;
}

/* Tooltip */
.seal-instruction::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: white;
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 1px;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.seal-instruction::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 6px solid transparent;
  border-top-color: var(--gold);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.seal-instruction:hover::before,
.seal-instruction:hover::after {
  opacity: 1;
  visibility: visible;
}

.seal-instruction:hover::before {
  transform: translateX(-50%) translateY(-12px);
}

/* Icono minimalista */
.tap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--gold-light);
  color: var(--gold);
  font-size: 1rem;
  transition: var(--transition);
  animation: bounce 2s infinite;
}

.tap-icon i {
  transition: var(--transition);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(8px);
  }
  60% {
    transform: translateY(4px);
  }
}

.seal-container:hover .tap-icon {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
  transform: scale(1.1);
}

/* ========================================
   DECORACIÓN INFERIOR
   ======================================== */
.bottom-decoration {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
}

.ornament-line {
  height: 1px;
  background: linear-gradient(
    90deg, 
    transparent, 
    var(--gold-light) 20%, 
    var(--gold) 50%, 
    var(--gold-light) 80%, 
    transparent
  );
  position: relative;
}

.ornament-line::before,
.ornament-line::after {
  content: "✦";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-light);
  font-size: 0.5rem;
}

.ornament-line::before {
  left: -12px;
}

.ornament-line::after {
  right: -12px;
}

/* ========================================
   ANIMACIONES DE ENTRADA
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

/* ========================================
   ANIMACIÓN DE SALIDA
   ======================================== */
.fade-out {
  animation: fadeOut 1.5s forwards;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
    visibility: hidden;
  }
}

/* ========================================
   ESTILOS RESPONSIVOS
   ======================================== */
@media (max-width: 1024px) {
  .leaf-decoration {
    height: 100vh;
  }
  
  .leaf-left {
    transform: translateX(-40%);
  }
  
  .leaf-right {
    transform: translateX(40%);
  }
}

@media (max-width: 768px) {
  .leaf-decoration {
    height: 100vh;
    opacity: 0.9;
  }
  
  .leaf-left {
    transform: translateX(-55%);
  }
  
  .leaf-right {
    transform: translateX(55%);
  }
  
  .name {
    font-size: 4rem;
  }
  
  .ampersand {
    font-size: 2.8rem;
  }
  
  .small-text {
    font-size: 1rem;
    letter-spacing: 6px;
  }
  
  .wedding-date {
    font-size: 1.3rem;
    letter-spacing: 4px;
  }
  
  .date-divider .line {
    width: 60px;
  }
}

@media (max-width: 480px) {
  .leaf-decoration {
    height: 100vh;
    opacity: 0.85;
  }
  
  .leaf-left {
    transform: translateX(-70%);
  }
  
  .leaf-right {
    transform: translateX(70%);
  }
  
  .seal-content {
    padding: 1.5rem;
  }
  
  .small-text {
    font-size: 0.85rem;
    letter-spacing: 4px;
  }
  
  .name {
    font-size: 4rem;
  }
  
  .ampersand {
    font-size: 2.8rem;
    margin: 0 0.5rem;
  }
  
  .wedding-date {
    font-size: 1.1rem;
    letter-spacing: 3px;
  }
  
  .date-divider {
    margin: 1.5rem 0;
  }
  
  .date-divider .line {
    width: 45px;
  }
  
  .tap-icon {
    width: 44px;
    height: 44px;
    font-size: 0.9rem;
  }
  
  .seal-instruction {
    margin-top: 2rem;
  }
  
  .bottom-decoration {
    width: 150px;
  }
}

@media (max-width: 360px) {
  .leaf-decoration {
    height: 100vh;
    opacity: 0.8;
  }
  
  .leaf-left {
    transform: translateX(-80%);
  }
  
  .leaf-right {
    transform: translateX(80%);
  }
  
  .seal-content {
    padding: 1rem;
  }
  
  .names-wrapper {
    flex-direction: column;
    gap: 0;
  }
  
  .small-text {
    font-size: 0.75rem;
    letter-spacing: 3px;
  }
  
  .name {
    font-size: 3.5rem;
  }
  
  .ampersand {
    font-size: 2.5rem;
    margin: 0.3rem 0;
  }
  
  .wedding-date {
    font-size: 1rem;
    letter-spacing: 2px;
  }
  
  .tap-icon {
    width: 40px;
    height: 40px;
  }
}

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