/**
 * ChecklistPro — info.html layout (hero, TOC, bandas imagen/texto)
 * Tokens heredados de :root en info.html (--bg, --card, --accent, etc.)
 */

/* Anclas: compensar header sticky */
#about,
#features,
#benefits,
#contact,
#integrations {
  scroll-margin-top: 5.5rem;
}

/* Ancho casi completo del viewport (solo info.html con body.info-page-wide) */
body.info-page-wide {
  padding-left: clamp(0.75rem, 2vw, 1.5rem);
  padding-right: clamp(0.75rem, 2vw, 1.5rem);
  box-sizing: border-box;
}

body.info-page-wide .section {
  max-width: min(100%, 96rem);
  width: 100%;
  box-sizing: border-box;
}

body.info-page-wide .footer-content {
  max-width: min(100%, 96rem);
}

/* —— Header info (móvil): anula reglas .landing de index que reabren nav y comprimen «Regresar» —— */
body.info-page-wide.landing .landing-header {
  padding: 10px 12px !important;
  padding-right: 12px !important;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

body.info-page-wide.landing .landing-header .logo {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

body.info-page-wide.landing .landing-header .logo .logo-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0.95rem, 3.5vw, 1.15rem) !important;
}

@media (max-width: 1024px) {
  body.info-page-wide.landing .landing-header .nav-menu {
    display: none !important;
  }

  body.info-page-wide.landing .mobile-back-button {
    display: inline-flex !important;
    flex: 0 0 auto;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    order: unset;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
    overflow: hidden;
    line-height: 1.2;
    font-size: 0.875rem;
    gap: 6px;
  }

  body.info-page-wide.landing .mobile-back-button .mbb-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1;
  }

  body.info-page-wide.landing .mobile-back-button .mbb-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 7.5rem;
  }
}

@media (max-width: 400px) {
  body.info-page-wide.landing .mobile-back-button {
    padding: 10px 12px;
    min-width: 44px;
  }

  body.info-page-wide.landing .mobile-back-button .mbb-text {
    display: none;
  }
}

/* —— Hero —— */
.info-about-wrap .section-content {
  max-width: 100%;
}

.info-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: center;
  margin-bottom: 0.5rem;
}

.info-hero-visual {
  border-radius: var(--radius-ios, 20px);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow:
    0 4px 24px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
  aspect-ratio: 16 / 9;
}

.info-hero-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  vertical-align: middle;
}

/* Diagramas extraídos de presentacion.html — ocupan todo el panel (object-fit: contain) */
.info-hero-visual:has(.info-deck-diagram) {
  aspect-ratio: auto;
  position: relative;
  min-height: clamp(220px, 32vw, 400px);
}

.info-hero-visual .info-deck-diagram {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: calc(var(--radius-ios, 20px) - 4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
}

/* La columna de imagen se estira a la altura del texto en la misma fila */
.info-split-row:has(.info-split-img .info-deck-diagram) {
  align-items: stretch;
}

.info-split-img:has(.info-deck-diagram) {
  position: relative;
  aspect-ratio: auto;
  max-height: none;
  height: 100%;
  min-height: clamp(240px, 38vw, 460px);
  padding: 0;
}

.info-split-img .info-deck-diagram {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: calc(var(--radius-ios, 20px) - 6px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
}

.info-hero-copy .lead {
  font-size: clamp(1rem, 1.1vw + 0.85rem, 1.15rem);
  line-height: 1.65;
  margin: 0 0 1rem;
}

.info-hero-cta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 900px) {
  .info-hero-split {
    grid-template-columns: 1fr;
  }

  .info-hero-visual {
    order: -1;
    max-height: none;
  }
}

/* —— TOC funciones —— */
.features-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  border-radius: var(--radius-ios, 20px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow-dark);
  position: sticky;
  top: calc(0.5rem + env(safe-area-inset-top, 0));
  z-index: 2;
  -webkit-overflow-scrolling: touch;
}

