/* ═══════════════════════════════════════════════════════════
   Da Vinci IA — hoja de estilos
   Marca: naranja #F58634 · carbón #4B4B4D · papel #FAF6EF
   Concepto: "Del códice al código" — renacimiento × software
   ═══════════════════════════════════════════════════════════ */

:root {
  --naranja: #F58634;
  --naranja-oscuro: #D96F1F;
  --carbon: #3E3E40;
  --carbon-hondo: #2E2E30;
  --tinta: #2B2B2D;
  --papel: #FAF6EF;
  --papel-hondo: #F3EDE2;
  --blanco-calido: #FFFDF8;
  --linea: rgba(62, 62, 64, 0.16);
  --gris-medio: #6E6A63;
  --verde-wa: #22A85B;
  --font-display: "Marcellus", "Times New Roman", serif;
  --font-accent: "Cormorant Garamond", Georgia, serif;
  --font-body: "Archivo", "Helvetica Neue", sans-serif;
  --s1: 0.5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem; --s6: 7rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sombra-difusa: 0 24px 55px -30px rgba(62, 62, 64, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--papel);
  color: var(--tinta);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--naranja); color: #fff; }

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--papel-hondo); }
body::-webkit-scrollbar-thumb { background: var(--carbon); border-radius: 5px; }
body::-webkit-scrollbar-thumb:hover { background: var(--naranja); }

:focus-visible { outline: 2px solid var(--naranja); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.01em; }
h2 em, h1 em, .contact h2 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 600;
  color: var(--naranja-oscuro);
  letter-spacing: 0;
}

img { max-width: 100%; display: block; }
section { scroll-margin-top: 5rem; position: relative; }

/* ---------- Preloader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.loader__panel { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--carbon-hondo); }
.loader__panel--top { top: 0; }
.loader__panel--bottom { bottom: 0; }
.loader__iso {
  position: absolute; top: 50%; left: 50%;
  width: 74px; transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 24px rgba(245, 134, 52, 0.35));
}
/* Respaldo sin JS: el loader se desvanece solo */
@keyframes loaderFallback { to { opacity: 0; visibility: hidden; } }
.loader { animation: loaderFallback 0.6s ease 2.8s forwards; }
.loader.is-done { animation: none; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0.5s; }

/* ---------- Grano de papel global ---------- */
.grain {
  position: fixed; inset: 0;
  z-index: 90;
  pointer-events: none;
  background: url("../assets/img/paper-texture.jpg") repeat;
  background-size: 480px;
  mix-blend-mode: multiply;
  opacity: 0.14;
}

/* ---------- Barra de progreso ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; }
.progress i {
  display: block; height: 100%; width: 100%;
  background: var(--naranja);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.85rem 1.7rem;
  border: 1.5px solid var(--tinta);
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
  color: var(--tinta);
  transition: transform 0.25s var(--ease-out), background 0.25s var(--ease-out), color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--solid { background: var(--tinta); color: var(--papel); }
.btn--solid:hover { background: var(--naranja); border-color: var(--naranja); color: #fff; box-shadow: 0 8px 24px -10px rgba(217, 111, 31, 0.55); }
.btn--ghost:hover { border-color: var(--naranja); color: var(--naranja-oscuro); }
.btn--lg { padding: 1rem 2.2rem; font-size: 1rem; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0.9rem clamp(1.25rem, 5vw, 4rem);
  background: color-mix(in srgb, var(--papel) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, transform 0.45s var(--ease-out);
}
.nav.is-scrolled { border-bottom-color: var(--linea); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__brand img { height: 42px; width: auto; }
.nav__links { display: flex; gap: var(--s3); margin-left: auto; }
.nav__links a {
  color: var(--tinta);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  position: relative;
  padding: 0.25rem 0;
  white-space: nowrap;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: var(--naranja);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  align-items: center;
  gap: var(--s4);
  padding: clamp(6rem, 14vh, 9rem) clamp(1.25rem, 5vw, 4rem) var(--s5);
  max-width: 1480px;
  margin: 0 auto;
  min-height: 100dvh;
}
.hero__motto {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--naranja-oscuro);
  letter-spacing: 0.04em;
  margin-bottom: var(--s2);
}
.hero__title { font-size: clamp(2.3rem, 4.6vw, 4rem); letter-spacing: -0.015em; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; }
.hero__lead {
  margin-top: var(--s3);
  font-size: 1.12rem;
  color: var(--gris-medio);
  max-width: 32rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }

/* Video del taller de fondo */
.hero__video {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.hero__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) brightness(1.02);
}
.hero__video::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(250, 246, 239, 0.4), rgba(250, 246, 239, 0) 22%, rgba(250, 246, 239, 0) 70%, var(--papel) 98%),
    linear-gradient(100deg, var(--papel) 8%, rgba(250, 246, 239, 0.9) 34%, rgba(250, 246, 239, 0.42) 58%, rgba(250, 246, 239, 0.12) 100%);
}
.hero > *:not(.hero__video) { position: relative; z-index: 1; }

