/* ═════════════════════════════════════════════════════════════════════════
   Infinity Nova — Presentación inversores
   Diseño derivado de /presentacion.html (tokens y paleta idénticos).
   ═════════════════════════════════════════════════════════════════════════ */

:root,
[data-theme="dark"] {
  --bg: #070b18;
  --bg2: #0d1428;
  --bg3: #131e3a;
  --text: #e2e8f0;
  --muted: #64748b;
  --muted2: #8892a4;
  --cyan: #06b6d4;
  --cyang: rgba(6, 182, 212, 0.15);
  --purple: #a855f7;
  --purpleg: rgba(168, 85, 247, 0.15);
  --gold: #f59e0b;
  --goldg: rgba(245, 158, 11, 0.15);
  --emerald: #10b981;
  --emeraldg: rgba(16, 185, 129, 0.15);
  --rose: #f43f5e;
  --roseg: rgba(244, 63, 94, 0.15);
  --green: #10b981;
  --red: #ef4444;
  --hdr-bg: rgba(7, 11, 24, 0.92);
  --hdr-border: rgba(6, 182, 212, 0.18);
  --card-bg: rgba(13, 20, 40, 0.8);
  --grid-line: rgba(6, 182, 212, 0.04);
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg2: #ffffff;
  --bg3: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --muted2: #475569;
  --cyan: #0891b2;
  --cyang: rgba(8, 145, 178, 0.12);
  --purple: #9333ea;
  --purpleg: rgba(147, 51, 234, 0.12);
  --gold: #d97706;
  --goldg: rgba(217, 119, 6, 0.12);
  --emerald: #059669;
  --emeraldg: rgba(5, 150, 105, 0.12);
  --rose: #e11d48;
  --roseg: rgba(225, 29, 72, 0.12);
  --hdr-bg: rgba(255, 255, 255, 0.92);
  --hdr-border: rgba(8, 145, 178, 0.2);
  --card-bg: rgba(255, 255, 255, 0.8);
  --grid-line: rgba(8, 145, 178, 0.06);
}

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

html,
body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Oculta scrollbar manteniendo funcionalidad de scroll */
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge legacy */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;              /* Chrome / Safari / Edge */
}

/* Todos los contenedores con overflow propio también sin barra visible */
.docs-sidebar,
.docs-viewer,
#modal-body,
.tabs,
.ct-card pre,
.docs-viewer pre,
#modal-body pre {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.docs-sidebar::-webkit-scrollbar,
.docs-viewer::-webkit-scrollbar,
#modal-body::-webkit-scrollbar,
.tabs::-webkit-scrollbar,
.ct-card pre::-webkit-scrollbar,
.docs-viewer pre::-webkit-scrollbar,
#modal-body pre::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  background: var(--bg);
  position: relative;
}

a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover {
  color: var(--gold);
}

/* Grid animado de fondo */
#grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  animation: gp 40s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes gp {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(56px, 56px);
  }
}

/* ═══════════════ LOGIN ═══════════════ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--hdr-border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
}

.login-eye {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
  text-align: center;
}

.login-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
  text-align: center;
  background: linear-gradient(135deg, #06b6d4 0%, #a855f7 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.login-card input {
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.login-card input:focus {
  border-color: var(--cyan);
}

.login-btn {
  margin-top: 10px;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.3);
}

.login-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.login-footer .dot {
  margin: 0 8px;
}

/* ═══════════════ APP (SPA) ═══════════════ */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Header */

#hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 36px;
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--hdr-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  cursor: pointer;
}
.logo span {
  color: var(--muted);
  font-weight: 600;
}

#hdr-nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: all 0.25s;
  text-transform: uppercase;
}
.nav-btn:hover {
  color: var(--text);
}

.nav-btn.active-innova {
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--cyang);
}
.nav-btn.active-shield {
  color: var(--purple);
  border-color: var(--purple);
  background: var(--purpleg);
}

#hdr-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hdr-user {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.hdr-user b {
  color: var(--text);
  font-weight: 600;
}

.hdr-icon {
  background: transparent;
  border: 1px solid var(--hdr-border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}
.hdr-icon:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ── Landing ── */

.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 36px;
  text-align: center;
  gap: 24px;
}

.landing-eye {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cyan);
}

.landing-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(135deg, #06b6d4 0%, #a855f7 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  max-width: 1000px;
}