.features-toc a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.features-toc a:hover,
.features-toc a:focus-visible {
  color: var(--accent);
  background: rgba(var(--accent-rgb, 245, 158, 11), 0.12);
  border-color: rgba(var(--accent-rgb, 245, 158, 11), 0.35);
  outline: none;
}

/* —— Subtítulos de bloque en grid —— */
.features-grid .info-features-subhead {
  grid-column: 1 / -1;
  margin: 1.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.05rem, 0.5vw + 1rem, 1.2rem);
  color: var(--text);
  scroll-margin-top: 6.5rem;
}

.features-grid .info-features-subhead:first-of-type {
  margin-top: 0.25rem;
}

/* —— Bandas imagen + texto —— */
.info-split-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: center;
  margin: 0 0 1.5rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  border-radius: var(--radius-ios, 20px);
  background: linear-gradient(
    135deg,
    rgba(var(--card-rgb, 17, 28, 48), 0.65),
    rgba(var(--card-rgb, 17, 28, 48), 0.25)
  );
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px var(--shadow-dark);
}

.info-split-row--reverse .info-split-img {
  order: 2;
}

.info-split-row--reverse .info-split-caption {
  order: 1;
}

.info-split-img {
  border-radius: calc(var(--radius-ios, 20px) - 4px);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  aspect-ratio: 8 / 5;
  max-height: 320px;
}

.info-spotlight-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-split-caption {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.info-split-caption p {
  margin: 0;
}

.info-split-caption strong {
  color: var(--text);
}

@media (max-width: 768px) {
  .info-split-row,
  .info-split-row--reverse {
    grid-template-columns: 1fr;
  }

  .info-split-row--reverse .info-split-img,
  .info-split-row--reverse .info-split-caption {
    order: unset;
  }

  .info-split-img {
    max-height: 220px;
    aspect-ratio: 16 / 10;
  }

  .info-split-img:has(.info-deck-diagram) {
    max-height: none;
    aspect-ratio: auto;
    min-height: min(360px, 62vw);
  }

  .features-toc {
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }

  .features-toc a {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

[data-theme="light"] .info-split-row {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(247, 249, 252, 0.85)
  );
}

@media (prefers-reduced-motion: reduce) {
  .features-toc a {
    transition: none;
  }
}

/* —— Hero “wow”: mesh / aurora + badges —— */
.info-hero-atmosphere {
  position: relative;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  margin-bottom: 0.5rem;
  border-radius: calc(var(--radius-ios, 20px) + 6px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 120% 80% at 10% 20%, rgba(245, 158, 11, 0.14), transparent 55%),
    radial-gradient(ellipse 100% 70% at 90% 10%, rgba(34, 211, 238, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(16, 185, 129, 0.06), transparent 45%),
    linear-gradient(165deg, rgba(var(--card-rgb, 17, 28, 48), 0.5), rgba(var(--card-rgb, 17, 28, 48), 0.15));
  border: 1px solid rgba(var(--accent-rgb, 245, 158, 11), 0.18);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 56px var(--shadow-dark);
}

.info-hero-atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

.info-hero-atmosphere > * {
  position: relative;
  z-index: 1;
}

.info-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.info-hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(var(--card-rgb, 17, 28, 48), 0.65);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow-dark);
}

.info-hero-badge--accent {
  color: #0b0f19;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: rgba(var(--accent-rgb, 245, 158, 11), 0.5);
}

[data-theme='light'] .info-hero-badge {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme='light'] .info-hero-badge--accent {
  color: #0b0f19;
}

.info-hero-visual--frame {
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 40px rgba(34, 211, 238, 0.08),
    0 12px 40px var(--shadow-dark);
  border-color: rgba(34, 211, 238, 0.22);
}

.info-hero-visual--frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.35) inset,
    0 0 0 2px rgba(34, 211, 238, 0.12) inset;
  pointer-events: none;
  z-index: 2;
}