/* Composición flotante del hero */
.hero__stage { position: relative; height: min(70vh, 600px); }
.float { position: absolute; will-change: transform; }
.float--chip {
  background: var(--blanco-calido);
  border: 1px solid var(--linea);
  border-radius: 12px;
  box-shadow: var(--sombra-difusa);
  padding: 0.75rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.float--chip-a { top: 12%; right: 26%; display: grid; gap: 2px; }
.float--chip-a small, .float--chip-d small { color: var(--gris-medio); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; }
.float--chip-a strong, .float--chip-d strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; }
.chip-up { color: #1F7A46; font-size: 0.78rem; font-weight: 600; }
.float--chip-b { top: 42%; right: 4%; display: flex; align-items: center; gap: 0.5rem; }
.float--chip-c {
  bottom: 16%; right: 30%;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.05rem;
  border-radius: 999px;
  color: var(--carbon);
}
.float--chip-d { bottom: 34%; left: 6%; display: grid; gap: 2px; }
.float--chip-d strong { color: var(--naranja-oscuro); }
.dot-live {
  width: 9px; height: 9px; border-radius: 50%;
  background: #2FA35C;
  display: inline-block;
  animation: respira 2.4s ease-in-out infinite;
}
@keyframes respira {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 163, 92, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(47, 163, 92, 0); }
}

.hero__scrollhint {
  position: absolute;
  bottom: 1.6rem; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 44px;
  border: 1.5px solid var(--gris-medio);
  border-radius: 14px;
  display: flex; justify-content: center;
}
.hero__scrollhint span {
  width: 3px; height: 9px;
  background: var(--naranja);
  border-radius: 2px;
  margin-top: 7px;
  animation: rueda 1.8s ease-in-out infinite;
}
@keyframes rueda { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--linea);
  background: var(--papel-hondo);
  padding: 0.95rem 0;
  position: relative;
  z-index: 2;
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: max-content;
  animation: desfile 30s linear infinite;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--carbon);
  white-space: nowrap;
}
.marquee__track i { font-style: normal; color: var(--naranja); font-size: 0.9rem; }
@keyframes desfile { to { transform: translateX(-50%); } }

/* ---------- Problema ---------- */
.problem { padding: var(--s6) clamp(1.25rem, 5vw, 4rem); }
.problem__inner {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--s5);
  align-items: start;
}
.problem__statement { position: sticky; top: 7rem; }
.problem__statement .word { opacity: 0.18; display: inline-block; transition: opacity 0.3s ease; }
.problem__statement .word.is-lit { opacity: 1; }
.problem__list { list-style: none; }
.problem__list li {
  padding: var(--s3) 0;
  border-top: 1px solid var(--linea);
  color: var(--gris-medio);
  max-width: 36rem;
}
.problem__list li:last-child { border-bottom: 1px solid var(--linea); }
.problem__list strong { color: var(--tinta); display: block; font-size: 1.1rem; margin-bottom: 0.3rem; }

/* ---------- Del códice al código ---------- */
.codex { background: var(--papel-hondo); border-block: 1px solid var(--linea); }
.codex__pin {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: var(--s4);
  align-items: center;
  min-height: 100vh;
  max-width: 1480px;
  margin: 0 auto;
  padding: var(--s5) clamp(1.25rem, 5vw, 4rem);
}
.codex__copy h2 { font-size: clamp(2.4rem, 4.6vw, 4rem); }
.codex__caption {
  margin-top: var(--s3);
  color: var(--gris-medio);
  max-width: 24rem;
  opacity: 0.25;
  transition: opacity 0.5s ease;
}
.codex__caption.is-on { opacity: 1; }
.codex__hint { margin-top: var(--s4); font-size: 0.85rem; color: var(--gris-medio); letter-spacing: 0.05em; }
.codex__stage {
  position: relative;
  --wipe: 0%;
  box-shadow: var(--sombra-difusa);
  border: 1px solid var(--linea);
  background: var(--blanco-calido);
  overflow: hidden;
}
.codex__sketch img { width: 100%; display: block; }
.codex__ui {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--wipe)) 0 0);
  background: var(--papel);
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 3vw, 2.5rem);
}
.codex__ui .panel { width: 100%; max-width: 640px; transform: none; }
.codex__wipeline {
  position: absolute; top: 0; bottom: 0;
  left: var(--wipe);
  width: 2px;
  background: var(--naranja);
  box-shadow: 0 0 18px 2px rgba(245, 134, 52, 0.6);
  opacity: 0;
}
.codex__stage.is-wiping .codex__wipeline { opacity: 1; }
.codex__ui .bar { transform: scaleY(0); transition: transform 0.7s var(--ease-out); }
.codex__ui .bar:nth-child(2) { transition-delay: 0.06s; }
.codex__ui .bar:nth-child(3) { transition-delay: 0.12s; }
.codex__ui .bar:nth-child(4) { transition-delay: 0.18s; }
.codex__ui .bar:nth-child(5) { transition-delay: 0.24s; }
.codex__ui .bar:nth-child(6) { transition-delay: 0.3s; }
.codex__ui .bar:nth-child(7) { transition-delay: 0.36s; }
.codex__stage.is-built .bar { transform: scaleY(1); }

