/* Colores tomados de la aplicación: tema Oscuro y tema Azul bruma */
:root,
[data-theme="dark"] {
  --bg: #101319;
  --bg-alt: #161a22;
  --surface: #1b2029;
  --border: #2a303b;
  --text: #e6ebf1;
  --muted: #95a0ae;
  --accent: #409eee;
  --accent-strong: #2f8ce0;
  --accent-soft: rgba(64, 158, 238, 0.14);
  --header-bg: rgba(16, 19, 25, 0.85);
  --hero-glow: radial-gradient(ellipse at top, rgba(64, 158, 238, 0.25), transparent 65%),
    linear-gradient(90deg, rgba(15, 37, 64, 0.35), rgba(38, 140, 150, 0.25));
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --alert: #e5534b;
  --alert-soft: rgba(229, 83, 75, 0.12);
  --ok: #3fb950;
}

[data-theme="mist"] {
  --bg: #eef3f8;
  --bg-alt: #e2eaf2;
  --surface: #f7fafc;
  --border: #cfdbe6;
  --text: #1c2a38;
  --muted: #5b6b7b;
  --accent: #2f7fb5;
  --accent-strong: #256b9a;
  --accent-soft: rgba(47, 127, 181, 0.12);
  --header-bg: rgba(238, 243, 248, 0.85);
  --hero-glow: radial-gradient(ellipse at top, rgba(47, 127, 181, 0.22), transparent 65%),
    linear-gradient(90deg, rgba(47, 127, 181, 0.12), rgba(63, 193, 201, 0.14));
  --shadow: 0 20px 50px rgba(28, 42, 56, 0.18);
  --alert: #c93c35;
  --alert-soft: rgba(201, 60, 53, 0.1);
  --ok: #2a8a3c;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  /* Safari en iOS no agranda el texto al girar el teléfono */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--accent);
}

code,
kbd,
pre {
  font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, monospace;
}

code {
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

kbd {
  display: inline-block;
  font-size: 0.8em;
  padding: 0.1em 0.45em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
}

.container {
  width: 90%;
  max-width: 1120px;
  margin: 0 auto;
}

/* Encabezado */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}

.logo img {
  border-radius: 8px;
}

.header nav {
  margin-left: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links .nav-cta {
  color: #fff;
  background: var(--accent);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
}

.nav-links .nav-cta:hover {
  color: #fff;
  background: var(--accent-strong);
}

.theme-toggle,
.menu-toggle {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
}

/* Las dos etiquetas ocupan la misma celda: el botón mide lo que la más larga y no mueve el menú al cambiar de tema */
.theme-toggle {
  display: inline-grid;
}

.theme-label {
  grid-area: 1 / 1;
}

[data-theme="dark"] .theme-label[data-theme-label="mist"],
[data-theme="mist"] .theme-label[data-theme-label="dark"] {
  visibility: hidden;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  font-size: 1.2rem;
}

/* Portada: ocupa el alto visible; la captura se ajusta al espacio que deja el texto */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 65px);
  height: calc(100svh - 65px);
  min-height: 520px;
  padding: clamp(1.5rem, 5vh, 4rem) 0 clamp(1.25rem, 4vh, 2.5rem);
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent);
  mask-image: linear-gradient(to bottom, #000 45%, transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.badge {
  align-self: center;
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: clamp(0.75rem, 2.5vh, 1.5rem);
}