.landing-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted2);
  max-width: 700px;
  line-height: 1.5;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  width: 100%;
  max-width: 1000px;
  margin-top: 24px;
}

.landing-card {
  background: var(--card-bg);
  border: 1px solid var(--hdr-border);
  border-radius: 18px;
  padding: 32px 28px;
  cursor: pointer;
  transition:
    transform 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(8px);
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.landing-card.lc-innova:hover {
  border-color: var(--cyan);
  box-shadow: 0 18px 48px rgba(6, 182, 212, 0.25);
}
.landing-card.lc-shield:hover {
  border-color: var(--purple);
  box-shadow: 0 18px 48px rgba(168, 85, 247, 0.25);
}

.lc-icon {
  font-size: 32px;
  margin-bottom: 4px;
}
.landing-card.lc-innova .lc-icon {
  color: var(--cyan);
}
.landing-card.lc-shield .lc-icon {
  color: var(--purple);
}

.lc-code {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.landing-card.lc-innova .lc-code {
  color: var(--cyan);
}
.landing-card.lc-shield .lc-code {
  color: var(--purple);
}

.lc-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
}

.lc-desc {
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.55;
}

.lc-stats {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--hdr-border);
}

.lc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lc-stat b {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}
.landing-card.lc-innova .lc-stat b {
  color: var(--cyan);
}
.landing-card.lc-shield .lc-stat b {
  color: var(--purple);
}
.lc-stat span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Hub (InNova / Shield) ── */

.hub {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 36px 60px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.breadcrumbs a {
  color: var(--muted);
  cursor: pointer;
}
.breadcrumbs a:hover {
  color: var(--cyan);
}
.breadcrumbs .sep {
  color: var(--muted);
  opacity: 0.5;
}
.breadcrumbs .current {
  color: var(--text);
  font-weight: 700;
}

.hub-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  margin-bottom: 6px;
}
.hub-title.innova {
  color: var(--cyan);
}
.hub-title.shield {
  color: var(--purple);
}

.hub-sub {
  font-size: 15px;
  color: var(--muted2);
  margin-bottom: 24px;
  max-width: 800px;
}

/* Tabs */

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--hdr-border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--cyan);
}
.tab.active.p-shield {
  border-bottom-color: var(--purple);
}

/* Subhub grid (cuando Shield está en landing del hub y muestra los 4 productos) */

.subhub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.subhub-card {
  background: var(--card-bg);
  border: 1px solid var(--hdr-border);
  border-radius: 14px;
  padding: 24px 22px;
  cursor: pointer;
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subhub-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.18);
}
.subhub-card .sh-icon {
  font-size: 26px;
  color: var(--purple);
}
.subhub-card h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.subhub-card p {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.5;
}
.subhub-card .sh-count {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

/* Docs list */

.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 820px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
}

.docs-sidebar {
  background: var(--bg2);
  border: 1px solid var(--hdr-border);
  border-radius: 12px;
  padding: 14px;
  max-height: 70vh;
  overflow-y: auto;
  position: sticky;
  top: 80px;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) transparent;
}

.docs-sidebar h4 {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 6px;
  font-weight: 700;
}

.docs-sidebar ul {
  list-style: none;
  padding: 0;
}

.docs-sidebar li a {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--muted2);
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  border-left: 2px solid transparent;
}
.docs-sidebar li a:hover {
  background: var(--bg3);
  color: var(--text);
}
.docs-sidebar li a.active {
  background: var(--cyang);
  color: var(--cyan);
  border-left-color: var(--cyan);
  font-weight: 600;
}

.docs-viewer {
  background: var(--bg2);
  border: 1px solid var(--hdr-border);
  border-radius: 12px;
  padding: 36px 44px;
  min-height: 60vh;
  line-height: 1.65;
  font-size: 14.5px;
  color: var(--muted2);
}

.docs-viewer .placeholder {
  color: var(--muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 14px;
}

.docs-viewer h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}
.docs-viewer h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 24px 0 10px;
  color: var(--cyan);
}
.docs-viewer h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 18px 0 6px;
  color: var(--text);
}
.docs-viewer h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 14px 0 4px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-viewer p {
  margin: 10px 0;
}
.docs-viewer strong {
  color: var(--text);
  font-weight: 700;
}
.docs-viewer em {
  color: var(--muted);
}