/* Panel de Da Vinci Central (mockup) */
.panel {
  background: var(--blanco-calido);
  border: 1px solid var(--linea);
  border-radius: 10px;
  box-shadow: var(--sombra-difusa);
  overflow: hidden;
}
.panel__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--linea);
  background: var(--papel-hondo);
}
.panel__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--linea); }
.panel__bar i:first-child { background: var(--naranja); }
.panel__bar span { margin-left: 0.6rem; font-family: var(--font-display); font-size: 0.9rem; color: var(--carbon); }
.panel__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--linea);
  border-bottom: 1px solid var(--linea);
}
.stat { background: var(--blanco-calido); padding: 1rem; }
.stat small { color: var(--gris-medio); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat__num { display: block; font-family: var(--font-display); font-size: clamp(1.1rem, 1.8vw, 1.5rem); color: var(--tinta); font-variant-numeric: tabular-nums; }
.panel__chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 1.2rem 1.2rem 0.6rem; }
.bar {
  flex: 1;
  height: var(--h);
  background: var(--carbon);
  border-radius: 3px 3px 0 0;
  opacity: 0.35;
  transform-origin: bottom;
}
.bar--hoy { background: var(--naranja); opacity: 1; }
.panel__ask {
  margin: 0.8rem 1.2rem 1.2rem;
  border: 1.5px solid var(--linea);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  color: var(--gris-medio);
  background: var(--papel);
}
.panel__cursor::after { content: "|"; color: var(--naranja); animation: parpadeo 1.1s steps(1) infinite; }
@keyframes parpadeo { 50% { opacity: 0; } }

/* ---------- Historia ---------- */
.story { background: var(--carbon-hondo); color: var(--papel); overflow: hidden; }
.story__bg {
  position: absolute; inset: -18% 0;
  background: url("../assets/img/sketch-studies.jpg") center / cover no-repeat;
  opacity: 0.1;
  filter: grayscale(0.4) contrast(1.05);
  will-change: transform;
}
.story__inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--s6) clamp(1.25rem, 5vw, 3rem);
}
.story h2 { color: var(--papel); }
.story__text { margin-top: var(--s4); }
.story__text p { margin-bottom: var(--s3); color: rgba(250, 246, 239, 0.75); font-size: 1.08rem; max-width: 42rem; }
.story__text strong { color: var(--papel); }
.story__quote { margin: var(--s5) 0; }
.story__quote p {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.2;
  color: var(--papel);
}
.story__quote .word { display: inline-block; }
.story__quote cite { display: block; margin-top: var(--s2); font-style: normal; color: var(--naranja); font-size: 0.95rem; }
.story__closing { font-family: var(--font-display); font-size: 1.3rem; color: var(--papel); max-width: 38rem; }
.story__closing em { font-family: var(--font-accent); font-style: italic; color: var(--naranja); }

/* ---------- Da Vinci Central · Bento ---------- */
.central { padding: var(--s6) clamp(1.25rem, 5vw, 4rem); max-width: 1480px; margin: 0 auto; }
.central__head { max-width: 46rem; }
.central__tag {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--naranja-oscuro);
  margin: var(--s2) 0;
}
.central__head > p:not(.central__tag) { color: var(--gris-medio); }

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s3);
  margin-top: var(--s5);
}
.tile {
  position: relative;
  background: var(--blanco-calido);
  border: 1px solid var(--linea);
  border-radius: 22px;
  box-shadow: 0 18px 40px -26px rgba(62, 62, 64, 0.28);
  padding: clamp(1.4rem, 2.4vw, 2.2rem);
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgba(62, 62, 64, 0.4); }
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(245, 134, 52, 0.09), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.tile:hover::after { opacity: 1; }
.tile h3 { font-size: 1.25rem; margin-top: var(--s3); }
.tile__label { color: var(--gris-medio); font-size: 0.92rem; margin-top: 0.4rem; max-width: 34rem; }

