/* ==========================================================================
   ROMAGMK · Sistema «Órbita»
   Todo nace del logo oficial: el globo de meridianos y la cinta binaria.
   Colores medidos en LogoNEW.png:
     índigo  #141675  wordmark y «Tecnología,»
     cerúleo #22a7cb  «Educación y Servicios»
     cobalto #2f69a9  cuerpo del globo
     agua    #70c4db  cinta binaria y brillos
     hielo   #eef8fb  reflejos del globo
   ========================================================================== */

@layer reset, tokens, base, components, sections, motion;

@font-face {
  font-family: "Unbounded";
  src: url("../../fonts/Unbounded-var-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../../fonts/InstrumentSans-var-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Unbounded Fallback";
  src: local("Arial Black"), local("Arial");
  size-adjust: 92%;
  ascent-override: 96%;
}

@view-transition { navigation: auto; }

/* ------------------------------------------------------------------------ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  img, svg, canvas, video { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }
  [hidden] { display: none !important; }
}

/* ------------------------------------------------------------------------ */
@layer tokens {
  :root {
    color-scheme: light;

    --indigo: #141675;
    --indigo-2: #1e2290;
    --night: #08093a;
    --night-2: #10125a;
    --cobalt: #2f69a9;
    --cerulean: #22a7cb;
    --aqua: #70c4db;
    --ice: #f2f8fb;
    --frost: #e2f0f6;
    --frost-2: #cfe6ef;
    --white: #ffffff;

    --text: var(--indigo);
    --text-2: #3d4a86;          /* 7.6:1 sobre hielo */
    --text-on-dark: #eef6fb;
    --text-on-dark-2: #aebfe0;  /* 8.9:1 sobre night */
    --line: rgb(20 22 117 / 0.12);
    --line-dark: rgb(174 191 224 / 0.18);

    --display: "Unbounded", "Unbounded Fallback", "Arial Black", sans-serif;
    --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

    --step--1: 0.9375rem;
    --step-0: 1.0625rem;
    --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
    --step-2: clamp(1.5rem, 1.25rem + 1vw, 2.1rem);
    /* Los tamaños grandes consideran también el alto: en laptops (pantallas anchas pero bajas)
       los titulares se reducen para que cada bloque quepa; en monitores grandes no cambian. */
    --step-3: clamp(1.9rem, min(1.5rem + 2.2vw, 1rem + 4.4vh), 3.4rem);
    --step-4: clamp(2.2rem, min(1.6rem + 3.8vw, 0.9rem + 6.2vh), 5.2rem);
    --step-5: clamp(2.4rem, min(1.4rem + 5vw, 0.9rem + 7.4vh), 6.2rem);

    --gutter: clamp(20px, 4vw, 64px);
    --max: 1440px;
    --radius: 22px;
    --radius-sm: 14px;
    --header-h: 68px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
    --spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.09 24.2%, 1.098 26.3%, 1.085 29.4%, 1.008 39.5%, 0.986 44.3%, 0.994 59.7%, 1);
  }
}

/* ------------------------------------------------------------------------ */
@layer base {
  html { scroll-padding-top: calc(var(--header-h) + 40px); background: var(--ice); }
  html:focus-within { scroll-behavior: smooth; }

  body {
    min-height: 100dvh;
    background: var(--ice);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1, h2, h3 {
    font-family: var(--display);
    font-weight: 640;
    line-height: 1.04;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }
  p { text-wrap: pretty; }
  a { color: inherit; }

  :focus-visible {
    outline: 3px solid var(--cerulean);
    outline-offset: 3px;
    border-radius: 6px;
  }
  ::selection { background: var(--indigo); color: var(--white); }

  .sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .skip-link {
    position: fixed; z-index: 200; top: 12px; left: 12px;
    padding: 12px 18px; border-radius: 999px;
    background: var(--indigo); color: var(--white); font-weight: 600; text-decoration: none;
    transform: translateY(-160%); transition: transform 0.25s var(--ease-out);
  }
  .skip-link:focus { transform: none; }

  .wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
}

/* ------------------------------------------------------------------------ */
@layer components {

  /* ---------- Botones: relleno que nace desde donde entra el cursor ---------- */
  .btn {
    --fill: var(--cerulean);
    --fill-text: var(--indigo);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 0 28px;
    border: 1.5px solid var(--indigo);
    border-radius: 999px;
    background: transparent;
    color: var(--indigo);
    font-family: var(--sans);
    font-size: 1.0625rem;
    font-weight: 620;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.4s var(--ease-out), border-color 0.4s, translate 0.5s var(--spring);
    touch-action: manipulation;
  }
  .btn::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: var(--x, 50%); top: var(--y, 50%);
    width: 260%; aspect-ratio: 1;
    border-radius: 50%;
    background: var(--fill);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s var(--ease-out);
  }
  .btn:hover::before, .btn:focus-visible::before { transform: translate(-50%, -50%) scale(1); }
  .btn:hover, .btn:focus-visible { color: var(--fill-text); border-color: var(--fill); }
  .btn:active { scale: 0.97; }

  .btn--solid { background: var(--indigo); color: var(--white); }
  .btn--on-dark { border-color: rgb(238 246 251 / 0.5); color: var(--text-on-dark); --fill: var(--aqua); --fill-text: var(--night); }
  .btn--light { background: var(--white); border-color: var(--white); color: var(--indigo); --fill: var(--aqua); }

  /* Indicador orbital: un punto que gira alrededor de un anillo (eco del globo). */
  .orbit-dot {
    position: relative;
    width: 18px; height: 18px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    flex: none;
  }
  .orbit-dot::after {
    content: "";
    position: absolute;
    top: -3px; left: 50%;
    width: 6px; height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: currentColor;
    transform-origin: 3px 10.5px;
    transition: transform 0.7s var(--ease-out);
  }
  :is(a, button):hover .orbit-dot::after, :is(a, button):focus-visible .orbit-dot::after { transform: rotate(180deg); }

  .text-link {
    font-weight: 620;
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
    padding-bottom: 3px;
    transition: background-size 0.45s var(--ease-out);
  }
  .text-link:hover, .text-link:focus-visible { background-size: 0% 1.5px; background-position: 100% 100%; }

  /* ---------- Header ---------- */
  .header {
    position: fixed;
    z-index: 50;
    top: 14px; left: 0; right: 0;
    view-transition-name: header;
    transition: translate 0.55s var(--ease-out);
  }
  .header.is-hidden { translate: 0 calc(-100% - 20px); }
  .header__bar {
    width: min(100% - 2 * var(--gutter) + 24px, calc(var(--max) + 24px));
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: var(--header-h);
    padding: 0 8px 0 20px;
    border: 1px solid rgb(20 22 117 / 0.08);
    border-radius: 999px;
    background: rgb(242 248 251 / 0.8);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 14px 40px -28px rgb(20 22 117 / 0.45);
  }
  .header__logo img { width: 118px; height: auto; }
  .nav { display: flex; align-items: center; gap: 2px; }
  .nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--indigo);
    font-weight: 560;
    text-decoration: none;
    overflow: hidden;
  }
  /* El texto «rueda» hacia arriba y entra su copia desde abajo. */
  .nav__link span { display: block; line-height: 44px; transition: translate 0.5s var(--ease-out); }
  .nav__link span::after {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 100%;
    width: 100%;
    color: var(--cobalt);
  }
  .nav__link:hover span, .nav__link:focus-visible span { translate: 0 -100%; }
  .nav__link > span { position: relative; }
  .nav__link.is-active { background: var(--frost); }
  .nav__cta { min-height: 52px; padding: 0 22px; margin-left: 8px; }

  .menu-btn {
    display: none;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--indigo);
    color: var(--white);
    font-weight: 620;
  }
  .menu-btn__lines { position: relative; width: 18px; height: 10px; }
  .menu-btn__lines::before, .menu-btn__lines::after {
    content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
  }
  .menu-btn__lines::before { top: 0; }
  .menu-btn__lines::after { top: 8px; }
  .menu-btn[aria-expanded="true"] .menu-btn__lines::before { top: 4px; transform: rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-btn__lines::after { top: 4px; transform: rotate(-45deg); }

  /* Menú móvil: se abre como un círculo que crece desde el botón. */
  .menu {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 32px;
    padding: calc(var(--header-h) + 48px) var(--gutter) 36px;
    background: var(--night);
    color: var(--text-on-dark);
    clip-path: circle(0 at var(--ox, 90%) var(--oy, 40px));
    visibility: hidden;
    transition: clip-path 0.8s var(--ease-in-out), visibility 0s linear 0.8s;
  }
  .menu.is-open { clip-path: circle(150% at var(--ox, 90%) var(--oy, 40px)); visibility: visible; transition: clip-path 0.8s var(--ease-in-out), visibility 0s; }
  .menu__links { display: grid; }
  .menu__links a {
    padding: 8px 0;
    color: inherit;
    font-family: var(--display);
    font-size: clamp(2.2rem, 10vw, 3.6rem);
    font-weight: 620;
    letter-spacing: -0.04em;
    text-decoration: none;
    opacity: 0;
    translate: 0 30px;
    transition: opacity 0.5s, translate 0.7s var(--ease-out);
    transition-delay: calc(0.2s + var(--i) * 0.06s);
  }
  .menu.is-open .menu__links a { opacity: 1; translate: 0 0; }
  .menu__meta { display: grid; gap: 6px; color: var(--text-on-dark-2); }
  .menu__meta a { color: var(--text-on-dark); }
  .menu-open { overflow: hidden; }

  @media (max-width: 960px) {
    .nav { display: none; }
    .menu-btn { display: inline-flex; }
  }
  @media (min-width: 961px) { .menu { display: none; } }

  /* ---------- Pie ---------- */
  .footer {
    padding: clamp(48px, 6vw, 84px) 0 28px;
    background: var(--frost);
  }
  .footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
  }
  .footer__brand img { width: 200px; }
  .footer__brand p { margin-top: 18px; max-width: 32ch; color: var(--text-2); }
  .footer h2 { font-family: var(--sans); font-size: var(--step--1); font-weight: 650; letter-spacing: 0; color: var(--text-2); margin-bottom: 14px; }
  .footer ul { display: grid; gap: 8px; padding: 0; list-style: none; }
  .footer li a { font-weight: 560; text-decoration: none; }
  .footer li a:hover { text-decoration: underline; text-underline-offset: 4px; }
  .footer__mark { margin-top: clamp(40px, 5vw, 64px); }
  .footer__mark img { width: clamp(200px, 24vw, 340px); height: auto; }
  .footer__bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--text-2); font-size: var(--step--1);
  }
  @media (max-width: 860px) {
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .footer__brand { grid-column: 1 / -1; }
  }
}

