/* ============================================================================
   INNERCORE — hoja de estilos del sitio
   ============================================================================ */

:root {
  /* Color */
  --abyss:      #111b28;   /* fondo principal */
  --hull:       #192534;   /* superficies */
  --hull-2:     #213041;
  --graphite:   #263343;   /* tarjeta oscura */
  --fog:        #e9ecef;   /* texto claro y fondo de secciones claras */
  --fog-2:      #d9dde1;   /* tarjeta clara */
  --steel:      #a1acb8;   /* texto secundario sobre oscuro */
  --steel-dark: #555d67;   /* texto secundario sobre claro */
  --ink:        #0d1117;   /* texto sobre claro */
  --signal:     #3fb6e8;   /* acento de marca: logo, foco, estados */

  --line:       rgba(233, 236, 239, 0.14);
  --line-dark:  rgba(13, 17, 23, 0.14);

  /* Tipografía */
  --f-display: 'Funnel Display', 'Helvetica Neue', Arial, sans-serif;
  --f-body:    'Funnel Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Medidas */
  --maxw:   1440px;
  --gutter: clamp(20px, 4vw, 56px);
  --nav-h:  68px;
  --radius: 6px;
  --ease:   cubic-bezier(0.16, 0.8, 0.24, 1);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 32px); }

body {
  background: var(--abyss);
  color: var(--fog);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--fog); color: var(--ink); padding: 10px 16px; border-radius: 3px;
}
.skip:focus { top: 16px; }

/* ── Botones ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 26px;
  border: 1px solid transparent; border-radius: 3px;
  font-size: 0.98rem; font-weight: 500; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn--light { background: var(--fog); color: var(--abyss); }
.btn--light:hover { background: #fff; }
.btn--ghost { border-color: rgba(233, 236, 239, 0.35); color: var(--fog); }
.btn--ghost:hover { border-color: var(--fog); background: rgba(255, 255, 255, 0.06); }
.btn--dark { background: var(--ink); color: var(--fog); }
.btn--dark:hover { background: var(--graphite); }
.btn:disabled { opacity: 0.6; cursor: default; }

/* ============================================================================
   BANNER (nav)
   ============================================================================ */
.nav { position: fixed; top: 14px; left: 14px; right: 14px; z-index: 100; }

.nav__bar {
  display: flex; align-items: center; gap: 36px;
  height: var(--nav-h);
  padding: 0 11px 0 24px;
  border-radius: 10px;
  background: rgba(34, 46, 62, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s, border-color 0.3s;
}
.nav.is-scrolled .nav__bar { background: rgba(20, 31, 45, 0.82); border-color: rgba(255, 255, 255, 0.1); }

.nav__brand { display: flex; flex-direction: column; gap: 5px; line-height: 1; }
.nav__brand { margin-right: auto; }
.nav__logo { display: block; height: var(--logo-h, 36px); width: auto; max-width: none; overflow: visible; }
.nav__name { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.16em; }
.nav__tag  { font-size: 0.58rem; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--signal); }

.nav__links { display: flex; align-items: center; gap: 10px; height: 100%; }
.nav__item  { position: relative; display: flex; align-items: center; height: 100%; }
.nav__link  {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.95rem; color: rgba(233, 236, 239, 0.78);
  transition: color 0.2s;
}
.nav__link:hover, .nav__item:focus-within > .nav__link, .nav__item:hover > .nav__link { color: var(--fog); }
/* "Proyectos" con el mismo marco que el botón "Contacto" */
.nav__link--outline {
  height: 46px; padding: 0 26px;
  border: 1px solid var(--fog); border-radius: 3px;
  color: var(--fog); font-weight: 500;
  transition: background 0.2s;
}
.nav__link--outline:hover,
.nav__item:hover > .nav__link--outline,
.nav__item:focus-within > .nav__link--outline { background: rgba(255, 255, 255, 0.08); }
.nav__caret { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 0.25s; }
.nav__item:hover .nav__caret, .nav__item:focus-within .nav__caret { transform: rotate(180deg); }

