@font-face {
  font-family: "Halimun";
  src: url("assets/Halimun.ttf") format("truetype");
  font-weight: 400; /* O el peso que tenga la fuente */
  font-style: normal;
  font-display: swap;
}

/* ===========================
   VARIABLES / RESET
   =========================== */
:root {
  --persp: 1200px;
  --label-min-scale: 0.35;
  --label-base-size: clamp(36px, 9vw, 120px);
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #e8eaed;
  overflow-x: hidden;
  position: relative;
  background-color: #000; /* color de fondo base, por si la imagen no carga */
  color: #fff;
}

/* Background fijo (imagen) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("assets/fondo.jpg") center/cover no-repeat;
  opacity: 0.3; /* bajamos opacidad para que se vea mejor el color dinámico */
  z-index: -1;
  pointer-events: none;
}
/* Color dinámico de fondo que cambia por era — controlado por JS */
body {
  transition: background-color 1.2s ease;
}

/* ===========================
   RAIL de AÑOS (navegación)
   =========================== */
.year-rail {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 70;
  pointer-events: none;
}
.year-rail a {
  pointer-events: auto;
  text-decoration: none;
  color: #9aa0a6;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  opacity: 0.6;
  transition: opacity 0.2s, background-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.year-rail a:hover {
  opacity: 0.9;
}
.year-rail a.is-active {
  color: #0b0d12;
  background: #e8eaed;
  opacity: 1;
  font-weight: 600;
}

/* ===========================
   ESCENA 3D / WORLD / FRAMES
   =========================== */
#stage {
  position: relative;
  height: 100svh;
  width: 100%;
  perspective: var(--persp);
  perspective-origin: 50% 50%;
  overflow: visible;
}
#world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
/* Fog overlay: simula niebla de profundidad como THREE.js fog */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none !important;
  z-index: -1;
  background: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    transparent 30%,
    rgba(0, 0, 0, 0.15) 70%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* Frame por año */
.frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 1440px);
  height: min(68vh, 860px);
  transform-style: preserve-3d;
  transform: translate3d(-50%, -50%, var(--z));
  isolation: isolate;
  /* perf — sin contain:size para no romper hit-testing 3D */
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-size: 800px 600px;
}

/* ===========================
   YEAR LABEL / CAPTION
   =========================== */
.year-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateZ(60px)
    scale(var(--label-min-scale));
  font-weight: 800;
  font-size: var(--label-base-size);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: #e8eaed;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter, letter-spacing;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
}

.year-caption {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 200px)); /* debajo del año */
  max-width: min(80vw, 640px);
  text-align: center;
  font-family: "Cormorant Garamond", serif; /* misma que usas en la portada/formulario */
  font-size: clamp(14px, 2.1vw, 180px);
  font-weight: 400; /* fina y legible */
  color: rgba(232, 234, 237, 0.9);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* Contorno tipo “portal” solo cuando el frame está activo → ahorro de composición */
@supports (-webkit-text-stroke: 1px black) {
  .frame.is-hot .year-label.portal {
    color: transparent;
    -webkit-text-stroke: 2px #e8eaed;
    text-shadow: 0 0 20px rgba(232, 234, 237, 0.15);
  }
}

/* ===========================
   CLUSTER / FOTOS
   =========================== */
