:root {
  --bg: #0b0b0b;
  --fg: #ece7db;          /* blanco hueso cálido */
  --muted: #6f6f6a;       /* gris */
  --line: #232320;        /* divisores */
  --field-line: #3a3a36;
  --p1: #ff3d7f;          /* rosa fiesta */
  --p2: #ffd23f;          /* amarillo */
  --p3: #45d9c8;          /* turquesa */
  --p4: #a86bff;          /* morado */
  --p5: #ff8a3d;          /* naranja */
  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --display: 'Archivo Black', 'Archivo', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.5;
  font-weight: 400;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--fg); color: var(--bg); }

/* Grano sutil */
.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cabecera fija */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(20px, 5vw, 48px);
  mix-blend-mode: difference;
}
.brand {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #fff;
}
.top-link {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}
.top-link:hover { opacity: 0.6; }

/* Contenedor */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px) 60px;
}

/* HERO */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(24px, 6vh, 56px);
}
.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(16px, 3vw, 28px);
}
.display {
  font-family: var(--display);
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.01em;
}
.d-line {
  display: block;
  font-size: clamp(3.5rem, 15vw, 12rem);
}
.d-line.accent {
  background: linear-gradient(90deg, var(--p1), var(--p5) 30%, var(--p2) 55%, var(--p3) 78%, var(--p4));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tagline {
  margin-top: clamp(20px, 3vw, 32px);
  max-width: 34ch;
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  color: var(--fg);
}

/* Confeti */
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.confetti span {
  position: absolute;
  top: -12%;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  opacity: 0.9;
  animation: fall linear infinite;
}
.confetti span:nth-child(1)  { left: 6%;  background: var(--p1); animation-duration: 7.5s;  animation-delay: -0.2s; }
.confetti span:nth-child(2)  { left: 14%; background: var(--p2); animation-duration: 9s;    animation-delay: -2s;   width: 7px; height: 7px; border-radius: 50%; }
.confetti span:nth-child(3)  { left: 22%; background: var(--p3); animation-duration: 8.2s;  animation-delay: -4s; }
.confetti span:nth-child(4)  { left: 30%; background: var(--p4); animation-duration: 10s;   animation-delay: -1s;   border-radius: 50%; }
.confetti span:nth-child(5)  { left: 38%; background: var(--p5); animation-duration: 7s;    animation-delay: -3.5s; }
.confetti span:nth-child(6)  { left: 46%; background: var(--p1); animation-duration: 9.5s;  animation-delay: -0.8s; width: 6px; height: 6px; }
.confetti span:nth-child(7)  { left: 54%; background: var(--p2); animation-duration: 8.6s;  animation-delay: -5s;   border-radius: 50%; }
.confetti span:nth-child(8)  { left: 62%; background: var(--p3); animation-duration: 7.8s;  animation-delay: -2.6s; }
.confetti span:nth-child(9)  { left: 70%; background: var(--p4); animation-duration: 10.5s; animation-delay: -1.4s; width: 7px; height: 7px; }
.confetti span:nth-child(10) { left: 78%; background: var(--p5); animation-duration: 8s;    animation-delay: -3s;   border-radius: 50%; }
.confetti span:nth-child(11) { left: 86%; background: var(--p1); animation-duration: 9.2s;  animation-delay: -0.5s; }
.confetti span:nth-child(12) { left: 92%; background: var(--p2); animation-duration: 7.4s;  animation-delay: -4.5s; width: 6px; height: 6px; }
.confetti span:nth-child(13) { left: 10%; background: var(--p3); animation-duration: 11s;   animation-delay: -6s;   border-radius: 50%; }
.confetti span:nth-child(14) { left: 34%; background: var(--p1); animation-duration: 9.8s;  animation-delay: -7s; }
.confetti span:nth-child(15) { left: 58%; background: var(--p4); animation-duration: 8.4s;  animation-delay: -5.5s; width: 7px; height: 7px; }
.confetti span:nth-child(16) { left: 82%; background: var(--p5); animation-duration: 10.2s; animation-delay: -2.2s; border-radius: 50%; }

@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translateY(112vh) rotate(540deg); opacity: 0.9; }
}

