/* Componentes de la portada (borrador «componentes-vidrio», 20-nov-2026).
   Van sin @layer a propósito: le ganan a las capas de la plantilla suiza. */

/* ---------- intro: todo blanco → logo en vidrio → «trazo» con brillo ---------- */
#intro { position: relative; height: 280vh; background: #fff; }
#intro .in-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; background: #fff; }
#intro .in-glass { position: absolute; inset: 0; transition: opacity .2s linear; }
#intro .in-word { position: absolute; left: 50%; top: 50%; margin: 0; translate: -50% calc(-50% + var(--in-dy, -0.035em)); font-family: var(--font-1); font-size: var(--in-size, clamp(96px, 18vw, 260px)); font-weight: 600; line-height: 1; letter-spacing: -0.035em; white-space: nowrap; color: var(--color-2); opacity: 0; pointer-events: none; }
#intro .in-sub { position: absolute; left: 50%; top: calc(50% + var(--in-size, 160px) * 0.5); translate: -50% 12px; margin: 0; color: var(--color-4); letter-spacing: .02em; opacity: 0; white-space: nowrap; }
#intro .in-hint { position: absolute; left: 50%; bottom: clamp(24px, 6vh, 56px); translate: -50% 0; margin: 0; display: grid; justify-items: center; gap: 10px; color: var(--color-5); transition: opacity .4s; }
#intro .in-hint__line { width: 1px; height: 42px; background: linear-gradient(var(--color-5), transparent); animation: in-hint 1.8s cubic-bezier(.6, 0, .4, 1) infinite; transform-origin: 50% 0; }
@keyframes in-hint { 0% { scale: 1 0; } 50% { scale: 1 1; transform-origin: 50% 0; } 51% { transform-origin: 50% 100%; } 100% { scale: 1 0; transform-origin: 50% 100%; } }

/* brillo que cruza la palabra (Shimmer Text de 21st.dev, en CSS) */
.in-shimmer { display: inline-block; -webkit-text-fill-color: transparent; background: currentColor linear-gradient(to right, currentColor 0%, rgba(255, 255, 255, .62) 40%, rgba(255, 255, 255, .62) 60%, currentColor 100%); -webkit-background-clip: text; background-clip: text; background-repeat: no-repeat; background-size: 50% 200%; background-position-x: 250%; }
#intro.is-brillo .in-shimmer { animation: in-shimmer 3s linear .4s infinite; }
@keyframes in-shimmer { 0% { background-position-x: -100%; } 50%, 100% { background-position-x: 250%; } }

/* sin WebGL2 o con movimiento reducido: la palabra sola, sin pantalla de espera */
#intro.in--simple { height: 100svh; }
#intro.in--simple .in-word, #intro.in--simple .in-sub { opacity: 1; }
#intro.in--simple .in-hint { display: none; }

/* mientras dura la intro no hay encabezado ni barra: la pantalla empieza en blanco */
#nav { transition: transform .5s cubic-bezier(.7, 0, .2, 1), opacity .4s; }
html.en-intro #nav { opacity: 0; pointer-events: none; }
html.en-intro #nav * { pointer-events: none; }
#nav .nav__lang { right: var(--space-1); }

/* ---------- barra flotante de agua ---------- */
#barra.barra { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 50; translate: -50% 0; transition: translate .6s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
html.en-intro #barra.barra { translate: -50% 140%; opacity: 0; pointer-events: none; }
.barra:empty { display: none; }

/* ---------- trabajos: carpetas de vidrio ---------- */
#work .wk-lead { margin: 18px 0 0 var(--space-2); max-width: 46ch; color: var(--color-4); }
#work .wk-folders { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(48px, 8vw, 120px); padding: clamp(150px, 22vh, 230px) var(--space-1) clamp(40px, 8vh, 80px); }
#work .wk-folders > div { width: min(380px, calc(100vw - 32px)); display: flex; justify-content: center; }
#work .wk-folders:not(:empty) ~ [data-sin-js] { display: none; }

/* ---------- proceso: órbita en vez de la regla fija ---------- */
#month { height: auto; }
#month .mo-stage { position: relative; height: auto; min-height: 0; padding-bottom: clamp(40px, 8vh, 80px); }
#month .mo-orbita { margin: 0 calc(-1 * var(--space-1)) 0 0; }

