/* ==========================================================================
   Crónicas de Belleza · hero.css
   Portada de la web: logo que se dibuja por capas y título.
   Orden de la intro: redondel → cara → pelo → libro → hojas → flores → título.
   ========================================================================== */

.hero {
  position: relative;
  z-index: 2;
  isolation: isolate;
  min-height: 980px;
  padding: 120px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Textura de papel */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: .07;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.hero__brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 56px;
}

/* ---------- Escenario 3D del logo ---------- */
.stage-wrap { perspective: 1100px; perspective-origin: 50% 50%; }
.stage {
  position: relative;
  width: min(460px, 80vw);
  aspect-ratio: 1 / 1;
  transform-style: preserve-3d;
  will-change: transform;
}

.ly { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ly-ring    { transform: translateZ(-70px) scale(1.0636); }
.ly-hair    { transform: translateZ(0); }
.ly-book    { transform: translateZ(30px) scale(.9727); }
.ly-face    { transform: translateZ(45px) scale(.9591); }
.ly-leaves  { transform: translateZ(70px) scale(.9364); }
.ly-flowers { transform: translateZ(110px) scale(.9); }

.halo {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(217, 184, 113, .35), rgba(217, 184, 113, 0) 70%);
  transform: translateZ(-120px) scale(1.109);
  opacity: 0;
}

/* Piezas que se animan dentro de los SVG */
.ring-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.med, .tick, .grow, .pop, .spark, .fx, .lx { transform-box: fill-box; transform-origin: center; }
.glint { stroke-dasharray: .07 .93; stroke-dashoffset: 0; opacity: 0; }
.spark { opacity: 0; }

/* Las capas se dibujan y, al final, se funden con el logo exacto */
.build { position: absolute; inset: 0; transform-style: preserve-3d; opacity: 0; visibility: hidden; }

/* ---------- Secuencia (clase .play en <body>) ---------- */
.play .ring-draw        { animation: draw 1.6s cubic-bezier(.65, 0, .35, 1) .2s both; }
.play .ring-draw.r2     { animation-delay: .55s; }
.play .med              { animation: medIn 1.3s var(--ease-out) .7s both; }
.play .tick             { animation: fade .5s ease calc(1.1s + var(--i) * .03s) both; }
.play .build            { animation: buildOut .9s ease 7.3s both; }
.play .ly-face          { animation: faceIn 1.7s cubic-bezier(.4, 0, .2, 1) 1.8s both; }
.play .ly-hair          { animation: hairIn 1.8s cubic-bezier(.4, 0, .2, 1) 3.3s both, hairColor 2s ease 3.6s both; }
.play .ly-book          { animation: bookIn 1.2s cubic-bezier(.4, 0, .2, 1) 4.6s both; }
.play .grow             { animation: grow .9s cubic-bezier(.2, .9, .3, 1.25) calc(5.2s + var(--i) * .08s) both; }
.play .pop              { animation: pop .9s cubic-bezier(.2, .9, .3, 1.3) calc(5.8s + var(--i) * .1s) both; }
.play .halo             { animation: halo 2.6s ease 6.8s forwards; }
.play .ly-exact         { animation: fade .9s ease 6.9s both; }
.play .glint            { animation: fade .6s ease 8.4s forwards, spin 7s linear 8.4s infinite; }
.play .spark            { animation: twinkle 2.6s ease-in-out calc(8.6s + var(--i) * .4s) infinite; }

/* Las flores y hojas del logo siguen moviéndose después de la intro */
.play .fx { animation: breathe 4.6s ease-in-out calc(7.9s + var(--i) * .37s) infinite alternate; }
.play .lx { animation: leafsway 5.8s ease-in-out calc(7.6s + var(--i) * .29s) infinite alternate; }

@keyframes medIn     { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes faceIn    { from { clip-path: inset(0 0 100% 0); opacity: 0; filter: blur(6px); } 40% { opacity: 1; } to { clip-path: inset(0 0 0 0); opacity: 1; filter: blur(0); } }
@keyframes hairIn    { from { clip-path: circle(0% at 46% 40%); } to { clip-path: circle(80% at 46% 40%); } }
@keyframes hairColor { from { filter: grayscale(1) brightness(1.6) contrast(.8); } to { filter: grayscale(0) brightness(1) contrast(1); } }
@keyframes bookIn    { from { clip-path: inset(0 0 0 100%); opacity: .2; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes halo      { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: .55; } }
@keyframes buildOut  { 0% { opacity: 1; visibility: visible; } 99% { opacity: 0; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes spin      { to { stroke-dashoffset: -1; } }
@keyframes twinkle   { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1); } }
@keyframes breathe   { from { transform: none; } to { transform: scale(1.04) rotate(3.5deg); } }
@keyframes leafsway  { from { transform: none; } to { transform: rotate(-2.5deg); } }

/* ---------- Título «Crónicas de Belleza» ---------- */
.title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(48px, 7.4vw, 104px);
  line-height: 1.1;
  color: var(--copper);
  text-align: left;
  perspective: 700px;
}
.title__line { display: block; }
.title__line--1 { letter-spacing: .07em; }
.title__line--2 { font-size: .83em; letter-spacing: .05em; }

/* Letras que giran en 3D (las crea intro.js) */
.js .title:not(.is-split) { visibility: hidden; }
.ch { display: inline-block; transform-origin: 50% 100%; backface-visibility: hidden; }
.ch--space { width: .35em; }
.play .ch { animation: flip 1.1s var(--ease-out) calc(7s + var(--i) * .07s) both; }
@keyframes flip { from { opacity: 0; transform: translateY(40px) rotateX(-95deg); } to { opacity: 1; transform: none; } }

/* Adorno bajo el título */
.hero__flourish { width: 240px; margin-top: 22px; }
.flourish { width: 240px; height: 24px; }
.flourish line { stroke-dasharray: 1; stroke-dashoffset: 0; }
.play .flourish line { animation: draw 1.2s ease 7.9s both; }
.play .flourish .fl  { animation: pop .8s cubic-bezier(.2, .9, .3, 1.3) 8.2s both; }

.hero__sub {
  margin: 34px 0 0;
  max-width: 620px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 26px);
  font-style: italic;
  line-height: 1.4;
  color: var(--text);
}
.hero__cta { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.hero__cue { margin-top: 46px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cue-mouse {
  width: 26px;
  height: 42px;
  padding-top: 8px;
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  display: flex;
  justify-content: center;
}
.cue-dot { width: 4px; height: 8px; border-radius: 2px; background: var(--gold); animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }

.hero__skip { position: absolute; right: 20px; bottom: 20px; z-index: 1; }

.play .hero__sub { animation: rise 1s ease 8.3s both; }
.play .hero__cta { animation: rise 1s ease 8.6s both; }
.play .hero__cue { animation: rise 1s ease 9.2s both; }

/* ---------- Arranque: la intro espera a que el logo esté montado (main.js quita .is-waiting) ---------- */
.js .is-waiting,
.js .is-waiting *,
.js .is-waiting *::before,
.js .is-waiting *::after { animation-play-state: paused !important; }

/* ---------- «Saltar intro»: todo aparece al instante ---------- */
.skip *, .skip *::before, .skip *::after { animation-delay: 0s !important; animation-duration: 1ms !important; }
.skip .cue-dot  { animation-duration: 2.2s !important; }
.skip .glint    { animation-duration: .6s, 7s !important; }
.skip .spark    { animation-duration: 2.6s !important; }
.skip .fx       { animation-duration: 4.6s !important; }
.skip .lx       { animation-duration: 5.8s !important; }