/* ------------------------------------------------------------------------ */
@layer sections {

  /* ===================== HERO ===================== */
  .hero {
    position: relative;
    min-height: max(100svh, 560px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    overflow: clip;
    isolation: isolate;
  }
  .hero__canvas {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
  }
  .hero__content {
    align-self: center;
    padding-top: calc(var(--header-h) + clamp(16px, 6vh, 64px));
    padding-bottom: clamp(16px, 4vh, 48px);
  }
  .hero__title {
    max-width: 11.5em;
    /* El mínimo baja en celulares angostos para que «desarrollamos» no se corte. */
    font-size: clamp(min(2.5rem, 10vw), min(1rem + 4.3vw, 9.4vh), 5.6rem);
    font-weight: 680;
    line-height: 0.98;
    letter-spacing: -0.045em;
  }
  .hero__title .ln { display: block; }
  /* La línea de la palabra cambiante se encoge en pantallas estrechas para que
     «aulas virtuales» quepa en una sola línea sin mover el resto del hero. */
  .hero__title .ln--swap { font-size: min(1em, calc((100vw - 2 * var(--gutter)) / 9.8)); }
  /* Cada palabra tiene su color, tomado de la familia del logo. */
  .swap {
    --swap-c: var(--cobalt);
    --swap-r: var(--cerulean);
    position: relative;
    display: inline-block;
    color: var(--swap-c);
    white-space: nowrap;
    transition: color 0.6s var(--ease-out);
  }
  .swap[data-i="1"] { --swap-c: #1a8bb0; --swap-r: var(--aqua); }
  .swap[data-i="2"] { --swap-c: #4a3fd1; --swap-r: #8f87ee; }
  .swap[data-i="3"] { --swap-c: var(--indigo); --swap-r: var(--cerulean); }
  .swap[data-i="3"] .swap__text {
    background: linear-gradient(90deg, var(--indigo) 0%, var(--cobalt) 45%, var(--cerulean) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .hero.is-dragging { cursor: grabbing; user-select: none; }
  /* La cinta binaria del logo, dibujada bajo la palabra que cambia. */
  .swap__ribbon {
    position: absolute;
    left: -2%; bottom: -0.18em;
    width: 108%; /* un SVG absoluto no se estira con left/right: el ancho va explícito */
    height: 0.36em;
    overflow: visible;
    pointer-events: none;
  }
  .swap__ribbon path { fill: none; stroke: var(--swap-r); stroke-width: 5; stroke-linecap: round; transition: stroke 0.6s var(--ease-out); }
  .hero__lead {
    max-width: min(42ch, 52vw);
    margin-top: clamp(14px, min(3vw, 3.4vh), 36px);
    font-size: var(--step-1);
    line-height: 1.5;
    color: var(--text-2);
  }
  .hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(16px, min(3.5vw, 4vh), 44px); }

  /* Cinta de clientes: nombres reales que avanzan sin fin. */
  .clients {
    position: relative;
    min-width: 0;
    border-top: 1px solid var(--line);
    background: rgb(242 248 251 / 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .clients__inner { display: flex; align-items: center; gap: 24px; overflow: hidden; }
  .clients__label {
    flex: none;
    padding: 22px 0 22px var(--gutter);
    color: var(--text-2);
    font-size: var(--step--1);
    font-weight: 600;
  }
  .marquee { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
  .marquee__track { display: flex; width: max-content; }
  .marquee__group { display: flex; align-items: center; gap: 40px; padding-right: 40px; margin: 0; list-style: none; padding-left: 0; }
  .marquee__group li { display: flex; align-items: center; gap: 40px; }
  .marquee a {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 560;
    letter-spacing: -0.02em;
    color: var(--indigo);
    text-decoration: none;
    white-space: nowrap;
    padding: 18px 0;
    transition: color 0.3s;
  }
  .marquee a:hover, .marquee a:focus-visible { color: var(--cobalt); }
  .marquee__sep { width: 10px; height: 10px; border: 1.5px solid var(--cerulean); border-radius: 50%; flex: none; }

  @media (max-width: 900px) {
    .hero__content { align-self: end; padding-top: max(56svh, 360px); }
    .hero__lead { max-width: 42ch; }
    .clients__label { display: none; }
  }

  /* ===================== CONSOLA DE PROYECTOS ===================== */
  .console {
    position: relative;
    padding: clamp(48px, min(9vw, 10vh), 130px) 0;
    background:
      radial-gradient(60% 50% at 70% 40%, rgb(47 105 169 / 0.35), transparent 70%),
      radial-gradient(40% 40% at 10% 90%, rgb(34 167 203 / 0.16), transparent 70%),
      var(--night);
    color: var(--text-on-dark);
    overflow: clip;
  }
  .console::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      repeating-radial-gradient(circle at 70% 45%, transparent 0 79px, rgb(112 196 219 / 0.07) 80px 81px);
    pointer-events: none;
  }
  .console__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(32px, 5vw, 80px);
    align-items: center;
  }
  /* Ajustado al ancho de la columna: «Proyectos» no debe salirse hacia el monitor. */
  .console__title { font-size: clamp(2rem, min(1rem + 3.3vw, 0.6rem + 5.4vh), 4.4rem); }
  .console__intro { margin-top: clamp(12px, 2vh, 22px); color: var(--text-on-dark-2); max-width: 36ch; font-size: var(--step-1); line-height: 1.5; }

  .picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: clamp(18px, 3vh, 32px); padding: 0; list-style: none; }
  .picker button {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border: 1px solid var(--line-dark);
    border-radius: 12px;
    background: transparent;
    color: var(--text-on-dark-2);
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 520;
    letter-spacing: -0.02em;
    text-align: left;
    transition: background-color 0.3s, color 0.3s, padding 0.5s var(--ease-out);
  }
  .picker button small { font-family: var(--sans); font-size: 0.78rem; font-weight: 500; letter-spacing: 0; color: var(--text-on-dark-2); }
  .picker button:hover { color: var(--text-on-dark); background: rgb(255 255 255 / 0.04); }
  /* En dos columnas, la categoría va bajo el nombre para que nada se parta. */
  .picker button { flex-direction: column; align-items: flex-start; gap: 0; white-space: nowrap; padding: clamp(6px, 1.1vh, 10px) 12px; }
  .picker button[aria-current="true"] { background: rgb(112 196 219 / 0.18); border-color: rgb(112 196 219 / 0.6); color: var(--white); }
  .picker button[aria-current="true"] small { color: var(--aqua); }

  .stage {
    position: relative;
    perspective: 1600px;
    padding-bottom: 8%;
    /* El equipo nunca es más alto que lo que deja la pantalla bajo la barra de control. */
    max-width: min(100%, calc((100svh - 300px) * 1.45));
    margin-inline: auto;
  }
  .device {
    position: relative;
    transform: rotateX(var(--rx, 3deg)) rotateY(var(--ry, -5deg));
    transform-style: preserve-3d;
    transition: transform 0.9s var(--ease-out);
  }
  /* Equipos de aluminio claro: se distinguen nítidos sobre el fondo nocturno. */
  .monitor {
    position: relative;
    padding: 12px 12px 34px;
    border-radius: 22px;
    background: linear-gradient(165deg, #f4f7fb 0%, #cfd8e6 45%, #aeb9cc 100%);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.9),
      inset 0 -2px 0 rgb(80 92 120 / 0.35),
      0 50px 110px -36px rgb(0 0 0 / 0.85),
      0 0 140px -30px rgb(112 196 219 / 0.55);
  }
  .monitor::before {
    /* Vidrio oscuro alrededor de la pantalla. */
    content: "";
    position: absolute;
    inset: 12px 12px 34px;
    border-radius: 12px;
    box-shadow: 0 0 0 6px #0b0d24;
    pointer-events: none;
  }
  .monitor::after {
    /* Pequeño indicador de encendido del monitor. */
    content: "";
    position: absolute;
    left: 50%; bottom: 13px;
    width: 8px; height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, #7fd6ec, #2a9cc4);
    box-shadow: 0 0 10px rgb(112 196 219 / 0.8);
  }
  .screen {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
  }
  /* Reflejo suave sobre el vidrio. */
  .screen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(115deg, rgb(255 255 255 / 0.16) 0%, rgb(255 255 255 / 0) 38%);
    pointer-events: none;
  }
  .screen__img {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    height: auto;
    /* 16 s por recorrido: espera 0,9 s arriba; sumado a la transición binaria,
       la captura empieza a bajar ~1,5 s después de elegir un proyecto. */
    animation: browse 16s linear infinite alternate;
    animation-play-state: var(--play, running);
  }
  .screen:hover .screen__img { animation-play-state: paused; }
  .screen__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .stand {
    position: relative;
    width: 18%;
    height: 58px;
    margin: -1px auto 0;
    background: linear-gradient(90deg, #9ea9be, #e9eef5 45%, #b3bed0);
    clip-path: polygon(28% 0, 72% 0, 84% 100%, 16% 100%);
  }
  .stand::after {
    /* Base del soporte. */
    content: "";
    position: absolute;
    left: -60%; right: -60%; bottom: -10px;
    height: 12px;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(180deg, #dfe6ef, #9aa6bb);
  }
  .stage { padding-bottom: 10%; }
  .phone {
    position: absolute;
    right: 2%;
    bottom: 1%;
    width: 22%;
    padding: 6px;
    border-radius: 30px;
    background: linear-gradient(160deg, #f2f5f9, #b9c4d6 55%, #8f9bb2);
    box-shadow:
      inset 0 0 0 1px rgb(255 255 255 / 0.7),
      inset 0 0 0 5px #0b0d24,
      0 40px 70px -20px rgb(0 0 0 / 0.85),
      0 0 60px -20px rgb(112 196 219 / 0.5);
    transform: translateZ(60px);
    transition: opacity 0.5s, translate 0.7s var(--ease-out);
  }
  .phone::before {
    /* Isla de la cámara. */
    content: "";
    position: absolute;
    left: 50%; top: 13px;
    z-index: 2;
    width: 30%; height: 12px;
    translate: -50% 0;
    border-radius: 999px;
    background: #0b0d24;
  }
  .phone.is-off { opacity: 0; translate: 0 24px; }
  .phone img { position: relative; display: block; width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 24px; border: 4px solid #0b0d24; }

  /* Barra de control arriba del equipo: nombre del proyecto, flechas y visita, bien a la vista. */
  .console__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: clamp(14px, 2.4vh, 24px);
    padding: 10px 10px 10px 22px;
    border: 1px solid rgb(112 196 219 / 0.35);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.07);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .console__now h3 { font-size: clamp(1.2rem, 0.9rem + 0.8vw, 1.6rem); color: var(--white); }
  .console__now p { color: var(--text-on-dark-2); font-size: 0.92rem; }
  .console__controls { display: flex; align-items: center; gap: 8px; }
  .round-btn {
    display: grid;
    place-items: center;
    width: 50px; height: 50px;
    border: 0;
    border-radius: 50%;
    background: var(--aqua);
    color: var(--night);
    box-shadow: 0 8px 20px -10px rgb(112 196 219 / 0.8);
    transition: background-color 0.3s, color 0.3s, scale 0.4s var(--spring);
  }
  .round-btn:hover { background: var(--white); color: var(--indigo); scale: 1.06; }
  .console__controls .btn { min-height: 50px; border-color: var(--white); background: var(--white); color: var(--indigo); --fill: var(--aqua); --fill-text: var(--night); }
  .round-btn:active { scale: 0.92; }
  .round-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .console :focus-visible { outline-color: var(--aqua); }

  @media (max-width: 960px) {
    .console__grid { grid-template-columns: minmax(0, 1fr); }
    .picker { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
    .picker li { flex: none; }
    .picker button { white-space: nowrap; border: 1px solid var(--line-dark); }
    .picker button small { display: none; }
    .stage { order: 2; }
  }

  /* ===================== SERVICIOS: pila de paneles ===================== */
  .services {
    position: relative;
    isolation: isolate;
    padding: clamp(56px, 7vw, 100px) 0 clamp(56px, 7vw, 100px);
    background: linear-gradient(180deg, var(--ice), var(--frost) 30%, var(--frost) 70%, var(--ice));
  }
  /* Lienzo pegado a la ventana mientras dura la sección: no ocupa altura propia. */
  .services__field {
    position: sticky;
    top: 0;
    z-index: -1;
    display: block;
    width: 100%;
    height: 100vh;
    margin-bottom: -100vh;
    pointer-events: none;
    mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  }
  .services__head {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    margin-bottom: clamp(32px, 4vw, 56px);
  }
  .services__title { font-size: var(--step-4); }
  .services__head p { margin-top: 22px; color: var(--text-2); font-size: var(--step-1); line-height: 1.5; max-width: 44ch; }
  .services__index { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding: 0; list-style: none; }
  .services__index a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.75);
    font-size: var(--step--1);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
  }
  .services__index a:hover, .services__index a:focus-visible { border-color: var(--indigo); background: var(--indigo); color: var(--white); }
  .services__globe { position: relative; aspect-ratio: 1; width: 100%; max-width: 460px; margin-inline: auto; }
  @media (max-width: 900px) { .services__globe { max-width: 340px; } }
  .services__globe canvas { width: 100%; height: 100%; }

  .stack { display: grid; gap: 28px; }
  .panel {
    position: sticky;
    top: calc(var(--header-h) + 40px + var(--i) * 16px);
    min-height: min(76vh, 660px);
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: center;
    padding: clamp(28px, 4vw, 64px);
    border-radius: var(--radius);
    overflow: hidden;
    transform-origin: 50% 0;
    transform: scale(calc(1 - var(--p, 0) * 0.06));
    filter: brightness(calc(1 - var(--p, 0) * 0.25));
    box-shadow: 0 -20px 60px -40px rgb(8 9 58 / 0.45);
  }
  .panel h3 { font-size: var(--step-3); }
  .panel__lead { margin-top: 18px; font-size: var(--step-1); line-height: 1.5; max-width: 40ch; }
  .panel__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; padding: 0; list-style: none; }
  .panel__list li { padding: 8px 16px; border: 1.5px solid currentColor; border-radius: 999px; font-weight: 560; font-size: var(--step--1); }
  .panel__cta { margin-top: 32px; }

  .panel--web { background: var(--white); color: var(--indigo); box-shadow: 0 30px 80px -50px rgb(20 22 117 / 0.6); }
  .panel--web .panel__lead { color: var(--text-2); }
  .panel--shop { background: var(--cobalt); color: var(--white); }
  .panel--edu { background: var(--cerulean); color: var(--indigo); }
  .panel--soft { background: var(--night); color: var(--text-on-dark); }
  .panel--soft .panel__lead { color: var(--text-on-dark-2); }
  .panel--support { background: var(--frost-2); color: var(--indigo); }
  .panel--learn { background: var(--indigo); color: var(--white); }
  .panel--shop .btn, .panel--learn .btn, .panel--soft .btn { --fill: var(--aqua); --fill-text: var(--night); border-color: rgb(255 255 255 / 0.6); color: var(--white); }
  .panel--edu .btn { --fill: var(--indigo); --fill-text: var(--white); }
  /* Esta capa va después de components: el color de hover debe repetirse aquí. */
  :is(.panel--shop, .panel--learn, .panel--soft, .panel--edu) .btn:is(:hover, :focus-visible) { color: var(--fill-text); border-color: var(--fill); }

  /* Trabajo real en abanico para el servicio principal. */
  .fan { position: relative; aspect-ratio: 5 / 4; }
  .fan img {
    position: absolute;
    width: 72%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
    border-radius: 12px;
    box-shadow: 0 30px 60px -30px rgb(20 22 117 / 0.55);
    transition: transform 0.9s var(--ease-out);
  }
  .fan img:nth-child(1) { left: 0; top: 4%; transform: rotate(-5deg); }
  .fan img:nth-child(2) { right: 0; top: 22%; transform: rotate(4deg); }
  .fan img:nth-child(3) { left: 14%; bottom: 0; width: 66%; transform: rotate(-1deg); }
  .panel--web:hover .fan img:nth-child(1) { transform: rotate(-8deg) translate(-4%, -4%); }
  .panel--web:hover .fan img:nth-child(2) { transform: rotate(7deg) translate(4%, -2%); }

  /* Composiciones tipográficas propias de cada panel. */
  .glyph-word {
    font-family: var(--display);
    font-size: clamp(2.8rem, 6.4vw, 6.6rem);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 1.5px currentColor;
    text-align: right;
    word-break: break-word;
  }
  .panel--shop .glyph-word { color: transparent; -webkit-text-stroke-color: rgb(255 255 255 / 0.7); }
  .feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; list-style: none; }
  .feature-grid li { padding: 20px; border-radius: var(--radius-sm); background: rgb(255 255 255 / 0.32); }
  .feature-grid strong { display: block; font-family: var(--display); font-size: 1rem; font-weight: 620; letter-spacing: -0.02em; margin-bottom: 6px; }
  .feature-grid span { font-size: var(--step--1); }
  .binary-block {
    font-family: var(--display);
    font-size: clamp(1.4rem, 2.6vw, 2.4rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: 0.14em;
    color: var(--aqua);
    opacity: 0.85;
    max-width: 11ch;
    margin-left: auto;
    user-select: none;
  }
  .check-list { display: grid; gap: 0; padding: 0; list-style: none; border-top: 1.5px solid rgb(20 22 117 / 0.2); }
  .check-list li { display: flex; gap: 14px; align-items: baseline; padding: 18px 0; border-bottom: 1.5px solid rgb(20 22 117 / 0.2); font-family: var(--display); font-size: var(--step-1); font-weight: 520; letter-spacing: -0.02em; }
  .check-list li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cerulean); translate: 0 -2px; }
  .panel--learn { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .panel__photo { align-self: stretch; margin: calc(-1 * clamp(28px, 4vw, 64px)); margin-left: 0; }
  .panel__photo img { width: 100%; height: 100%; object-fit: cover; }

  /* Si un panel no cabe entero en pantalla, se apila sin quedar fijo para no ocultar su contenido. */
  @media (max-width: 900px), (max-height: 760px) {
    .panel { position: relative; top: auto; transform: none; filter: none; }
  }
  @media (max-width: 900px) {
    .services__head { grid-template-columns: 1fr; }
    .panel, .panel--learn { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .panel--shop .glyph-word { display: none; }
    .glyph-word { text-align: left; font-size: clamp(2.6rem, 14vw, 5rem); }
    .panel__photo { margin: 0 calc(-1 * clamp(28px, 4vw, 64px)) calc(-1 * clamp(28px, 4vw, 64px)); height: 260px; }
    .feature-grid { grid-template-columns: 1fr; }
  }

  /* ===================== NOSOTROS: localizador de Ecuador ===================== */
  .about { padding: clamp(48px, 6vw, 88px) 0 clamp(28px, 3.5vw, 48px); }
  /* Tarjeta con tono escarcha: separa Nosotros del fondo y agrupa mapa, texto y fotos. */
  .about__card {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 4.5vw, 64px);
    border-radius: calc(var(--radius) * 1.6);
    background:
      radial-gradient(circle at 18% 30%, rgb(255 255 255 / 0.7), transparent 45%),
      var(--frost);
  }
  .about__grid {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    gap: clamp(28px, 5vw, 80px);
    align-items: center;
  }

  /* Mapa real de Ecuador relleno de dígitos binarios; el globo se posa encima. */
  .about__visual { position: relative; aspect-ratio: 600 / 600; }
  .ec-map {
    position: absolute;
    right: 0; bottom: 0;
    width: 80%;
    height: auto;
    overflow: visible;
  }
  .ec-map__base { fill: var(--frost-2); }
  .ec-map__bits { fill: url(#ec-bits); }
  .ec-map text { font: 600 12px var(--display); text-anchor: middle; fill: var(--cobalt); opacity: 0.55; }
  .ec-map__line { fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-linejoin: round; }
  .locator {
    position: absolute;
    left: 0; top: 0;
    width: 52%;
    aspect-ratio: 1;
  }
  .locator canvas { width: 100%; height: 100%; }
  .locator__tag {
    position: absolute;
    left: 50%; top: 50%;
    translate: 18px -50%;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--indigo);
    color: var(--white);
    font-size: var(--step--1);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.4s 0.15s;
  }
  .locator.is-located .locator__tag { opacity: 1; }
  .about__title { font-size: var(--step-4); }
  .about__text { margin-top: 24px; font-size: var(--step-1); line-height: 1.55; color: var(--text-2); max-width: 46ch; }
  .about__facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: end; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
  .about__facts .about__num { font-family: var(--display); font-size: clamp(4rem, 9vw, 7.5rem); font-weight: 760; line-height: 0.8; letter-spacing: -0.06em; color: var(--cobalt); }
  .about__num sup { font-size: 0.45em; vertical-align: top; color: var(--cerulean); }
  .about__facts p { max-width: 24ch; font-size: var(--step-1); line-height: 1.35; }

  /* Pilares del lema: tres bloques compactos bajo el dato de años. */
  .pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 28px; padding: 0; list-style: none; }
  .pillars li {
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 16px 16px 18px;
    border-radius: var(--radius-sm);
    background: rgb(255 255 255 / 0.7);
    border-top: 3px solid var(--cerulean);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-2);
  }
  .pillars li:nth-child(2) { border-top-color: var(--cobalt); }
  .pillars li:nth-child(3) { border-top-color: var(--indigo); }
  .pillars strong { font-family: var(--display); font-size: 1rem; font-weight: 650; letter-spacing: -0.02em; color: var(--indigo); }
  @media (max-width: 560px) { .pillars { grid-template-columns: 1fr; } }

  /* Hilo que une el punto de Ecuador en el globo con el mapa. */
  .about__link { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
  .about__link path { fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 0.018 0.014; opacity: 0; }
  .ec-map__ping circle { fill: none; stroke: var(--cerulean); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
  .ec-map__ping .ec-map__dot { fill: var(--indigo); stroke: var(--white); stroke-width: 4; }
  .locator { z-index: 2; }

  /* Espacios para fotos reales. */
  .about__photos {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: clamp(12px, 1.6vw, 20px);
    margin-top: clamp(32px, 4vw, 56px);
  }
  .photo-slot {
    position: relative;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    min-height: clamp(180px, 20vw, 280px);
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--ice);
    color: var(--text-2);
  }
  .photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: scale 1.2s var(--ease-out); }
  .photo-slot:hover img { scale: 1.04; }
  .photo-slot:not(.is-empty) figcaption {
    position: absolute;
    left: 12px; bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgb(20 22 117 / 0.82);
    color: var(--white);
    font-size: 0.85rem;
  }
  .photo-slot.is-empty { border: 1.5px dashed rgb(47 105 169 / 0.4); }
  .photo-slot svg { width: 34px; height: 34px; fill: none; stroke: var(--cobalt); stroke-width: 1.6; stroke-linejoin: round; }
  .photo-slot figcaption { font-size: var(--step--1); font-weight: 600; text-align: center; padding-inline: 16px; }

  @media (max-width: 900px) {
    .about__grid { grid-template-columns: 1fr; }
    .about__visual { max-width: 480px; width: 100%; margin-inline: auto; }
    .about__photos { grid-template-columns: 1fr 1fr; }
    .photo-slot--wide { grid-column: 1 / -1; }
  }

  /* ===================== PROCESO: órbita que se dibuja ===================== */
  .process { padding: 0 0 clamp(64px, 8vw, 110px); }
  /* Tarjeta nocturna: el flujo de trabajo brilla sobre un campo de datos. */
  .process__card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(36px, 5vw, 72px) clamp(24px, 4.5vw, 64px) clamp(40px, 5vw, 72px);
    border-radius: calc(var(--radius) * 1.6);
    color: var(--text-on-dark);
    background:
      radial-gradient(60% 80% at 85% 10%, rgb(34 167 203 / 0.28), transparent 60%),
      radial-gradient(50% 70% at 5% 100%, rgb(47 105 169 / 0.35), transparent 60%),
      var(--night);
  }
  .process__field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
  .process__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; margin-bottom: clamp(40px, 5vw, 64px); }
  .process__title { font-size: var(--step-3); max-width: 18ch; color: var(--white); }
  .process__head p { max-width: 34ch; color: var(--text-on-dark-2); font-size: var(--step-1); line-height: 1.45; }
  .process__track { position: relative; }
  .flow { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .flow path { fill: none; stroke-linecap: round; }
  .flow__base { stroke: rgb(112 196 219 / 0.22); stroke-width: 2; }
  .flow__dash { stroke: rgb(112 196 219 / 0.75); stroke-width: 2; stroke-dasharray: 2 14; animation: flow-dash 1s linear infinite; }
  .flow__comet { stroke: var(--white); stroke-width: 4; filter: drop-shadow(0 0 6px var(--aqua)) drop-shadow(0 0 14px var(--cerulean)); }
  @keyframes flow-dash { to { stroke-dashoffset: -16; } }
  .steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); padding: 0; list-style: none; }
  .step {
    position: relative;
    padding: 34px 22px 24px;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-sm);
    background: rgb(16 18 90 / 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: border-color 0.5s, background-color 0.5s, translate 0.6s var(--ease-out);
  }
  .step:nth-child(1), .step:nth-child(4) { margin-top: 72px; }
  .step__dot {
    position: absolute;
    left: 22px; top: 0;
    width: 22px; height: 22px;
    translate: 0 -50%;
    border-radius: 50%;
    background: var(--night);
    border: 2px solid var(--aqua);
    transition: background-color 0.4s, box-shadow 0.4s, scale 0.4s var(--spring);
  }
  .step__num { display: block; margin-bottom: 10px; font-family: var(--display); font-size: 0.85rem; font-weight: 600; color: var(--aqua); }
  .step h3 { font-size: clamp(1.15rem, 0.6rem + 1.2vw, 1.6rem); color: var(--white); }
  .step p { margin-top: 10px; color: var(--text-on-dark-2); max-width: 30ch; }
  .step.is-lit { border-color: rgb(112 196 219 / 0.5); background: rgb(30 34 144 / 0.6); }
  .step.is-lit .step__dot { background: var(--aqua); box-shadow: 0 0 0 6px rgb(112 196 219 / 0.18), 0 0 18px var(--aqua); }
  .step.is-hit .step__dot { scale: 1.35; }
  .step.is-hit { translate: 0 -4px; }
  @media (max-width: 900px) {
    .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; }
    .step:nth-child(n) { margin-top: 0; }
  }
  @media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

  /* ===================== CONTACTO ===================== */
  .contact {
    position: relative;
    isolation: isolate;
    overflow: clip;
    padding: clamp(48px, min(9vw, 10vh), 130px) 0;
    background: var(--indigo);
    color: var(--white);
  }
  .contact__field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
  .contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
  }
  .contact__title { font-size: var(--step-5); line-height: 0.95; }
  .contact__lead { margin-top: 24px; color: #c9d3f2; font-size: var(--step-1); line-height: 1.5; max-width: 38ch; }
  .channels { display: grid; gap: 10px; margin-top: 36px; padding: 0; list-style: none; }
  .channels a {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 22px;
    border: 1.5px solid rgb(255 255 255 / 0.25);
    border-radius: var(--radius-sm);
    color: var(--white);
    text-decoration: none;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
  }
  .channels a:hover, .channels a:focus-visible { background: var(--white); color: var(--indigo); border-color: var(--white); }
  .channels small { display: block; font-size: 0.85rem; color: inherit; opacity: 0.75; }
  .channels strong { font-family: var(--display); font-weight: 560; font-size: var(--step-1); letter-spacing: -0.02em; }
  .contact :focus-visible { outline-color: var(--aqua); }

  .form {
    padding: clamp(24px, 3.4vw, 44px);
    border-radius: var(--radius);
    background: var(--ice);
    color: var(--indigo);
    box-shadow: 0 40px 90px -40px rgb(0 0 0 / 0.6);
  }
  .form h3 { font-size: var(--step-2); }
  .form__intro { margin: 8px 0 26px; color: var(--text-2); }
  .form fieldset { margin: 0 0 22px; padding: 0; border: 0; }
  .form legend, .field label { display: block; margin-bottom: 8px; font-size: var(--step--1); font-weight: 650; }
  .optional { font-weight: 450; color: var(--text-2); }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid rgb(20 22 117 / 0.25); border-radius: 999px; font-size: var(--step--1); font-weight: 600; cursor: pointer; transition: background-color 0.25s, color 0.25s, border-color 0.25s; }
  .chip span:hover { border-color: var(--indigo); }
  .chip input:checked + span { background: var(--indigo); color: var(--white); border-color: var(--indigo); }
  .chip input:focus-visible + span { outline: 3px solid var(--cerulean); outline-offset: 2px; }
  .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; }
  .field--wide { grid-column: 1 / -1; }
  .field input, .field textarea {
    width: 100%; min-height: 52px; padding: 12px 16px;
    border: 1.5px solid rgb(20 22 117 / 0.22); border-radius: 12px;
    background: var(--white); color: var(--indigo); font-size: 1rem;
    transition: border-color 0.25s, box-shadow 0.25s;
  }
  .field textarea { min-height: 128px; resize: vertical; }
  .field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px rgb(34 167 203 / 0.35); }
  .field [aria-invalid="true"] { border-color: #b3261e; }
  .field__error { min-height: 1.3em; margin-top: 6px; color: #a1170f; font-size: 0.875rem; font-weight: 600; }
  .form__submit { width: 100%; justify-content: center; margin-top: 8px; }
  .form__note { margin-top: 12px; color: var(--text-2); font-size: 0.9rem; }
  .form__status { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--indigo); color: var(--white); font-size: 0.95rem; }
  .form__status a { color: var(--white); }
  .form :focus-visible { outline-color: var(--cerulean); }
  @media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } }
  @media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
}

