/* ==========================================================================
   Stenko — secciones
   ========================================================================== */

/* --------------------------------------------------------------------------
   01 · Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: clamp(7rem, 18vh, 11rem);
  padding-bottom: clamp(2rem, 6vh, 3.5rem);
}

/* --------------------------------------------------------------------------
   Velo de legibilidad
   La ilustración 3D vive detrás de TODO el sitio, así que donde hay texto
   encima hace falta un suelo oscuro. En apaisado el degradado va horizontal:
   la columna de texto queda casi opaca y el eclipse respira a la derecha, que
   es hacia donde lo corre la cámara (_computeFraming en FlowScene.js). En
   vertical no hay columna que proteger y el degradado pasa a ser vertical.

   Es un pseudo-elemento dentro de #app, así que se pinta por encima del lienzo
   (z-index 1) sin necesidad de tocar el apilamiento global.
   -------------------------------------------------------------------------- */
.hero::before,
.flow__sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  background: linear-gradient(100deg,
    rgba(4, 6, 15, 0.97) 0%,
    rgba(4, 6, 15, 0.94) 26%,
    rgba(4, 6, 15, 0.78) 44%,
    rgba(4, 6, 15, 0.38) 64%,
    rgba(4, 6, 15, 0.06) 84%,
    rgba(4, 6, 15, 0) 100%);
}

.flow__sticky::before {
  background: linear-gradient(178deg,
    rgba(4, 6, 15, 0.30) 0%,
    rgba(4, 6, 15, 0.72) 22%,
    rgba(4, 6, 15, 0.88) 50%,
    rgba(4, 6, 15, 0.93) 100%);
}

/* El contenido siempre por encima de su propio velo. */
.hero > .container,
.flow__sticky > .container { position: relative; z-index: 1; }
.hero__scroll { z-index: 1; } /* ya es absolute más abajo; sólo necesita subir */

/* En vertical el eclipse no se puede correr a un lado: se apaga hacia abajo,
   que es donde se acumula el texto. */
@media (max-width: 860px) {
  .hero::before {
    background: linear-gradient(180deg,
      rgba(4, 6, 15, 0) 0%,
      rgba(4, 6, 15, 0.30) 18%,
      rgba(4, 6, 15, 0.82) 38%,
      rgba(4, 6, 15, 0.95) 55%,
      rgba(4, 6, 15, 0.98) 100%);
  }
}

.hero__eyebrow {
  margin-bottom: clamp(1.5rem, 5vh, 3rem);
  color: var(--bone-60); /* sube desde --bone-42: va sobre la parte viva del arco */
}

.hero__wordmark { margin-bottom: 0.4rem; }

.hero__slogan {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-3);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1.6rem;
}

.hero__text {
  max-width: 34rem;
  margin-bottom: clamp(2rem, 5vh, 2.75rem);
}

.hero__actions { margin-bottom: clamp(2.5rem, 8vh, 4.5rem); }

/* Pie técnico del hero: coordenadas reales, el idioma del software. */
.hero__readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}
.hero__readout span { white-space: nowrap; }
.hero__readout b {
  font-weight: 600;
  color: rgba(245, 246, 248, 0.72);
  letter-spacing: 0.06em;
}

.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(2rem, 6vh, 3.5rem);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  writing-mode: vertical-rl;
  height: 8rem;
}
.hero__scroll::after {
  content: "";
  flex: 1;
  width: 1px;
  background: linear-gradient(180deg, var(--line) 0%, rgba(58, 66, 112, 0) 100%);
}
@media (max-width: 900px) { .hero__scroll { display: none; } }

/* --------------------------------------------------------------------------
   02 · Nosotros
   -------------------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about__aside { position: sticky; top: 7rem; }

.about__title {
  font-size: var(--step-3);
  margin-bottom: 1.25rem;
  max-width: 12ch;
}

.about__body { display: grid; gap: 1.5rem; max-width: 46rem; }
.about__body p { font-size: var(--step-1); line-height: 1.55; letter-spacing: -0.015em; }

/* El párrafo pivote del relato, marcado con el arco a un costado. */
.about__pivot {
  position: relative;
  padding-left: 1.6rem;
}
.about__pivot::before {
  content: "";
  position: absolute;
  left: 0; top: 0.4em; bottom: 0.4em;
  width: 2px;
  border-radius: 2px;
  background: var(--arc);
  transform: scaleY(var(--p, 0));
  transform-origin: top;
}

.about__slogan {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-2);
  letter-spacing: -0.035em;
  margin-top: 0.5rem;
}

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__aside { position: static; }
}

/* --------------------------------------------------------------------------
   03 · Lo que hacemos
   -------------------------------------------------------------------------- */