.tile--ask { grid-column: span 7; }
.tile--live { grid-column: span 5; }
.tile--sort { grid-column: span 5; }
.tile--stream { grid-column: span 7; }
.tile--alert { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s3); align-items: center; }
.tile--alert h3 { margin-top: 0; }

.tile__ask-box {
  display: flex; align-items: center; gap: 0.7rem;
  border: 1.5px solid var(--linea);
  border-radius: 10px;
  background: var(--papel);
  padding: 0.85rem 1.1rem;
  font-size: 0.98rem;
  min-height: 3.2rem;
}
.tile__ask-icon { width: 19px; height: 19px; color: var(--naranja); flex-shrink: 0; }
.type-target { color: var(--tinta); }
.type-target::after { content: "|"; color: var(--naranja); animation: parpadeo 1.1s steps(1) infinite; }
.tile__answer {
  display: flex; align-items: center; gap: 0.7rem;
  margin-top: 0.9rem;
  min-height: 2.4rem;
  font-size: 0.95rem;
  color: var(--gris-medio);
}
.tile__answer strong { color: var(--naranja-oscuro); }
.tile__answer .answer-target { opacity: 0; transform: translateY(6px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
.tile__answer.is-answered .answer-target { opacity: 1; transform: none; }
.dot-think { display: inline-flex; gap: 4px; }
.dot-think i { width: 5px; height: 5px; border-radius: 50%; background: var(--gris-medio); animation: puntito 1s ease-in-out infinite; }
.dot-think i:nth-child(2) { animation-delay: 0.15s; }
.dot-think i:nth-child(3) { animation-delay: 0.3s; }
.tile__answer.is-answered .dot-think { display: none; }
@keyframes puntito { 40% { transform: translateY(-4px); } }

.tile__live-head { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.85rem; color: #1F7A46; }
.tile__metrics { list-style: none; margin-top: var(--s2); }
.tile__metrics li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.55rem 0;
  border-top: 1px dashed var(--linea);
}
.tile__metrics small { color: var(--gris-medio); }
.tile__metrics data { font-family: var(--font-display); font-size: 1.2rem; font-variant-numeric: tabular-nums; }

.sortlist { list-style: none; position: relative; }
.sortlist li {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.2rem;
  border-top: 1px dashed var(--linea);
  font-size: 0.9rem;
  background: var(--blanco-calido);
  transition: transform 0.6s var(--ease-out);
}
.sortlist li small { margin-left: auto; color: var(--gris-medio); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pri { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pri--alta { background: var(--naranja); }
.pri--media { background: #C9A227; }
.pri--baja { background: #9B958B; }

.stream { overflow: hidden; border: 1.5px solid var(--linea); border-radius: 10px; background: var(--papel); padding: 0.7rem 0; }
.stream__track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: desfile 22s linear infinite;
  font-size: 0.88rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stream__track span { display: inline-flex; align-items: center; gap: 0.4rem; }

.alertdemo { position: relative; min-height: 96px; display: grid; place-items: center; }
.alertdemo__badge {
  background: var(--carbon);
  color: var(--papel);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 18px 36px -18px rgba(46, 46, 48, 0.6);
  border-left: 3px solid var(--naranja);
  transform: scale(0.6) translateY(14px);
  opacity: 0;
}
.alertdemo__badge small { display: block; color: rgba(250, 246, 239, 0.7); font-weight: 400; margin-top: 2px; }
.alertdemo__badge.is-pop { animation: pop 4.2s var(--ease-out) both; }
@keyframes pop {
  0% { transform: scale(0.6) translateY(14px); opacity: 0; }
  10% { transform: scale(1.05) translateY(0); opacity: 1; }
  14% { transform: scale(1); }
  82% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.92) translateY(-8px); opacity: 0; }
}

/* ---------- Demos ---------- */
.demos {
  background: var(--papel-hondo);
  border-block: 1px solid var(--linea);
  padding: var(--s6) clamp(1.25rem, 5vw, 4rem);
}
.demos__head { max-width: 1480px; margin: 0 auto; }
.demos__head p { color: var(--gris-medio); margin-top: var(--s2); }
.demos__tabs {
  max-width: 1480px;
  margin: var(--s4) auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  border-bottom: 1px solid var(--linea);
}
.demos__tab {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gris-medio);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.demos__tab:hover { color: var(--tinta); }
.demos__tab.is-active { color: var(--naranja-oscuro); border-bottom-color: var(--naranja); }

.demo { max-width: 1480px; margin: var(--s4) auto 0; }
.demo__note { margin-top: var(--s3); color: var(--gris-medio); font-size: 0.95rem; max-width: 46rem; }
.demo__stage { position: relative; }
.demo__replay { margin-top: var(--s3); font-size: 0.85rem; padding: 0.6rem 1.2rem; }

.chatdemo {
  background: var(--blanco-calido);
  border: 1px solid var(--linea);
  border-radius: 14px;
  box-shadow: var(--sombra-difusa);
  padding: var(--s3);
  max-width: 760px;
}
.chatdemo__log { min-height: 260px; display: flex; flex-direction: column; gap: var(--s2); }
.msg {
  max-width: 85%;
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  animation: sube 0.4s var(--ease-out) both;
}
@keyframes sube { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.msg--user { align-self: flex-end; background: var(--carbon); color: var(--papel); border-bottom-right-radius: 3px; }
.msg--ia { align-self: flex-start; background: var(--papel-hondo); border: 1px solid var(--linea); border-bottom-left-radius: 3px; }
.msg--ia strong { color: var(--naranja-oscuro); }
.msg--typing { display: inline-flex; gap: 5px; align-items: center; }
.msg--typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gris-medio); animation: puntito 1s ease-in-out infinite; }
.msg--typing i:nth-child(2) { animation-delay: 0.15s; }
.msg--typing i:nth-child(3) { animation-delay: 0.3s; }
.msg__bars { display: flex; align-items: flex-end; gap: 5px; height: 52px; margin-top: 0.6rem; }
.msg__bars i { flex: 1; min-width: 14px; height: var(--h); background: var(--naranja); opacity: 0.75; border-radius: 2px 2px 0 0; transform-origin: bottom; animation: crece 0.7s var(--ease-out) both; }
@keyframes crece { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.msg__list { list-style: none; margin-top: 0.5rem; font-variant-numeric: tabular-nums; }
.msg__list li { display: flex; justify-content: space-between; gap: var(--s3); padding: 0.35rem 0; border-top: 1px dashed var(--linea); }
.msg__alert { color: var(--naranja-oscuro); font-weight: 600; }
.chatdemo__chips { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); border-top: 1px solid var(--linea); padding-top: var(--s3); }
.chip {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--tinta);
  background: var(--papel);
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.chip:hover { border-color: var(--naranja); color: var(--naranja-oscuro); }
.chip:active { transform: scale(0.97); }
.chip[disabled] { opacity: 0.45; cursor: default; }

.phonedemo { display: flex; flex-direction: column; align-items: flex-start; }
.phone {
  width: min(100%, 390px);
  background: #EDE6DA;
  border: 1px solid var(--linea);
  border-radius: 22px;
  box-shadow: var(--sombra-difusa);
  overflow: hidden;
}
.phone__head {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--carbon);
  color: var(--papel);
  padding: 0.8rem 1rem;
}
.phone__head small { display: block; color: #A8E6C3; font-size: 0.72rem; }
.phone__dot { width: 34px; height: 34px; border-radius: 50%; background: var(--naranja); flex-shrink: 0; }
.phone__log { min-height: 320px; padding: var(--s2); display: flex; flex-direction: column; gap: 0.6rem; }
.burbuja {
  max-width: 82%;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  animation: sube 0.35s var(--ease-out) both;
}
.burbuja--cliente { align-self: flex-start; background: #FFFFFF; border-bottom-left-radius: 3px; }
.burbuja--agente { align-self: flex-end; background: #D9F2E3; border-bottom-right-radius: 3px; }
.burbuja--agente strong { color: #14713C; }
.burbuja time { display: block; text-align: right; font-size: 0.65rem; color: var(--gris-medio); margin-top: 2px; }

.flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s3);
  max-width: 1100px;
}
.flow__step {
  position: relative;
  background: var(--blanco-calido);
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: var(--s3);
  opacity: 0.3;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.flow__step.is-on {
  opacity: 1;
  transform: none;
  border-color: var(--naranja);
  box-shadow: 0 16px 36px -22px rgba(217, 111, 31, 0.55);
}
.flow__step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -1.35rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gris-medio);
  font-size: 1.2rem;
}
.flow__icon { width: 30px; height: 30px; color: var(--naranja); margin-bottom: var(--s1); }
.flow__step h3 { font-size: 1.1rem; }
.flow__detail { margin-top: 0.5rem; font-size: 0.82rem; color: var(--gris-medio); font-variant-numeric: tabular-nums; }

/* ---------- Módulos · scroll horizontal ---------- */
.mods { background: var(--papel); }
.mods__pin { overflow: hidden; }
.mods__track {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: var(--s5) clamp(1.25rem, 5vw, 4rem);
  width: max-content;
  min-height: 100vh;
}
.mod {
  width: min(78vw, 430px);
  flex-shrink: 0;
  background: var(--blanco-calido);
  border: 1px solid var(--linea);
  border-radius: 22px;
  padding: clamp(1.6rem, 3vw, 2.6rem);
  box-shadow: 0 18px 40px -26px rgba(62, 62, 64, 0.28);
}
.mod--intro { background: transparent; border: none; box-shadow: none; width: min(84vw, 480px); }
.mod--intro p { color: var(--gris-medio); margin-top: var(--s3); }
.mods__hint { font-size: 0.85rem; letter-spacing: 0.05em; color: var(--naranja-oscuro) !important; }
.mod__icon { width: 40px; height: 40px; color: var(--naranja); }
.mod h3 { font-size: 1.5rem; margin-top: var(--s3); }
.mod p { color: var(--gris-medio); margin-top: var(--s2); }

/* ---------- Método ---------- */
.method { background: var(--carbon-hondo); color: var(--papel); padding: var(--s6) clamp(1.25rem, 5vw, 4rem); }
.method__head { max-width: 1480px; margin: 0 auto; }
.method h2 { color: var(--papel); }
.method__head p { margin-top: var(--s2); color: rgba(250, 246, 239, 0.72); max-width: 36rem; }
.method__head strong { color: var(--naranja); }
.method__body {
  max-width: 900px;
  margin: var(--s5) auto 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--s4);
}
.method__rail { position: relative; }
.method__rail svg { position: absolute; inset: 0; width: 8px; height: 100%; left: 50%; transform: translateX(-50%); overflow: visible; }
.rail-path {
  stroke: var(--naranja);
  stroke-width: 2.5;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  vector-effect: non-scaling-stroke;
}
.method__rail::before {
  content: "";
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: rgba(250, 246, 239, 0.18);
}
.method__steps { list-style: none; display: grid; gap: var(--s5); padding-block: var(--s2); }
.mstep { position: relative; opacity: 0.28; transform: translateY(16px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.mstep.is-active { opacity: 1; transform: none; }
.mstep__n {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 2.6rem;
  color: var(--naranja);
  line-height: 1;
  display: block;
  margin-bottom: 0.4rem;
}
.mstep h3 { font-size: 1.5rem; color: var(--papel); }
.mstep p { margin-top: 0.6rem; color: rgba(250, 246, 239, 0.72); max-width: 34rem; }

/* ---------- FAQ ---------- */
.faq { padding: var(--s6) clamp(1.25rem, 5vw, 4rem); }
.faq__inner { max-width: 820px; margin: 0 auto; }
.faq__list { margin-top: var(--s4); }
.faq details { border-top: 1px solid var(--linea); }
.faq details:last-child { border-bottom: 1px solid var(--linea); }
.faq summary {
  font-family: var(--font-display);
  font-size: 1.15rem;
  padding: var(--s3) 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  transition: color 0.25s var(--ease-out);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--naranja); font-size: 1.5rem; line-height: 1; transition: transform 0.3s var(--ease-out); }
.faq details[open] summary { color: var(--naranja-oscuro); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 var(--s3); color: var(--gris-medio); max-width: 44rem; }

/* ---------- Contacto ---------- */
.contact { background: var(--papel-hondo); border-top: 1px solid var(--linea); }
.contact__intro, .contact__form {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 5vw, 2rem);
}
.contact__intro { padding-top: var(--s6); }
.contact__intro h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.contact__intro p { margin-top: var(--s3); color: var(--gris-medio); max-width: 34rem; }
.contact__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  padding-block: var(--s4) var(--s6);
}
.field { display: grid; gap: 0.5rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea {
  font: inherit;
  color: var(--tinta);
  background: var(--papel);
  border: 1.5px solid var(--linea);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: #9B958B; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--naranja);
  box-shadow: 0 0 0 3px rgba(245, 134, 52, 0.18);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: #C0392B; }
.form__error { grid-column: 1 / -1; color: #C0392B; font-size: 0.9rem; }
.contact__form .btn { justify-self: start; grid-column: 1 / -1; }

/* ---------- Footer ---------- */
.footer { background: var(--tinta); color: rgba(250, 246, 239, 0.65); overflow: hidden; }
.footer__marquee { border-bottom: 1px solid rgba(250, 246, 239, 0.12); padding: 1.4rem 0; overflow: hidden; }
.footer__marquee-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  animation: desfile 26s linear infinite;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(250, 246, 239, 0.4);
}
.footer__marquee-track i { font-style: normal; color: var(--naranja); -webkit-text-stroke: 0; font-size: 1.6rem; }
.footer__body { text-align: center; padding: var(--s5) clamp(1.25rem, 5vw, 4rem) var(--s4); }
.footer__logo { height: 50px; width: auto; margin: 0 auto var(--s3); }
.footer__note { font-family: var(--font-accent); font-style: italic; font-size: 1.2rem; color: var(--papel); margin-bottom: var(--s3); }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); margin-bottom: var(--s3); }
.footer__nav a { color: rgba(250, 246, 239, 0.75); text-decoration: none; font-size: 0.9rem; }
.footer__nav a:hover { color: var(--naranja); }
.footer small { font-size: 0.8rem; }
.footer small a { color: inherit; }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 75;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  background: var(--verde-wa);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 12px 28px -10px rgba(34, 168, 91, 0.6);
  transition: transform 0.25s var(--ease-out);
}
.wa-float svg { width: 30px; height: 30px; }
.wa-float:hover { transform: translateY(-3px) scale(1.05); }
.wa-float[hidden] { display: none; }