.docs-viewer ul,
.docs-viewer ol {
  margin: 10px 0 10px 24px;
}
.docs-viewer li {
  margin: 4px 0;
}

.docs-viewer hr {
  border: none;
  border-top: 1px solid var(--hdr-border);
  margin: 24px 0;
}

.docs-viewer blockquote {
  border-left: 3px solid var(--cyan);
  padding: 10px 16px;
  margin: 14px 0;
  background: var(--cyang);
  color: var(--muted);
  font-style: italic;
  border-radius: 4px;
}

.docs-viewer code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--cyan);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.docs-viewer pre {
  background: var(--bg3);
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.5;
}
.docs-viewer pre code {
  background: transparent;
  padding: 0;
  color: var(--text);
}

.docs-viewer table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 13.5px;
}
.docs-viewer th,
.docs-viewer td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--hdr-border);
}
.docs-viewer th {
  background: var(--bg3);
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}
.docs-viewer tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="light"] .docs-viewer tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.03);
}

/* Shield variant: morado en vez de cyan. */
.docs-viewer.shield h2,
.docs-viewer.shield th {
  color: var(--purple);
}
.docs-viewer.shield blockquote {
  border-left-color: var(--purple);
  background: var(--purpleg);
  color: var(--muted);
}
.docs-viewer.shield code {
  color: var(--purple);
}
.docs-sidebar.shield li a.active {
  background: var(--purpleg);
  color: var(--purple);
  border-left-color: var(--purple);
}

/* Loader */

.loading,
.error {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
}
.error {
  color: var(--red);
}

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--hdr-border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════ SECCIONES (hero de página + zonas) ═══════════════ */

.page-hero {
  padding: 54px clamp(24px, 4vw, 64px) 20px;
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: min(1760px, 96vw);
  margin: 0 auto;
}
.page-hero .eye {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}
.page-hero.shield-hero .eye {
  color: var(--purple);
}

.page-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(135deg, #06b6d4 0%, #a855f7 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.page-hero p {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--muted2);
  max-width: 960px;
  margin: 0 auto;
  line-height: 1.55;
}
.page-hero .hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.page-hero .hero-stat {
  text-align: center;
}
.page-hero .hero-stat b {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: var(--cyan);
  line-height: 1;
}
.page-hero.shield-hero .hero-stat b {
  color: var(--purple);
}
.page-hero .hero-stat span {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.zone {
  padding: 40px clamp(24px, 4vw, 64px) 24px;
  max-width: min(1760px, 96vw);
  margin: 0 auto;
  width: 100%;
}
.zone-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--hdr-border);
  padding-bottom: 12px;
}
.zone-head .zone-code {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.zone-head.c-innova .zone-code {
  color: var(--cyan);
}
.zone-head.c-shield .zone-code {
  color: var(--purple);
}
.zone-head.c-gold .zone-code {
  color: var(--gold);
}
.zone-head h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 900;
  color: var(--text);
}
.zone-head .zone-desc {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  text-align: right;
}

/* ═══════════════ CARDS DE PRODUCTO (ct-card) ═══════════════ */

.ct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}
.ct-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.ct-grid.narrow {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.ct-card {
  background: var(--card-bg);
  border: 1px solid var(--hdr-border);
  border-radius: 14px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(8px);
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.ct-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--cyan);
  opacity: 0.7;
}
.ct-card.c-purple::before {
  background: var(--purple);
}
.ct-card.c-gold::before {
  background: var(--gold);
}
.ct-card.c-emerald::before {
  background: var(--emerald);
}
.ct-card.c-rose::before {
  background: var(--rose);
}

.ct-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.18);
}
.ct-card.c-purple:hover {
  border-color: var(--purple);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.18);
}
.ct-card.c-gold:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.18);
}
.ct-card.c-emerald:hover {
  border-color: var(--emerald);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.18);
}
.ct-card.c-rose:hover {
  border-color: var(--rose);
  box-shadow: 0 12px 32px rgba(244, 63, 94, 0.18);
}

.ct-code {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 800;
}
.ct-card.c-purple .ct-code {
  color: var(--purple);
}
.ct-card.c-gold .ct-code {
  color: var(--gold);
}
.ct-card.c-emerald .ct-code {
  color: var(--emerald);
}
.ct-card.c-rose .ct-code {
  color: var(--rose);
}

.ct-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.ct-subtitle {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.5;
  flex: 1;
}