.cluster {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.photo {
  position: absolute;
  border-radius: 16px;
  backface-visibility: hidden;
  opacity: 0;
  height: auto;
  object-fit: contain;
  max-height: 25vh;
}
.frame.is-hot .photo {
  will-change: transform, opacity, filter;
}

/* frames no activos */
.frame:not(.is-hot) .photo {
  filter: none !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.frame:not(.is-hot) .year-label {
  filter: none !important;
}
/* evita mezclas caras salvo en el activo */
.frame:not(.is-hot) .year-label.portal {
  mix-blend-mode: normal;
  -webkit-text-stroke: 0;
  color: #e8eaed;
}

/* ===========================
   COVER / CORTINILLA (PORTADA)
   =========================== */
.cover {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background-color: #000;
  background: url("assets/fondo.jpg") center/cover no-repeat;
  opacity: 0.5; /* 50% */
  color: #eef2ff;
}
.cover__content {
  text-align: center;
  padding: 2rem;
}
.cover__title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.75rem 0;
}
.cover__sub {
  color: #c7d2fe;
  margin: 0 0 0 0;
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  font-family: "Cormorant Garamond", serif;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.06em;
  animation-delay: 0.15s;
}

/* reutilizamos tu .btn-primary si ya existe; si no, copiar la que propusimos antes */
.cover.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.cover:not(.is-hidden) {
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Tarjeta sutil con efecto glass */
.cover-card {
  padding: 2.25rem 2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* ——— Estilo “boda” ——— */
.fancy-title {
  font-family: "Halimun", "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(44px, 8vw, 96px);
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 18px rgba(255, 255, 255, 0.12);
  margin-bottom: 0.25rem;
}

/* Pequeña animación de entrada */
.cover-card,
.fancy-title,
.cover__sub,
.btn-ghost {
  animation: fadeUp 0.6s ease both;
}
.fancy-title {
  animation-delay: 0.05s;
}
.btn-ghost {
  animation-delay: 0.25s;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cover-card::after {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  margin: 1rem auto 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
}

/* ===========================
   BOTONES (COVER) - AHORA EN VERTICAL POR DEFECTO
   =========================== */
/* Cambié la dirección por defecto a columna para escritorio y móvil */
.cover__buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  justify-content: center; /* horizontal centering */
  align-items: center; /* vertical alignment dentro del contenedor */
  margin-top: 1.25rem;
  flex-direction: column; /* <-- vertical en escritorio y móvil */
}

/* Botón fantasma (transparente con borde blanco) */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: transparent;
  border: 1.6px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease,
    border-color 0.25s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.btn-ghost:active {
  transform: translateY(0);
}
.btn-ghost:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.btn-ghost--secondary {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* ===========================
   FORMULARIO RSVP
   =========================== */
.form-section {
  padding: 80px 16px 120px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.form-card {
  width: 100%;
  max-width: 520px;
  padding: 32px 24px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.form-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 32px;
  margin: 0 0 4px;
}
.form-subtitle {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}
.form-group {
  margin-bottom: 18px; /* 18px ajustado para mejor lectura */
}
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 10, 20, 0.85);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.form-textarea {
  min-height: 90px;
  resize: vertical;
}
.form-submit {
  margin-top: 8px;
}
.form-msg {
  margin-top: 10px;
  font-size: 14px;
}
.form-msg--ok {
  color: #a5d6a7;
}
.form-msg--error {
  color: #ef9a9a;
}
.sleep-options label {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}
.sleep-options label:first-of-type {
  margin-top: 4px;
}
.form-title-icon {
  margin-right: 0.5rem;
  font-size: 1.4em;
  vertical-align: middle;
}
.form-card::before {
  content: "♥";
  display: block;
  text-align: center;
  margin-bottom: 14px;
  font-family: "Great Vibes", cursive;
  font-size: 26px;
  color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   BLOQUE RON + CUENTA ATRÁS (INFO)
   =========================== */
.info-section {
  padding: 48px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 20;
}
.info-card {
  width: 100%;
  max-width: 920px;
  padding: 28px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(0, 0, 0, 0.35)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  color: #eef2ff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.info-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(28px, 5vw, 48px);
  margin: 0 0 6px;
  color: #fff;
}

.info-card p.info-text:first-of-type {
  margin-top: 50px; /* Aquí pones el valor de margen que quieres solo para el primero */
}
.info-text {
  margin: 8px 0;
  color: rgba(232, 234, 237, 0.92);
  font-size: 15px;
}

.info-sign {
  margin-top: 8px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}
.event-details {
  margin: 14px 0 18px;
  font-size: 15px;
  color: rgba(232, 234, 237, 0.9);
}
.event-details ul {
  margin: 6px 0 0 1rem;
  padding: 0;
  list-style: disc;
}

/* cuenta atrás */
.countdown {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.countdown-number {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}
.countdown-label {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
}
.countdown-note {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(232, 234, 237, 0.7);
  text-align: center;
}
.map-link {
  color: #cfe8ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.map-link:hover {
  color: #fff;
  text-decoration: none;
}
/* botón sencillo similar a tus .btn-ghost pero más compacto */
.map-btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.2px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
  text-decoration: none;
  color: #fff;
  margin-left: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.map-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

/* ===========================
   LIGHTBOX / PHOTO MODAL (estilo example)
   =========================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.5s ease;
  cursor: pointer;
}
.lightbox.is-open {
  background: rgba(0, 0, 0, 0.85);
  pointer-events: auto;
}
.lightbox__img {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  object-fit: contain;
  transform: scale(0.7);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.45s ease;
}
.lightbox.is-open .lightbox__img {
  transform: scale(1);
  opacity: 1;
}
.lightbox__caption {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(14px, 2vw, 20px);
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.4s ease 0.2s;
  pointer-events: none;
  text-align: center;
}
.lightbox.is-open .lightbox__caption {
  opacity: 1;
}
.lightbox__close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease 0.15s, background 0.2s ease;
}
.lightbox.is-open .lightbox__close {
  opacity: 1;
}
.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Photos clickable + hover (estilo example) */
.frame.is-hot .photo {
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.frame.is-hot .photo:hover {
  filter: brightness(1.12) saturate(1.1) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

/* ===========================
   SCROLL INDICATOR (flecha sutil)
   =========================== */
.scroll-indicator {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.scroll-indicator.is-hidden {
  opacity: 0;
}
.scroll-indicator__text {
  font-family: "Cormorant Garamond", serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.scroll-indicator__arrow {
  width: 18px;
  height: 18px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(5px); }
}

/* ===========================
   REDUCED MOTION
   =========================== */
@media (prefers-reduced-motion: reduce) {
  .year-rail {
    display: none;
  }
  #world,
  .photo,
  .year-label {
    transition: none !important;
    animation: none !important;
  }
}

/* ===========================
   MEDIA QUERIES (MÓVIL / TÁCTIL / ORIENTACIÓN)
   =========================== */
/* Móvil: rail horizontal y UI adaptada */
@media (max-width: 900px), (pointer: coarse) {
  .year-rail {
    right: auto;
    left: 50%;
    top: auto;
    bottom: var(--safe-bottom);
    transform: translateX(-50%);
    flex-direction: row;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(8, 10, 14, 0.35);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    max-width: 92vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .year-rail::-webkit-scrollbar {
    display: none;
  }
  .year-rail {
    scrollbar-width: none;
  }
  .year-rail a {
    font-size: 13px;
    padding: 6px 10px;
  }

  .frame {
    width: min(96vw, 1200px);
    height: min(70vh, 760px);
  }

  /* apaga filtros pesados en móvil (excepto tint) */
  .year-label {
    filter: none !important;
  }

  /* mantengo los botones verticales también en móvil;
     aquí refuerzo layout para que ocupen más espacio si quieres */
  .cover__buttons {
    margin-top: 0px;
    gap: 1rem;
    min-height: 30vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
}

/* Portrait / móvil: fotos más grandes */
@media (orientation: portrait) {
  .photo {
    max-height: 72vh;
  }
}
@media (max-width: 640px) {
  .photo {
    max-height: 72vh;
  }

  .form-card {
    padding: 24px 18px;
  }

  .info-card {
    padding: 18px;
  }
  .countdown-item {
    min-width: 58px;
    padding: 8px 10px;
  }
  .countdown-number {
    font-size: 18px;
  }
}

.ron-avatar {
  /* -------------------------------------- */
  position: absolute; /* CLAVE: Posicionamiento absoluto */
  top: 10px; /* Desplaza la imagen hacia arriba, fuera de la tarjeta */
  right: 20px; /* La posiciona en la esquina derecha */
  /* -------------------------------------- */

  display: block;
  /* Nota: 'margin: auto' y 'text-align: center' ya no son necesarios */

  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
@media (max-width: 900px), (pointer: coarse) {
  /* ... estilos existentes de móviles ... */

  /* Ajuste del avatar en móvil: hacerlo un poco más pequeño y más pegado al borde */
  .ron-avatar {
    width: 80px;
    height: 80px;
    top: 10px; /* Ajuste para el nuevo tamaño de 80px */
    right: 10px;
  }
  /* Ajustar el margen del título para el nuevo tamaño del avatar */
  .info-title {
    margin-right: 100px; /* 80px del avatar + margen */
  }
  .info-card p.info-text:first-of-type {
    margin-top: 50px; /* Aquí pones el valor de margen que quieres solo para el primero */
  }

  /* Ajustar el margen del texto para el nuevo tamaño del avatar */
  .info-text {
    margin-top: 30px; /* Menos espacio en móvil */
  }
}