/* ---------- Reveals genéricos ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
.central__more { color: var(--naranja-oscuro); font-weight: 600; text-decoration: none; white-space: nowrap; }
.central__more:hover { text-decoration: underline; }
.mod--intro a { color: var(--naranja-oscuro); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .loader { display: none; }
  .hero__video video { display: none; }
  .hero__video { background: url("../assets/img/hero-poster.jpg") center / cover no-repeat; }
  .reveal, .mstep, .flow__step { opacity: 1 !important; transform: none !important; }
  .problem__statement .word { opacity: 1; }
  .codex__ui { clip-path: none; }
  .codex__sketch { display: none; }
  .hero__title .line > span { transform: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav__links { gap: var(--s2); }
  .tile--ask, .tile--live, .tile--sort, .tile--stream { grid-column: span 6; }
  .tile--alert { grid-column: span 12; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 92dvh; padding-top: 7rem; }
  .hero__stage { height: 240px; max-width: 480px; margin: 0 auto; width: 100%; }
  .float--chip-a { top: 8%; right: 8%; }
  .float--chip-b { top: auto; bottom: 8%; right: 2%; }
  .float--chip-c { bottom: 4%; left: 0; right: auto; }
  .float--chip-d { display: none; }
  .hero__scrollhint { display: none; }
  .problem__inner { grid-template-columns: 1fr; gap: var(--s4); }
  .problem__statement { position: static; }
  .codex__pin { grid-template-columns: 1fr; min-height: auto; gap: var(--s3); align-items: start; }
  .codex__hint { display: none; }
  .tile--ask, .tile--live, .tile--sort, .tile--stream, .tile--alert { grid-column: span 12; }
  .tile--alert { grid-template-columns: 1fr; }
  .method__body { grid-template-columns: 20px minmax(0, 1fr); gap: var(--s3); }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow__step:nth-child(2)::after { content: none; }
  /* Módulos: sin pin, apilados */
  .mods__track { width: auto; flex-direction: column; align-items: stretch; min-height: auto; }
  .mod, .mod--intro { width: 100%; }
}