.ct-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.ct-tag {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--bg3);
  color: var(--muted2);
  border: 1px solid var(--hdr-border);
}

.ct-expand {
  margin-top: 10px;
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid;
  background: transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  border-color: var(--cyan);
  background: var(--cyang);
}
.ct-expand:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.ct-card.c-purple .ct-expand {
  color: var(--purple);
  border-color: var(--purple);
  background: var(--purpleg);
}
.ct-card.c-gold .ct-expand {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--goldg);
}
.ct-card.c-emerald .ct-expand {
  color: var(--emerald);
  border-color: var(--emerald);
  background: var(--emeraldg);
}
.ct-card.c-rose .ct-expand {
  color: var(--rose);
  border-color: var(--rose);
  background: var(--roseg);
}

/* Card destacada (Visión, ML-Service) — ancho completo, con icono grande */
.ct-feature {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 32px;
  align-items: center;
}
@media (max-width: 720px) {
  .ct-feature {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ct-feature .ct-icon {
    margin: 0 auto;
  }
}
.ct-feature .ct-icon {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyang) 0%, var(--purpleg) 100%);
  border: 2px solid var(--hdr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  color: var(--cyan);
}

/* ─── Nova Core animado (P-16 Visión Ejecutiva) ─── */
.ct-feature .ct-icon.nova-core {
  position: relative;
  overflow: hidden;
  font-size: 0;
  animation: nc-breath 5s ease-in-out infinite;
}
.ct-feature .ct-icon.nova-core::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(103, 232, 249, 0.55) 60deg,
    transparent 120deg,
    transparent 240deg,
    rgba(168, 85, 247, 0.45) 300deg,
    transparent 360deg
  );
  filter: blur(6px);
  animation: nc-spin 8s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.ct-feature .ct-icon.nova-core .nova-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}
.nc-halo {
  transform-origin: 50px 50px;
  animation: nc-halo-pulse 3.2s ease-in-out infinite;
}
.nc-ring-1 {
  transform-origin: 50px 50px;
  animation: nc-spin 14s linear infinite;
}
.nc-ring-2 {
  transform-origin: 50px 50px;
  animation: nc-spin 9s linear infinite reverse;
}
.nc-arcs {
  transform-origin: 50px 50px;
  animation: nc-spin 6s linear infinite;
}
.nc-arcs path {
  stroke-dasharray: 90;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 2px rgba(103, 232, 249, 0.85));
}
.nc-bolts {
  transform-origin: 50px 50px;
  animation: nc-bolt-flicker 1.4s steps(8, end) infinite;
  filter: drop-shadow(0 0 1.5px rgba(165, 243, 252, 0.9));
}
.nc-core {
  transform-origin: 50px 50px;
  animation: nc-core-pulse 2.4s ease-in-out infinite;
}
.nc-dot {
  transform-origin: 50px 50px;
  animation: nc-dot-pulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.95));
}
.nc-orbit {
  transform-origin: 50px 50px;
  animation: nc-spin 4s linear infinite;
}
.nc-orbit circle {
  filter: drop-shadow(0 0 3px rgba(103, 232, 249, 0.95));
}
.nc-orbit-rev {
  animation: nc-spin 6.5s linear infinite reverse;
}

@keyframes nc-spin {
  to { transform: rotate(360deg); }
}
@keyframes nc-breath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
  50%      { box-shadow: 0 0 24px 2px rgba(6, 182, 212, 0.35); }
}
@keyframes nc-halo-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.06); }
}
@keyframes nc-core-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
@keyframes nc-dot-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.85; }
  50%      { transform: scale(1.35); opacity: 1; }
}
@keyframes nc-bolt-flicker {
  0%, 14%, 50%, 78%, 100% { opacity: 0.25; }
  6%, 22%, 60%, 86%        { opacity: 1; }
}

