/* /agentes — la página pública del MCP de Flu.
   Documento de diseño: Docs/design/agentes-landing.md.
   Misma gramática que /flu-links: hojas de color plano a todo el ancho que se apoyan
   una sobre otra, Nunito 1000 contra texto chico, acento solo en lo que se mueve.
   Todo vive bajo .agl; los temas siguen a html[data-theme]. */

/* `body.light-mode h1-h6` de light-mode-shared.css repinta TODOS los títulos con
   la tinta del tema claro, incluidos los que están sobre una hoja oscura: el hero
   quedaba con fondo #1a0b2e y texto #111827. Igual que en /flu-links, los títulos
   y rótulos dentro de la página toman la tinta de su hoja. */
.agl.agl :is(h1, h2, h3, h4, h5, h6),
.agl.agl label,
.agl.agl .agl-step__title,
.agl.agl .agl-h2,
.agl.agl .agl-title {
  color: inherit;
}
/* Los remates de acento van después, para ganarle al `color: inherit`. */
.agl.agl .agl-title__mark,
.agl.agl .agl-mark,
.agl.agl .agl-lead strong {
  color: var(--accent);
}

/* El shell público envuelve el contenido en `.container.mt-4`: Bootstrap le pone
   margen y ancho máximo. La landing es a sangre, así que neutraliza ese margen
   desde el contenedor (solo cuando contiene la landing) sin tocar el shell. */
.container:has(> .agl) {
  max-width: none;
  margin-top: 0 !important;
  padding-left: 0;
  padding-right: 0;
}

/* El shell deja un `.container.mt-5.pt-5` vacío arriba para compensar la barra
   fija. La landing ya reserva ese alto en su hero, así que en esta página sobra.
   No sirve `:empty`: el spacer tiene un nodo de texto en blanco, así que `:empty`
   nunca matchea. Se apunta por la clase, acotado con `:has(.agl)` al sitio. */
main:has(.agl) > .container.mt-5.pt-5:not(:has(.agl)) {
  display: none;
}