/* STATEMENT */
.statement {
  padding: clamp(80px, 16vh, 200px) 0;
  max-width: 24ch;
}
.statement p {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.8rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.statement em {
  font-style: normal;
  color: var(--p1);
}
.statement .hl {
  background: linear-gradient(90deg, var(--p3), var(--p4) 50%, var(--p1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* INFO */
.info {
  border-top: 1px solid var(--line);
}
.info-row {
  display: grid;
  grid-template-columns: 60px 200px 1fr;
  align-items: baseline;
  gap: 20px;
  padding: clamp(22px, 4vw, 40px) 0;
  border-bottom: 1px solid var(--line);
}
.info-index {
  font-size: 0.8rem;
  color: var(--p1);
  letter-spacing: 0.1em;
  font-weight: 700;
}
.info-label {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-value {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.3rem, 3.2vw, 2.6rem);
  line-height: 1.05;
}
.info-cta { padding-top: clamp(28px, 5vw, 48px); }

@media (max-width: 680px) {
  .info-row {
    grid-template-columns: 40px 1fr;
    row-gap: 8px;
  }
  .info-label { grid-column: 2; }
  .info-value { grid-column: 2; }
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 16px 34px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  transition: background 0.25s, color 0.25s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn.primary {
  width: 100%;
  justify-content: center;
  background: var(--fg);
  color: var(--bg);
  margin-top: 12px;
}
.btn.primary:hover { background: transparent; color: var(--fg); }
.btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* RSVP */
.rsvp { padding-top: clamp(80px, 16vh, 200px); }
.rsvp-head { margin-bottom: clamp(32px, 6vw, 64px); max-width: 40ch; }
.section-index {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--p1);
  font-weight: 700;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(2rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.section-sub {
  color: var(--muted);
  margin-top: 20px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 46ch;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 560px;
}
.field { display: flex; flex-direction: column; gap: 12px; }
.field label, .label-static {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
input, textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--field-line);
  border-radius: 0;
  padding: 10px 2px;
  color: var(--fg);
  font-family: inherit;
  font-size: 1.15rem;
  transition: border-color 0.2s;
}
input:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--fg);
}
input::placeholder, textarea::placeholder { color: #4a4a46; }
textarea { resize: vertical; }

/* Toggle Sí/No */
.toggle-group {
  display: inline-flex;
  gap: 8px;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  padding: 5px;
  width: fit-content;
}
.toggle-group input { display: none; }
.toggle-group label {
  cursor: pointer;
  padding: 11px 26px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
  transition: background 0.2s, color 0.2s;
}
.toggle-group input:checked + label {
  background: var(--fg);
  color: var(--bg);
}

.form-status {
  font-size: 0.9rem;
  min-height: 1.2em;
}
.form-status.ok { color: var(--fg); }
.form-status.err { color: #d98a8a; }

/* Footer */
.footer {
  margin-top: clamp(80px, 14vh, 160px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Reproductor de música */
#sc-player {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.music-toggle {
  position: fixed;
  right: clamp(16px, 4vw, 32px);
  bottom: clamp(16px, 4vw, 32px);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--field-line);
  background: rgba(11, 11, 11, 0.7);
  backdrop-filter: blur(10px);
  color: var(--fg);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s;
}
.music-toggle:hover { border-color: var(--fg); }
.music-toggle .music-label { white-space: nowrap; }

.eq-mini {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}
.eq-mini span {
  width: 2px;
  height: 4px;
  background: var(--fg);
}
.music-toggle.playing .eq-mini span {
  animation: bounce-mini 0.9s ease-in-out infinite;
}
.music-toggle.playing .eq-mini span:nth-child(2) { animation-delay: -0.3s; }
.music-toggle.playing .eq-mini span:nth-child(3) { animation-delay: -0.6s; }
.music-toggle.playing .eq-mini span:nth-child(4) { animation-delay: -0.15s; }

@keyframes bounce-mini {
  0%, 100% { height: 3px; }
  50%      { height: 14px; }
}

/* Aparición al hacer scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .music-toggle.playing .eq-mini span { animation: none; }
  .confetti span { animation: none; display: none; }
  html { scroll-behavior: auto; }
}
