/* Páginas de producto y banda de producto del inicio. Usa los tokens de site.css (:root): petróleo como marca, tinta,
   papel, niebla y marfil; terracota solo como el ojo del tero (el punto de "en piloto" y de las demostraciones). Clases
   con prefijo p-. */

/* Titular de cada página: petróleo oscuro, copia a la izquierda y el video del panel a la derecha. */
.p-hero,
.p-band {
  background: var(--ink);
  color: var(--ivory);
  padding: clamp(48px, 7vw, 104px) 0 clamp(56px, 8vw, 112px);
  overflow: hidden;
}
.p-band {
  background: linear-gradient(180deg, var(--ink) 0%, var(--petrol) 100%);
}
/* En las páginas, el titular arriba (título | texto) y el video a todo el ancho: la interfaz se tiene que poder leer. */
.p-hero__in {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(20px, 3vw, 40px) clamp(28px, 5vw, 72px);
  align-items: end;
}
.p-hero__top {
  display: grid;
  gap: 18px;
}
.p-hero__in > .p-video {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  margin-top: clamp(16px, 3vw, 32px);
}
.p-band__in {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.p-hero__copy,
.p-band__copy {
  display: grid;
  gap: 20px;
  align-content: start;
}
.p-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.72);
}
.p-eyebrow--dark {
  color: var(--mute);
}
.p-hero__title,
.p-band__title {
  font-size: clamp(2.5rem, 5.6vw, 4.75rem);
  font-weight: 800;
  font-stretch: 86%;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.p-hero__lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: rgba(247, 243, 234, 0.8);
  max-width: 54ch;
  text-wrap: pretty;
}

/* Estado de lo que se afirma (sale de funciones.mjs). */
.p-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.3;
  white-space: nowrap;
  background: var(--mist);
  color: var(--petrol);
  border: 1px solid var(--line);
}
.p-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f8a5b;
}
.p-badge--pilot::before {
  background: var(--eye);
}
.p-hero .p-badge,
.p-band .p-badge,
.p-dark .p-badge {
  background: rgba(247, 243, 234, 0.1);
  color: var(--ivory);
  border-color: var(--line-dark);
}

/* Video del panel en un marco de navegador. */
.p-video {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.p-video__frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1a1e;
  border: 1px solid var(--line-dark);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.p-video__bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: #0f2328;
}
.p-video__bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(247, 243, 234, 0.22);
}
.p-video video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper);
}
.p-video__toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(16, 38, 44, 0.78);
  color: var(--ivory);
  cursor: pointer;
}
.p-video__toggle svg {
  width: 20px;
  height: 20px;
}
.p-video__toggle svg:last-child,
.p-video.is-playing .p-video__toggle svg:first-child {
  display: none;
}
.p-video.is-playing .p-video__toggle svg:last-child {
  display: block;
}
.p-video__demo {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 38, 44, 0.82);
  color: var(--ivory);
  font-size: 0.78rem;
  font-weight: 600;
}
.p-video__demo::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--eye);
}
.p-video figcaption {
  font-size: 0.85rem;
  color: var(--mute);
}
.p-hero .p-video figcaption,
.p-band .p-video figcaption,
.p-dark .p-video figcaption {
  color: rgba(247, 243, 234, 0.62);
}

/* Un video casi cuadrado no ocupa todo el ancho: se leería más chico de alto que de ancho de pantalla. */
.p-hero__in > .p-video--tall {
  max-width: 860px;
}

/* Bloques comunes */
.p-dark {
  background: var(--ink);
  color: var(--ivory);
}
.p-dark .lead {
  color: rgba(247, 243, 234, 0.78);
}
.p-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.p-split--wide {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
}
.p-split .head {
  margin-bottom: 24px;
}
.p-checks {
  display: grid;
  gap: 12px;
}
.p-checks li {
  position: relative;
  padding-left: 28px;
  line-height: 1.5;
}
.p-checks li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--petrol);
  border-bottom: 2px solid var(--petrol);
  transform: rotate(-45deg);
}
.p-dark .p-checks li::before {
  border-color: var(--ivory);
}

.p-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: none;
}
.p-steps li {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
.p-steps__k {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--petrol);
  color: var(--ivory);
  font-weight: 760;
}
.p-steps h3,
.p-card h3,
.p-tpl h3,
.p-mode h3 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.p-steps p,
.p-card p,
.p-mode p {
  color: var(--mute);
}

.p-cards {
  display: grid;
  gap: 16px;
}
.p-cards--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.p-cards--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.p-card {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
.p-card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--mist);
  color: var(--petrol);
}
.section--mist .p-card__icon {
  background: var(--paper);
}
.p-card__icon svg {
  width: 22px;
  height: 22px;
}