/* Respeto de prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .ct-feature .ct-icon.nova-core,
  .ct-feature .ct-icon.nova-core::before,
  .nc-halo, .nc-ring-1, .nc-ring-2, .nc-arcs,
  .nc-bolts, .nc-core, .nc-dot, .nc-orbit {
    animation: none !important;
  }
}

/* ═══ Animación P-15 ML-Service: red neuronal dorada ═══ */
.ct-feature .ct-icon.ml-core {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--goldg) 0%, var(--purpleg) 100%);
  border-color: rgba(245, 158, 11, 0.4);
  font-size: 0;
  animation: ml-card-pulse 5.5s ease-in-out infinite;
}
.ct-feature .ct-icon.ml-core::before {
  content: "";
  position: absolute;
  inset: -25%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(252, 211, 77, 0.18) 70deg,
    transparent 140deg,
    rgba(168, 85, 247, 0.14) 230deg,
    transparent 320deg
  );
  animation: ml-spin 9s linear infinite reverse;
  filter: blur(7px);
  pointer-events: none;
}
.ct-feature .ct-icon.ml-core .ml-svg {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ml-halo {
  transform-origin: 50px 50px;
  animation: ml-halo-pulse 3.6s ease-in-out infinite;
}
.ml-ring-1 {
  transform-origin: 50px 50px;
  animation: ml-spin 16s linear infinite;
}
.ml-ring-2 {
  transform-origin: 50px 50px;
  animation: ml-spin 11s linear infinite reverse;
}

.ml-links {
  animation: ml-links-fade 2.6s ease-in-out infinite;
}

.ml-node {
  transform-origin: center;
  transform-box: fill-box;
  animation: ml-node-pulse 1.8s ease-in-out infinite;
}
.ml-node.n1 { animation-delay: 0s; }
.ml-node.n2 { animation-delay: .25s; }
.ml-node.n3 { animation-delay: .50s; }
.ml-node.n4 { animation-delay: .75s; }
.ml-node.n5 { animation-delay: 1.0s; }
.ml-node.n6 { animation-delay: 1.25s; }

.ml-core-g {
  transform-origin: 50px 50px;
  animation: ml-core-pulse 2.6s ease-in-out infinite;
}
.ml-dot {
  transform-origin: 50px 50px;
  animation: ml-dot-glow 1.8s ease-in-out infinite;
}

.ml-orbit {
  transform-origin: 50px 50px;
  animation: ml-spin 7s linear infinite;
}

@keyframes ml-spin {
  to { transform: rotate(360deg); }
}
@keyframes ml-halo-pulse {
  0%, 100% { transform: scale(1);    opacity: .55; }
  50%      { transform: scale(1.12); opacity: .9;  }
}
@keyframes ml-links-fade {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1;   }
}
@keyframes ml-node-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0 transparent); }
  50%      { transform: scale(1.35); filter: drop-shadow(0 0 4px #fcd34d);   }
}
@keyframes ml-core-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 1px rgba(252,211,77,.5)); }
  50%      { transform: scale(1.06); filter: drop-shadow(0 0 8px rgba(252,211,77,.9)); }
}
@keyframes ml-dot-glow {
  0%, 100% { opacity: 1;  filter: drop-shadow(0 0 2px #fcd34d); }
  50%      { opacity: .6; filter: drop-shadow(0 0 9px #fcd34d); }
}
@keyframes ml-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50%      { box-shadow: 0 0 28px 4px rgba(245, 158, 11, 0.18); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-feature .ct-icon.ml-core,
  .ct-feature .ct-icon.ml-core::before,
  .ml-halo, .ml-ring-1, .ml-ring-2, .ml-links,
  .ml-node, .ml-core-g, .ml-dot, .ml-orbit,
  .ml-packets circle {
    animation: none !important;
  }
  .ml-packets animateMotion { display: none; }
}

/* ═══════════════ MOTORS CONSTELLATION — icono animado M01-M12 (zona InNova 04) ═══════════════ */
/* Identidad: Nova-Core central cyan/púrpura + 12 motores orbitando con paleta
   distintiva. Cada nodo pulsa secuencialmente sugiriendo actividad continua. */

.ct-feature .ct-icon.motors-const {
  background:
    radial-gradient(circle at 50% 50%, rgba(168,85,247,0.20) 0%, rgba(168,85,247,0.06) 35%, transparent 65%),
    linear-gradient(135deg, rgba(34,211,238,0.10), rgba(168,85,247,0.05));
  border: 1px solid rgba(168,85,247,0.35);
  position: relative;
  overflow: hidden;
  animation: mc-card-pulse 4s ease-in-out infinite;
}
.ct-feature .ct-icon.motors-const::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(103,232,249,0.18) 0%, transparent 50%);
  pointer-events: none;
}
.ct-feature .ct-icon.motors-const .mc-svg {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.mc-halo {
  transform-origin: 50px 50px;
  animation: mc-halo-pulse 3.8s ease-in-out infinite;
}
.mc-ring-1 {
  transform-origin: 50px 50px;
  animation: mc-spin 22s linear infinite;
}
.mc-ring-2 {
  transform-origin: 50px 50px;
  animation: mc-spin 14s linear infinite reverse;
}
.mc-orbit {
  transform-origin: 50px 50px;
  animation: mc-spin 30s linear infinite;
}

.mc-node {
  transform-origin: center;
  transform-box: fill-box;
  animation: mc-node-pulse 2.2s ease-in-out infinite;
}
.mc-node.n1  { animation-delay: 0s; }
.mc-node.n2  { animation-delay: .15s; }
.mc-node.n3  { animation-delay: .30s; }
.mc-node.n4  { animation-delay: .45s; }
.mc-node.n5  { animation-delay: .60s; }
.mc-node.n6  { animation-delay: .75s; }
.mc-node.n7  { animation-delay: .90s; }
.mc-node.n8  { animation-delay: 1.05s; }
.mc-node.n9  { animation-delay: 1.20s; }
.mc-node.n10 { animation-delay: 1.35s; }
.mc-node.n11 { animation-delay: 1.50s; }
.mc-node.n12 { animation-delay: 1.65s; }

.mc-core-dot {
  transform-origin: 50px 50px;
  animation: mc-core-glow 1.8s ease-in-out infinite;
}

@keyframes mc-spin {
  to { transform: rotate(360deg); }
}
@keyframes mc-halo-pulse {
  0%, 100% { transform: scale(1);    opacity: .55; }
  50%      { transform: scale(1.10); opacity: .9;  }
}
@keyframes mc-node-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0 transparent); }
  50%      { transform: scale(1.45); filter: drop-shadow(0 0 3px currentColor); }
}
@keyframes mc-core-glow {
  0%, 100% { opacity: 1;  filter: drop-shadow(0 0 2px #67e8f9); }
  50%      { opacity: .7; filter: drop-shadow(0 0 9px #67e8f9); }
}
@keyframes mc-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
  50%      { box-shadow: 0 0 28px 4px rgba(168, 85, 247, 0.20); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-feature .ct-icon.motors-const,
  .ct-feature .ct-icon.motors-const::before,
  .mc-halo, .mc-ring-1, .mc-ring-2, .mc-orbit,
  .mc-node, .mc-core-dot {
    animation: none !important;
  }
}

/* ═══════════════ ENOVA CORE — icono animado P-01 (zona InNova) ═══════════════ */
/* Identidad: cyan/teal (energía + voz IA) — bolt central, ondas de voz, partículas
   orbitales (leads) y halo pulsante. Distinto a Nova Core (cyan/eléctrico)
   y a ML Core (gold/neuronal). */

.ct-feature .ct-icon.enova-core {
  background: linear-gradient(135deg, rgba(6,182,212,0.18), rgba(20,184,166,0.18));
  position: relative;
  overflow: hidden;
  animation: en-card-pulse 5s ease-in-out infinite;
}
.ct-feature .ct-icon.enova-core::before {
  content: '';
  position: absolute; inset: -10%;
  background: conic-gradient(
    from 0deg,
    rgba(6,182,212,.0) 0deg,
    rgba(6,182,212,.35) 90deg,
    rgba(20,184,166,.0) 180deg,
    rgba(20,184,166,.35) 270deg,
    rgba(6,182,212,.0) 360deg
  );
  filter: blur(8px);
  animation: en-spin 11s linear infinite;
  z-index: 0;
  opacity: .8;
}
.ct-feature .ct-icon.enova-core .en-svg {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
}

.en-halo {
  transform-origin: center;
  animation: en-halo-pulse 3.4s ease-in-out infinite;
}
.en-ring { transform-origin: 50px 50px; }
.en-ring-1 { animation: en-spin 18s linear infinite; }
.en-ring-2 { animation: en-spin 12s linear infinite reverse; }

.en-wave {
  stroke-dasharray: 3 4;
  animation: en-wave-dash 2.6s linear infinite;
}
.en-wave.w2 { animation-delay: .4s; }

.en-bolt {
  transform-origin: 50px 50px;
  animation: en-bolt-pulse 1.9s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(6,182,212,.45));
}

.en-orbit { transform-origin: 50px 50px; }
.en-orbit-1 { animation: en-spin 7s linear infinite; }
.en-orbit-2 { animation: en-spin 9s linear infinite reverse; }

@keyframes en-spin { to { transform: rotate(360deg); } }
@keyframes en-halo-pulse {
  0%, 100% { transform: scale(1);     opacity: .55; }
  50%      { transform: scale(1.10);  opacity: 1;   }
}
@keyframes en-wave-dash { to { stroke-dashoffset: -42; } }
@keyframes en-bolt-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 4px rgba(6,182,212,.45)); }
  50%      { transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(103,232,249,.95)); }
}
@keyframes en-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0); }
  50%      { box-shadow: 0 0 28px 4px rgba(6,182,212,0.20); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-feature .ct-icon.enova-core,
  .ct-feature .ct-icon.enova-core::before,
  .en-halo, .en-ring-1, .en-ring-2, .en-wave,
  .en-bolt, .en-orbit-1, .en-orbit-2 {
    animation: none !important;
  }
}

