/* ==========================================================================
   sections/hero.css
   Sección INICIO: titular, palabra rotativa, cifras y carrusel 3D de servicios.
   ========================================================================== */
.hero {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 30px;
  max-width: var(--maxw); margin: 0 auto; padding: 120px var(--gutter) 80px; position: relative;
}
.hero__text { position: relative; z-index: 2; } /* el texto queda por encima de las tarjetas laterales del carrusel */
.hero__title { font-family: var(--font-d); font-weight: 800; font-size: clamp(2.3rem, 3.3vw, 3.4rem); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 22px; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .split { display: inline-block; transform: translateY(110%) rotate(6deg); transform-origin: left bottom; transition: transform 1.1s var(--ease); }
.ready .hero__title .split { transform: none; }
.ready .hero__title .line:nth-child(2) .split { transition-delay: .1s; }
.ready .hero__title .line:nth-child(3) .split { transition-delay: .2s; }
.hero__title em { background: linear-gradient(120deg, var(--red-2), var(--red) 60%, #ff8a8d); -webkit-background-clip: text; background-clip: text; color: transparent; position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; background: inherit; -webkit-background-clip: text; background-clip: text; opacity: 0; }
.ready .glitch::before { animation: glitch 4s infinite 2s; color: #fff; -webkit-text-fill-color: rgba(255,255,255,.7); }
@keyframes glitch { 0%, 92%, 100% { opacity: 0; transform: none; } 93% { opacity: .8; transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); } 95% { opacity: .8; transform: translate(3px, -1px); clip-path: inset(60% 0 8% 0); } 97% { opacity: 0; } }
.hero__sub { font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 30em; margin: 0 0 20px; }
.hero__rotator { display: flex; align-items: center; gap: .5em; font-weight: 600; margin-bottom: 30px; font-size: 1.05rem; }
.rot-label { color: var(--muted); }
.rot-word { color: #fff; padding: .15em .6em; border-radius: 10px; background: rgba(227,38,43,.16); border: 1px solid rgba(227,38,43,.4); min-height: 1.7em; }
.rot-caret { width: 2px; height: 1.2em; background: var(--red); animation: blink 1s steps(1) infinite; margin-left: -4px; }
@keyframes blink { 50% { opacity: 0; } }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero__stats { display: flex; gap: clamp(18px, 4vw, 44px); }
.stat b { display: block; font-family: var(--font-d); font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1; }
.stat span { color: var(--muted); font-size: .85rem; }

.hero__stage { position: relative; height: min(640px, 80vh); -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); perspective: 1100px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.hero__stage.grab { cursor: grabbing; }
.ring { position: absolute; left: 50%; top: 46%; width: 0; height: 0; transform-style: preserve-3d; }
/* Tarjetas diseñadas del carrusel (ícono + título; el flyer se ve en el detalle) */
.ring__item {
  position: absolute; width: var(--cw, 200px); aspect-ratio: 4/5; left: calc(var(--cw, 200px) / -2); top: calc(var(--cw, 200px) * -.625);
  border-radius: 20px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 1px solid var(--line-2); padding: 18px; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(227,38,43,.55), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(140,15,19,.5), transparent 60%),
    linear-gradient(160deg, #1b1b22, #0b0b0f);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.08);
  transition: box-shadow .4s, border-color .4s, filter .4s; filter: brightness(.5) saturate(.7);
}
.rc__grid { position: absolute; inset: 0; pointer-events: none; opacity: .35; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 75%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); }
.rc__num { position: absolute; top: 14px; left: 16px; font-family: var(--font-d); font-size: .78rem; color: rgba(255,255,255,.55); }
.rc__orb { position: absolute; top: 18%; left: 50%; width: 46%; aspect-ratio: 1; translate: -50% 0; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--red-2), var(--red) 45%, var(--red-deep)); box-shadow: 0 18px 40px -10px rgba(227,38,43,.9), inset 0 -8px 18px rgba(0,0,0,.35), inset 0 6px 14px rgba(255,255,255,.3); }
.rc__orb .ico { width: 42%; height: 42%; color: #fff; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
/* Variante con foto (data.js → fotoCarrusel): la foto cubre TODA la tarjeta.
   .rc__shade oscurece la parte de abajo para que el título siga siendo legible. */
.rc__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.rc__shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,8,11,.15) 0%, rgba(8,8,11,.05) 38%, rgba(8,8,11,.75) 66%, rgba(8,8,11,.97) 100%); }
.ring__item--photo .rc__num { color: #fff; padding: .3em .65em; border-radius: 999px; background: rgba(8,8,11,.55); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* Tarjeta del frente: la foto se acerca despacio y un brillo la recorre */
.ring__item--photo .rc__photo { transition: transform 6s ease-out; }
.ring__item--photo.front .rc__photo { transform: scale(1.08); }
.ring__item--photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.16) 48%, transparent 60%); transform: translateX(-120%); }
.ring__item--photo.front::after { animation: cardShine 4.5s ease-in-out infinite 1s; }
@keyframes cardShine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.ring__item--photo .rc__tag { align-self: flex-start; color: #fff; background: var(--red); padding: .35em .75em; border-radius: 6px; box-shadow: 0 6px 16px -4px rgba(227,38,43,.8); margin-bottom: 4px; }
.ring__item--photo .rc__title { font-size: calc(var(--cw, 200px) * .088); text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.ring__item--photo .rc__go { padding: .55em 1em; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); color: #fff; align-self: flex-start; }
.ring__item--photo.front .rc__go { background: var(--red); border-color: var(--red); }
.ring__item--photo.front .rc__go .ico { color: #fff; }
/* Espacio reservado mientras falta la foto (assets/img/carrusel/<id>.jpg no existe todavía) */
.rc__placeholder { position: absolute; top: 12%; left: 10%; right: 10%; height: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 2px dashed rgba(255,255,255,.28); border-radius: 14px; background: rgba(255,255,255,.04); color: rgba(255,255,255,.75); }
.rc__placeholder .ico { width: 30%; height: auto; color: var(--red-2); }
.rc__placeholder b { font-size: calc(var(--cw, 200px) * .07); }
.rc__placeholder small { font-size: .62rem; color: var(--muted); }
.rc__halo { position: absolute; inset: -14%; border-radius: 50%; border: 1px dashed rgba(255,255,255,.3); animation: spin 14s linear infinite; }
.rc__tag { position: relative; font-size: max(.62rem, calc(var(--cw, 200px) * .04)); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--red-2); line-height: 1.3; }
.rc__title { position: relative; font-family: var(--font-d); font-weight: 700; font-size: calc(var(--cw, 200px) * .078); line-height: 1.15; color: #fff; }
.rc__go { position: relative; display: inline-flex; align-items: center; gap: .4em; margin-top: 6px; font-size: max(.72rem, calc(var(--cw, 200px) * .046)); font-weight: 700; color: rgba(255,255,255,.75); opacity: 0; transform: translateY(6px); transition: all .4s var(--ease); }
.rc__go .ico { color: var(--red-2); }
.ring__item.front { filter: none; border-color: rgba(227,38,43,.7); box-shadow: 0 30px 80px -20px rgba(227,38,43,.65), inset 0 1px 0 rgba(255,255,255,.12); }
.ring__item.front .rc__go { opacity: 1; transform: none; }
.ring__item.front .rc__orb { animation: orbFloat 3.2s ease-in-out infinite; }
@keyframes orbFloat { 50% { translate: -50% -6px; } }
.stage__floor { position: absolute; left: 10%; right: 10%; bottom: 8%; height: 60px; background: radial-gradient(ellipse at center, rgba(227,38,43,.45), transparent 70%); filter: blur(16px); }
.stage__hint { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: .8rem; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: .5em; margin: 0; }
.scroll-cue { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--line-2); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--red); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
.hero .reveal { transition-delay: calc(var(--d, 0ms) + .2s); }
body:not(.ready) .hero .reveal { opacity: 0 !important; transform: translateY(34px) !important; }
