/* ==========================================================================
   Navidad con CIINSEV 2026 — Estilos (mobile-first, minimalista)
   Cristal sutil · mucho aire · un solo acento dorado y rojo cereza
   ========================================================================== */

:root {
  --cherry: #e0193f;
  --gold: #e8b45a;
  --gold-soft: #f3d697;
  --night: #071119;

  --text: #f5f7fa;
  --text-2: rgba(245, 247, 250, 0.68);
  --text-3: rgba(245, 247, 250, 0.42);
  --line: rgba(255, 255, 255, 0.12);

  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(22, 30, 40, 0.72);
  --blur: blur(24px) saturate(160%);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0; min-height: 100dvh;
  font-family: var(--font); color: var(--text); background: var(--night);
  overflow-x: hidden; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; border-radius: 14px; }

/* --------------------------------------------------------------------------
   Fondo
   -------------------------------------------------------------------------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.backdrop__base {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 50% at 15% 10%, rgba(18, 92, 64, 0.35), transparent 70%),
    radial-gradient(60% 45% at 85% 100%, rgba(170, 20, 50, 0.22), transparent 70%),
    linear-gradient(180deg, #08151e 0%, #071119 100%);
}
#scene3d { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.8s var(--ease-out); }
.scene-ready #scene3d { opacity: 1; }
.backdrop__snow-fallback { position: absolute; inset: 0; display: none; }
.no-webgl .backdrop__snow-fallback {
  display: block; opacity: .7;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent 60%),
    radial-gradient(3px 3px at 120px 80px, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 200px 150px, #fff, transparent 60%),
    radial-gradient(2.5px 2.5px at 280px 40px, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(2px 2px at 330px 230px, #fff, transparent 60%);
  background-size: 360px 260px;
  animation: snow-fallback 16s linear infinite;
}
main { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Botón redondo (música, cerrar)
   -------------------------------------------------------------------------- */
.round-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.07);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  cursor: pointer;
  transition: transform .3s var(--ease-spring), background .25s;
}
.round-btn:hover { background: rgba(255,255,255,.13); }
.round-btn:active { transform: scale(.9); }
.round-btn svg { width: 19px; height: 19px; }

.audio-dock {
  position: fixed; z-index: 30;
  top: calc(14px + var(--safe-top)); right: 14px;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 8px;
}
#musicToggle .eq { display: none; align-items: flex-end; gap: 2.5px; height: 14px; }
#musicToggle[aria-pressed="true"] .eq { display: inline-flex; }
#musicToggle[aria-pressed="true"] .i-off { display: none; }
#musicToggle[aria-pressed="false"] .i-off { opacity: .75; }
.eq i { width: 2.5px; height: 5px; border-radius: 2px; background: var(--gold-soft); animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }

.volume {
  display: flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.07);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  opacity: 0; transform: translateX(12px); pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease-out);
}
.audio-dock.is-open .volume { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) { .audio-dock:hover .volume { opacity: 1; transform: none; pointer-events: auto; } }
.volume input { width: 100px; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 3px; border-radius: 3px; background: rgba(255,255,255,.25); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }

/* --------------------------------------------------------------------------
   Bienvenida
   -------------------------------------------------------------------------- */
.welcome {
  min-height: 100dvh; display: grid; place-items: center; text-align: center;
  padding: calc(70px + var(--safe-top)) 24px calc(56px + var(--safe-bottom));
}
.welcome__inner { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; }

/* Logotipo original dentro de un ícono tipo app; el gorro se coloca encima de su esquina */
.brand { position: relative; width: 112px; height: 112px; margin-bottom: 40px; }
.brand__tile {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 28%;
  background: #fff;
  box-shadow: 0 30px 60px -22px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.6) inset;
}
.brand__tile img, .mini-logo img {
  position: absolute; max-width: none;
  width: 118%; height: auto;          /* conserva la proporción original del logotipo */
  left: -7%; top: 5.3%;
}
.brand__hat {
  position: absolute; z-index: 2;
  width: 72%; left: -24%; top: -30%;
  transform: rotate(-24deg); transform-origin: 70% 85%;
  filter: drop-shadow(0 6px 10px rgba(30,0,6,.45));
}

.welcome__title { margin: 0; font-weight: 700; letter-spacing: -0.05em; line-height: .95; }
.welcome__title .t1 { display: block; font-size: clamp(60px, 19vw, 120px); }
.welcome__title .t2 {
  display: block; margin-top: .22em;
  font-size: clamp(22px, 6.4vw, 38px); font-weight: 500; letter-spacing: -0.02em; color: var(--text-2);
}
.welcome__title em { font-style: normal; font-weight: 700; color: var(--gold-soft); }
.welcome__title .ch { display: inline-block; }