.hero h1 {
  font-size: clamp(2rem, min(5vw, 6vh), 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: clamp(0.75rem, 2vh, 1.25rem);
}

.accent {
  background: linear-gradient(90deg, var(--accent), #3fc1c9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 680px;
  margin: 0 auto clamp(1.25rem, 3vh, 2rem);
  font-size: clamp(1rem, 2vh, 1.15rem);
  color: var(--muted);
}

.lead abbr {
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 4vh, 3rem);
}

/* La demo toma el mayor tamaño que quepa en el hueco disponible, sin deformarse */
.hero-shot {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}

.hero-media {
  position: relative;
}

.hero-shot video {
  display: block;
  width: min(100cqw, 160cqh, 1000px);
  height: auto;
  aspect-ratio: 1776 / 1110;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.hero-shot video {
  cursor: zoom-in;
}

.video-toggle,
.video-expand {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: #fff;
  background: rgba(16, 19, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.video-expand {
  right: 54px;
  font-size: 1.05rem;
}

.video-toggle:hover,
.video-toggle:focus-visible,
.video-expand:hover,
.video-expand:focus-visible {
  opacity: 1;
}

/* Demostración en grande */
.video-dialog {
  width: min(94vw, calc(84vh * 1.6));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

.video-dialog::backdrop {
  background: rgba(8, 10, 14, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.video-dialog video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1776 / 1110;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  background: #101319;
}

/* Encima del vídeo, para no tapar la interfaz grabada */
.dialog-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: #fff;
  background: rgba(16, 19, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
}

.video-toggle .icon-play,
.video-toggle.paused .icon-pause {
  display: none;
}

.video-toggle.paused .icon-play {
  display: inline;
}

/* Texto sobre la demo (pantallas de menos de 1000 px): título más contenido y sin saltos forzados,
   que dejarían palabras sueltas y le quitarían altura a la demo */
@media (max-width: 999px) {
  .hero h1 {
    font-size: clamp(1.8rem, min(4.2vw, 5vh), 3rem);
  }

  .hero h1 br {
    display: none;
  }
}

/* En pantallas anchas, texto a la izquierda y captura a la derecha para que esta se vea grande */
@media (min-width: 1000px) {
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(360px, 0.8fr) 1.2fr;
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 3.5vw, 3.5rem);
    width: 94%;
    max-width: 1560px;
    text-align: left;
  }

  .badge {
    align-self: flex-start;
  }

  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    font-size: clamp(1.8rem, min(2.45vw, 5.2vh), 2.9rem);
  }

  .lead {
    margin-left: 0;
  }

  .hero-actions {
    justify-content: flex-start;
    margin-bottom: 0;
  }

  .hero-shot {
    height: 100%;
  }

  .hero-shot video {
    width: min(100cqw, 160cqh);
  }
}

/* Demo en perspectiva (pantallas anchas): la ventana gira sobre su eje vertical, con un reflejo
   diagonal como de cristal, y se endereza un poco al pasar el ratón */
@media (min-width: 1000px) {
  .hero-shot {
    perspective: 1600px;
  }

  .hero-media {
    --tilt-y: -16deg;
    --tilt-x: 4deg;
    transform: rotateY(var(--tilt-y)) rotateX(var(--tilt-x));
    transform-origin: 60% 50%;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  /* Solo con el foco del teclado: un clic en pausa deja el foco en el botón y no debe enderezarla */
  .hero-media:hover,
  .hero-media:has(:focus-visible) {
    --tilt-y: -6deg;
    --tilt-x: 1.5deg;
  }

  .hero-shot video {
    box-shadow:
      -30px 40px 70px rgba(0, 0, 0, 0.45),
      -8px 12px 24px rgba(0, 0, 0, 0.25);
  }

  [data-theme="mist"] .hero-shot video {
    box-shadow:
      -30px 40px 70px rgba(28, 42, 56, 0.22),
      -8px 12px 24px rgba(28, 42, 56, 0.12);
  }

  .hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
    background: linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.05) 38%,
      rgba(255, 255, 255, 0) 38.5%,
      rgba(255, 255, 255, 0) 100%
    );
  }

  .video-toggle,
  .video-expand {
    z-index: 1;
  }
}

/* Botones */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

/* Botón principal de descarga: sistema detectado y formato */
.btn-download {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.7rem 1.8rem;
  line-height: 1.3;
  box-shadow: 0 8px 24px rgba(64, 158, 238, 0.3);
}

.btn-download-label {
  font-size: 1.05rem;
}

.btn-download-meta {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.hero-trust {
  margin-top: clamp(0.75rem, 2vh, 1.25rem);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Etiqueta de versión, con el acento de la marca */
.version-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  padding: 0.1rem 0.5rem;
  border-radius: 5px;
  vertical-align: middle;
}

.badge .version-tag {
  margin-right: 0.4rem;
}

/* Secciones */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.eyebrow {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section h2 {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.section-lead {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--muted);
}

.subhead {
  font-size: 1.2rem;
  margin: 2.5rem 0 1.25rem;
}

.center {
  text-align: center;
}

/* Texto solo para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* El problema: un escritorio que se llena de terminales a lo largo del día */
.problem {
  background: radial-gradient(ellipse 70% 45% at 30% 40%, var(--alert-soft), transparent 70%), var(--bg);
}

.eyebrow-alert {
  color: var(--alert);
}

.h-chaos {
  color: var(--alert);
  text-decoration: underline wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.chaos {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  margin-top: 2.5rem;
}

/* Todo el escritorio escala con su ancho, como si fuera una imagen */
.chaos-desk {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 11;
}

.win {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: calc(var(--t) + 1);
  width: var(--w);
  font: 1.8cqw/1.5 ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, monospace;
  color: #c9d1d9;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 0.6em;
  box-shadow: 0 1.2em 2.5em rgba(0, 0, 0, 0.45);
  rotate: var(--r);
  animation: drift 5s ease-in-out calc(var(--t) * -1.3s) infinite alternate;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.45em 0.7em;
  font-size: 0.85em;
  color: #8b949e;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  border-radius: 0.6em 0.6em 0 0;
}

.win-bar i {
  flex: none;
  width: 0.75em;
  height: 0.75em;
  border-radius: 50%;
  background: #ff5f57;
}

.win-bar i:nth-child(2) {
  background: #febc2e;
}

.win-bar i:nth-child(3) {
  background: #28c840;
}

.win-bar span {
  margin-left: 0.5em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.win-body {
  padding: 0.7em 0.9em;
}

.win-body p {
  overflow-wrap: anywhere;
}

.c-prompt {
  color: #58a6ff;
}

.c-dim {
  color: #8b949e;
}

.c-warn {
  color: #e3b341;
}

.c-danger {
  color: #ff7b72;
}

.win-alert {
  border-color: rgba(255, 123, 114, 0.7);
  animation: drift 5s ease-in-out calc(var(--t) * -1.3s) infinite alternate, alarm 1.6s ease-in-out infinite;
}

.win-dead .win-body {
  color: #6e7681;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: currentColor;
  animation: blink 1s steps(1) infinite;
}

.callout {
  position: absolute;
  right: -0.6em;
  bottom: -1em;
  padding: 0.3em 0.7em;
  font: 700 1.1em/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  white-space: nowrap;
  background: #e5534b;
  border-radius: 0.4em;
  box-shadow: 0 0.5em 1.2em rgba(0, 0, 0, 0.4);
  rotate: var(--cr);
}

.callout-top {
  top: -1.2em;
  bottom: auto;
}

.callout-stamp {
  right: 1em;
  bottom: -0.9em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ff7b72;
  background: rgba(13, 17, 23, 0.85);
  border: 0.15em solid currentColor;
  box-shadow: none;
}

.chaos-count {
  position: absolute;
  left: 1%;
  bottom: 1%;
  z-index: 10;
  padding: 0.5em 0.9em;
  font: 600 2cqw/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background: #e5534b;
  border-radius: 999px;
  box-shadow: 0 0.6em 1.5em rgba(229, 83, 75, 0.4);
}

.chaos-count b {
  font-variant-numeric: tabular-nums;
}

/* Línea del día: cada hora coincide con la ventana que aparece */
.day {
  position: relative;
  display: grid;
  gap: 1.1rem;
  list-style: none;
}

.day::before {
  content: "";
  position: absolute;
  left: 0.36rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(var(--border), var(--alert));
}

.day li {
  position: relative;
  padding-left: 1.9rem;
}

.day li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.8rem;
  height: 0.8rem;
  background: var(--bg);
  border: 2px solid var(--alert);
  border-radius: 50%;
}

.day li:last-child::before {
  background: var(--alert);
}

.day time {
  font: 700 0.85rem ui-monospace, "JetBrains Mono", Menlo, monospace;
  color: var(--alert);
}

.day p {
  color: var(--muted);
}

.day strong {
  color: var(--text);
}

.problem .subhead {
  text-align: center;
  margin-top: 4.5rem;
}

.pains {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
}

.pains li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--alert);
  border-radius: 12px;
  transition: transform 0.25s, border-color 0.25s;
}

.pains li:hover {
  transform: translateY(-3px);
  border-color: var(--alert);
}

.pain-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.3rem;
  background: var(--alert-soft);
  border-radius: 10px;
}

.pains strong {
  display: block;
  color: var(--text);
}

/* Paso del problema a la solución */
.bridge {
  margin-top: 4.5rem;
  text-align: center;
}

.bridge p {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bridge strong {
  background: linear-gradient(90deg, var(--accent), #3fc1c9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bridge-arrow {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-top: 1.25rem;
  font-size: 1.3rem;
  color: var(--accent);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  animation: nudge 1.8s ease-in-out infinite;
}

/* La solución: las mismas piezas, ordenadas en una sola ventana */
.solution {
  background: radial-gradient(ellipse 60% 45% at 35% 50%, var(--accent-soft), transparent 70%), var(--bg-alt);
}

.order {
  --cycle: 3.2s; /* Debe coincidir con CYCLE_MS de script.js */
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 2.5rem;
}

.order-stage {
  container-type: inline-size;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

/* Ventana de ejemplo: todo en em para que escale con su ancho */
.app-mock {
  position: relative;
  display: grid;
  gap: 0.6em;
  padding: 0.6em;
  font-size: 1.45cqw;
  line-height: 1.45;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1em;
  box-shadow: var(--shadow);
}

.mock-top {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.5em 0.7em;
  color: #e6ebf1;
  background: linear-gradient(90deg, #0f2540, #1c5a73 70%, #268c96);
  border-radius: 0.7em;
}

.mock-tabs {
  display: flex;
  gap: 0.3em;
  border-radius: 0.5em;
}

.mock-tabs span {
  padding: 0.3em 0.8em;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 0.5em;
}

.mock-tabs .is-current {
  color: #1c2a38;
  background: #fff;
}

.mock-pill {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin-left: auto;
  padding: 0.25em 0.8em;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.mock-pill i {
  width: 0.5em;
  height: 0.5em;
  background: #f5c451;
  border-radius: 50%;
}

.mock-brand {
  font-size: 0.95em;
  white-space: nowrap;
}

.mock-body {
  display: grid;
  grid-template-columns: 24% 1fr 28%;
  gap: 0.6em;
}

.mock-tasks,
.mock-chat,
.mock-git,
.mock-quota {
  padding: 0.8em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7em;
}

.mock-tasks,
.mock-chat,
.mock-side {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.mock-label {
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.mock-task-list {
  display: grid;
  gap: 0.35em;
  border-radius: 0.5em;
}

.mock-task {
  display: flex;
  gap: 0.5em;
  padding: 0.5em 0.6em;
  border-radius: 0.5em;
}

.mock-task.is-current {
  background: var(--accent-soft);
}

.mock-task b {
  display: block;
  font-size: 0.9em;
}

.mock-task small {
  display: block;
  font-size: 0.78em;
  color: var(--muted);
}

.dot-run,
.dot-wait {
  flex: none;
  width: 0.55em;
  height: 0.55em;
  margin-top: 0.45em;
  border-radius: 50%;
  background: var(--accent);
  animation: glow 1.4s ease-in-out infinite;
}

.dot-wait {
  background: #f5c451;
}

.mock-history {
  margin-top: auto;
  padding: 0.4em 0.5em;
  font-size: 0.85em;
  color: var(--muted);
  border-radius: 0.5em;
}

.mock-bubble {
  align-self: flex-end;
  max-width: 85%;
  padding: 0.5em 0.9em;
  font-size: 0.92em;
  color: #fff;
  background: var(--accent);
  border-radius: 1em;
}

.mock-activity {
  padding: 0.5em 0.8em;
  font-size: 0.85em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.6em;
}

.mock-activity p {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.app-mock .ok {
  font-style: normal;
  color: var(--ok);
}

.spin {
  width: 0.8em;
  height: 0.8em;
  border: 0.15em solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.mock-perm {
  padding: 0.7em 0.9em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 0.25em solid #f5c451;
  border-radius: 0.6em;
}

.mock-cmd {
  display: inline-block;
  margin: 0.35em 0 0.6em;
  padding: 0.2em 0.5em;
  font: 0.85em ui-monospace, "JetBrains Mono", Menlo, monospace;
  background: var(--accent-soft);
  border-radius: 0.35em;
}

.mock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.mock-actions span {
  padding: 0.35em 0.8em;
  font-size: 0.82em;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 0.45em;
}

.mock-actions .is-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.mock-perm.is-lit .is-primary {
  animation: press 1.6s ease-in-out infinite;
}

.mock-file {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 0.35em;
  font: 0.78em ui-monospace, "JetBrains Mono", Menlo, monospace;
  white-space: nowrap;
}

.mock-file i {
  font-style: normal;
  color: var(--accent);
}

.mock-file .add {
  margin-left: auto;
  color: var(--ok);
}

.mock-file .del {
  color: var(--alert);
}

.mock-btn {
  display: block;
  margin-top: 0.7em;
  padding: 0.4em;
  font-size: 0.82em;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: var(--accent);
  border-radius: 0.45em;
}

.mock-quota .bar {
  height: 0.5em;
  margin: 0.4em 0 0.35em;
  overflow: hidden;
  background: var(--border);
  border-radius: 999px;
}

.mock-quota .bar i {
  display: block;
  width: var(--v);
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #3fc1c9);
  transition: width 1.2s ease 1.2s;
}

.mock-quota small {
  display: block;
  margin-bottom: 0.6em;
  font-size: 0.75em;
  color: var(--muted);
}

.mock-term {
  padding: 0.55em 0.9em;
  font: 0.82em ui-monospace, "JetBrains Mono", Menlo, monospace;
  color: #c9d1d9;
  background: #0d1117;
  border-radius: 0.6em;
}

.mock-term b {
  color: #58a6ff;
}

.mock-term .ok {
  margin-left: 1em;
  color: #3fb950;
}

.mock-toast {
  position: absolute;
  right: 1.4em;
  bottom: 3.8em;
  padding: 0.55em 0.9em;
  font-size: 0.85em;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 0.25em solid var(--ok);
  border-radius: 0.6em;
  box-shadow: var(--shadow);
}

/* Cada pilar ilumina su zona en la ventana y atenúa el resto */
.app-mock :is(.mock-top, .mock-tasks, .mock-chat, .mock-side, .mock-term, .mock-toast, .mock-perm, .mock-tabs, .mock-pill, .mock-brand, .mock-task-list, .mock-history, .mock-bubble, .mock-activity, .mock-git, .mock-quota, .mock-label) {
  outline: 0.15em solid transparent;
  outline-offset: 0.2em;
  transition: opacity 0.7s var(--delay, 0s), translate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay, 0s),
    rotate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay, 0s), scale 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay, 0s),
    filter 0.4s, outline-color 0.4s, box-shadow 0.4s;
}

.app-mock.has-zone :is(.mock-tabs, .mock-pill, .mock-brand, .mock-tasks > .mock-label, .mock-task-list, .mock-history, .mock-chat > .mock-label, .mock-bubble, .mock-activity, .mock-perm, .mock-git, .mock-quota, .mock-term, .mock-toast):not(.is-lit) {
  filter: saturate(0.3) opacity(0.4);
}

.app-mock .is-lit {
  outline-color: var(--accent);
  box-shadow: 0 0 0 0.5em var(--accent-soft), 0 0 2.5em var(--accent-soft);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.pillar {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1.25rem 1.1rem 1.4rem;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.3s, background 0.3s, opacity 0.6s 0.8s, translate 0.6s 0.8s;
}

.pillar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border);
  transition: background 0.3s;
}

.pillar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
}

.pillar.is-active {
  background: linear-gradient(90deg, var(--accent-soft), transparent 75%), var(--surface);
  border-color: var(--accent);
}

.pillar.is-active::before {
  background: var(--accent);
}

.order.is-cycling .pillar.is-active::after {
  animation: fill var(--cycle) linear forwards;
}

.pillar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pillar h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.pillar p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Del caos al control: lo de antes se tacha y aparece lo de ahora */
.shift {
  display: grid;
  gap: 0.6rem;
  max-width: 960px;
  margin: 0 auto;
  list-style: none;
}

.shift li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.35fr);
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: opacity 0.6s calc(var(--i) * 0.12s), translate 0.6s calc(var(--i) * 0.12s);
}

.shift-before,
.shift-after {
  position: relative;
}

.shift-before {
  padding-left: 1.6rem;
  color: var(--muted);
  text-decoration: line-through 2px;
  text-decoration-color: color-mix(in srgb, var(--alert) 70%, transparent);
  transition: text-decoration-color 0.4s calc(var(--i) * 0.12s + 0.4s);
}

.shift-before::before {
  content: "✗";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--alert);
}

.shift-arrow {
  font-size: 1.3rem;
  color: var(--accent);
}

.shift-after {
  padding-left: 1.9rem;
  font-weight: 500;
}

.shift-after::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.15em;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--ok);
  border-radius: 50%;
}