/* Desplegable de proyectos */
.nav__menu {
  position: absolute; top: calc(100% + 6px); right: -24px;
  min-width: 380px; padding: 8px;
  border-radius: 10px;
  background: rgba(20, 31, 45, 0.95);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.nav__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.nav__item:hover .nav__menu, .nav__item:focus-within .nav__menu { opacity: 1; visibility: visible; transform: none; }
.nav__menu a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 11px 14px; border-radius: 6px;
  font-size: 0.98rem; transition: background 0.15s;
}
.nav__menu a:hover { background: rgba(255, 255, 255, 0.06); }
.nav__menu span, .nav__menu small { white-space: nowrap; }
.nav__menu small { font-size: 0.82rem; color: var(--steel); }

.nav__cta { height: 46px; }

.nav__burger {
  display: none; position: relative;
  width: 46px; height: 46px;
  border: 1px solid rgba(233, 236, 239, 0.25); border-radius: 3px;
}
.nav__burger span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--fog);
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}
.nav__burger span:first-child { top: 18px; }
.nav__burger span:last-child  { top: 26px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child  { top: 22px; transform: rotate(-45deg); }

/* Menú móvil a pantalla completa */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  padding: calc(var(--nav-h) + 56px) var(--gutter) 40px;
  background: var(--abyss);
  overflow-y: auto;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.overlay.is-open { opacity: 1; visibility: visible; }
.overlay__main a {
  display: block; padding: 10px 0;
  font-family: var(--f-display); font-size: clamp(2rem, 9vw, 3rem); line-height: 1.1; letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}
.overlay__label { margin: 40px 0 8px; color: var(--steel); font-size: 0.9rem; }
.overlay__projects a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0; font-size: 1.15rem; border-bottom: 1px solid var(--line);
}
.overlay__projects small { color: var(--steel); font-size: 0.85rem; }
.overlay__cta { margin-top: 36px; width: 100%; }

/* ============================================================================
   HERO
   ============================================================================ */
.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: var(--abyss);
}
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__media canvas,
.hero__video,
.hero__image { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__media canvas { opacity: 0.7; transition: opacity 1.2s ease; }
.hero__video, .hero__image { object-fit: cover; }
.hero__image { opacity: 0.45; }
.hero__image--soft { opacity: 0.22; object-position: center top; filter: blur(5px) saturate(1.1); transform: scale(1.04); }
.hero__video { opacity: 0; transition: opacity 1.2s ease; }
.hero.has-video .hero__video { opacity: 0.4; }
.hero.has-video canvas { opacity: 0; }
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      rgba(17, 27, 40, 0.55) 0%,
      rgba(17, 27, 40, 0.05) 30%,
      rgba(17, 27, 40, 0.35) 62%,
      rgba(17, 27, 40, 0.94) 100%);
}

.hero__content {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding: calc(var(--nav-h) + 80px) var(--gutter) clamp(44px, 7vh, 88px);
}
.hero__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.9rem, 7.4vw, 7.2rem);
  line-height: 0.96; letter-spacing: -0.035em;
  max-width: 17ch;
  text-wrap: balance;
  animation: rise 1.1s var(--ease) 0.1s both;
}
.hero__foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 28px 48px;
  margin-top: clamp(28px, 4vw, 48px); padding-top: 28px;
  border-top: 1px solid var(--line);
  animation: rise 1.1s var(--ease) 0.35s both;
}
.hero__lead { max-width: 52ch; font-size: clamp(1rem, 1.25vw, 1.12rem); line-height: 1.6; color: rgba(233, 236, 239, 0.8); }
/* Texto bajo el titular del inicio: en 3 líneas, como en el texto aprobado.
   En pantallas angostas las líneas se juntan y el texto se ajusta solo. */