@media (max-width: 720px) {
  .nav { gap: var(--s2); }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--papel);
    border-bottom: 1px solid var(--linea);
    padding: var(--s2) clamp(1.25rem, 5vw, 4rem) var(--s3);
  }
  .nav__links a { padding: 0.7rem 0; }
  .nav.is-open .nav__links { display: flex; }
  .nav__cta { margin-left: auto; padding: 0.65rem 1rem; font-size: 0.82rem; }
  .nav__toggle {
    display: grid;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
  }
  .nav__toggle span { width: 22px; height: 2px; background: var(--tinta); transition: transform 0.3s var(--ease-out); }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .contact__form { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow__step::after { content: none !important; }
  .hero__stage { height: 330px; }
}

/* ═══════════════════════════════════════════════════════════
   FUSIÓN CÓDICE × CÓDIGO (v3)
   El pergamino de Leonardo se encuentra con el lenguaje de
   los agentes: mono para datos, blueprint oscuro, glow naranja.
   ═══════════════════════════════════════════════════════════ */

:root {
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
  --tinta-tech: #232326;
  --glow: 0 0 16px rgba(245, 134, 52, 0.4);
}

/* Divisor trazo → circuito */
.fusion {
  display: block;
  width: 100%;
  max-width: 1480px;
  height: 60px;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 5vw, 4rem);
  color: var(--carbon);
  opacity: 0.5;
}
.fusion--claro { color: var(--papel); opacity: 0.35; }