/* Galería de plantillas */
.p-templates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.p-tpl {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: start;
  padding: 22px;
  border-radius: var(--r);
  background: #fff;
  border: 1px solid var(--line);
}
.p-tpl__tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--petrol-2);
}
.p-tpl dl {
  display: grid;
  gap: 10px;
}
.p-tpl dt {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink);
}
.p-tpl dd {
  margin: 2px 0 0;
  color: var(--mute);
  font-size: 0.95rem;
}

/* Conteo */
.p-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.p-mode {
  display: grid;
  gap: 14px;
  align-content: start;
  justify-items: start;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
.p-mode .p-checks {
  font-size: 0.95rem;
}
.p-mode__note {
  padding: 10px 12px;
  border-left: 3px solid var(--eye);
  background: var(--mist);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}

/* IA */
.p-providers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.p-providers li {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
.p-providers b {
  font-weight: 700;
}
.p-providers span {
  color: var(--mute);
  font-size: 0.95rem;
}
.p-small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--mute);
  max-width: 80ch;
}
.p-schemas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
/* Un nodo del editor dibujado con CSS: título, pregunta y sus salidas. */
.p-node {
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-left: 4px solid #7a4bb4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 38, 44, 0.08);
}
.p-node__head {
  padding: 14px 16px 4px;
}
.p-node__q {
  padding: 0 16px 12px;
  font-size: 0.9rem;
  color: var(--mute);
  font-style: italic;
}
.p-node__ports {
  display: grid;
  gap: 6px;
  padding: 12px 16px 14px;
  border-top: 1px dashed var(--line);
}
.p-node__ports li {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.p-node__ports li::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid var(--petrol);
  border-radius: 50%;
  background: #fff;
}
.p-node__ports li.is-err {
  color: var(--mute);
}

/* Código */
.p-code {
  min-width: 0;
  margin: 0;
}
.p-code pre {
  margin: 0;
  padding: 22px 24px;
  overflow-x: auto;
  border-radius: var(--r);
  background: #0b1a1e;
  border: 1px solid var(--line-dark);
  color: #e8efe9;
  font: 0.88rem/1.65 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.p-note {
  display: grid;
  gap: 18px;
  max-width: 860px;
}
.p-note p:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.p-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  color: var(--petrol);
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
}
.p-link svg {
  width: 18px;
  height: 18px;
}

/* Enlaces a las páginas de producto (inicio y pie de cada página). */
.p-band__pages {
  margin: clamp(48px, 7vw, 88px) 0 20px;
  font-size: 0.9rem;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.72);
}
.p-pages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.p-more .p-pages {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.p-pages a {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 10px 10px 14px;
  border-radius: var(--r);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s;
}
.p-band .p-pages a {
  background: rgba(247, 243, 234, 0.06);
  border-color: var(--line-dark);
}
.p-pages a:hover {
  border-color: var(--petrol);
  transform: translateY(-2px);
}
.p-band .p-pages a:hover {
  border-color: var(--ivory);
}
.p-pages img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--mist);
}
.p-pages b {
  font-weight: 700;
  padding: 0 4px;
}
.p-pages span {
  padding: 0 4px;
  font-size: 0.88rem;
  color: var(--mute);
}
.p-band .p-pages span {
  color: rgba(247, 243, 234, 0.66);
}

/* Pie: lista de páginas de producto */
.footer__producto {
  padding-top: 16px;
}

/* Inicio: automatizaciones, casi al final. Los tres pasos son capítulos del video. Petróleo arriba para que no se
   funda con la sección oscura de confianza. */