.hero__lead--lineas { flex: 1 1 100%; max-width: none; font-size: clamp(1.15rem, 1.75vw, 1.6rem); line-height: 1.5; color: rgba(233, 236, 239, 0.86); }
.hero__lead--lineas span { display: block; }
@media (max-width: 760px) { .hero__lead--lineas span { display: inline; } }

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* Variante para páginas de proyecto */
.hero--page { min-height: 82vh; min-height: 82svh; }
.hero--page .hero__title { font-size: clamp(3rem, 8vw, 7.4rem); max-width: none; }
.crumb {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 22px; font-size: 0.95rem; color: rgba(233, 236, 239, 0.75);
  transition: color 0.2s;
}
.crumb:hover { color: var(--fog); }
.crumb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.facts { display: flex; flex-wrap: wrap; gap: 16px 44px; }
.facts dt { font-size: 0.85rem; color: var(--steel); margin-bottom: 2px; }
.facts dd { font-size: 1.02rem; }

/* ============================================================================
   SECCIONES
   ============================================================================ */
.section { padding-block: clamp(88px, 11vw, 160px); }
.section--flush-top { padding-top: 0; }

.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end; gap: 20px 64px;
  padding-bottom: clamp(36px, 5vw, 64px);
}
.section-head--row { display: flex; justify-content: space-between; align-items: flex-end; }
.section-title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 4.2rem);
  line-height: 1; letter-spacing: -0.03em;
  text-wrap: balance;
}
.section-lead {
  justify-self: end; max-width: 36ch;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem); line-height: 1.5;
  color: rgba(233, 236, 239, 0.8);
}

/* Placeholder para imagen o video pendiente */
.ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 22px 24px;
  color: var(--steel);
  background:
    radial-gradient(80% 90% at 72% 28%, rgba(63, 182, 232, 0.09), transparent 62%),
    var(--hull);
  overflow: hidden;
}
.ph::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}
.ph__note { position: relative; font-size: 0.85rem; }
.ph__name {
  position: relative; align-self: flex-end;
  font-family: var(--f-display); font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 1; letter-spacing: -0.03em;
  color: rgba(233, 236, 239, 0.12);
}

/* ── Proyectos (inicio) ───────────────────────────────────────────────────── */
.project {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center; gap: clamp(28px, 5vw, 80px);
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.project--flip .project__media { order: 2; }

.project__media {
  position: relative; display: block;
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--hull);
}
.project__media > img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.project:hover .project__media > img { transform: scale(1.025); }
.project__media > video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.project__cat { margin-bottom: 16px; font-size: 1.05rem; color: var(--steel); }
.project__name {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.2rem, 4.4vw, 4rem); line-height: 1; letter-spacing: -0.03em;
}
.project__summary {
  margin-top: 24px; max-width: 34ch;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem); line-height: 1.55;
  color: rgba(233, 236, 239, 0.86);
}
/* Descripción en líneas fijas (PROYECTOS[...]['lineas']): en pantallas de
   computador cada línea va completa, con la letra ajustada al ancho de la
   columna. En pantallas más angostas el texto se ajusta normalmente. */
.project__summary--lineas { max-width: none; font-size: min(1.15rem, 1.27vw); }
.project__summary--lineas span { display: block; white-space: nowrap; }
@media (max-width: 1199px) {
  .project__summary--lineas { font-size: 1.1rem; max-width: 40ch; }
  .project__summary--lineas span { display: inline; white-space: normal; }
}

/* Datos clave bajo la descripción (PROYECTOS[...]['datos'] en application.py) */
.project__facts { margin-top: 30px; border-top: 1px solid var(--line); }
.project__facts > div {
  display: grid; grid-template-columns: minmax(7.5em, 0.4fr) 1fr; gap: 4px 20px;
  padding-block: 13px; border-bottom: 1px solid var(--line);
}
.project__facts dt { font-size: 0.95rem; color: var(--steel); }
.project__facts dd { font-size: 1.05rem; line-height: 1.45; }

.project--others { align-items: start; }
.project--others .project__name { color: var(--steel); }
.project--others .project__summary { margin-top: 0; max-width: 46ch; }