.agl {
  --canvas: #f8f0e3;
  --text: #1a0b2e;
  --muted: rgba(26, 11, 46, 0.68);
  --line: rgba(26, 11, 46, 0.12);
  /* Acento del sistema, nunca un hex propio: violeta en oscuro y magenta en claro,
     con su hover. Es la misma pareja que usa el resto del sitio (--flu-action). */
  --accent: var(--flu-action, #d42a63);
  --accent-hover: var(--flu-action-hover, #bd2257);
  --accent-ink: #fff;
  /* hojas: material de la página, iguales en los dos temas */
  --peach: #ffd7a8;
  --peach-ink: #4a1d0a;
  --coral: #f77737;
  --coral-ink: #2a0d02;
  --wine: #7a1238;
  --wine-ink: #ffe3ec;
  --paper: #fffaf2;
  --paper-ink: #1a0b2e;
  --ink-sheet: #1a0b2e;
  --ink-sheet-ink: #f6f1ff;
  /* El hero cambia con el tema, igual que el cartel de /flu-links (chicle en claro,
     violeta en oscuro). En claro va sobre papel: así la barra del sitio, que en
     claro pinta sus links en magenta, sigue leyéndose. */
  --hero-bg: var(--paper);
  --hero-ink: #1a0b2e;
  --code-bg: #0f0a18;
  --code-ink: #ffe9c9;
  --btn: #6b0d36;
  --btn-ink: #ffd7e6;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sheet-r: 48px;
}

html:not([data-theme="light"]):not(.light-mode) .agl {
  --canvas: #0d0c12;
  --text: #f6f1ff;
  --muted: rgba(246, 241, 255, 0.7);
  --line: rgba(255, 255, 255, 0.14);
  /* Las hojas de color NO cambian con el tema: son el material de la página, igual
     que en /flu-links. Solo cambian el papel, el canvas y el acento. */
  --paper: #19161f;
  --paper-ink: #f6f1ff;
  --ink-sheet: #05040a;
  --ink-sheet-ink: #f6f1ff;
  --hero-bg: #05040a;
  --hero-ink: #f6f1ff;
  --code-bg: #08060f;
  --code-ink: #ffe9c9;
  --btn: #ff9dc0;
  --btn-ink: #4d0a29;
}

.agl {
  background: var(--canvas);
  color: var(--text);
  font-family: "Nunito", system-ui, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* El shell público envuelve el contenido en un .container de Bootstrap: la
     landing es a sangre, así que se escapa de él sin tocar el layout global. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* La barra del sitio es fija: el hero le deja su alto para no quedar debajo. */
.agl > .agl-hero {
  padding-top: calc(128px + var(--flu-navbar-h, 70px));
}

.agl-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------- hojas --- */

.agl-sheet {
  position: relative;
  border-radius: var(--sheet-r) var(--sheet-r) 0 0;
  margin-top: -var(--sheet-r);
  padding: 88px 0;
}
/* La primera hoja va a sangre: sin radio y sin margen negativo. No se puede usar
   :first-child porque el primer hijo del bloque es un <script> de datos. */
.agl > .agl-sheet:first-of-type,
.agl > .agl-sheet--ink:first-of-type {
  margin-top: 0;
  border-radius: 0;
}
.agl-sheet + .agl-sheet {
  /* cada hoja se apoya sobre la anterior */
  margin-top: calc(-1 * var(--sheet-r));
}

.agl-sheet--ink {
  background: var(--ink-sheet);
  color: var(--ink-sheet-ink);
}

.agl-hero {
  background: var(--hero-bg);
  color: var(--hero-ink);
  padding: 128px 0 96px;
}
/* El acento del sistema es violeta/magenta, y sobre las hojas oscuras (vino) o
   saturadas (coral) no lee. Cada hoja define su propio acento, igual que
   --wine-hi en /flu-links; el resto de la página usa el del sistema. */
.agl-cycle {
  background: var(--peach);
  color: var(--peach-ink);
}
.agl-approve {
  background: var(--wine);
  color: var(--wine-ink);
  /* violeta/magenta sobre vino queda en ~1,8:1; este rosa da 6,2:1 */
  --accent: #ff9dc0;
}
.agl-prompts {
  background: var(--paper);
  color: var(--paper-ink);
}
.agl-tools {
  background: var(--canvas);
  color: var(--text);
}
.agl-limits {
  background: var(--coral);
  color: var(--coral-ink);
  /* el magenta sobre coral queda en ~1,9:1; la tinta oscura de la hoja da 6,4:1 */
  --accent: var(--coral-ink);
}
.agl-end {
  background: var(--ink-sheet);
  color: var(--ink-sheet-ink);
  padding-bottom: 96px;
}

/* ------------------------------------------------------------- tipografía --- */

.agl-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}
.agl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.agl-title {
  margin: 0 0 24px;
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 1000;
  line-height: 0.92;
  letter-spacing: -0.045em;
}
.agl-title__mark {
  color: var(--accent);
  font-style: italic;
}

.agl-lead {
  max-width: 46ch;
  margin: 0 0 40px;
  font-size: 19px;
  line-height: 1.55;
  opacity: 0.9;
}
.agl-lead strong {
  font-weight: 800;
  color: var(--accent);
}

.agl-h2 {
  max-width: 24ch;
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 1000;
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.agl-mark {
  color: var(--accent);
  font-style: italic;
}
.agl-sub {
  max-width: 56ch;
  margin: 0 0 56px;
  font-size: 17px;
  line-height: 1.6;
  opacity: 0.82;
}

/* --------------------------------------------------------------- comando --- */

.agl-command {
  max-width: 720px;
  padding: 20px;
  /* El relleno y el filete salen de la tinta del hero: blancos translúcidos sobre
     la hoja oscura, tinta suave sobre el papel del tema claro. */
  background: color-mix(in srgb, var(--hero-ink) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--hero-ink) 16%, transparent);
  /* radio concéntrico: 20 + 14 de alto del botón = 34 */
  border-radius: 34px;
}
.agl-command__label {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
.agl-command__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.agl-command__code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 16px;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 20px;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}
.agl-command__hint {
  margin: 14px 2px 0;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.66;
}
.agl-command__hint code {
  color: var(--accent);
  font-weight: 700;
}

.agl-hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 40px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}
.agl-sep {
  opacity: 0.5;
}

/* --------------------------------------------------------------- botones --- */

.agl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 140ms var(--ease), background-color 180ms var(--ease), opacity 180ms var(--ease);
}
.agl-btn:active {
  transform: scale(0.96);
}
.agl-btn--copy {
  flex: 0 0 auto;
  background: var(--accent);
  color: var(--accent-ink);
}
.agl-btn--copy.is-done {
  background: #2f9e5f;
  color: #fff;
}
.agl-btn--ghost {
  background: transparent;
  color: inherit;
  border: 1px solid var(--line);
}
.agl-btn--solid {
  background: var(--accent);
  color: var(--accent-ink);
}
.agl-btn--line {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.agl-ico {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- ciclo --- */

.agl-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.agl-step {
  position: relative;
  padding: 24px 22px 22px;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 24px;
}
/* Solo se ocultan cuando el script puede animarlas: sin JS se ven todas.
   El :not() es necesario: sin él esta regla (3 clases) le gana a `.agl-step.is-on`
   (2 clases) y los pasos quedarían invisibles para siempre. */
.agl-steps.is-animatable .agl-step:not(.is-on) {
  opacity: 0;
  transform: translateY(16px);
}
.agl-step.is-on {
  opacity: 1;
  transform: none;
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}
.agl-step__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--peach-ink);
  color: var(--peach);
  font-size: 14px;
  font-weight: 1000;
}
.agl-step__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: -0.02em;
}
.agl-step__text {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.55;
  opacity: 0.82;
}
.agl-step__tool {
  display: inline-block;
  padding: 4px 9px;
  background: rgba(74, 29, 10, 0.12);
  border-radius: 8px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
}

.agl-cycle__back {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 66ch;
  margin: 40px 0 0;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.84;
}
.agl-cycle__back-ico {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1.2;
}