/* ═══════════════ InNova Mobile (P-05) — Featured icon (purple/indigo) ═══════════════ */
.ct-feature .ct-icon.innova-mobile-core {
  background: radial-gradient(circle at 30% 30%, rgba(168,85,247,0.20), rgba(99,102,241,0.10) 60%, transparent 100%);
  border: 1px solid rgba(168,85,247,0.45);
  position: relative;
  animation: im-card-pulse 5s ease-in-out infinite;
}
.ct-feature .ct-icon.innova-mobile-core::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.30), transparent 70%);
  filter: blur(10px);
  animation: im-halo-pulse 3.6s ease-in-out infinite;
  z-index: 0;
}
.ct-feature .ct-icon.innova-mobile-core .im-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.im-halo  { animation: im-halo-pulse 3.4s ease-in-out infinite; transform-origin: 50px 50px; }
.im-ring  { transform-origin: 50px 50px; }
.im-ring-1 { animation: im-spin 18s linear infinite; }
.im-ring-2 { animation: im-spin 12s linear infinite reverse; }
.im-orb   { transform-origin: 50px 50px; animation: im-spin 16s linear infinite; }
.im-orb-2 { animation-delay: -2.66s; }
.im-orb-3 { animation-delay: -5.33s; }
.im-orb-4 { animation-delay: -8.0s;  }
.im-orb-5 { animation-delay: -10.66s;}
.im-orb-6 { animation-delay: -13.33s;}
.im-tab   { transform-origin: 50px 50px; animation: im-tab-float 4s ease-in-out infinite; }
.im-cdot  { animation: im-dot-pulse 1.4s ease-in-out infinite; }