.link-line {
  display: inline-block; margin-top: 30px; padding-bottom: 5px;
  font-weight: 500;
  border-bottom: 1px solid rgba(233, 236, 239, 0.35);
  transition: border-color 0.2s;
}
.link-line:hover { border-color: var(--fog); }

/* ── Carrusel de imágenes ──────────────────────────────────────────────────── */
/* Cada imagen se ve completa en un marco fijo; detrás, una copia difuminada
   rellena el espacio sobrante para que todas se vean uniformes. */
.slides { position: absolute; inset: 0; overflow: hidden; background: var(--hull); outline-offset: -3px; }
.slides__item { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 0.7s ease, visibility 0.7s; }
.slides__item.is-active { opacity: 1; visibility: visible; }
.slides__bg {
  position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none;
  object-fit: cover; filter: blur(28px) brightness(0.42) saturate(1.15);
}
.slides__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
  padding: clamp(14px, 2.4vw, 28px) clamp(14px, 2.4vw, 28px) clamp(52px, 5vw, 64px);
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.55));
}
.slides__ui {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px;
  background: linear-gradient(transparent, rgba(17, 27, 40, 0.7));
}
.slides__dots { display: flex; flex-wrap: wrap; gap: 4px; }
.slides__dot {
  width: 22px; height: 20px; padding: 0;
  background: linear-gradient(rgba(233, 236, 239, 0.35), rgba(233, 236, 239, 0.35)) center / 100% 3px no-repeat;
  transition: width 0.3s var(--ease), background 0.3s;
}
.slides__dot:hover { background-image: linear-gradient(rgba(233, 236, 239, 0.7), rgba(233, 236, 239, 0.7)); }
.slides__dot.is-active { width: 34px; background-image: linear-gradient(var(--fog), var(--fog)); }
.slides__nav { display: flex; gap: 6px; }
.slides__btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 3px;
  background: rgba(20, 31, 45, 0.6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
}
.slides__btn:hover { border-color: var(--fog); background: rgba(20, 31, 45, 0.85); }
.slides__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ── Secciones claras ─────────────────────────────────────────────────────── */
.surface-light { background: var(--fog); color: var(--ink); }
.surface-light :focus-visible { outline-color: var(--ink); }

/* ── Contacto ─────────────────────────────────────────────────────────────── */
/* Sección de contacto más compacta que el resto */
#contacto.section { padding-block: clamp(56px, 6vw, 96px); }
#contacto .field textarea { height: 7.5em; }
.contact {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(48px, 7vw, 120px);
}
.contact__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.6rem, 5.4vw, 5rem); line-height: 0.98; letter-spacing: -0.035em;
  max-width: 11ch; text-wrap: balance;
}
.contact__lead { margin-top: 24px; max-width: 40ch; font-size: 1.08rem; color: var(--steel-dark); }