/* TOC scroll-spy activo */
.features-toc a.is-active {
  color: var(--text);
  background: rgba(var(--accent-rgb, 245, 158, 11), 0.22);
  border-color: rgba(var(--accent-rgb, 245, 158, 11), 0.55);
  box-shadow: 0 0 20px rgba(var(--accent-rgb, 245, 158, 11), 0.15);
}

/* Pasos en bandas split */
.info-split-step {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 0.5rem;
  opacity: 0.95;
}

.info-split-row {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

@media (hover: hover) {
  .info-split-row:hover {
    transform: translateY(-2px);
    box-shadow:
      0 16px 48px var(--shadow-dark),
      0 0 0 1px rgba(var(--accent-rgb, 245, 158, 11), 0.12);
  }
}

/* Tarjetas de funciones: hover HUD */
#features .feature-card.neumorphic-inset {
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

@media (hover: hover) {
  #features .feature-card.neumorphic-inset:hover {
    transform: translateY(-3px);
    box-shadow:
      0 14px 36px var(--shadow-dark),
      0 0 0 1px rgba(34, 211, 238, 0.12);
  }
}

#about .roles-grid .role-card.neumorphic-inset {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  #about .roles-grid .role-card.neumorphic-inset:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--shadow-dark);
  }
}

/* Ritmo entre secciones principales */
body.info-page-wide section#integrations.section.neumorphic,
body.info-page-wide section#benefits.section.neumorphic {
  border-top: 1px solid rgba(var(--accent-rgb, 245, 158, 11), 0.12);
}

body.info-page-wide section#features.section.neumorphic {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(34, 211, 238, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .info-split-row,
  #features .feature-card.neumorphic-inset,
  #about .roles-grid .role-card.neumorphic-inset {
    transition: none;
  }

  #features .feature-card.neumorphic-inset:hover,
  #about .roles-grid .role-card.neumorphic-inset:hover,
  .info-split-row:hover {
    transform: none;
  }
}

/* ============================================================================
   TACTICAL TERMINAL SYSTEM - THEME ADAPTIVE & HIGH FIDELITY
   ============================================================================ */

:root {
  /* Default variables (Light Mode) */
  --terminal-bg: rgba(255, 255, 255, 0.9);
  --terminal-monitor-bg: rgba(241, 245, 249, 0.7);
  --terminal-border: rgba(217, 119, 6, 0.3);
  --terminal-text: #1a1d22;
  --terminal-accent: #d97706; /* Amber Dark */
  --terminal-accent-alt: #059669; /* Emerald Dark */
  --terminal-accent-cyan: #0891b2; /* Cyan Dark */
  --terminal-glow: rgba(217, 119, 6, 0.1);
  --terminal-scanline-color: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
  --terminal-bg: #020617;
  --terminal-monitor-bg: rgba(15, 23, 42, 0.85);
  --terminal-border: rgba(245, 158, 11, 0.25);
  --terminal-text: #f1f5f9;
  --terminal-accent: #f59e0b; /* Amber */
  --terminal-accent-alt: #10b981; /* Emerald */
  --terminal-accent-cyan: #22d3ee; /* Cyan */
  --terminal-glow: rgba(245, 158, 11, 0.2);
  --terminal-scanline-color: rgba(245, 158, 11, 0.1);
}

.tactical-terminal {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 400px;
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius-ios, 20px);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1), 0 0 15px var(--terminal-glow);
  font-family: 'Inter', 'JetBrains Mono', monospace;
  color: var(--terminal-text);
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

[data-theme="dark"] .tactical-terminal {
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 15px var(--terminal-glow);
}

/* CRT EFFECTS - ADAPTIVE */
.terminal-crt-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.01), rgba(0, 255, 0, 0.005), rgba(0, 0, 255, 0.01));
  background-size: 100% 3px, 3px 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.6;
}