@keyframes im-spin       { to   { transform: rotate(360deg); } }
@keyframes im-halo-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.65; }
  50%      { transform: scale(1.13); opacity: 1;    }
}
@keyframes im-tab-float  {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.5px); }
}
@keyframes im-dot-pulse  {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1;   }
}
@keyframes im-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); }
  50%      { box-shadow: 0 0 28px 4px rgba(168,85,247,0.22); }
}
@media (prefers-reduced-motion: reduce) {
  .ct-feature .ct-icon.innova-mobile-core,
  .ct-feature .ct-icon.innova-mobile-core::before,
  .im-halo, .im-ring, .im-orb, .im-tab, .im-cdot {
    animation: none !important;
  }
}

/* ═══════════════ NSR (P-06) — Featured icon (gold/amber) ═══════════════ */
.ct-feature .ct-icon.nsr-core {
  background: radial-gradient(circle at 30% 30%, rgba(245,158,11,0.22), rgba(217,119,6,0.10) 60%, transparent 100%);
  border: 1px solid rgba(245,158,11,0.45);
  position: relative;
  animation: nsr-card-pulse 5s ease-in-out infinite;
}
.ct-feature .ct-icon.nsr-core::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251,191,36,0.32), transparent 70%);
  filter: blur(10px);
  animation: nsr-halo-pulse 3.6s ease-in-out infinite;
  z-index: 0;
}
.ct-feature .ct-icon.nsr-core .nsr-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.nsr-halo   { animation: nsr-halo-pulse 3.4s ease-in-out infinite; transform-origin: 50px 50px; }
.nsr-gearg  { transform-origin: 50px 50px; animation: nsr-spin 14s linear infinite; }
.nsr-cdot   { animation: nsr-cdot-pulse 1.6s ease-in-out infinite; transform-origin: 50px 50px; }
.nsr-nodes  circle { animation: nsr-node-pulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.nsr-lines  line   { animation: nsr-line-glow 3s ease-in-out infinite; }

@keyframes nsr-spin       { to { transform: rotate(360deg); } }
@keyframes nsr-halo-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%      { transform: scale(1.12); opacity: 1;   }
}
@keyframes nsr-cdot-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
@keyframes nsr-node-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1);    }
  50%      { opacity: 1;    transform: scale(1.18); }
}
@keyframes nsr-line-glow {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.85; }
}
@keyframes nsr-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
  50%      { box-shadow: 0 0 28px 4px rgba(245,158,11,0.22); }
}
@media (prefers-reduced-motion: reduce) {
  .ct-feature .ct-icon.nsr-core,
  .ct-feature .ct-icon.nsr-core::before,
  .nsr-halo, .nsr-gearg, .nsr-cdot, .nsr-nodes circle, .nsr-lines line {
    animation: none !important;
  }
}