.form { display: grid; gap: 20px; align-content: start; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9rem; color: var(--steel-dark); }
.field input,
.field textarea {
  width: 100%; padding: 10px 0;
  background: transparent; border: 0; border-bottom: 1px solid rgba(13, 17, 23, 0.25); border-radius: 0;
  font: inherit; font-size: 1.1rem; color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.field.is-invalid input,
.field.is-invalid textarea { border-color: #b3261e; box-shadow: 0 1px 0 0 #b3261e; }
.field__error { min-height: 1.2em; font-size: 0.85rem; color: #b3261e; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Teléfono con selector de país (intl-tel-input) */
.field--phone .iti { display: block; width: 100%; }
.field--phone .iti__flag-container { padding: 0; }
.field--phone .iti__selected-flag { padding: 0 10px 0 0; background: transparent !important; }
.field--phone .iti__selected-dial-code { font-size: 1.1rem; color: var(--ink); }
.field--phone .iti__arrow { border-top-color: var(--steel-dark); }
.field--phone .iti__arrow--up { border-top: none; border-bottom-color: var(--steel-dark); }
.iti__country-list {
  max-height: 280px; border: 1px solid var(--line-dark); border-radius: 6px;
  box-shadow: 0 18px 40px rgba(13, 17, 23, 0.18);
  font-size: 0.95rem; color: var(--ink);
}
.iti__country { padding: 8px 12px; }
.iti__country.iti__highlight { background: var(--fog-2); }
.iti__dial-code { color: var(--steel-dark); }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 8px; }
.form__status { max-width: 46ch; font-size: 0.95rem; color: var(--steel-dark); }
.form__status.is-ok { color: #1d6b3a; }
.form__status.is-error { color: #b3261e; }
.form { position: relative; }

/* Colores de la sección de contacto: el fondo es igual al resto de la página y
   el formulario va dentro de una tarjeta azul. Se cambian con estas variables. */
#contacto {
  --c-bg: var(--abyss);
  --c-text: #eef2f6;
  --c-muted: #a9b8c9;
  --c-line: rgba(233, 236, 239, 0.26);
  --c-focus: #3fb6e8;
  --c-btn-bg: #eef2f6;      /* mismo botón claro que "Contacto" del banner */
  --c-btn-fg: #0d1117;
  --c-btn-hover: #ffffff;
  --c-error: #ff9b91;
  --c-ok: #7fd8a4;
  background: var(--c-bg);
  color: var(--c-text);
}
/* Tarjeta azul (se usa en el contacto y en el cierre de cada proyecto) */
#contacto .contact,
.cta-card--light {
  border-radius: 14px;
  background: linear-gradient(135deg, #1d3049 0%, #18263a 60%, #16222f 100%);
  border: 1px solid rgba(63, 182, 232, 0.22);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
#contacto .contact { padding: clamp(28px, 4vw, 60px); }
#contacto :focus-visible { outline-color: var(--c-focus); }
#contacto .contact__lead,
#contacto .field label,
#contacto .form__status { color: var(--c-muted); }
#contacto .field input,
#contacto .field textarea { color: var(--c-text); border-bottom-color: var(--c-line); }
#contacto .field input:focus,
#contacto .field textarea:focus { border-color: var(--c-focus); box-shadow: 0 1px 0 0 var(--c-focus); }
#contacto .field.is-invalid input,
#contacto .field.is-invalid textarea { border-color: var(--c-error); box-shadow: 0 1px 0 0 var(--c-error); }
#contacto .field__error,
#contacto .form__status.is-error { color: var(--c-error); }
#contacto .form__status.is-ok { color: var(--c-ok); }
#contacto .field--phone .iti__selected-dial-code { color: var(--c-text); }
#contacto .field--phone .iti__arrow { border-top-color: var(--c-muted); }
#contacto .field--phone .iti__arrow--up { border-bottom-color: var(--c-muted); }
#contacto .btn--dark { background: var(--c-btn-bg); color: var(--c-btn-fg); }
#contacto .btn--dark:hover { background: var(--c-btn-hover); }

/* ── Tarjetas de llamado a la acción ──────────────────────────────────────── */
.cta-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 36px);
  margin-top: clamp(72px, 9vw, 128px);
  padding-block: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark);
}
.cta-cards--solo { margin-top: 0; }
.cta-card {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  min-height: clamp(200px, 22vw, 290px);
  padding: clamp(22px, 2.4vw, 32px);
  border-radius: 4px;
  transition: background 0.25s;
}
.cta-card__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2rem, 3.8vw, 3.6rem); line-height: 1; letter-spacing: -0.03em;
}
.cta-card svg {
  flex: none; width: clamp(34px, 3vw, 48px); height: auto; margin-top: 6px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  transition: transform 0.25s var(--ease);
}
.cta-card:hover svg { transform: translateX(6px); }
.cta-card--light { color: var(--fog); border-radius: 14px; transition: border-color 0.25s; }
.cta-card--light:hover { border-color: rgba(63, 182, 232, 0.55); }
.cta-card--light svg { color: var(--signal); }
.cta-card--dark { background: var(--hull); color: var(--fog); border: 1px solid var(--line); border-radius: 14px; }
.cta-card--dark:hover { background: var(--hull-2); }