.terminal-scanline {
  position: absolute;
  top: 0;
  width: 100%;
  height: 4px;
  background: var(--terminal-scanline-color);
  box-shadow: 0 0 10px var(--terminal-scanline-color);
  animation: scanlineScroll 10s linear infinite;
  z-index: 11;
  opacity: 0.4;
}

@keyframes scanlineScroll {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

.terminal-monitor {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: var(--terminal-monitor-bg);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  z-index: 5;
  overflow: hidden;
}

[data-theme="dark"] .terminal-monitor {
  border-color: rgba(255, 255, 255, 0.05);
}

/* RIBBON-STYLE HEADER */
.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 2px solid var(--terminal-border);
  padding: 10px 15px;
}

[data-theme="dark"] .terminal-header {
  background: rgba(255, 255, 255, 0.03);
}

.terminal-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--terminal-accent);
}

.terminal-tabs {
  display: flex;
  gap: 8px;
}

.terminal-tab {
  font-size: 8px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  opacity: 0.6;
}

.terminal-tab--active {
  background: var(--terminal-accent);
  color: white;
  opacity: 1;
}

/* DATA RENDERING */
.terminal-content {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* PILL BADGES MOCKUP */
.hud-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(0,0,0,0.05);
}

[data-theme="dark"] .hud-badge { background: rgba(255,255,255,0.1); }

/* GRID & TABLES */
.terminal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.grid-cell {
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 8px;
  text-align: center;
  border-radius: 8px;
}

[data-theme="dark"] .grid-cell { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.05); }

.cell-val { font-size: 14px; font-weight: 800; line-height: 1.2; }
.cell-sub { font-size: 7px; text-transform: uppercase; opacity: 0.6; margin-top: 2px; }

/* DATA GROUP PROGRESS */
.data-group { display: flex; flex-direction: column; gap: 4px; }
.data-label { font-size: 8px; font-weight: 700; opacity: 0.7; }

.data-bar-bg {
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
  overflow: hidden;
}

[data-theme="dark"] .data-bar-bg { background: rgba(255,255,255,0.1); }

.data-bar-fill {
  height: 100%;
  background: var(--terminal-accent);
  transition: width 1s ease;
}

.data-bar-fill--emerald { background: var(--terminal-accent-alt); }
.data-bar-fill--cyan { background: var(--terminal-accent-cyan); }

/* LOG SCROLLER */
.terminal-logs {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px dashed var(--terminal-border);
  padding-top: 10px;
}

.log-entry { opacity: 0.7; }
.log-entry--accent { color: var(--terminal-accent); font-weight: 700; }

/* RADAR VARIANT */
.terminal-radar {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  position: relative;
  border: 1px solid var(--terminal-border);
  border-radius: 50%;
}

.radar-sweep {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg at 50% 50%, var(--terminal-accent-alt) 0deg, transparent 90deg);
  border-radius: 50%;
  animation: radarSweep 4s linear infinite;
  opacity: 0.3;
}

@keyframes radarSweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* CARD-SPECIFIC TERMINALS (MICRO) */
.card-terminal {
  width: 100%;
  height: 120px;
  background: var(--terminal-monitor-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 12px;
  margin-top: 15px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
}

.card-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.03) 50%);
  background-size: 100% 2px;
  pointer-events: none;
  opacity: 0.5;
}

.card-terminal .term-head {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  font-weight: 800;
  color: var(--terminal-accent);
  margin-bottom: 6px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 4px;
}

[data-theme="dark"] .card-terminal .term-head { border-bottom-color: rgba(255,255,255,0.05); }

.card-terminal .term-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-terminal .term-line {
  font-size: 8px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-terminal .term-line--accent { color: var(--terminal-accent-cyan); font-weight: 700; }

/* FEATURE CARD GRID ADAPTATION */
.feature-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-card p {
  flex: 1;
}