.welcome__phrase {
  margin: 26px auto 40px; max-width: 30ch;
  font-size: clamp(15.5px, 4.2vw, 18px); color: var(--text-2); text-wrap: balance;
}

.cta {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 26px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-size: clamp(15px, 4.2vw, 16.5px); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  color: #0b1219; background: #fff;
  box-shadow: 0 18px 40px -16px rgba(255,255,255,.35);
  transition: transform .35s var(--ease-spring), box-shadow .35s;
}
.cta svg { width: 20px; height: 20px; stroke-width: 2.2; color: var(--cherry); transition: transform .35s var(--ease-out); }
.cta:hover { transform: translateY(-2px); box-shadow: 0 24px 50px -16px rgba(255,255,255,.45); }
.cta:hover svg { transform: translateX(4px); }
.cta:active { transform: scale(.96); }

/* --------------------------------------------------------------------------
   Galería
   -------------------------------------------------------------------------- */
.gallery { min-height: 100dvh; padding: calc(22px + var(--safe-top)) 16px 0; }
.gallery__head { display: grid; justify-items: center; text-align: center; gap: 2px; margin: 4px 60px 26px; }
.mini-logo {
  position: relative; overflow: hidden;
  width: 44px; height: 44px; margin-bottom: 12px;
  border-radius: 28%; background: #fff;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.7);
}
.gallery__head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.gallery__count { margin: 0; font-size: 13.5px; color: var(--text-3); }

.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px; max-width: 1120px; margin: 0 auto;
}

.card {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.card__frame {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(70% 55% at 50% 32%, rgba(255,255,255,.13), transparent 70%),
    var(--glass);
  border: 1px solid rgba(255,255,255,.09);
  transition: transform .5s var(--ease-out), border-color .4s, box-shadow .5s var(--ease-out);
}
.card__photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0;
  transition: transform .8s var(--ease-out);
}
.card__meta { display: flex; align-items: center; gap: 7px; padding: 10px 4px 0; }
.card__meta strong { font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.22); }
.card.has-gift .card__dot { background: var(--gold); box-shadow: 0 0 10px rgba(232,180,90,.8); }
.card:active .card__frame { transform: scale(.97); }
.card.is-source .card__photo { opacity: 0; }

.card--skeleton { pointer-events: none; }
.card--skeleton .card__frame { background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.card--skeleton .card__meta::after { content: ""; display: block; width: 60%; height: 12px; border-radius: 6px; background: rgba(255,255,255,.07); }

.legend { margin: 26px 0 0; text-align: center; font-size: 13px; color: var(--text-3); }
.legend i { display: inline-block; width: 7px; height: 7px; margin: 0 4px 1px 0; border-radius: 50%; background: var(--gold); vertical-align: middle; }

.state { max-width: 420px; margin: 30px auto; text-align: center; color: var(--text-2); }
.state strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.state button { margin-top: 14px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.08); cursor: pointer; }

/* --------------------------------------------------------------------------
   Pie
   -------------------------------------------------------------------------- */
.site-footer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  max-width: 1120px; margin: 56px auto 0;
  padding: 18px 0 calc(22px + var(--safe-bottom));
  font-size: 12.5px; color: var(--text-3); letter-spacing: .02em;
}
.dot-sep { opacity: .6; }
.foot-btn {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: none; color: var(--text-3);
  cursor: pointer; text-decoration: none; transition: color .2s, background .2s;
}
.foot-btn svg { width: 16px; height: 16px; }
.foot-btn:hover { color: var(--text); background: rgba(255,255,255,.07); }
.foot-btn[aria-pressed="true"] { color: var(--gold-soft); }
.foot-btn--admin { opacity: .55; }

/* --------------------------------------------------------------------------
   Revelación
   -------------------------------------------------------------------------- */
.reveal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.reveal__backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 8, 13, .6);
  -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%);
  opacity: 0; transition: opacity .5s var(--ease-out);
}
.reveal.is-open .reveal__backdrop { opacity: 1; }

.reveal__sheet {
  position: relative; width: 100%; max-width: 480px;
  max-height: calc(100dvh - 16px - var(--safe-top));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  padding: 14px 22px calc(26px + var(--safe-bottom));
  border-radius: 32px 32px 0 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,.1); border-bottom: 0;
  box-shadow: 0 -20px 60px -20px rgba(0,0,0,.6);
  transform: translateY(100%);
  transition: transform .65s var(--ease-out);
  text-align: center;
}
.reveal__sheet::-webkit-scrollbar { display: none; }
.reveal.is-open .reveal__sheet { transform: none; }
.reveal.is-dragging .reveal__sheet { transition: none; }
.reveal__grab { display: block; width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: rgba(255,255,255,.22); }
.reveal__close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 38px; height: 38px; }
.reveal__close svg { width: 16px; height: 16px; }