/* ----------------------------------------------------------- aprobación --- */

.agl-approve__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}
.agl-checks {
  margin: 0;
  padding: 0;
  list-style: none;
}
.agl-checks li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 14px;
  font-size: 15.5px;
  line-height: 1.55;
  opacity: 0.9;
}
.agl-checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 1000;
  color: var(--wine-ink);
  opacity: 0.75;
}
.agl-checks strong {
  font-weight: 800;
}

/* teléfono de la aprobación (decorativo, aria-hidden) */
.agl-phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 10px;
  background: var(--ink-sheet);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 42px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}
.agl-phone__notch {
  width: 76px;
  height: 5px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
.agl-phone__screen {
  padding: 18px 16px 20px;
  background: #fffaf2;
  color: #1a0b2e;
  border-radius: 32px;
}
.agl-phone__kicker {
  margin: 0 0 12px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
}
.agl-phone__card {
  padding: 12px;
  border: 1px solid rgba(26, 11, 46, 0.1);
  border-radius: 20px;
}
.agl-phone__img {
  height: 96px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd7a8, #f77737 55%, #7a1238);
}
.agl-phone__net {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
}
.agl-phone__text {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
}
.agl-phone__actions {
  display: flex;
  gap: 8px;
}
.agl-phone__btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 999px;
  border: 1px solid rgba(26, 11, 46, 0.16);
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}
.agl-phone__btn--go {
  background: #6b0d36;
  color: #ffd7e6;
  border-color: transparent;
}

/* -------------------------------------------------------------- prompts --- */

.agl-prompt-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.agl-prompt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px;
  background: var(--canvas);
  border-radius: 24px;
}
.agl-prompt__title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}
.agl-prompt__text {
  flex: 1 1 auto;
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.agl-prompt .agl-btn {
  align-self: flex-start;
}

/* --------------------------------------------------------- herramientas --- */

.agl-tool-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 40px;
}
.agl-tool-group__label {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}
.agl-tool-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.agl-tool {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.agl-tool:last-child {
  border-bottom: 0;
}
.agl-tool__name {
  flex: 0 0 auto;
  padding: 3px 8px;
  /* el fondo sale del acento del tema; el texto usa la tinta de la página, que
     sobre ese tinte suave da más contraste que el acento mismo a 12 px */
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 7px;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}
.agl-tool__title {
  flex: 1 1 auto;
  font-size: 14.5px;
  font-weight: 600;
}
.agl-tool__flag {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.45;
}
.agl-tool__flag.is-read {
  opacity: 0.35;
}

/* ---------------------------------------------------------- lo que no --- */

.agl-limits-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.agl-limit {
  position: relative;
  padding: 14px 0 14px 30px;
  border-bottom: 1px solid rgba(42, 13, 2, 0.16);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
}
.agl-limit::before {
  content: "—";
  position: absolute;
  left: 0;
  font-weight: 1000;
  opacity: 0.5;
}

/* --------------------------------------------------------------- cierre --- */

.agl-clients {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 40px 0 32px;
}
.agl-client {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
}
.agl-client__name {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
}
.agl-client__cmd {
  display: block;
  overflow-x: auto;
  color: var(--code-ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
  scrollbar-width: thin;
}
.agl-end__note {
  max-width: 62ch;
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.75;
}
.agl-end__note a {
  color: var(--accent);
  font-weight: 700;
}
.agl-end__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------------------------------------------------------- móvil --- */

@media (max-width: 900px) {
  .agl-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agl-approve__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .agl-tool-groups,
  .agl-prompt-list,
  .agl-limits-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .agl {
    --sheet-r: 30px;
  }
  .agl-wrap {
    padding: 0 14px;
  }
  /* en el teléfono cada hoja es una tarjeta separada, como el discover de /flu-links */
  .agl-sheet {
    margin-top: 12px;
    border-radius: 30px;
    padding: 56px 0;
  }
  .agl > .agl-sheet:first-of-type {
    margin-top: 0;
    border-radius: 0;
  }
  .agl-sheet + .agl-sheet {
    margin-top: 12px;
  }
  .agl-hero {
    padding: 72px 0 64px;
  }
  .agl-title {
    font-size: clamp(2.6rem, 12vw, 3.6rem);
  }
  .agl-lead {
    font-size: 17px;
  }
  .agl-steps {
    grid-template-columns: 1fr;
  }
  .agl-command {
    padding: 14px;
    border-radius: 28px;
  }
  /* el comando se apila: en 390 px no entra al lado del botón */
  .agl-command__row {
    flex-direction: column;
    align-items: stretch;
  }
  .agl-command__code {
    /* `break-all` partía "https" en "http" + "s://": con `anywhere` el navegador
       prefiere los espacios y solo parte una palabra si de verdad no entra. */
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    font-size: 12.5px;
  }
  .agl-btn--copy {
    width: 100%;
  }
  .agl-phone {
    max-width: 260px;
  }
  .agl-sub {
    margin-bottom: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agl-step {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .agl-btn {
    transition: none;
  }
}