/* ── Página de proyecto ───────────────────────────────────────────────────── */
.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 64px; align-items: start;
}
.prose { display: grid; gap: 1.2em; max-width: 60ch; font-size: 1.12rem; line-height: 1.7; color: rgba(233, 236, 239, 0.82); }

.frame { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--hull); border: 1px solid var(--line); }
.frame--video  { aspect-ratio: 16 / 9; }
.frame--scheme { aspect-ratio: 4 / 3; }
.frame > iframe,
.frame > video,
.frame > img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame--scheme > img { object-fit: contain; background: var(--hull); }

.how {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px); align-items: center;
}
.steps { list-style: none; counter-reset: paso; }
.steps li {
  counter-increment: paso;
  display: grid; grid-template-columns: 44px 1fr; column-gap: 12px;
  padding-block: 20px; border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(paso);
  grid-row: span 2;
  font-family: var(--f-display); font-size: 1.4rem; line-height: 1.2; color: var(--signal);
}
.steps h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.25rem; line-height: 1.2; }
.steps p  { margin-top: 4px; color: var(--steel); }

/* Galería con scroll horizontal */
.gallery__ctrls { display: flex; gap: 8px; }
.gallery__ctrls button {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border: 1px solid rgba(233, 236, 239, 0.25); border-radius: 3px;
  transition: border-color 0.2s, background 0.2s;
}
.gallery__ctrls button:hover { border-color: var(--fog); background: rgba(255, 255, 255, 0.05); }
.gallery__ctrls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.gallery__track {
  --inset: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  display: flex; gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-inline: var(--inset); scroll-padding-inline: var(--inset);
  padding-bottom: 14px;
  scrollbar-width: thin; scrollbar-color: var(--hull-2) transparent;
}
.gallery__item { flex: 0 0 clamp(280px, 62vw, 760px); scroll-snap-align: start; }
.gallery__img { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--hull); }
.gallery__img img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item figcaption { margin-top: 12px; font-size: 0.95rem; color: var(--steel); }

/* Otros proyectos */
.others { list-style: none; border-top: 1px solid var(--line); }
.others li { border-bottom: 1px solid var(--line); }
.others a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding-block: 22px;
  transition: padding 0.3s var(--ease), color 0.2s;
}
.others a:hover { padding-left: 12px; }
.others__name { font-family: var(--f-display); font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.1; letter-spacing: -0.02em; }
.others__cat { color: var(--steel); }

.closing { padding-block: clamp(56px, 7vw, 96px); }
/* El cierre de cada proyecto ya no es blanco: mismo fondo que la página */
.closing.surface-light { background: var(--abyss); color: var(--fog); }
.closing .cta-cards { border-color: var(--line); }
.closing .cta-cards { margin-top: 0; }

/* ── Documentos públicos ──────────────────────────────────────────────────── */
.docs { border: 1px solid var(--line); border-radius: var(--radius); background: var(--hull); overflow: hidden; }
.docs__list { list-style: none; }
.docs__item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 18px;
  padding: 20px clamp(18px, 2.4vw, 28px);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.docs__item:last-child { border-bottom: 0; }
.docs__item:hover { background: var(--hull-2); }
.docs__icon { width: 26px; height: 26px; fill: none; stroke: var(--signal); stroke-width: 1.5; }
.docs__name { font-size: 1.05rem; overflow-wrap: anywhere; }
.docs__meta { margin-top: 2px; font-size: 0.88rem; color: var(--steel); }
.docs__actions { display: flex; gap: 8px; }
.docs__btn {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  border: 1px solid rgba(233, 236, 239, 0.25); border-radius: 3px;
  font-size: 0.92rem; font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}
