/* Efectos de prueba (solo portada 2027). Todo se activa con html.fx, que pone iw-fx.js. */
.n27-hero--home { position: relative; overflow: hidden; }
.n27-hero--home > .iw-wrap { position: relative; z-index: 1; }
.fx-orb { position: absolute; z-index: 0; top: clamp(70px, 8vw, 130px); right: max(2vw, calc((100vw - 1320px) / 2 - 60px)); width: clamp(240px, 30vw, 520px); aspect-ratio: 1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.fx-orb.is-on { opacity: 1; }
@media (max-width: 760px) { .fx-orb { display: none; } }

/* Aparecer al bajar */
html.fx .n27 [data-fx] { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--fx-d, 0s); will-change: opacity, transform; }
html.fx .n27 [data-fx].is-in { opacity: 1; transform: none; will-change: auto; }

/* Titulares: la línea de acento crece al entrar */
html.fx .n27 h2[data-k]::before { transition: background-size .9s cubic-bezier(.2,.7,.2,1) .15s; }

/* Al pasar el mouse */
.n27 .iw-btn { transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s, background-color .3s, color .3s; }
.n27 .iw-btn:hover { transform: translateY(-2px); }
.n27 .n27-link span[aria-hidden], .n27 .iw-btn span[aria-hidden] { display: inline-block; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.n27 .n27-link:hover span[aria-hidden], .n27 .iw-btn:hover span[aria-hidden] { transform: translateX(5px); }

@media (prefers-reduced-motion: reduce) {
  html.fx .n27 [data-fx] { opacity: 1; transform: none; transition: none; }
  .fx-orb { transition: none; }
  .n27 .iw-btn:hover { transform: none; }
}

/* =====================================================================
   Animaciones atadas al scroll (idea tomada de mazel-startup.com).
   CSS puro, sin JavaScript. Solo se activan donde el navegador lo soporta
   (Chrome, Edge, Safari nuevo) y si no pidió "reducir movimiento".
   Donde no, la página se ve normal.
   ===================================================================== */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {

    /* 1) Cómo trabajamos: cada paso se «enfoca» al cruzar el centro de la pantalla */
    @keyframes fx-focus { 0%, 10% { opacity: .22; } 40%, 60% { opacity: 1; } 90%, 100% { opacity: .22; } }
    #proceso .n27-steps > li { animation: fx-focus linear both; animation-timeline: view(); }
    html.fx #proceso .n27-steps > li[data-fx] { opacity: unset; transform: none; transition: none; }

    /* 2) Imágenes de proyectos: se «paran» en 3D al entrar */
    @keyframes fx-stand { from { transform: perspective(1100px) rotateX(9deg) translateY(22px); opacity: .3; } to { transform: perspective(1100px) rotateX(0) translateY(0); opacity: 1; } }
    .n27-work__img, .n27-cover__img { transform-origin: 50% 100%; animation: fx-stand linear both; animation-timeline: view(); animation-range: entry 0% cover 38%; }

    /* 4) Cifras de la portada: suben de a una */
    @keyframes fx-rise { from { transform: translateY(46px); opacity: 0; } to { transform: none; opacity: 1; } }
    .n27-facts > li { animation: fx-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  }
}

/* Filas de servicios y listas: relleno que barre al pasar el mouse */
.n27-list li, .n27-inline li a { transition: color .25s; }

/* =====================================================================
   Franja roja con frase gigante que se desliza (idea de la sección roja de Mazel).
   Base: franja fija, la frase se lee entera. Con scroll-driven animations
   (Chrome, Edge, Safari nuevo) la franja queda fija y la frase se desliza.
   ===================================================================== */
.fx-ads { background: var(--iw-accent); color: #fff; padding: clamp(56px, 8vw, 110px) 0; overflow: clip; }
.fx-ads__big { margin: 0; padding: 0 max(20px, 3vw); font-size: clamp(64px, 17vw, 300px); font-weight: 600; line-height: .98; letter-spacing: -.055em; color: #fff; }
.fx-ads__row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 22px 40px; margin-top: clamp(22px, 3vw, 44px); }
.fx-ads__lead { max-width: 44ch; margin: 0; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; color: #fff; }
.n27 .fx-ads__btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 99px; background: #fff; color: #1c1412; font-size: 17px; font-weight: 600; text-decoration: none; transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.n27 .fx-ads__btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(0,0,0,.45); }
.fx-ads__btn span { display: inline-block; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.fx-ads__btn:hover span { transform: translateX(5px); }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes fx-ads-slide { from { transform: translateX(14vw); } to { transform: translateX(calc(-100% + 100vw - 2 * max(20px, 3vw))); } }
    @keyframes fx-ads-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
    .fx-ads { view-timeline: --fxads block; height: 260vh; padding: 0; }
    .fx-ads__stick { position: sticky; top: 0; height: 100vh; min-height: 460px; display: flex; flex-direction: column; justify-content: center; overflow: clip; }
    .fx-ads__big { width: max-content; white-space: nowrap; font-size: clamp(110px, min(28vw, 42vh), 420px); animation: fx-ads-slide linear both; animation-timeline: --fxads; animation-range: contain 0% contain 92%; will-change: transform; }
    .fx-ads__row { animation: fx-ads-in linear both; animation-timeline: --fxads; animation-range: contain 40% contain 70%; width: 100%; }
  }
}

/* =====================================================================
   Filas que se rellenan al pasar el mouse (idea de la lista de servicios de Mazel):
   el color de marca barre la fila de abajo hacia arriba y el texto pasa a blanco.
   ===================================================================== */
.n27 .n27-rubros a {
  margin-inline: -18px; padding-inline: 18px; border-radius: 4px;
  background: linear-gradient(var(--iw-accent), var(--iw-accent)) 0 100% / 100% 0 no-repeat;
  transition: background-size .38s cubic-bezier(.2,.8,.2,1), color .25s;
}
.n27 .n27-rubros li:first-child a { padding-top: 16px; }
.n27 .n27-rubros a h3, .n27 .n27-rubros a p { transition: color .25s; }
.n27 .n27-rubros a:hover, .n27 .n27-rubros a:focus-visible { background-size: 100% 100%; }
.n27 .n27-rubros a:hover h3, .n27 .n27-rubros a:focus-visible h3,
.n27 .n27-rubros a:hover p, .n27 .n27-rubros a:focus-visible p { color: #fff; }
@media (prefers-reduced-motion: reduce) { .n27 .n27-rubros a { transition: none; } }
