/* Animaciones de toda la web. Se carga después de site.css y claro.css.
   Todo se desactiva con "reducir movimiento" del sistema. */

@view-transition { navigation: auto; }

/* Lenis (scroll suave) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Barra de progreso de lectura */
.mo-progress { position: fixed; inset: 0 0 auto 0; z-index: 80; height: 3px; background: var(--color-accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }

/* Aparición base: más recorrido, con desenfoque en los textos */
.js .reveal { transform: translateY(44px); transition: opacity 1.1s var(--ease-out-expo), transform 1.1s var(--ease-out-expo), filter 1.1s var(--ease-out-expo); transition-delay: var(--delay, 0s); }
.js .reveal:not(:has(img)) { filter: blur(6px); }
.js .reveal.is-in { transform: none; filter: none; }

/* Títulos palabra a palabra */
.mo-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .14em 0 .06em; margin: -.14em 0 -.06em; }
.mo-wi { display: inline-block; transform: translateY(105%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.1s var(--ease-out-expo); transition-delay: calc(var(--wd, 0) * 55ms + var(--delay, 0ms)); }
.mo-split.is-in .mo-wi, .is-in .mo-split .mo-wi { transform: none; }

/* Fotos: entran con un zoom suave y una cortina desde abajo */
.mo-img { transform: scale(1.16); transition: transform 1.8s var(--ease-out-expo), scale 1.2s var(--ease-out-expo) !important; }
.is-in .mo-img, .mo-img.is-in { transform: none; }
.mo-curtain { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease-out-expo); transition-delay: var(--delay, 0s); }
.mo-curtain.is-in, .is-in > .mo-curtain { clip-path: inset(0 0 0 0); }

/* Parallax (lo mueve motion.js con la propiedad translate) */
[data-parallax] { will-change: translate; }

/* Botones rojos: brillo que cruza al pasar el ratón */
a.bg-accent, .sv-btn-red { position: relative; overflow: hidden; isolation: isolate; }
a.bg-accent::after, .sv-btn-red::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, #ffffff55 50%, transparent 70%); transform: translateX(-120%); transition: transform .9s var(--ease-out-expo); pointer-events: none; }
a.bg-accent:hover::after, .sv-btn-red:hover::after { transform: translateX(120%); }
.mo-mag { transition: translate .5s var(--ease-out-expo), background-color .3s, color .3s; }

/* Tarjetas: se levantan un poco */
.sv-tile, .cm-specs li, .renting-logo { transition: transform .6s var(--ease-out-expo), box-shadow .6s var(--ease-out-expo); }
.sv-tile:hover, .cm-specs li:hover, .renting-logo:hover { transform: translateY(-6px); box-shadow: 0 18px 40px -18px #d7141c55; }

/* Logo de la portada: aparece al cargar */
html:has(#hero-title) [data-logo-fly] > img { animation: mo-logo 1.6s var(--ease-out-expo) backwards .15s; }
@keyframes mo-logo { from { opacity: 0; scale: .9; filter: blur(12px); } }
.hero-cita { animation: mo-up 1.2s var(--ease-out-expo) backwards .45s; }
@keyframes mo-up { from { opacity: 0; translate: 0 30px; } }

/* Historia del taller (Quiénes somos) */
.hist { margin-top: 6rem; }
.hist-head { text-align: center; }
.hist-list { position: relative; margin: 4rem auto 0; max-width: 64rem; padding-left: 3rem; }
.hist-ol { display: grid; gap: 2.5rem; }
.hist-line { position: absolute; top: .5rem; bottom: .5rem; left: .9rem; width: 2px; background: var(--color-line); }
.hist-fill { position: absolute; inset: 0 0 auto 0; height: 100%; background: var(--color-accent); transform-origin: 50% 0; transform: scaleY(var(--hp, 0)); }
.hist-item { position: relative; }
.hist-dot { position: absolute; left: -2.6rem; top: .55rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--color-ink); border: 2px solid var(--color-line); transition: background-color .5s, border-color .5s, transform .6s var(--ease-out-expo), box-shadow .6s; }
.hist-item.is-on .hist-dot { background: var(--color-accent); border-color: var(--color-accent); transform: scale(1.25); box-shadow: 0 0 0 6px #d7141c22; }
.js .hist-card { opacity: .15; transform: translateY(24px); transition: opacity .9s var(--ease-out-expo), transform .9s var(--ease-out-expo); }
.js .hist-item.is-on .hist-card { opacity: 1; transform: none; }
.hist-year { font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: .9; color: var(--color-accent); }
.hist-card h4 { margin-top: .35rem; font-family: var(--font-display); font-size: 1.75rem; letter-spacing: .02em; line-height: 1; }
.hist-card p:last-child { margin-top: .6rem; max-width: 30rem; color: var(--color-mute); line-height: 1.55; }
@media (min-width: 64rem) {
  .hist-list { padding-left: 0; } .hist-ol { gap: 1rem; }
  .hist-line { left: 50%; margin-left: -1px; }
  .hist-item { width: 50%; padding-right: 3.5rem; text-align: right; }
  .hist-item:nth-child(odd) { margin-left: 50%; padding: 0 0 0 3.5rem; text-align: left; }
  .hist-item .hist-dot { left: auto; right: -.575rem; }
  .hist-item:nth-child(odd) .hist-dot { left: -.575rem; right: auto; }
  .js .hist-item:not(:nth-child(odd)):not(.is-on) .hist-card { transform: translateX(-28px); }
  .js .hist-item:nth-child(odd):not(.is-on) .hist-card { transform: translateX(28px); }
  .hist-item:not(:nth-child(odd)) .hist-card p:last-child { margin-left: auto; }
}

/* Foto de Manuel */
.duenyo { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--color-ink-3); }
.duenyo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.duenyo figcaption { position: absolute; inset: auto 0 0 0; padding: 4rem 1.5rem 1.4rem; background: linear-gradient(to top, #000000c0, transparent); color: #fff; }
.duenyo figcaption b { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: .95; letter-spacing: .02em; }
.duenyo figcaption span { display: block; margin-top: .35rem; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: #ffffffd0; }
.duenyo::before { content: ""; position: absolute; z-index: 1; inset: 0 auto 0 0; width: 4px; background: var(--color-accent); }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .mo-wi, .mo-img, .mo-curtain, .hist-card { transition: none !important; transform: none !important; filter: none !important; clip-path: none !important; opacity: 1 !important; }
  html:has(#hero-title) [data-logo-fly] > img, .hero-cita { animation: none; }
  .mo-progress { display: none; }
}

/* Quiénes somos: foto + texto */
.nos-grid { display: grid; gap: 3rem; }
@media (min-width: 64rem) { .nos-grid { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 5rem; align-items: center; } }

.hist-h { margin-top: 1rem; font-size: clamp(2.6rem, 6vw, 5rem); line-height: .95; }