.reveal__hero { display: grid; justify-items: center; gap: 12px; padding-top: 8px; }
.reveal__photo {
  width: 132px; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 26px;
  background: radial-gradient(70% 55% at 50% 32%, rgba(255,255,255,.16), transparent 70%), rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.reveal__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.reveal__name { margin: 0; font-size: clamp(28px, 8vw, 34px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; overflow-wrap: anywhere; }

/* Escenario de la caja */
.reveal__stage { position: relative; height: 150px; display: grid; place-items: center; transition: height .7s var(--ease-out); }
.reveal.is-revealed .reveal__stage { height: 64px; }
.sparkles { position: absolute; left: -40px; right: -40px; top: -140px; bottom: -120px; width: calc(100% + 80px); height: calc(100% + 260px); pointer-events: none; z-index: 3; }
.burst-ring {
  position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border-radius: 50%; border: 2px solid rgba(243,214,151,.9);
  opacity: 0; transform: scale(.2);
}
.reveal.is-revealed .burst-ring { animation: ring 1s var(--ease-out) forwards; }

.giftbox { position: relative; width: 92px; height: 92px; transform-origin: 50% 100%; }
.giftbox__body {
  position: absolute; left: 6px; right: 6px; bottom: 0; height: 60px; border-radius: 9px 9px 13px 13px;
  background:
    linear-gradient(90deg, transparent 43%, var(--gold-soft) 43% 57%, transparent 57%),
    linear-gradient(180deg, #ec2b50, #b01030);
}
.giftbox__lid {
  position: absolute; left: 0; right: 0; top: 12px; height: 22px; z-index: 2; border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 42%, var(--gold-soft) 42% 58%, transparent 58%),
    linear-gradient(180deg, #ff4b6e, #d0183e);
}
.bow { position: absolute; top: -21px; width: 30px; height: 24px; border: 5px solid var(--gold-soft); border-radius: 50% 50% 45% 45%; }
.bow.l { left: 16px; transform: rotate(-22deg); } .bow.r { right: 16px; transform: rotate(22deg); }
.knot { position: absolute; left: 50%; top: -8px; width: 14px; height: 13px; margin-left: -7px; border-radius: 5px; background: var(--gold); }
.giftbox__shadow { position: absolute; left: 14px; right: 14px; bottom: -10px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(5px); z-index: -1; }

.giftbox.is-in { animation: gift-drop .8s var(--ease-spring) both; }
.giftbox.is-shaking { animation: gift-shake .75s ease-in-out; }
.giftbox.is-open .giftbox__lid { animation: lid-pop .7s var(--ease-out) forwards; }
.giftbox.is-open { animation: gift-vanish .8s var(--ease-out) .1s forwards; }
.giftbox.is-locked { animation: gift-nope .7s ease-in-out; }

/* Contenido */
.reveal__content { position: relative; }
.gift-label { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-soft); }
.gift-title { margin: 0; font-size: clamp(30px, 9vw, 40px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; overflow-wrap: anywhere; }
.gift-title .w { display: inline-block; white-space: pre; }
.gift-desc { margin: 12px auto 0; max-width: 34ch; color: var(--text-2); font-size: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.gift-links { display: grid; gap: 10px; margin-top: 24px; }
.link-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 16px;
  text-decoration: none; font-weight: 600; font-size: 16px;
  color: #0b1219; background: #fff;
  transition: transform .3s var(--ease-spring), background .2s;
}
.link-btn svg { width: 17px; height: 17px; stroke-width: 2.1; color: var(--cherry); }
.link-btn.secondary { color: var(--text); background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.link-btn.secondary svg { color: var(--gold-soft); }
.link-btn:active { transform: scale(.97); }
.gift-secret .gift-title { font-size: clamp(21px, 6vw, 25px); letter-spacing: -0.02em; line-height: 1.2; }

.reveal__actions { display: flex; gap: 10px; justify-content: center; margin-top: 26px; }
.text-btn {
  flex: 1; max-width: 200px; min-height: 46px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05);
  font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s, transform .3s var(--ease-spring);
}
.text-btn svg { width: 16px; height: 16px; }
.text-btn:hover { background: rgba(255,255,255,.1); }
.text-btn:active { transform: scale(.96); }

/* Elemento compartido (foto que vuela de la tarjeta a la revelación) */
.fly { position: fixed; z-index: 70; margin: 0; overflow: hidden; pointer-events: none; border-radius: 24px; background: rgba(255,255,255,.06); will-change: transform; }
.fly img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.reveal__photo.is-hidden img { opacity: 0; }

.noscript { position: fixed; inset: auto 16px 16px; z-index: 99; padding: 14px; border-radius: 14px; background: #fff; color: #111; text-align: center; }
.reveal.is-secret .reveal__stage { height: 120px; }
.reveal.is-secret .burst-ring { display: none; }