/* ---------- botones (Interactive Hover Button de 21st.dev, en CSS) ---------- */
.m-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 30px 0 36px; border: 1px solid var(--color-2); border-radius: 999px; background: var(--color-1); color: var(--color-2); font-family: var(--font-1); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: -.01em; text-decoration: none; overflow: hidden; isolation: isolate; cursor: pointer; }
.m-btn::before { content: ""; position: absolute; z-index: 0; left: 18px; top: calc(50% - 4px); width: 8px; height: 8px; inset: auto; left: 18px; top: calc(50% - 4px); border-radius: 999px; background: var(--color-6); transform: none; mask: none; -webkit-mask: none; padding: 0; transition: left .3s, top .3s, width .3s, height .3s, scale .3s, border-radius .3s; }
.m-btn__label { position: relative; z-index: 1; display: inline-block; transition: translate .3s, opacity .3s; }
.m-btn__hover { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; translate: 48px 0; opacity: 0; transition: translate .3s, opacity .3s; pointer-events: none; }
.m-btn__hover svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-btn:disabled { cursor: default; }
@media (hover: hover) {
  .m-btn:hover::before, .m-btn:focus-visible::before { left: 0; top: 0; width: 100%; height: 100%; scale: 1.8; }
  .m-btn:hover .m-btn__label, .m-btn:focus-visible .m-btn__label { translate: 48px 0; opacity: 0; }
  .m-btn:hover .m-btn__hover, .m-btn:focus-visible .m-btn__hover { translate: 0 0; opacity: 1; }
}
/* en el fondo negro de la apertura el botón va al revés */
#opening .op-two .m-btn { border-color: var(--color-1); }

@media (prefers-reduced-motion: reduce) {
  .m-btn::before, .m-btn__label, .m-btn__hover { transition: none; }
  #intro .in-hint__line { animation: none; }
}

/* ---------- servicios: tres tarjetas visuales, una línea cada una ---------- */
#services .sv-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); padding: clamp(32px, 6vh, 64px) var(--space-1) 0; }
#services .sv-card { position: relative; display: grid; gap: 6px; color: var(--color-2); text-decoration: none; }
#services .sv-vis { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: var(--color-3); margin-bottom: 14px; box-shadow: 0 0 0 1px var(--color-8), 0 18px 40px -24px rgba(11, 11, 11, .35); }
#services .sv-vis img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: scale .8s cubic-bezier(.2, .8, .2, 1); }
#services .sv-num { color: var(--color-6); }
#services .sv-name { font-size: clamp(24px, 2.4vw, 36px); }
#services .sv-one { color: var(--color-4); max-width: 30ch; }
#services .sv-go { margin-top: 8px; font-weight: 600; font-size: 14px; }
#services .sv-go span { display: inline-block; transition: translate .3s; color: var(--color-6); }
@media (hover: hover) {
  #services .sv-card:hover .sv-vis img { scale: 1.04; }
  #services .sv-card:hover .sv-go span { translate: 6px 0; }
}
@media (max-width: 860px) { #services .sv-cards { grid-template-columns: 1fr; gap: 40px; } }
/* gráfico de optimización: barras que crecen y puntos que se prenden en rojo */
#services .sv-vis--opt { display: grid; place-items: center; background: var(--color-2); }
#services .sv-opt { width: 70%; display: grid; gap: 12px; color: #fff; font-size: clamp(14px, 1.3vw, 18px); font-weight: 600; }
#services .sv-opt__bar { display: flex; align-items: end; gap: 8px; height: 70px; margin-bottom: 6px; }
#services .sv-opt__bar i { flex: 1; border-radius: 6px 6px 2px 2px; background: #3a3a3a; height: 30%; transition: height 1.2s cubic-bezier(.2, .8, .2, 1), background .6s; }
#services .sv-opt__row { display: flex; align-items: center; gap: 10px; opacity: .45; transition: opacity .5s; }
#services .sv-opt__row b { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #fff; transition: background .5s, border-color .5s; }
#services .sv-cards.is-in .sv-opt__bar i:nth-child(1) { height: 55%; background: #7a1520; }
#services .sv-cards.is-in .sv-opt__bar i:nth-child(2) { height: 78%; background: #a51a28; transition-delay: .15s; }
#services .sv-cards.is-in .sv-opt__bar i:nth-child(3) { height: 100%; background: var(--color-6); transition-delay: .3s; }
#services .sv-cards.is-in .sv-opt__row { opacity: 1; }
#services .sv-cards.is-in .sv-opt__row b { background: var(--color-6); border-color: var(--color-6); }
#services .sv-cards.is-in .sv-opt__row:nth-child(3), #services .sv-cards.is-in .sv-opt__row:nth-child(3) b { transition-delay: .5s; }
#services .sv-cards.is-in .sv-opt__row:nth-child(4), #services .sv-cards.is-in .sv-opt__row:nth-child(4) b { transition-delay: .8s; }
#services .sv-cards.is-in .sv-opt__row:nth-child(5), #services .sv-cards.is-in .sv-opt__row:nth-child(5) b { transition-delay: 1.1s; }

/* ---------- palabras que aparecen (Words Stagger de 21st.dev, en CSS) ---------- */
.ws-w { display: inline-block; opacity: 0; translate: 0 20px; filter: blur(12px); transition: opacity .55s ease-out, translate .55s ease-out, filter .55s ease-out; transition-delay: calc(var(--ws-i) * 80ms); }
.ws-on .ws-w { opacity: 1; translate: 0 0; filter: blur(0); }
@media (prefers-reduced-motion: reduce) { .ws-w { opacity: 1; translate: none; filter: none; transition: none; } }

/* que la barra flotante no tape la última línea del pie */
#footer .ft-bottom { padding-bottom: 96px; }