/* ------------------------------------------------------------------------ */
@layer motion {
  /* Todo el movimiento arranca al entrar en la página, sin interruptor. */

  /* Entrada del hero: una sola secuencia orquestada. */
  .hero__title .ln { animation: line-in 1.1s var(--ease-out) both; animation-delay: calc(0.1s + var(--i) * 0.11s); }
  .hero__lead, .hero__actions { animation: fade-in 0.9s var(--ease-out) both; animation-delay: 0.65s; }
  .swap__ribbon path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s var(--ease-out) 0.8s forwards; }
  .marquee__track { animation: marquee 48s linear infinite; }
  /* La máscara solo recorta en vertical; los lados quedan libres para no cortar letras. */
  .reveal__in { display: block; clip-path: inset(0 -50vw 100% -50vw); translate: 0 0.4em; transition: clip-path 1s var(--ease-out), translate 1s var(--ease-out); }
  .reveal.is-in .reveal__in { clip-path: inset(-0.2em -50vw -0.3em -50vw); translate: 0 0; }
  @keyframes line-in { from { opacity: 0; transform: translateY(0.6em) rotate(1.5deg); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 -20% 0); } }
  @keyframes fade-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes marquee { to { transform: translateX(-50%); } }
  @keyframes browse {
    0%, 5.5% { transform: translateY(0); animation-timing-function: cubic-bezier(0.3, 0, 0.45, 1); }
    94.5%, 100% { transform: translateY(calc(-100% + var(--screen-h, 400px))); }
  }

  /* Nosotros: al localizar Ecuador, un hilo de datos sale del globo, el mapa se dibuja,
     se llena de dígitos y el centro del país empieza a emitir ondas. */
  .ec-map__line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s var(--ease-in-out) 0.1s; }
  .ec-map__base, .ec-map__bits { opacity: 0; transition: opacity 0.7s var(--ease-out) 0.5s; }
  .ec-map { transform-origin: 48% 50%; scale: 0.92; transition: scale 1s var(--ease-out) 0.05s; }
  .about__visual.is-located .ec-map { scale: 1; }
  .about__visual.is-located .ec-map__line { stroke-dashoffset: 0; }
  .about__visual.is-located :is(.ec-map__base, .ec-map__bits) { opacity: 1; }
  .about__visual.is-located .about__link path { opacity: 1; transition: opacity 0.5s; animation: link-flow 1.4s linear infinite; }
  .about__visual.is-located .ec-map__ping circle { animation: ping 2.4s var(--ease-out) 1s infinite; }
  .about__visual.is-located .ec-map__ping circle:nth-child(2) { animation-delay: 2.2s; }
  .about__visual.is-located .ec-map__ping .ec-map__dot { opacity: 1; animation: dot-pop 0.6s var(--spring) 0.9s both; }
  .about__visual.is-located .ec-map__bits { animation: bits-drift 6s ease-in-out 2.4s infinite; }
  @keyframes link-flow { to { stroke-dashoffset: -0.064; } }
  @keyframes ping { 0% { opacity: 0.9; scale: 0.6; } 100% { opacity: 0; scale: 5; } }
  @keyframes dot-pop { from { scale: 0; } to { scale: 1; } }
  @keyframes bits-drift { 50% { opacity: 0.55; } }

  ::view-transition-old(root) { animation: 0.35s var(--ease-in-out) both vt-out; }
  ::view-transition-new(root) { animation: 0.6s var(--ease-out) both vt-in; }
  @keyframes vt-out { to { opacity: 0; scale: 0.98; } }
  @keyframes vt-in { from { clip-path: circle(0 at 50% 50%); } to { clip-path: circle(75% at 50% 50%); } }}