/* Marquee híbrido: serif renacentista ↔ mono técnico */
.marquee__track .tech {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--naranja-oscuro);
}

/* Panel de Da Vinci Central: tableta oscura con glow (el "código") */
.panel { background: var(--tinta-tech); border-color: rgba(245, 134, 52, 0.3); }
.panel__bar { background: #2A2A2D; border-bottom-color: rgba(245, 134, 52, 0.18); }
.panel__bar i { background: rgba(250, 246, 239, 0.18); }
.panel__bar i:first-child { background: var(--naranja); box-shadow: var(--glow); }
.panel__bar span { color: rgba(250, 246, 239, 0.85); }
.panel__stats { background: rgba(245, 134, 52, 0.16); border-bottom-color: rgba(245, 134, 52, 0.18); }
.stat { background: var(--tinta-tech); }
.stat small { color: rgba(250, 246, 239, 0.45); font-family: var(--font-mono); letter-spacing: 0.1em; }
.stat__num { color: var(--naranja); font-family: var(--font-mono); text-shadow: var(--glow); }
.panel__chart {
  background-image: repeating-linear-gradient(to top, rgba(245, 134, 52, 0.07) 0 1px, transparent 1px 24px);
}
.bar { background: rgba(250, 246, 239, 0.22); opacity: 1; }
.bar--hoy { background: var(--naranja); box-shadow: var(--glow); }
.panel__ask {
  background: #1B1B1D;
  border-color: rgba(245, 134, 52, 0.28);
  color: rgba(250, 246, 239, 0.75);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Tile "En vivo" del bento: la pieza tech entre pergaminos */
.tile--live {
  background: var(--tinta-tech);
  border-color: rgba(245, 134, 52, 0.32);
  background-image:
    linear-gradient(rgba(245, 134, 52, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 134, 52, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
}
.tile--live h3 { color: var(--papel); }
.tile--live .tile__label { color: rgba(250, 246, 239, 0.6); }
.tile--live .tile__live-head { color: #7BD8A2; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.tile--live .tile__metrics li { border-top-color: rgba(250, 246, 239, 0.14); }
.tile--live .tile__metrics small { color: rgba(250, 246, 239, 0.55); }
.tile--live .tile__metrics data { color: var(--naranja); font-family: var(--font-mono); text-shadow: var(--glow); }

/* Datos siempre en mono: el idioma de la máquina */
.tile__metrics data, .stream__track, .msg__list, .flow__detail { font-family: var(--font-mono); }
.stream__track { font-size: 0.78rem; }
.msg__list { font-size: 0.85rem; }
.float--chip-a strong, .float--chip-d strong { font-family: var(--font-mono); font-size: 1.15rem; }

/* Secciones oscuras con retícula blueprint */
.method, .pcta {
  background-image:
    linear-gradient(rgba(245, 134, 52, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 134, 52, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
}
.mstep__n { font-family: var(--font-mono); font-style: normal; font-size: 1rem; letter-spacing: 0.14em; }
.mstep__n::before { content: "["; color: rgba(250, 246, 239, 0.4); }
.mstep__n::after { content: "]"; color: rgba(250, 246, 239, 0.4); }

/* Etiquetas técnicas (páginas interiores) */
.ttag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--naranja-oscuro);
  border: 1px solid rgba(217, 111, 31, 0.4);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  margin: 0 0.4rem 0.4rem 0;
  background: rgba(245, 134, 52, 0.06);
}

/* Teaser de la sala de demos (landing) */
.demos__teaser {
  max-width: 1480px;
  margin: var(--s4) auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s2);
}
.tcard {
  display: grid;
  gap: 0.3rem;
  background: var(--blanco-calido);
  border: 1px solid var(--linea);
  border-radius: 16px;
  padding: var(--s3);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.tcard:hover { transform: translateY(-4px); border-color: var(--naranja); box-shadow: 0 22px 44px -26px rgba(217, 111, 31, 0.45); }
.tcard__icon { font-size: 1.6rem; }
.tcard strong { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; }
.tcard small { color: var(--gris-medio); }
.demos__go { max-width: 1480px; margin: var(--s4) auto 0; }