.docs__btn:hover { border-color: var(--fog); }
.docs__btn--solid { background: var(--fog); color: var(--abyss); border-color: var(--fog); }
.docs__btn--solid:hover { background: #fff; }
.docs__empty { padding: 36px clamp(18px, 2.4vw, 28px); color: var(--steel); }

/* ── Galería del inicio: dos imágenes que se oscurecen al cambiar ─────────── */
.home-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 32px); }
.home-gallery__tile {
  position: relative; margin: 0; overflow: hidden;
  aspect-ratio: 4 / 3; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--hull);
}
.home-gallery__bg {
  position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none;
  object-fit: cover; filter: blur(28px) brightness(0.42) saturate(1.15);
}
.home-gallery__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: clamp(12px, 2vw, 24px);
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.55));
}
.home-gallery__shade {
  position: absolute; inset: 0; background: #000;
  opacity: 0; transition: opacity 0.9s ease;
  pointer-events: none;
}
.home-gallery__tile.is-dark .home-gallery__shade { opacity: 1; }

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer { padding-bottom: 0; border-top: 1px solid var(--line); background: var(--abyss); color: var(--steel); font-size: 0.95rem; }

/* Carrusel de clientes: entra por la derecha, sale por la izquierda */
.clients { padding-block: 44px 52px; border-bottom: 1px solid var(--line); }
.clients__label { margin-bottom: 26px; font-size: 0.9rem; }
.clients__viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.clients__track { display: flex; width: max-content; animation: clientes 40s linear infinite; }
.clients__viewport:hover .clients__track { animation-play-state: paused; }
.clients__set {
  display: flex; align-items: center; justify-content: space-around;
  min-width: 100vw; list-style: none;
}
.clients__item { flex: none; display: flex; align-items: center; height: 64px; padding-inline: clamp(28px, 4vw, 56px); }
.clients__item img {
  max-height: 56px; max-width: 180px; width: auto;
  filter: brightness(0) invert(1); opacity: 0.72;
  transition: opacity 0.2s;
}
.clients__item img:hover { opacity: 1; }
.clients__item span {
  font-family: var(--f-display); font-size: 1.2rem; letter-spacing: -0.01em;
  color: rgba(233, 236, 239, 0.62); white-space: nowrap;
}
@keyframes clientes { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.footer__legal { padding-block: 26px; font-size: 0.88rem; }

/* ── Páginas de proyecto: esquema "Cómo funciona" ────────────────────────── */
.scheme { margin: 0; }
.scheme__frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a1119;           /* mismo fondo que los esquemas SVG */
  overflow: hidden;
}
.scheme__svg { display: block; width: 100%; height: auto; max-width: none; }
.scheme__cap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; margin-top: 18px;
  color: var(--steel); font-size: 0.95rem;
}
.scheme__open { margin-top: 0; margin-left: auto; font-size: 0.95rem; }
.scheme__hint { display: none; }

/* ── Páginas de proyecto: ficha técnica ──────────────────────────────────── */
.spec { border-top: 1px solid var(--line); }
.spec > div {
  display: grid; grid-template-columns: minmax(140px, 0.36fr) 1fr; gap: 6px 32px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.spec dt { font-family: var(--f-display); font-weight: 500; font-size: 1.12rem; line-height: 1.35; }
.spec dd { max-width: 58ch; color: rgba(233, 236, 239, 0.74); font-size: 1.05rem; line-height: 1.65; }
.hero--page .facts dd { max-width: 26ch; }

/* ── Páginas de proyecto: imagen + texto (ej. Análisis histórico) ────────── */
.feature {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px); align-items: center;
}
.feature__media {
  position: relative; aspect-ratio: 16 / 10;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--hull);
}
.feature__text .section-title { margin-bottom: 28px; }
.feature__item { padding-block: 22px; border-top: 1px solid var(--line); }
.feature__item:last-child { border-bottom: 1px solid var(--line); }
.feature__item h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.3rem; line-height: 1.25; }
.feature__item p { margin-top: 8px; max-width: 52ch; color: rgba(233, 236, 239, 0.74); font-size: 1.05rem; line-height: 1.65; }