.shift-arrow,
.shift-after {
  transition: opacity 0.5s calc(var(--i) * 0.12s + 0.6s), translate 0.5s calc(var(--i) * 0.12s + 0.6s);
}

/* Estados iniciales de las animaciones: solo si el script las activa */
.reveal .chaos:not(.in-view) .win {
  opacity: 0;
  scale: 0.85;
  translate: 0 1.5em;
}

.reveal .chaos .win {
  transition: opacity 0.5s calc(var(--t) * 0.6s), scale 0.5s cubic-bezier(0.3, 1.5, 0.6, 1) calc(var(--t) * 0.6s),
    translate 0.5s calc(var(--t) * 0.6s);
}

.reveal .chaos:not(.in-view) .callout {
  opacity: 0;
  scale: 1.8;
}

.reveal .chaos .callout {
  transition: opacity 0.3s calc(var(--t) * 0.6s + 0.5s), scale 0.3s ease-in calc(var(--t) * 0.6s + 0.5s);
}

.reveal .chaos:not(.in-view) .day li {
  opacity: 0;
  translate: 1rem 0;
}

.reveal .chaos .day li {
  transition: opacity 0.5s calc(var(--t) * 0.6s), translate 0.5s calc(var(--t) * 0.6s);
}

.reveal .pains:not(.in-view) li {
  opacity: 0;
  translate: 0 1rem;
}