.ct-feature .ct-title {
  font-size: 28px;
}
.ct-feature .ct-subtitle {
  font-size: 15px;
}

/* ═══════════════ MODAL (documento completo embebido) ═══════════════ */

#modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 24, 0.88);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  opacity: 0;
  transition: opacity 0.25s;
}
[data-theme="light"] #modal-bg {
  background: rgba(15, 23, 42, 0.55);
}
#modal-bg.visible {
  display: flex;
  opacity: 1;
}

#modal {
  background: var(--bg2);
  border: 1px solid var(--hdr-border);
  border-radius: 14px;
  max-width: min(1400px, 94vw);
  width: 100%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.25s;
}
#modal-bg.visible #modal {
  transform: scale(1);
}

#modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hdr-border);
  flex-shrink: 0;
  gap: 16px;
}
#modal-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#modal.sec-purple #modal-title {
  color: var(--purple);
}
#modal.sec-gold #modal-title {
  color: var(--gold);
}

#modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg3);
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
}
#modal-close:hover {
  background: var(--red);
  color: #fff;
}

#modal-body {
  padding: 32px clamp(28px, 4vw, 64px);
  overflow-y: auto;
  line-height: 1.7;
  font-size: 15px;
  color: var(--muted2);
}
#modal-body h1 {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
#modal-body h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 20px 0 8px;
  color: var(--cyan);
}
#modal.sec-purple #modal-body h2,
#modal.sec-purple #modal-body th {
  color: var(--purple);
}
#modal.sec-gold #modal-body h2,
#modal.sec-gold #modal-body th {
  color: var(--gold);
}

#modal-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 6px;
  color: var(--text);
}
#modal-body p {
  margin: 8px 0;
}
#modal-body strong {
  color: var(--text);
  font-weight: 700;
}
#modal-body em {
  color: var(--muted);
}
#modal-body ul,
#modal-body ol {
  margin: 8px 0 8px 24px;
}
#modal-body li {
  margin: 4px 0;
}
#modal-body hr {
  border: none;
  border-top: 1px solid var(--hdr-border);
  margin: 18px 0;
}
#modal-body blockquote {
  border-left: 3px solid var(--cyan);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--cyang);
  color: var(--muted);
  font-style: italic;
  border-radius: 4px;
}
#modal.sec-purple #modal-body blockquote {
  border-left-color: var(--purple);
  background: var(--purpleg);
}
#modal.sec-gold #modal-body blockquote {
  border-left-color: var(--gold);
  background: var(--goldg);
}
#modal-body code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--cyan);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
#modal.sec-purple #modal-body code {
  color: var(--purple);
}
#modal.sec-gold #modal-body code {
  color: var(--gold);
}
#modal-body pre {
  background: var(--bg3);
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.5;
}
#modal-body pre code {
  background: transparent;
  padding: 0;
  color: var(--text);
}
#modal-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 13px;
}
#modal-body th,
#modal-body td {
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--hdr-border);
}
#modal-body th {
  background: var(--bg3);
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}
#modal-body tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="light"] #modal-body tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.03);
}

/* Footer */

#ftr {
  padding: 24px 36px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--hdr-border);
  text-align: center;
  letter-spacing: 0.06em;
  margin-top: 40px;
}
#ftr span {
  margin: 0 10px;
}