.pillars__intro {
  max-width: 40rem;
  font-size: var(--step-2);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.pillars__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.pillars__note {
  margin-top: clamp(2rem, 5vh, 3rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  max-width: 44rem;
}

/* --------------------------------------------------------------------------
   04 · Cómo funciona el flujo
   Aquí la ilustración 3D manda: el texto es mínimo y se enciende por pasos.
   -------------------------------------------------------------------------- */
.flow { position: relative; padding-block: 0; }

.flow__track { height: 340svh; position: relative; }

/* El esquema de automatización manda en esta sección; el arco 3D se queda
   detrás como atmósfera (data-canvas="0.55"). Todo cabe en una pantalla. */
.flow__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(4.5rem, 10vh, 6rem) clamp(1.5rem, 5vh, 3rem);
}

.flow__head { margin-bottom: clamp(1rem, 3vh, 2rem); }
.flow__title { font-size: var(--step-2); max-width: 20ch; }

.flow__diagram { margin-bottom: clamp(1rem, 3vh, 2rem); }

.flow__steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  border-top: 1px solid var(--line-soft);
  padding-top: 1.5rem;
}

.flow__step {
  position: relative;
  padding-top: 1.25rem;
  opacity: 0.3;
  transition: opacity 520ms var(--ease-arc);
}
.flow__step.is-active { opacity: 1; }

/* El nodo de cada paso vive sobre el horizonte de la lista. */
.flow__step::before {
  content: "";
  position: absolute;
  top: -1.5rem; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: background 520ms var(--ease-arc), box-shadow 520ms var(--ease-arc), transform 520ms var(--ease-arc);
}
.flow__step.is-active::before {
  background: var(--arc);
  box-shadow: 0 0 14px rgba(255, 165, 62, 0.55);
  transform: scale(1.35);
}

.flow__step-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.flow__step-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem;
}
.flow__step-text { font-size: var(--step--1); line-height: 1.55; color: var(--bone-60); }

/* Lectura del estado del flujo, como un instrumento. */
.flow__readout {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.flow__readout b { font-weight: 600; color: rgba(245, 246, 248, 0.72); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .flow__track { height: 320svh; }
  .flow__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.25rem; }
  .flow__step::before { top: -1.35rem; }
}
/* Dos columnas incluso en móvil: sin el texto de los pasos inactivos cada
   celda es sólo número + nombre, y cuatro filas no caben en la pantalla. */
@media (max-width: 520px) {
  .flow__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .flow__step { padding-top: 0.9rem; }
  .flow__step::before { top: -1.25rem; }
}

@media (max-width: 640px) {
  .flow__sticky { padding-block: clamp(3.5rem, 9vh, 4.5rem) 0.75rem; }
  .flow__readout { display: none; }
}

/* La sección 04 vive pegada a la pantalla, así que su contenido tiene que caber
   en una pantalla. En viewports bajos se recorta por prioridad: primero el
   detalle de los pasos inactivos, luego la lectura del instrumento, y el
   esquema cede altura antes que la lista. */
@media (max-height: 780px), (max-width: 520px) {
  .flow__step-text { display: none; }
  .flow__step.is-active .flow__step-text { display: block; }
}

@media (max-height: 780px) {
  .dg__svg { max-height: 42svh; }
  .flow__readout { display: none; }
}

@media (max-height: 660px) {
  .flow__sticky { padding-block: clamp(3.25rem, 8vh, 4.5rem) 0.75rem; }
  .flow__head { margin-bottom: 0.75rem; }
  .flow__head .section-tag { margin-bottom: 0.75rem; }
  .flow__title { font-size: var(--step-1); max-width: 34ch; }
  .flow__diagram { margin-bottom: 0.75rem; }
  .flow__steps { padding-top: 1.1rem; }
  .dg__svg { max-height: 46svh; }
}

/* Ventanas muy bajas (portátiles pequeños, navegador a media pantalla):
   se sacrifica la etiqueta de sección antes que cualquier contenido. */
@media (max-height: 580px) {
  .flow__head .section-tag { display: none; }
  .dg__svg { max-height: 38svh; }
}

/* --------------------------------------------------------------------------
   05 · CTA final
   -------------------------------------------------------------------------- */
.cta { position: relative; text-align: center; }
.cta__inner { max-width: 46rem; margin-inline: auto; }
.cta__title { font-size: var(--step-4); margin-bottom: 1.5rem; }
.cta__text { margin-inline: auto; max-width: 34rem; margin-bottom: 2.5rem; }
.cta .btn-row { justify-content: center; }

.cta__channels {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
}

/* --------------------------------------------------------------------------
   06 · Footer
   -------------------------------------------------------------------------- */
.footer { position: relative; padding-block: clamp(3rem, 8vh, 5rem) 2.5rem; }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vh, 4rem);
}
.footer__tagline { margin-top: 1.1rem; max-width: 24rem; font-size: var(--step--1); color: var(--bone-60); }

.footer__col h3 {
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--bone-42);
  margin-bottom: 1rem;
}
.footer__col-h2 { margin-top: 1.75rem; }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer__col a { font-size: var(--step--1); color: rgba(245, 246, 248, 0.78); }

.footer__base {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

@media (max-width: 720px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

/* Entradilla de la seccion 03: aclara que las tarjetas son ejemplos, no un menu. */
.pillars__lead {
  max-width: 62ch;
  font-size: var(--step-0);
  margin-bottom: clamp(2rem, 5vh, 3rem);
}