.ha {
  background: linear-gradient(180deg, var(--petrol) 0%, var(--ink) 55%);
}
.ha .p-eyebrow {
  margin-bottom: -4px;
}
.ha-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.ha-step {
  display: grid;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: left;
  border-radius: var(--r);
  border: 1px solid var(--line-dark);
  background: rgba(247, 243, 234, 0.05);
  color: var(--ivory);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.ha-step:hover,
.ha-step[aria-current='true'] {
  background: rgba(247, 243, 234, 0.1);
  border-color: rgba(247, 243, 234, 0.4);
}
.ha-step__k {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--eye);
  color: #fff;
  font-weight: 760;
}
.ha-step b {
  font-size: 1.375rem;
  font-weight: 760;
  font-stretch: 88%;
  line-height: 1.15;
}
.ha-step__d {
  color: rgba(247, 243, 234, 0.75);
  font-size: 0.97rem;
}
.ha-hint {
  margin-top: 10px;
  font-size: 0.875rem;
  color: rgba(247, 243, 234, 0.6);
}
.ha-sub {
  margin: clamp(48px, 6vw, 72px) 0 20px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 760;
  font-stretch: 88%;
  letter-spacing: -0.02em;
}
.ha-ready {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.ha-place h4 {
  margin-bottom: 10px;
  font-size: 1.0625rem;
  font-weight: 700;
}
.ha-place ul {
  display: grid;
  gap: 10px;
}
.ha-flow {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(247, 243, 234, 0.06);
  border: 1px solid var(--line-dark);
  font-size: 0.95rem;
}
.ha-flow p span {
  display: inline-block;
  min-width: 4.4em;
  margin-right: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.55);
}
.ha-flow .p-badge {
  justify-self: start;
  margin-top: 6px;
}
.ha-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  font-size: 0.92rem;
  color: rgba(247, 243, 234, 0.8);
}
.ha-status li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ha-video {
  padding-top: 8px;
}
.ha-video .ha-sub {
  margin-top: clamp(56px, 7vw, 88px);
  margin-bottom: 10px;
}
.ha-video__lead {
  color: rgba(247, 243, 234, 0.78);
  max-width: 70ch;
  margin-bottom: 24px;
}
.ha-video__wide {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gut);
}
.ha-video .actions {
  margin-top: 28px;
}
.p-video--mob {
  display: none;
}
/* Los cortes del inicio llevan sus rótulos abajo: el aviso de demostración y el botón van arriba. */
.p-video--wide .p-video__demo,
.p-video--mob .p-video__demo {
  top: 42px;
  bottom: auto;
}
.p-video--wide .p-video__toggle,
.p-video--mob .p-video__toggle {
  top: 38px;
  bottom: auto;
}
.p-video__big {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--eye);
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.p-video__big svg {
  width: 36px;
  height: 36px;
  margin-left: 4px;
  fill: currentColor;
}
.p-video__big[hidden] {
  display: none;
}

/* A tu medida: más discreta. */
.am__actions {
  margin-top: 28px;
}
.am__pages {
  margin: clamp(48px, 6vw, 72px) 0 18px;
  font-size: 1.25rem;
  font-weight: 720;
}
.am .p-pages img {
  max-height: 140px;
  object-fit: cover;
}

@media (max-width: 1060px) {
  .ha-ready {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .p-video--desk {
    display: none;
  }
  .p-video--mob {
    display: grid;
  }
  .ha-steps {
    grid-template-columns: 1fr;
  }
  .ha-step {
    grid-template-columns: 36px 1fr;
    column-gap: 12px;
    padding: 16px;
  }
  .ha-step__d {
    grid-column: 2;
  }
  .ha-video__wide .p-video--mob {
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 1060px) {
  .p-hero__in,
  .p-band__in,
  .p-split,
  .p-split--wide {
    grid-template-columns: minmax(0, 1fr);
  }
  .p-cards--3,
  .p-templates,
  .p-modes,
  .p-providers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p-schemas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p-pages,
  .p-more .p-pages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .p-steps,
  .p-cards--3,
  .p-cards--2,
  .p-templates,
  .p-modes,
  .p-providers,
  .p-schemas {
    grid-template-columns: minmax(0, 1fr);
  }
  .p-pages,
  .p-more .p-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p-video__frame {
    border-radius: 10px;
  }
  .p-video__bar {
    padding: 7px 9px;
  }
  .p-video__demo {
    left: 8px;
    bottom: 8px;
    padding: 3px 8px;
    font-size: 0.7rem;
  }
  .p-video__toggle {
    right: 8px;
    bottom: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .p-pages a {
    transition: none;
  }
  .p-pages a:hover {
    transform: none;
  }
}

/* A tu medida: lista compacta. */
.am__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
}
.am__list li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.am__list h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 4px;
  font-size: 1.125rem;
  font-weight: 700;
}
.am__list p {
  color: var(--mute);
  font-size: 0.97rem;
}
@media (max-width: 760px) {
  .am__list {
    grid-template-columns: 1fr;
  }
  .am__more {
    display: none;
  }
  /* Las de cada lugar, de costado: una tarjeta por lugar. */
  .ha-ready {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gut);
    margin: 0 calc(-1 * var(--gut));
    padding: 0 var(--gut) 8px;
    scrollbar-width: thin;
  }
  .ha-place {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
  .ha-sub {
    margin-top: 40px;
  }
  .ha-status {
    margin-top: 20px;
    gap: 8px 16px;
    font-size: 0.85rem;
  }
}
.p-video__big:not([hidden]) ~ .p-video__toggle {
  display: none;
}
