/* ============================================================
   Grupo Alpha — AI Roadmap  ·  sistema corporativo
   Estilo limpio inspirado en el roadmap de Grupo HEMA,
   con la marca Alpha: rojo #E41B1D + slate, tipografía Archivo.
   ============================================================ */

:root {
  /* Marca */
  --red:        #E41B1D;
  --red-deep:   #B5130F;
  --accent:     #E41B1D;
  --accent-soft: rgba(228,27,29,0.12);

  /* Neutros */
  --ink:        #16222E;
  --muted:      #5A6B7B;
  --line:       #E3E9F0;
  --line-strong:#CDD7E2;
  --surface:    #FFFFFF;
  --surface-2:  #F7F9FC;
  --page:       #EEF2F7;

  /* Slate oscuro (nav / footer / callout) */
  --navy:       #1B2733;
  --navy-700:   #243240;
  --navy-900:   #121A24;

  /* Acentos secundarios */
  --slate:      #384152;
  --amber:      #C2802F;
  --amber-soft: #FBEFD9;

  /* Fases (mirror phases.json) */
  --fase-1:     #C0552E;
  --fase-2:     #2C7A8C;
  --fase-3:     #3E5C97;

  /* Tipografía — Archivo en display y texto */
  --font-display: "Archivo", system-ui, sans-serif;
  --font-text:    "Archivo", system-ui, sans-serif;
  --display: var(--font-display);
  --sans:    var(--font-text);
  --mono:    var(--font-text);

  --radius:    16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,34,54,.06), 0 2px 8px rgba(15,34,54,.05);
  --shadow-md: 0 10px 30px rgba(15,34,54,.12);
  --shadow-lg: 0 24px 60px rgba(15,34,54,.22);
  --maxw: 1180px;

  --z-nav: 50; --z-chat: 70; --z-overlay: 80; --z-panel: 81;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--page);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0 0 .4em; letter-spacing: -0.015em; color: var(--ink); }