/* ── Páginas de proyecto: pantallas de la plataforma (imagen + texto alternados) */
.platform { display: grid; gap: clamp(56px, 7vw, 104px); }
.feature--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.feature--flip .feature__media { order: 2; }
.feature__media > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}
.feature__kicker { margin-bottom: 12px; font-size: 1rem; color: var(--signal); }
.feature__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.1; letter-spacing: -0.02em;
  text-wrap: balance;
}
.feature__lead { margin-top: 18px; max-width: 46ch; font-size: 1.1rem; line-height: 1.6; color: rgba(233, 236, 239, 0.82); }
.feature__list { list-style: none; margin-top: 22px; border-top: 1px solid var(--line); }
.feature__list li {
  position: relative; padding: 11px 0 11px 22px;
  border-bottom: 1px solid var(--line); color: rgba(233, 236, 239, 0.8);
}
.feature__list li::before {
  content: ""; position: absolute; left: 2px; top: 1.15em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--signal);
}

/* ── Páginas de proyecto: lista de funcionalidades ───────────────────────── */
.features {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(24px, 3vw, 48px);
}
.features li { padding-block: 24px 30px; border-top: 1px solid var(--line); }
.features h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; line-height: 1.3; }
.features p { margin-top: 8px; max-width: 40ch; color: var(--steel); font-size: 1rem; line-height: 1.6; }

/* ============================================================================
   INTRO — video del logo al entrar al inicio (INTRO_VIDEO en application.py,
   lo controla static/intro.js). Al terminar queda fijo en el último cuadro.
   ============================================================================ */
.intro {
  --intro-bg: #000;                  /* mismo color que el borde del video */
  position: relative; isolation: isolate;
  height: 100vh; height: 100svh; min-height: 420px;
  overflow: hidden;
  background: var(--intro-bg);
}
.intro__video {
  position: absolute;
  top: calc(var(--nav-h) + 22px); bottom: 40px; left: 0; right: 0;
  width: 100%; height: calc(100% - var(--nav-h) - 62px);
  object-fit: contain;
  background: var(--intro-bg);
}
/* Unión suave con la sección siguiente */
.intro::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(var(--intro-bg), var(--abyss));
  pointer-events: none;
}

/* El hero que sigue a la intro se anima cuando llega a la pantalla */
.intro.is-armed + .hero--tras-intro:not(.is-visible) .hero__title,
.intro.is-armed + .hero--tras-intro:not(.is-visible) .hero__foot { animation-play-state: paused; }
#inicio { scroll-margin-top: calc(-1 * (var(--nav-h) + 32px)); }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__burger { display: block; }

  .section-head, .split { grid-template-columns: 1fr; }
  .section-lead { justify-self: start; }

  .project, .project--flip { grid-template-columns: 1fr; }
  .project--flip .project__media { order: 0; }

  .how { grid-template-columns: 1fr; }
  .feature, .feature--flip { grid-template-columns: 1fr; }
  .feature--flip .feature__media { order: 0; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact { grid-template-columns: 1fr; }
  .cta-cards { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .scheme__frame { overflow-x: auto; overscroll-behavior-x: contain; }
  .scheme__svg { width: 860px; }
  .scheme__hint { display: block; }
  .scheme__open { margin-left: 0; }
}

@media (max-width: 600px) {
  .nav { --logo-h: 30px; }
  .spec > div { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .nav { top: 10px; left: 10px; right: 10px; }
  .nav__bar { padding-left: 18px; }
  .form__row { grid-template-columns: 1fr; }
  .home-gallery { grid-template-columns: 1fr; }
  .docs__item { grid-template-columns: auto minmax(0, 1fr); }
  .slides__nav { display: none; }
  .slides__ui { padding: 6px 12px; }
  .slides__img { padding: 10px 10px 28px; }
  .slides__dot { width: 16px; }
  .slides__dot.is-active { width: 26px; }
  .docs__actions { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .clients__track { animation: none; width: auto; }
  .clients__set { flex-wrap: wrap; min-width: 0; width: 100%; }
  .clients__set[aria-hidden="true"] { display: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}