/* ------------------------------------------------------------------------ */
/* Dos páginas: Inicio y Servicios. Piezas propias de cada una y comunes.     */
@layer sections {
  /* Servicios como página: la cabecera ocupa el lugar del hero. */
  .services--page { padding-top: calc(var(--header-h) + clamp(48px, 7vw, 96px)); }
  .services--page .services__head { min-height: min(72svh, 640px); margin-bottom: clamp(40px, 5vw, 72px); }

  /* Inicio: puente hacia la página de Servicios. */
  .teaser { padding: clamp(48px, 6vw, 88px) 0 0; }
  /* Tarjeta nocturna con red de nodos viva: responde al cursor. */
  .teaser__card {
    position: relative;
    isolation: isolate;
    display: grid;
    gap: clamp(24px, 3vw, 36px);
    overflow: hidden;
    padding: clamp(32px, 4.5vw, 64px);
    border-radius: calc(var(--radius) * 1.6);
    color: var(--text-on-dark);
    background:
      radial-gradient(55% 80% at 90% 0%, rgb(34 167 203 / 0.28), transparent 60%),
      radial-gradient(50% 70% at 0% 100%, rgb(47 105 169 / 0.35), transparent 60%),
      var(--night);
  }
  .teaser__field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
  .teaser__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px 40px; }
  .teaser__title { font-size: var(--step-3); max-width: 16ch; color: var(--white); }
  .teaser__head .btn--solid { --fill: var(--aqua); --fill-text: var(--night); background: var(--white); border-color: var(--white); color: var(--indigo); }
  .teaser__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 0; list-style: none; }
  .teaser__list a {
    position: relative;
    display: grid;
    align-content: start;
    gap: 10px;
    height: 100%;
    min-height: 160px;
    padding: 24px 22px;
    overflow: hidden;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    background: rgb(16 18 90 / 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-decoration: none;
    transition: translate 0.5s var(--ease-out), border-color 0.3s, background-color 0.3s;
  }
  /* Franja de color del logo que se llena al pasar el cursor. */
  .teaser__list a::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--cobalt), var(--cerulean), var(--aqua));
    transform: scaleX(0.18);
    transform-origin: 0 50%;
    transition: transform 0.6s var(--ease-out);
  }
  .teaser__list a:is(:hover, :focus-visible) { translate: 0 -4px; border-color: rgb(112 196 219 / 0.55); background: rgb(30 34 144 / 0.7); }
  .teaser__list a:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
  .teaser__list a:is(:hover, :focus-visible)::before { transform: scaleX(1); }
  .teaser__list strong { font-family: var(--display); font-size: 1.1rem; font-weight: 650; letter-spacing: -0.02em; color: var(--white); }
  .teaser__list span { color: var(--text-on-dark-2); line-height: 1.45; }
  @media (max-width: 520px) { .teaser__list a { min-height: 0; } }

  /* Servicios: cierre con llamada a la acción. */
  .cta-band { padding: 0 0 clamp(64px, 8vw, 110px); }
  .cta-band__card {
    display: grid;
    justify-items: start;
    gap: 18px;
    padding: clamp(36px, 5vw, 72px);
    border-radius: calc(var(--radius) * 1.6);
    color: var(--white);
    background:
      radial-gradient(50% 90% at 90% 20%, rgb(34 167 203 / 0.45), transparent 60%),
      linear-gradient(120deg, var(--indigo), var(--indigo-2));
  }
  .cta-band__title { font-size: var(--step-4); max-width: 14ch; }
  .cta-band__card p { max-width: 44ch; color: var(--text-on-dark-2); font-size: var(--step-1); line-height: 1.5; }
  .cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

  /* WhatsApp flotante. */
  .wa {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    justify-items: end;
    gap: 12px;
  }
  .wa__btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    background: #1c9f52;
    color: var(--white);
    box-shadow: 0 12px 30px -10px rgb(8 9 58 / 0.55);
    cursor: pointer;
    transition: scale 0.4s var(--spring), background-color 0.3s;
  }
  .wa__btn:hover { scale: 1.07; background: #178a47; }
  .wa__btn:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; }
  .wa__btn svg { width: 32px; height: 32px; }
  .wa__bubble { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
  .wa__phone { fill: currentColor; }
  /* Onda que late alrededor del círculo para que se note sin molestar. */
  .wa__btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #1c9f52;
    animation: wa-pulse 2.6s var(--ease-out) infinite;
  }
  .wa.is-open .wa__btn::before { animation: none; opacity: 0; }
  @keyframes wa-pulse { 0% { opacity: 0.8; scale: 1; } 100% { opacity: 0; scale: 1.6; } }
  .wa__hint {
    position: absolute;
    right: 74px;
    bottom: 13px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--white);
    color: var(--indigo);
    font-weight: 650;
    white-space: nowrap;
    box-shadow: 0 10px 28px -12px rgb(8 9 58 / 0.45);
    opacity: 0;
    translate: 10px 0;
    pointer-events: none;
    transition: opacity 0.4s, translate 0.5s var(--ease-out);
  }
  .wa.is-hinting .wa__hint, .wa:has(.wa__btn:hover) .wa__hint { opacity: 1; translate: 0 0; }
  .wa.is-open .wa__hint { opacity: 0; }
  .wa__panel {
    position: relative;
    width: min(330px, calc(100vw - 32px));
    padding: 24px 22px 22px;
    border-radius: 22px;
    border-top: 4px solid #1c9f52;
    background: var(--white);
    box-shadow: 0 30px 60px -24px rgb(8 9 58 / 0.5);
    transform-origin: 100% 100%;
    animation: wa-pop 0.45s var(--spring);
  }
  .wa__panel[hidden] { display: none; }
  @keyframes wa-pop { from { opacity: 0; scale: 0.85; translate: 0 12px; } }
  .wa__close {
    position: absolute;
    top: 8px; right: 8px;
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
  }
  .wa__close:hover { background: var(--frost); }
  .wa__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .wa__title { padding-right: 32px; font-family: var(--display); font-size: 1.15rem; font-weight: 650; letter-spacing: -0.02em; color: var(--indigo); }
  .wa__text { margin-top: 6px; color: var(--text-2); font-size: 0.95rem; line-height: 1.45; }
  .wa__topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
  .wa__topics a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
  }
  .wa__topics a:is(:hover, :focus-visible) { border-color: #178a47; background: #178a47; color: var(--white); }
  .wa__go {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border-radius: 999px;
    background: #178a47;
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s;
  }
  .wa__go:hover { background: #12703a; }
}

/* ------------------------------------------------------------------------ */
/* Nosotros: cifras, video de presentación, socios y principios.            */
@layer sections {
  .about__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: clamp(32px, 4vw, 52px);
    padding: 0;
    list-style: none;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 24px 50px -36px rgb(20 22 117 / 0.45);
  }
  .about__stats li { display: grid; align-content: start; gap: 6px; padding: 24px 26px; }
  .about__stats li + li { border-left: 1px solid var(--line); }
  .about__stats strong {
    font-family: var(--display);
    font-size: clamp(2.3rem, 1.6rem + 2vw, 3.4rem);
    font-weight: 760;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--cobalt);
    font-variant-numeric: tabular-nums;
  }
  .about__stats .about__stat-word { font-size: clamp(1.05rem, 0.7rem + 1.6vw, 1.9rem); letter-spacing: -0.03em; padding-top: 0.35em; color: var(--indigo); }
  .about__stats span { color: var(--text-2); line-height: 1.4; }

  .about__media { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; margin-top: 16px; }
  .about__video {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: calc(var(--radius) * 1.2);
    background: var(--night);
    box-shadow: 0 30px 60px -36px rgb(8 9 58 / 0.6);
  }
  .about__video video { display: block; width: 100%; height: 100%; object-fit: cover; }
  .about__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: clamp(16px, 2.4vw, 26px);
    border: 0;
    background: linear-gradient(180deg, rgb(8 9 58 / 0) 45%, rgb(8 9 58 / 0.85));
    color: var(--white);
    text-align: left;
    cursor: pointer;
  }
  .about__play-icon {
    position: relative;
    flex: none;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--indigo);
    box-shadow: 0 16px 34px -12px rgb(8 9 58 / 0.7);
    transition: scale 0.4s var(--spring), background-color 0.3s;
  }
  .about__play-icon::before {
    content: "";
    position: absolute;
    left: 25px; top: 20px;
    border-left: 19px solid var(--white);
    border-block: 12px solid transparent;
  }
  .about__play-icon::after {
    /* Onda que invita a reproducir. */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--indigo);
    animation: core-ping 2.4s var(--ease-out) infinite;
  }
  .about__play:hover .about__play-icon, .about__play:focus-visible .about__play-icon { scale: 1.08; background: var(--cobalt); }
  .about__play:focus-visible { outline: 3px solid var(--cerulean); outline-offset: -3px; }
  .about__play-text { display: grid; gap: 2px; }
  .about__play-text strong { font-family: var(--display); font-size: 1.15rem; font-weight: 650; letter-spacing: -0.02em; }
  .about__play-text span { color: var(--text-on-dark-2); font-size: 0.92rem; }
  .about__video.is-playing .about__play { display: none; }
  @keyframes core-ping { from { opacity: 0.7; scale: 1; } to { opacity: 0; scale: 1.7; } }

  .about__side { display: grid; gap: 16px; grid-template-rows: auto 1fr; }
  .about__partner {
    padding: clamp(20px, 2.6vw, 28px);
    border-radius: calc(var(--radius) * 1.2);
    color: var(--text-on-dark-2);
    line-height: 1.5;
    background:
      radial-gradient(70% 90% at 100% 0%, rgb(34 167 203 / 0.35), transparent 60%),
      var(--indigo);
  }
  .about__partner-title { margin-bottom: 8px; font-family: var(--display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; color: var(--white); }
  .about__duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .about__duo .photo-slot { min-height: 150px; height: 100%; }

  .about__values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding: 0; list-style: none; }
  .about__values li {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 20px;
    border-radius: var(--radius-sm);
    background: rgb(255 255 255 / 0.7);
    color: var(--text-2);
    font-size: 0.93rem;
    line-height: 1.45;
    transition: translate 0.45s var(--ease-out), background-color 0.3s;
  }
  .about__values li:hover { translate: 0 -4px; background: var(--white); }
  .about__values svg { width: 30px; height: 30px; margin-bottom: 6px; fill: none; stroke: var(--cobalt); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s, rotate 0.5s var(--spring); }
  .about__values li:hover svg { stroke: var(--cerulean); rotate: -8deg; }
  .about__values strong { font-family: var(--display); font-size: 1rem; font-weight: 650; letter-spacing: -0.02em; color: var(--indigo); }

  /* Entrada por partes: cada bloque se revela cuando llega a la vista. */
  .js :is(.about__stats li, .about__video, .about__partner, .about__duo, .about__values li) { transition: opacity 0.7s var(--ease-out), translate 0.8s var(--ease-out); }
  .js :is(.about__stats:not(.is-in) li, .about__media:not(.is-in) :is(.about__video, .about__partner, .about__duo), .about__values:not(.is-in) li) { opacity: 0; translate: 0 24px; }
  .about__stats li:nth-child(2) { transition-delay: 0.08s; }
  .about__stats li:nth-child(3) { transition-delay: 0.16s; }
  .about__stats li:nth-child(4) { transition-delay: 0.24s; }
  .js .about__partner { transition-delay: 0.12s; }
  .js .about__duo { transition-delay: 0.22s; }
  .js .about__values li { transition-delay: calc(var(--i) * 0.08s); }

  @media (max-width: 900px) {
    .about__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .about__stats li:nth-child(3) { border-left: 0; }
    .about__stats li:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .about__media { grid-template-columns: minmax(0, 1fr); }
    .about__values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 520px) {
    .about__values { grid-template-columns: minmax(0, 1fr); }
    .about__stats li { padding: 18px; }
    .about__play-text span { display: none; }
    .about__play-icon { width: 54px; height: 54px; }
    .about__play-icon::before { left: 21px; top: 16px; }
  }
}