.reveal .pains li {
  transition: opacity 0.5s calc(var(--i) * 0.08s), translate 0.5s calc(var(--i) * 0.08s), transform 0.25s, border-color 0.25s;
}

/* La ventana se arma con las piezas que llegan torcidas, como las del escritorio caótico */
.mock-top { --delay: 0s; }
.mock-tasks { --delay: 0.15s; }
.mock-chat { --delay: 0.3s; }
.mock-side { --delay: 0.45s; }
.mock-term { --delay: 0.6s; }
.mock-perm { --delay: 1s; }
.mock-toast { --delay: 1.4s; }

.reveal .order:not(.in-view) .mock-top {
  opacity: 0;
  translate: 0 -2em;
  rotate: -2deg;
}

.reveal .order:not(.in-view) .mock-tasks {
  opacity: 0;
  translate: -3em 2em;
  rotate: -5deg;
}

.reveal .order:not(.in-view) .mock-chat {
  opacity: 0;
  translate: 0 3em;
  rotate: 2deg;
  scale: 0.92;
}

.reveal .order:not(.in-view) .mock-side {
  opacity: 0;
  translate: 3em -1em;
  rotate: 4deg;
}

.reveal .order:not(.in-view) .mock-term {
  opacity: 0;
  translate: -2em 2em;
  rotate: 3deg;
}