p { margin: 0 0 .8em; text-wrap: pretty; }
a { color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scrollbar oculta (el scroll sigue funcionando) */
html { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(40px, 6vw, 64px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }
main { position: relative; z-index: 1; }

.section-head { margin-bottom: 22px; max-width: 760px; }
.eyebrow {
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; display: inline-block;
}
.eyebrow::before { content: none; }   /* sin código mono del HMI anterior */
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 10px 0 0; }
.section-head p { margin: 12px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; max-width: 68ch; }

/* ---------- Navbar (oscuro corporativo) ---------- */
nav.site {
  position: sticky; top: 0; z-index: var(--z-nav);
  display: flex; align-items: center; gap: 6px;
  padding: 0 24px; height: 62px;
  background: rgba(18,26,36,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
nav.site .brand { display: flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; }
nav.site .brand img { height: 30px; width: auto; display: block; filter: brightness(0) invert(1); }
nav.site .brand .tag {
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: #9fb0c0; border-left: 1px solid rgba(255,255,255,.16); padding-left: 12px; line-height: 1.25;
}
nav.site a.nl {
  text-decoration: none; color: #cdd9e5; font-size: .9rem; font-weight: 500;
  padding: 8px 13px; border-radius: 9px; white-space: nowrap;
  transition: background .16s, color .16s;
}
nav.site a.nl:hover { background: rgba(255,255,255,.09); color: #fff; }
nav.site a.nl.active { color: #fff; background: rgba(228,27,29,.92); }
nav.site #logoutBtn {
  margin-left: 8px; font-family: var(--font-text); font-size: .82rem; font-weight: 500;
  cursor: pointer; background: none; color: #cdd9e5;
  border: 1px solid rgba(255,255,255,.18); padding: 7px 14px; border-radius: 9px;
  transition: all .16s;
}
nav.site #logoutBtn:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (max-width: 900px) {
  nav.site { gap: 0; overflow-x: auto; height: 58px; }
  nav.site .brand .tag { display: none; }
  nav.site a.nl { padding: 7px 10px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 1px solid transparent;
  padding: 12px 22px; border-radius: 11px; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none; font-family: var(--font-text);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-red { background: var(--accent); color: #fff; }
.btn-red:hover { background: var(--red-deep); }
.btn-ghost, .btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.qw { background: var(--amber-soft); color: #9a6418; border-color: #f0d9af; }
.chip.qw::before { content: "★"; font-size: 9px; }
.chip.phase { color: #fff; border: none; }
.chip.area { background: var(--accent-soft); color: var(--accent); border: none; }

/* ============================================================
   HERO (roadmap) — slate corporativo con acento de marca
   ============================================================ */
.forge {
  position: relative; overflow: hidden; color: #eef4fa;
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(228,27,29,.30), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(56,65,82,.5), transparent 55%),
    linear-gradient(140deg, var(--navy-900), var(--navy) 60%, var(--navy-700));
}
.forge::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(700px 380px at 70% 20%, #000, transparent 75%);
}
.forge .wrap { position: relative; z-index: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ============================================================
   HOME — video de fondo + tarjeta de acceso
   ============================================================ */
.home-hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.home-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.home-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(1000px 520px at 82% 0%, rgba(228,27,29,.30), transparent 58%),
    linear-gradient(125deg, rgba(15,21,28,.93) 0%, rgba(18,26,36,.82) 46%, rgba(18,26,36,.62) 100%);
}
.home-hero > .wrap { position: relative; z-index: 2; }
.home-hero .wrap { flex: 1; display: grid; grid-template-columns: 1.12fr .88fr; gap: 54px; align-items: center; padding-top: 36px; padding-bottom: 56px; }
.home-brandbar { display: flex; align-items: center; gap: 15px; padding: 26px 0; }
.home-brandbar img { height: 36px; filter: brightness(0) invert(1); }
.home-brandbar .div { width: 1px; height: 24px; background: rgba(255,255,255,.22); }
.home-brandbar .meta { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #b9c6d3; }

.home-copy .kicker { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #ff8a84; display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.home-copy .kicker .ln { height: 2px; width: 42px; background: var(--red); }
.home-copy h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; color: #fff; }
.home-copy h1 em { font-style: normal; color: #ff8a84; }
.home-copy .lede { font-size: 1.1rem; line-height: 1.6; color: #d4dfea; max-width: 32em; margin: 22px 0 0; }
.home-stats { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.home-stats .s { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-sm); padding: 14px 20px; min-width: 120px; }
.home-stats .s .n { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.home-stats .s .l { font-size: .76rem; letter-spacing: .04em; color: #b9c6d3; margin-top: 8px; }

/* Tarjeta de acceso */
.login-card { background: var(--surface); border-radius: var(--radius); padding: 34px 32px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.5); }
.login-card h2 { font-size: 1.55rem; color: var(--ink); }
.login-card .sub { color: var(--muted); font-size: .95rem; margin: 6px 0 22px; }
.login-card label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
.login-card .field { margin-bottom: 4px; }
.login-card input { width: 100%; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 11px; font-family: var(--font-text); font-size: .95rem; color: var(--ink); transition: border .16s, box-shadow .16s; }
.login-card input::placeholder { color: #9fb0bf; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn { width: 100%; margin-top: 22px; }
.login-card #loginError { color: #b14a43; font-size: .86rem; margin: 14px 0 0; background: #fbecea; border: 1px solid #f3d2ce; border-radius: 9px; padding: 10px 13px; }
.login-foot { font-size: .72rem; color: #9fb0bf; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; letter-spacing: .04em; }
.login-foot-logo { height: 16px; width: auto; opacity: .75; }
@media (max-width: 920px) { .home-hero .wrap { grid-template-columns: 1fr; gap: 32px; } }

/* ============================================================
   ROADMAP HERO + KPIs
   ============================================================ */
.rhero { padding: 54px 0 50px; }
.rhero .kicker { font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #ff8a84; margin-bottom: 16px; }
.rhero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; color: #fff; max-width: 18em; letter-spacing: -.02em; }
.rhero h1 em { font-style: normal; color: #ff8a84; }
.rhero .lede { color: #cfddea; font-size: 1.05rem; line-height: 1.6; max-width: 44em; margin: 16px 0 0; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.kpi { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 18px 20px; }
.kpi .n { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; color: #fff; line-height: 1; }
.kpi .l { font-weight: 600; margin-top: 8px; color: #eaf1f8; font-size: .92rem; }
.kpi .d { font-size: .8rem; color: #a9bccd; margin-top: 4px; line-height: 1.45; }
@media (max-width: 820px) { .kpi-row { grid-template-columns: repeat(2,1fr); } }

/* ============================================================
   DIAGNÓSTICO (FODA)
   ============================================================ */
.foda-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.foda { --q: var(--ink); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--q); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.foda.f { --q: #2F8F5B; } .foda.d { --q: var(--red); } .foda.o { --q: #2674B6; } .foda.a { --q: var(--amber); }
.foda .tag { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); margin-bottom: 12px; }
.foda .tag::before { content: attr(data-letter); width: 28px; height: 28px; border-radius: 8px; background: var(--q); color: #fff; display: grid; place-items: center; font-size: .85rem; font-weight: 800; }
.foda h3 { display: none; }
.foda ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foda li { font-size: .92rem; line-height: 1.5; padding-left: 18px; position: relative; color: var(--ink); }
.foda li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 2px; background: var(--q); opacity: .6; }
.madurez { margin-top: 16px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 16px 18px; font-size: .92rem; color: var(--muted); line-height: 1.6; }
.madurez b { color: var(--ink); font-weight: 700; display: block; margin-bottom: 6px; }
@media (max-width: 760px) { .foda-grid { grid-template-columns: 1fr; } }

/* ============================================================
   FASES
   ============================================================ */
.phase-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.phase { --pc: var(--accent); position: relative; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--pc); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.phase:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.phase.sel { box-shadow: 0 0 0 2px var(--pc), var(--shadow-md); }
.phase .ord { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pc); }
.phase .tf { font-size: .78rem; font-weight: 600; color: var(--ink); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; float: right; }
.phase h3 { font-size: 1.05rem; margin: 12px 0 6px; }
.phase p { font-size: .88rem; color: var(--muted); margin: 0; line-height: 1.5; }
.phase .count { margin-top: 12px; font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--pc); }
@media (max-width: 760px) { .phase-strip { grid-template-columns: 1fr; } }

/* ============================================================
   MATRIZ (SVG)
   ============================================================ */
.matrix-shell { display: grid; grid-template-columns: 1fr 230px; gap: 22px; align-items: stretch; }
.matrix-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px 24px 24px 50px; }
.matrix-svg { width: 100%; height: 460px; display: block; overflow: visible; }
.qw-zone { fill: rgba(194,128,47,.1); stroke: rgba(194,128,47,.5); stroke-dasharray: 4 4; }
.qw-label { font-family: var(--font-text); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; fill: #9a6418; font-weight: 700; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { font-family: var(--font-text); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; fill: var(--muted); font-weight: 600; }
.axis-end { font-family: var(--font-text); font-size: 10px; fill: #9fb0bf; }
.dot { cursor: pointer; transition: transform .15s, opacity .2s; transform-box: fill-box; transform-origin: center; }
.dot circle { stroke: #fff; stroke-width: 2.5; transition: r .15s; filter: drop-shadow(0 2px 4px rgba(15,34,54,.2)); }
.dot text { font-family: var(--font-text); font-size: 10px; font-weight: 700; fill: #fff; pointer-events: none; }
.dot:hover { transform: scale(1.28); }
.dot.dim { opacity: .18; }
.matrix-legend { display: flex; flex-direction: column; gap: 12px; padding: 6px 4px; align-self: center; }
.matrix-legend .lg-title { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.matrix-legend .lg { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--ink); }
.matrix-legend .sw { width: 13px; height: 13px; border-radius: 4px; flex: none; }
.matrix-legend .hint { font-size: .78rem; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 820px) { .matrix-shell { grid-template-columns: 1fr; } .matrix-box { padding-left: 44px; } }

/* ============================================================
   FILTROS + TARJETAS DE INICIATIVAS
   ============================================================ */
.filterbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 20px; }
.fchip { font-family: var(--font-text); font-size: .82rem; font-weight: 500; cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); transition: all .15s; }
.fchip:hover { border-color: var(--muted); color: var(--ink); }
.fchip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.fchip.qw.active { background: var(--amber); border-color: var(--amber); color: #fff; }
.fchip.clear { color: var(--accent); background: var(--accent-soft); border: none; margin-left: auto; }
.fchip.clear[hidden] { display: none; }

.init-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.icard { --pc: var(--accent); display: flex; flex-direction: column; text-align: left; cursor: pointer; font-family: inherit; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--pc); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.icard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.icard .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.icard .id { font-family: var(--font-display); font-weight: 700; font-size: .76rem; color: var(--muted); }
.icard .area { font-size: .7rem; letter-spacing: .03em; color: var(--muted); text-transform: uppercase; text-align: right; max-width: 56%; }
.icard h3 { font-size: 1.04rem; line-height: 1.22; margin: 8px 0 10px; }
.icard p { font-size: .88rem; color: var(--muted); margin: 0 0 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.icard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.icard .ie { margin-left: auto; font-size: .76rem; color: var(--muted); display: flex; gap: 10px; }
.icard .ie b { color: var(--ink); font-family: var(--font-display); }
.icard[hidden] { display: none; }
.grid-empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 44px; font-size: .9rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
@media (max-width: 600px) { .init-grid { grid-template-columns: 1fr; } }

/* Agrupación por fase (iniciativas) */
.phase-group { margin-bottom: 40px; }
.phase-group .ph-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.phase-group .ph-dot { width: 5px; height: 26px; border-radius: 3px; flex: none; }
.phase-group .ph-head h2 { font-size: 1.25rem; margin: 0; }
.phase-group .ph-head .tf { font-size: .82rem; color: var(--muted); margin-left: auto; }

/* ============================================================
   PANEL DE DETALLE
   ============================================================ */
.ov { position: fixed; inset: 0; z-index: var(--z-overlay); background: rgba(12,24,38,.5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.ov.open { opacity: 1; pointer-events: auto; }
.panel { --pc: var(--accent); position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-panel); width: min(490px, 94vw); background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(102%); transition: transform .28s cubic-bezier(.16,.84,.44,1); display: flex; flex-direction: column; overflow: hidden; border-left: 6px solid var(--pc); }
.panel.open { transform: none; }
.panel .ph { padding: 22px 26px 16px; border-bottom: 1px solid var(--line); position: relative; }
.panel .ph .x { position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--surface-2); cursor: pointer; font-size: 1.1rem; color: var(--muted); display: grid; place-items: center; transition: all .16s; }
.panel .ph .x:hover { background: var(--line); color: var(--ink); }
.panel .ph .pid { font-family: var(--font-display); font-weight: 700; font-size: .8rem; color: var(--pc); }
.panel .ph h2 { font-size: 1.4rem; margin: 4px 36px 12px 0; line-height: 1.16; }
.panel .ph .chips { display: flex; gap: 7px; flex-wrap: wrap; }
.panel .body { padding: 20px 26px 40px; overflow-y: auto; }
.panel .blk { margin-bottom: 20px; }
.panel .blk > .lbl { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 7px; }
.panel .blk p { margin: 0; font-size: .94rem; line-height: 1.6; color: var(--ink); }
.panel .blk ul { margin: 0; padding-left: 18px; font-size: .92rem; display: grid; gap: 5px; }
.panel .blk li { line-height: 1.5; color: var(--ink); }
.panel .tags { display: flex; gap: 7px; flex-wrap: wrap; }
.panel .syn { display: flex; gap: 7px; flex-wrap: wrap; }
.panel .syn a { font-family: var(--font-display); font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; cursor: pointer; transition: all .15s; }
.panel .syn a:hover { background: var(--accent); color: #fff; }
.panel .syn span.plain { font-size: .8rem; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
@media (max-width: 560px) { .panel .ph, .panel .body { padding-left: 20px; padding-right: 20px; } }

/* ============================================================
   BENCHMARK (radar + tabla)
   ============================================================ */
.radar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.radar-wrap { display: grid; grid-template-columns: 1fr 240px; gap: 20px; align-items: center; }
.radar-wrap svg { width: 100%; height: auto; }
.radar-side .radar-legend-title { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 700; }
.radar-legend { display: flex; flex-direction: column; gap: 8px; }
.radar-chip { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-family: var(--font-text); font-size: .88rem; font-weight: 600; color: var(--muted); text-align: left; transition: all .14s; }
.radar-chip .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; opacity: .35; }
.radar-chip.on { color: var(--ink); border-color: var(--line-strong); background: #fff; box-shadow: var(--shadow-sm); }
.radar-chip.on .sw { opacity: 1; }
.radar-chip:hover { border-color: var(--accent); }

.bench-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.bench-table th, .bench-table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
.bench-table thead th { background: var(--navy); color: #eaf1f8; font-family: var(--font-display); font-weight: 600; font-size: .82rem; }
.bench-table tbody tr:hover { background: var(--surface-2); }
.bench-table .co { font-weight: 700; font-family: var(--font-display); white-space: nowrap; }
.score { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-weight: 700; font-size: .82rem; color: #fff; }
.sw-inline { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.bench-note { color: var(--muted); font-size: .85rem; max-width: 420px; }
.bench-notes { display: grid; gap: 12px; margin-top: 20px; }
.callout, .reco { margin-top: 20px; background: linear-gradient(120deg, var(--accent-soft), transparent); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 18px 22px; }
.callout .lbl, .reco h4 { margin: 0 0 6px; color: var(--accent); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.callout p, .reco p { font-size: 1rem; line-height: 1.6; margin: 0; color: var(--ink); max-width: 64ch; }
@media (max-width: 760px) { .radar-wrap { grid-template-columns: 1fr; } .bench-table { font-size: .82rem; } .bench-table th, .bench-table td { padding: 10px 9px; } }

/* Bar chart (referencias por sector) */
.barchart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px; }
.barchart-title { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 16px; }
.barchart { display: grid; gap: 12px; }
.barrow { display: grid; grid-template-columns: 220px 1fr 34px; align-items: center; gap: 14px; }
.barlabel { font-size: .9rem; font-weight: 600; color: var(--ink); }
.bartrack { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; height: 14px; overflow: hidden; }
.barfill { display: block; height: 100%; min-width: 6px; border-radius: 999px; transition: width .8s cubic-bezier(.22,.61,.36,1); }
.barval { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); text-align: right; }
@media (max-width: 620px) { .barrow { grid-template-columns: 140px 1fr 28px; gap: 10px; } .barlabel { font-size: .8rem; } }

/* Lecturas estratégicas */
.lecturas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lectura { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px 22px; }
.lectura .ln { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 800; font-size: .95rem; margin-bottom: 12px; }
.lectura h3 { font-size: 1.05rem; margin: 0 0 8px; }
.lectura p { font-size: .9rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* ============================================================
   TECNOLOGÍAS (constelación + columnas)
   ============================================================ */
.graph-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.graph-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.graph-legend .lg { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); font-weight: 600; }
.graph-legend .sw { width: 13px; height: 13px; border-radius: 50%; }
.graph-legend .sw-prop { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1.4px dashed var(--muted); color: var(--muted); font-size: 9px; font-weight: 700; }
.graph-legend .lg-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 2px; }
.clear-filter { border: none; background: var(--accent-soft); color: var(--accent); font-weight: 600; border-radius: 999px; padding: 7px 15px; cursor: pointer; font-family: var(--font-text); font-size: .83rem; }
.graph-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; }
.graph-card svg { width: 100%; height: auto; display: block; }
#constellation { touch-action: none; }
#constellation .tech-node, #constellation .hub-node, #constellation .lbl { cursor: grab; }
#constellation.grabbing, #constellation.grabbing * { cursor: grabbing !important; }
.graph-hint { text-align: center; color: var(--muted); font-size: .84rem; margin: 8px 0 4px; }
.cedge { transition: opacity .18s, stroke .18s; }
.cedge.hl { stroke: var(--accent); stroke-width: 2.4; opacity: 1; }
.cedge.dim { opacity: .1; }
.cnode { transition: opacity .18s; }
.cnode.dim { opacity: .2; }
.cnode circle { transition: transform .14s; transform-box: fill-box; transform-origin: center; }
.cnode:hover circle, .cnode.hl-hover circle, .cnode.hl-hover .prop-ring { transform: scale(1.22); }
.cnode.sel circle { stroke-width: 3.5; }
.lbl { fill: var(--ink); font-family: var(--font-text); font-size: 12.5px; font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3.6px; stroke-linejoin: round; transition: font-size .14s, fill .14s; }
.lbl-prop { font-style: italic; }
.lbl.hl-hover { font-size: 14px; font-weight: 700; fill: #0f2236; }
.lbl.dim { opacity: .2; }

.tech-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 36px; }
.tech-col h2 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 16px; }
.tech-col h2 .badge { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; }
.tech-col.actual h2 .badge { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tech-col.propuesta h2 .badge { background: var(--accent-soft); color: var(--accent); }
.tech-list { display: grid; gap: 12px; }
.tech-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 18px; box-shadow: var(--shadow-sm); }
.tech-col.actual .tech-item { border-left: 4px solid var(--muted); }
.tech-col.propuesta .tech-item { border-left: 4px solid var(--accent); }
.tech-item .nm { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.tech-item p { font-size: .88rem; color: var(--muted); margin: 4px 0 8px; line-height: 1.5; }
.tech-item .areas { display: flex; gap: 6px; flex-wrap: wrap; }
.tech-item .areas .chip { font-size: .7rem; padding: 3px 9px; }
@media (max-width: 820px) { .tech-cols { grid-template-columns: 1fr; gap: 28px; } }

/* ============================================================
   SEGUNDO CEREBRO (graph) — pantalla oscura embebida
   ============================================================ */
#sbroot { position: relative; }
.sb-stage { position: relative; background: radial-gradient(120% 120% at 50% -10%, #1d2530 0%, #121a24 70%); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.sb-stage canvas { display: block; width: 100%; height: 620px; cursor: grab; }
.sb-stage canvas:active { cursor: grabbing; }
.sb-legend { position: absolute; left: 18px; top: 18px; display: flex; flex-direction: column; gap: 9px; background: rgba(15,21,28,.78); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 15px 17px; }
.sb-legend .t { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #97a4b2; margin-bottom: 3px; }
.sb-legend .lg { display: flex; align-items: center; gap: 9px; font-size: .8rem; color: #dce3ea; }
.sb-legend .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sb-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 13px 15px; max-width: 280px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.sb-tip.show { opacity: 1; transform: none; }
.sb-tip .tt { font-family: var(--font-display); font-size: .95rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.sb-tip .ty { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.sb-tip .ds { font-size: .82rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.sb-hint { position: absolute; right: 18px; bottom: 16px; font-size: .78rem; color: #97a4b2; }

/* ============================================================
   CHAT
   ============================================================ */
#chatWidget { position: fixed; right: 22px; bottom: 22px; z-index: var(--z-chat); }
#chatToggle { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; background: var(--accent); color: #fff; font-size: 1.4rem; box-shadow: var(--shadow-md); transition: transform .16s; }
#chatToggle:hover { transform: scale(1.06); }
#chatPanel { position: absolute; right: 0; bottom: 70px; width: 350px; max-width: 88vw; height: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; }
#chatPanel[hidden] { display: none; }
#chatPanel::before { content: "Aleph · Asistente del AI Roadmap"; display: block; background: var(--navy); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: .92rem; padding: 13px 16px; }
#chatMessages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; background: var(--surface-2); }
.chat-msg { padding: 9px 13px; border-radius: 13px; font-size: .9rem; max-width: 84%; line-height: 1.5; }
.chat-msg-user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg-bot { background: #fff; color: var(--ink); align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
#chatForm { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
#chatInput { flex: 1; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 10px; font-family: var(--font-text); font-size: .9rem; }
#chatInput:focus { outline: none; border-color: var(--accent); }
#chatForm button { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 0 16px; cursor: pointer; font-weight: 600; font-family: var(--font-text); }
#chatForm button:hover { background: var(--red-deep); }

/* ---------- Footer ---------- */
.site-foot { background: var(--navy-900); color: #9fb3c6; padding: 30px 0; font-size: .85rem; margin-top: 0; }
.site-foot .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-foot img { height: 24px; filter: brightness(0) invert(1); opacity: .8; }
.site-foot .div { width: 1px; height: 22px; background: rgba(255,255,255,.2); }
.site-foot .meta { font-size: .85rem; }
.site-foot .meta b { color: #ff8a84; font-weight: 600; }
.site-foot .right { margin-left: auto; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.site-foot .foot-by { margin-left: auto; display: inline-flex; align-items: center; gap: 9px; font-size: .72rem; letter-spacing: .04em; color: #8a9aab; opacity: .85; }
.site-foot .foot-by img { height: 15px; width: auto; filter: brightness(0) invert(1); opacity: .8; }

/* ---------- Reveal ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s cubic-bezier(.22,.61,.36,1) both; }
.rise-1 { animation-delay: .04s; } .rise-2 { animation-delay: .1s; }
.rise-3 { animation-delay: .16s; } .rise-4 { animation-delay: .22s; } .rise-5 { animation-delay: .28s; }
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .home-video { display: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
