/* ============================================================
   Regalo Día del Padre — Variación 2: viaje de zoom en profundidad
   ============================================================ */

:root {
  --bg: #0b0a09;
  --bg-2: #14110e;
  --ink: #f4ede4;
  --ink-soft: #b8ab9b;
  --accent: #fb923c;
  --accent-2: #f5b06a;
  --gold: #e8b873;
  --tile-radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; }
html.locked, html.locked body { overflow: hidden; height: 100%; }

/* ---------- Puerta con contraseña ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 600px at 50% 34%, rgba(251,146,60,.17), transparent 60%),
    linear-gradient(180deg, #14110e, #0b0a09 55%);
  transition: opacity .6s ease;
}
.gate--open { opacity: 0; pointer-events: none; }
.gate__card { width: min(92vw, 420px); text-align: center; }
.gate__eyebrow {
  color: #f5b06a;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .78rem;
  margin: 0 0 1rem;
}
.gate__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 .6rem;
  color: #f4ede4;
}
.gate__sub { color: #b8ab9b; margin: 0 0 1.8rem; }
.gate__form { display: flex; flex-direction: column; gap: .8rem; }
.gate__input {
  width: 100%;
  padding: .95rem 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  color: #f4ede4;
  font-size: 1.05rem;
  text-align: center;
  outline: none;
  transition: border-color .2s, background .2s;
}
.gate__input::placeholder { color: rgba(184,171,155,.55); }
.gate__input:focus { border-color: #fb923c; background: rgba(255,255,255,.07); }
.gate__btn {
  padding: .95rem 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(120deg, #fb923c, #e8b873);
  color: #1a1208;
  font-weight: 600;
  font-size: 1rem;
  transition: transform .15s, filter .15s;
}
.gate__btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.gate__error { min-height: 1.2em; margin: .9rem 0 0; font-size: .9rem; color: #ff9b9b; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.gate--shake .gate__card { animation: gate-shake .45s; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Fondo ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 50% 38%, rgba(251, 146, 60, .20), transparent 60%),
    radial-gradient(900px 600px at 80% 15%, rgba(232, 184, 115, .10), transparent 55%),
    radial-gradient(1000px 800px at 15% 85%, rgba(251, 146, 60, .07), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 45%);
}
.bg-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: .04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Escena 3D ---------- */
.scroll-track {
  position: relative;
  z-index: 1;
  /* la altura la pone JS (más alto = viaje más largo) */
}
.viewport {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  perspective: 1000px;
  perspective-origin: 50% 46%;
}
.world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Cada elemento (foto u hero) flota en el espacio 3D.
   JS pone el transform de posición/profundidad una sola vez;
   en cada frame solo cambia la opacidad. */
.item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  will-change: opacity;
  backface-visibility: hidden;
}

.frame {
  position: relative;
  border-radius: var(--tile-radius);
  overflow: hidden;
  background: #1c1814;
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    0 30px 60px -24px rgba(0,0,0,.8);
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(255,255,255,.07) inset;
  pointer-events: none;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder cuando no hay foto real */
.frame.is-placeholder {
  display: grid;
  place-items: center;
}
.frame.is-placeholder .ph-label {
  font-family: 'Fraunces', serif;
  color: rgba(255,255,255,.5);
  font-size: 1rem;
  text-align: center;
}
.frame.is-placeholder .ph-label small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-top: .35rem;
  opacity: .7;
}

/* ---------- HERO (item en z=0) ---------- */
.item--hero { width: min(92vw, 700px); transform: translate(-50%, -50%); }
.hero { text-align: center; position: relative; }
/* Scrim suave detrás del hero: oscurece el fondo difuminado para que el
   título destaque y las fotos no compitan. */
.hero::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 150%; height: 210%;
  background: radial-gradient(ellipse at center, rgba(11,10,9,.82) 0%, rgba(11,10,9,.5) 42%, transparent 72%);
  z-index: -1;
  pointer-events: none;
}
.hero__kicker {
  font-size: clamp(.7rem, 1.5vw, .88rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 1.3rem;
  font-weight: 500;
}
.hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.8rem, 11vw, 7rem);
  line-height: .96;
  letter-spacing: -.02em;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .04em;
}
.hero__title-accent {
  background: linear-gradient(120deg, var(--accent) 10%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}
.hero__dedication {
  max-width: 30ch;
  margin: 1.8rem auto 0;
  font-size: clamp(1rem, 2.3vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-soft);
}
.hero__cue {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero__cue-arrow { font-size: 1.1rem; animation: bob 1.8s var(--ease) infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- Cierre (overlay 2D nítido) ---------- */
.closing {
  position: absolute;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%);
  width: min(90vw, 40ch);
  text-align: center;
  z-index: 3;
  opacity: 0;                 /* JS sube la opacidad al final */
  pointer-events: none;
  text-shadow: 0 2px 24px rgba(0,0,0,.7);
}
.closing__line {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
}
.closing__sign { margin: 1.1rem 0 0; color: var(--accent-2); font-size: clamp(1rem, 2.4vw, 1.15rem); }
.closing__heart { font-size: 1.8rem; margin-top: 1rem; }

/* ---------- Fallback sin animación / sin JS ---------- */
/* Sin JS (no .js) o con reduced-motion (.flat): todo en columna, visible. */
.flat .viewport, html:not(.js) .viewport {
  position: static;
  height: auto;
  overflow: visible;
  perspective: none;
  padding: 8vh 5vw;
}
.flat .world, html:not(.js) .world {
  position: static;
  transform: none !important;
  transform-style: flat;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8vh;
}
.flat .item, html:not(.js) .item {
  position: static;
  top: auto; left: auto;
  transform: none !important;
  opacity: 1 !important;
}
.flat .closing, html:not(.js) .closing {
  position: static;
  transform: none;
  opacity: 1;
  margin: 8vh auto 10vh;
}
.flat .frame, html:not(.js) .frame {
  width: min(82vw, 440px) !important;
  height: auto !important;
}
.flat .frame img, html:not(.js) .frame img { height: auto !important; }
.flat .frame.is-placeholder, html:not(.js) .frame.is-placeholder { height: 300px !important; }
.flat .item--hero, html:not(.js) .item--hero { width: auto; }