.reveal .order:not(.in-view) :is(.mock-perm, .mock-toast) {
  opacity: 0;
  scale: 0.9;
  translate: 0 1em;
}

.reveal .order:not(.in-view) .bar i {
  width: 0;
}

.reveal .order:not(.in-view) .pillar {
  opacity: 0;
  translate: 0 1.5rem;
}

.reveal .order .pillar:nth-child(2) { transition-delay: 0s, 0s, 0.9s, 0.9s; }
.reveal .order .pillar:nth-child(3) { transition-delay: 0s, 0s, 1s, 1s; }
.reveal .order .pillar:nth-child(4) { transition-delay: 0s, 0s, 1.1s, 1.1s; }

.reveal .shift:not(.in-view) li {
  opacity: 0;
  translate: 0 1rem;
}

.reveal .shift:not(.in-view) .shift-before {
  text-decoration-color: transparent;
}

.reveal .shift:not(.in-view) :is(.shift-arrow, .shift-after) {
  opacity: 0;
  translate: -0.75rem 0;
}

@keyframes drift {
  to {
    transform: translateY(-0.6em);
  }
}

@keyframes alarm {
  50% {
    box-shadow: 0 0 0 0.35em rgba(229, 83, 75, 0.35), 0 1.2em 2.5em rgba(0, 0, 0, 0.45);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes nudge {
  50% {
    transform: translateY(6px);
  }
}

@keyframes glow {
  50% {
    opacity: 0.35;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes press {
  50% {
    box-shadow: 0 0 0 0.4em var(--accent-soft);
  }
}

@keyframes fill {
  to {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .chaos {
    grid-template-columns: 1fr;
  }

  .pillars {
    grid-template-columns: repeat(2, 1fr);
  }

  .shift li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .shift-arrow {
    display: none;
  }
}

/* En teléfonos el escritorio se alarga y la ventana de ejemplo reparte sus paneles para seguir siendo legible */
@media (max-width: 700px) {
  .chaos-desk {
    aspect-ratio: 4 / 5;
  }

  .win {
    left: var(--mx);
    top: var(--my);
    width: 78%;
    font-size: 2.9cqw;
  }

  .chaos-count {
    font-size: 3.2cqw;
  }

  .app-mock {
    font-size: 2.7cqw;
  }

  .mock-brand {
    display: none;
  }

  .mock-body {
    grid-template-columns: 1fr 1fr;
  }

  .mock-chat {
    grid-column: 1 / -1;
    order: -1;
  }
}

@media (max-width: 560px) {
  .pillars {
    grid-template-columns: 1fr;
  }
}

/* Características destacadas: la sección queda fija y el scroll cambia de característica */
.feature-story {
  position: relative;
  height: calc((var(--steps) + 0.5) * 100svh);
}

.story-sticky {
  position: sticky;
  top: 65px;
  height: calc(100svh - 65px);
  overflow: hidden;
}

.story-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1440px;
  padding: clamp(1.25rem, 4vh, 3rem) 0 clamp(1rem, 3vh, 2rem);
}

.story-header {
  text-align: center;
  margin-bottom: clamp(1rem, 3vh, 2.25rem);
}

.story-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
}

.story-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 0.7fr) 1.3fr;
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: center;
}

.story-texts,
.story-media {
  display: grid;
}

.story-step,
.story-shot {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, transform 0.6s ease, visibility 0.5s;
}

.story-step {
  transform: translateY(28px);
}

.story-shot {
  transform: translateY(24px) scale(0.97);
}

.story-step.is-active,
.story-shot.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.story-count {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.story-step h3 {
  font-size: clamp(1.6rem, min(2.4vw, 4.2vh), 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.showcase-lead {
  font-size: clamp(1.02rem, 2vh, 1.2rem);
  font-weight: 600;
  margin-bottom: clamp(0.75rem, 2vh, 1.25rem);
}

.story-step ul {
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.9vh, 1.05rem);
}

.story-step li {
  margin-bottom: 0.55rem;
}

.story-step li strong {
  color: var(--text);
}

/* La captura toma el mayor tamaño que quepa, sin deformarse */
.story-media {
  height: 100%;
  min-height: 0;
  container-type: size;
  place-items: center;
}

.story-shot img {
  display: block;
  width: min(100cqw, 160cqh);
  height: auto;
  aspect-ratio: 1440 / 900;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.story-progress {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: clamp(0.75rem, 2.5vh, 1.5rem);
}

.story-dot {
  width: 44px;
  height: 20px;
  border: none;
  cursor: pointer;
  background: linear-gradient(var(--border), var(--border)) center / 100% 4px no-repeat;
  transition: background-size 0.3s;
}

.story-dot.is-active {
  background: linear-gradient(var(--accent), var(--accent)) center / 100% 4px no-repeat;
}

.solved {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(63, 185, 80, 0.1);
  border-left: 3px solid #3fb950;
  border-radius: 0 8px 8px 0;
}

.solved strong {
  color: #3fb950;
}

/* Pantallas estrechas o bajas: fijar la sección no funciona bien, las características se apilan */
@media (max-width: 960px), (max-height: 620px) {
  .feature-story {
    height: auto;
    padding: 4rem 0;
  }

  .story-sticky {
    position: static;
    height: auto;
    overflow: visible;
  }

  .story-inner {
    height: auto;
    padding: 0;
  }

  .story-stage {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .story-texts,
  .story-media {
    display: contents;
  }

  .story-step,
  .story-shot {
    order: var(--order);
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .story-step:not(:first-child) {
    margin-top: 2rem;
  }

  .story-shot img {
    width: 100%;
  }

  .story-progress {
    display: none;
  }
}

/* Descargas: una tarjeta por distribución con sus comandos */
.download {
  position: relative;
  padding: 5.5rem 0 5rem;
  text-align: center;
  background:
    radial-gradient(ellipse 55% 60% at 50% 55%, var(--accent-soft), transparent 70%),
    var(--bg-alt);
}

.download h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.download-lead {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--muted);
  margin-bottom: 3.25rem;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
  max-width: 960px;
  margin: 0 auto;
}

.platform {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.75rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.platform:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.os-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1.1rem;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.os-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.os-icon .os-swirl {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.platform h3 {
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
}

.formats {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.platform-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1rem;
}

.btn-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sistemas de escritorio: Windows y macOS (próximamente) en la primera fila */
.platforms-desktop {
  margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

.platform-head,
.platform-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.platform-soon .platform-body {
  flex: 1;
  justify-content: center;
  gap: 1.25rem;
}

.platform-soon .os-icon {
  opacity: 0.75;
}

.soon-lead {
  max-width: 34ch;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text);
}

.soon-list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  text-align: left;
  font-size: 0.88rem;
  color: var(--muted);
}

.soon-list li {
  display: flex;
  gap: 0.6rem;
}

.soon-list li::before {
  content: "✓";
  flex: none;
  font-weight: 800;
  color: var(--accent);
}

.soon-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.soon-status span {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  border-radius: 50%;
}

.soon-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
}

/* Texto de un paso sin comando y aviso dentro de la tarjeta */
.step-text {
  font-size: 0.88rem;
  color: var(--muted);
}

.platform .note {
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 10px;
}

.platform .note strong {
  color: var(--text);
}

/* Pasos de instalación y bloques de comandos */
.install-steps {
  list-style: none;
  counter-reset: step;
  width: 100%;
  display: grid;
  gap: 1.1rem;
  text-align: left;
}

.install-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
}

.install-steps li > span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.install-steps li > span::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.install-steps li:only-child > span::before {
  display: none;
}

.cmd-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Comandos que se ejecutan en secuencia: cada bloque lleva su número de orden */
.cmd-seq {
  counter-reset: cmd;
  display: grid;
  gap: 0.5rem;
}

.cmd-seq > .cmd {
  counter-increment: cmd;
}

.cmd-seq > .cmd::before {
  content: counter(cmd);
  flex: none;
  padding: 0.3rem 0;
  font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--accent);
  user-select: none;
}

/* Comando a la izquierda (se desplaza si no cabe) y botón de copiar fuera del texto */
.cmd {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.45rem 0.45rem 0.45rem 0.9rem;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cmd pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.3rem 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.cmd code {
  display: block;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  background: none;
}

.cmd-line {
  display: block;
}

/* Un comando que ocupa dos o más líneas queda separado de los demás */
.cmd-line.wrapped {
  margin: 0.6em 0;
}

.cmd-line.wrapped:first-child {
  margin-top: 0;
}

.cmd-line.wrapped:last-child {
  margin-bottom: 0;
}

.copy-btn {
  flex: none;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--accent);
}

.copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}

.alt {
  min-height: 1.5em;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.alt a {
  font-weight: 600;
  text-decoration: none;
}

.alt a:hover {
  text-decoration: underline;
}

.install-help {
  max-width: 640px;
  margin: 2.5rem auto 0;
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
}

.install-help summary {
  width: fit-content;
  margin: 0 auto;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.install-help summary::-webkit-details-marker {
  display: none;
}

.install-help summary::after {
  content: " ▾";
  color: var(--accent);
}

.install-help[open] summary::after {
  content: " ▴";
}

.install-help p {
  margin: 1rem 0 0.5rem;
}

.install-help .cmd code {
  font-size: 0.75rem;
}

.install-help ul {
  padding-left: 1.2rem;
}

.install-help li {
  margin-bottom: 0.35rem;
}

.install-help strong {
  color: var(--text);
}

@media (max-width: 860px) {
  .platforms {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
    gap: 1.75rem;
  }
}

/* Servidores MCP: lo nuevo de la 1.2.38, la lista de Configuración junto a lo que permite */
.new-tag {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
}

a.badge {
  text-decoration: none;
  transition: border-color 0.2s;
}

a.badge:hover {
  border-color: var(--accent);
}

/* Hasta ahora (un archivo por agente) frente a Agentic Workspace (un solo lugar) */
.mcp-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  max-width: 1120px;
  margin: 0 auto;
}

.mcp-side {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.mcp-after {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 24px 60px var(--accent-soft);
}

.mcp-label {
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
}

.mcp-before .mcp-label {
  color: var(--alert);
  background: var(--alert-soft);
}

.mcp-after .mcp-label {
  color: var(--accent);
  background: var(--accent-soft);
}

.mcp-side h3 {
  margin-top: -0.4rem;
  font-size: 1.3rem;
}

/* Los dos archivos, con el aspecto de las terminales de "El problema" */
.mcp-files {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
  padding-bottom: 0.4rem;
}

.mcp-file {
  position: relative;
  font: 0.78rem/1.55 ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, monospace;
  color: #c9d1d9;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 0.6em;
  box-shadow: 0 1.2em 2.5em rgba(0, 0, 0, 0.3);
}

.mcp-file .win-body {
  margin: 0;
  overflow-x: auto;
  font: inherit;
  white-space: pre;
}

.mcp-file code {
  padding: 0;
  font-size: inherit;
  background: none;
}

.mcp-file .callout {
  font-size: 0.95rem;
}

.mcp-shot {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.mcp-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.mcp-cons,
.mcp-pros {
  display: grid;
  gap: 0.65rem;
  margin-top: auto;
  list-style: none;
  font-size: 0.95rem;
}

.mcp-cons li,
.mcp-pros li {
  position: relative;
  padding-left: 1.9rem;
}

.mcp-cons li {
  color: var(--muted);
}

.mcp-cons li::before {
  content: "✗";
  position: absolute;
  left: 0.2rem;
  font-weight: 700;
  color: var(--alert);
}

.mcp-pros li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.15em;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--ok);
  border-radius: 50%;
}

.mcp-pros strong,
.mcp-agents strong {
  color: var(--text);
}

.mcp-agents {
  max-width: 760px;
  margin: 2.5rem auto 0;
  text-align: center;
  color: var(--muted);
}

/* Un servidor, todos los agentes: los servidores llegan al espacio y de ahí a cada agente */
.mcp-hub {
  max-width: 1120px;
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
  text-align: center;
}

.mcp-hub h3 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  letter-spacing: -0.01em;
}

.mcp-hub > p {
  max-width: 680px;
  margin: 0 auto 2.25rem;
  color: var(--muted);
}

.hub-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-col {
  flex: 0 1 250px;
  padding: 1rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.hub-caption {
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-col ul {
  display: grid;
  gap: 0.45rem;
  list-style: none;
}

.hub-col li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.hub-col svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* La línea entre columnas, con un punto que la recorre hacia los agentes */
.hub-link {
  position: relative;
  flex: 1 1 3rem;
  min-width: 2.5rem;
  max-width: 7rem;
  height: 2px;
  background: linear-gradient(90deg, var(--border), var(--accent));
}

.hub-link::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: hub-flow 1.8s linear infinite;
}

.hub-core + .hub-link::after {
  animation-delay: 0.9s;
}

@keyframes hub-flow {
  from { left: 0; opacity: 0; }
  15%, 85% { opacity: 1; }
  to { left: 100%; opacity: 0; }
}

@keyframes hub-flow-down {
  from { top: 0; opacity: 0; }
  15%, 85% { opacity: 1; }
  to { top: 100%; opacity: 0; }
}

.hub-core {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 1.25rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 18px;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 20px 50px var(--accent-soft);
}

.hub-core img {
  margin-bottom: 0.3rem;
}

.hub-core strong {
  font-size: 1.05rem;
}

.hub-core small {
  font-size: 0.8rem;
  color: var(--muted);
}

.reveal .mcp-hub:not(.in-view) {
  opacity: 0;
  translate: 0 1rem;
}

.reveal .mcp-hub {
  transition: opacity 0.6s, translate 0.6s;
}

@media (max-width: 760px) {
  .hub-diagram {
    flex-direction: column;
  }

  .hub-col {
    flex: none;
    width: 100%;
    max-width: 320px;
  }

  .hub-link {
    flex: none;
    width: 2px;
    min-width: 0;
    height: 2.5rem;
    background: linear-gradient(180deg, var(--border), var(--accent));
  }

  .hub-link::after {
    left: 50%;
    animation-name: hub-flow-down;
  }
}

/* Primero aparece "Hasta ahora" y después, con un poco de retraso, Agentic Workspace */
.reveal .mcp-compare:not(.in-view) .mcp-side {
  opacity: 0;
  translate: 0 1rem;
}

.reveal .mcp-compare .mcp-side {
  transition: opacity 0.6s, translate 0.6s;
}

.reveal .mcp-compare .mcp-after {
  transition-delay: 0.35s;
}

.reveal .mcp-compare:not(.in-view) .callout {
  opacity: 0;
  scale: 1.8;
}

.reveal .mcp-compare .callout {
  transition: opacity 0.4s 0.7s, scale 0.4s cubic-bezier(0.3, 1.5, 0.6, 1) 0.7s;
}

@media (max-width: 900px) {
  .mcp-compare {
    grid-template-columns: minmax(0, 1fr);
    max-width: 600px;
  }
}

@media (max-width: 480px) {
  .mcp-file {
    font-size: 0.68rem;
  }

  .mcp-file .callout {
    right: -0.3em;
    font-size: 0.8rem;
  }
}

/* Comunidad .agent: la tarjeta de miembro junto a su texto y, debajo, la tabla periódica a todo el ancho */
.community-member {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 1040px;
  margin: 0 auto;
}

.community-shot {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, border-color 0.25s;
}

.community-shot:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.community-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.community-text h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.community-text p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.community-poster {
  max-width: 1040px;
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
}

.community-poster figcaption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.reveal :is(.community-member, .community-poster):not(.in-view) {
  opacity: 0;
  translate: 0 1rem;
}

.reveal :is(.community-member, .community-poster) {
  transition: opacity 0.6s, translate 0.6s;
}

@media (max-width: 860px) {
  .community-member {
    grid-template-columns: 1fr;
    max-width: 560px;
    text-align: center;
  }
}

/* Preguntas frecuentes */
.faq {
  text-align: center;
}

.faq-list {
  max-width: 760px;
  margin: 2.5rem auto 0;
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease;
}

.faq-list details[open],
.faq-list details:hover {
  border-color: var(--accent);
}

.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  flex: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--accent);
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  padding: 0 1.25rem 1.15rem;
  color: var(--muted);
  line-height: 1.65;
}

/* Contacto de soporte, debajo de las preguntas */
.faq-contact {
  margin-top: 2rem;
  color: var(--muted);
}

.faq-contact a {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hero-trust strong {
  color: var(--accent);
}

/* Empieza en minutos: tres pasos unidos por una línea que se dibuja al entrar en pantalla */
.quickstart {
  --qs-gap: clamp(1.25rem, 3vw, 2.5rem);
  position: relative;
  padding: 4.5rem 0 5rem;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg);
}

.quickstart h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
}

.qs-steps {
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--qs-gap);
  max-width: 1120px;
  margin: 0 auto;
}

/* La línea une los centros de los tres números */
.qs-steps::before,
.qs-steps::after {
  content: "";
  position: absolute;
  top: 32px;
  left: calc((100% - 2 * var(--qs-gap)) / 6);
  right: calc((100% - 2 * var(--qs-gap)) / 6);
  height: 3px;
  border-radius: 3px;
}

.qs-steps::before {
  background: var(--border);
}

.qs-steps::after {
  background: linear-gradient(90deg, var(--accent), #3fc1c9);
  transform-origin: left center;
}

.qs-steps > li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.5rem;
}

.qs-num {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #3fc1c9);
  border-radius: 50%;
  box-shadow: 0 0 0 8px var(--bg), 0 10px 30px rgba(64, 158, 238, 0.35);
}

.qs-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 0.6rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qs-steps h3 {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.qs-steps p {
  max-width: 320px;
  color: var(--muted);
  font-size: 0.97rem;
}

.qs-cta {
  margin-top: 1.1rem;
  padding: 0.6rem 1.3rem;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(64, 158, 238, 0.28);
}

.qs-agents {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.1rem;
}

.qs-agents li {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

.qs-keys {
  margin-top: 1.1rem;
  font-size: 0.85rem !important;
}

.qs-keys kbd {
  font-size: 0.95rem;
  padding: 0.2rem 0.55rem;
}

.qs-keys span {
  margin-left: 0.35rem;
}

/* Al entrar en pantalla: la línea se dibuja y cada paso aparece cuando ella llega a su número */
.reveal .qs-steps:not(.in-view)::after {
  scale: 0 1;
}

.reveal .qs-steps::after {
  transition: scale 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.reveal .qs-steps:not(.in-view) > li {
  opacity: 0;
  translate: 0 1.5rem;
}

.reveal .qs-steps > li {
  transition: opacity 0.5s calc(var(--i) * 0.55s + 0.1s), translate 0.5s calc(var(--i) * 0.55s + 0.1s);
}

.reveal .qs-steps:not(.in-view) .qs-num {
  scale: 0.4;
}

.reveal .qs-steps .qs-num {
  transition: scale 0.5s cubic-bezier(0.3, 1.6, 0.6, 1) calc(var(--i) * 0.55s + 0.1s);
}

/* Pantallas estrechas: los pasos se apilan y la línea baja por la izquierda */
@media (max-width: 760px) {
  .qs-steps {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }

  .qs-steps::before,
  .qs-steps::after {
    top: 32px;
    bottom: 32px;
    left: 30px;
    right: auto;
    width: 3px;
    height: auto;
    transform-origin: center top;
  }

  .reveal .qs-steps:not(.in-view)::after {
    scale: 1 0;
  }

  .qs-steps > li {
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: 1.25rem;
    align-items: start;
    padding: 0;
  }

  .qs-steps > li > :not(.qs-num) {
    grid-column: 2;
  }

  .qs-num {
    grid-row: 1 / span 5;
    margin-bottom: 0;
  }

  .qs-agents {
    justify-content: flex-start;
  }

  .qs-cta {
    justify-self: start;
  }
}

/* Pie de página */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Diseño adaptable */
@media (max-width: 960px) {
  .menu-toggle {
    display: block;
  }

  /* El menú desplegable no ocupa sitio en la fila: se descuenta el hueco que le daría la cabecera */
  .header nav {
    margin-left: -1.5rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 5% 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  /* Filas a todo el ancho y de unos 44 px de alto, fáciles de tocar */
  .nav-links li {
    align-self: stretch;
  }

  .nav-links a {
    display: block;
    padding: 0.6rem 0;
  }

  .nav-links .nav-cta {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.6rem 1.2rem;
  }

}

/* En teléfonos (también en horizontal) el texto ocupa demasiado alto: la portada vuelve a crecer con
   su contenido y la demo toma el ancho, sin pasar del alto de la pantalla */
@media (max-width: 700px), (max-width: 999px) and (max-height: 500px) {
  .hero {
    height: auto;
    min-height: 0;
  }

  .hero-shot {
    display: block;
    container-type: normal;
  }

  .hero-media {
    max-width: calc((100svh - 6rem) * 1.6);
    margin: 0 auto;
  }

  .hero-shot video {
    width: 100%;
  }

}

@media (max-width: 480px) {
  .nav {
    gap: 0.5rem;
  }

  .header nav {
    margin-left: -0.5rem;
  }

  .theme-toggle {
    padding: 0.35rem 0.5rem;
  }

  .theme-label {
    font-size: 0.75rem;
  }

  .section {
    padding: 3.5rem 0;
  }

}

/* Teléfonos muy estrechos: el nombre del tema no cabe junto al logo y el menú, queda un icono */
@media (max-width: 374px) {
  .logo {
    gap: 0.45rem;
    font-size: 0.95rem;
  }

  .logo img {
    width: 28px;
    height: 28px;
  }

  .theme-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  /* Círculo mitad lleno, dibujado para no depender de la fuente */
  .theme-toggle::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  }

  .theme-label {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
