/* DL Tech · Continuidad: integra las subpáginas de servicios (diseño Tailwind anterior) al diseño del sitio.
   Se carga al final del <head>, después de style.min.css, movil-subpaginas.css y contraste-claro.css.
   1) Tokens del sitio (bloque :root copiado de continuidad/index.html, ámbar como --def), oscuro por defecto
      y claro por preferencia o por [data-theme]; más los colores semánticos que usan estas páginas.
   2) Encabezado, barra de subpáginas y pie del sitio.
   3) Remapeo de las clases de color de Tailwind a los tokens. Los selectores "html body .clase" superan a la
      utilidad base de Tailwind; las variantes :hover, :focus y group-hover se remapean aparte.
   4) Componentes propios de las páginas (tarjetas .glass, líneas de hitos, simulador). */

/* ---------- 1. Tokens (copiados de continuidad/index.html) ---------- */
:root{
  color-scheme: dark;
  --bg:#0A0E12; --bg-2:#0E141A; --surface:#121A21; --line:#1E2A34; --line-2:#2A3a47;
  --ink:#E6EDF0; --muted:#8D9CA7; --faint:#818F9A;
  --def:#F2C66D; --def-soft:rgba(242,198,109,.12);
  --off:#F0A36B; --off-soft:rgba(240,163,107,.12);
  --ok:#7FD4A6; --warn:#F2C66D; --crit:#F2877E;
  --glow:rgba(242,198,109,.18);
  --display:"Anybody", "Arial Narrow", system-ui, sans-serif;
  --body:"Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:"IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r:14px;
  --ease:cubic-bezier(.2,.7,.1,1);
}
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){
    color-scheme: light;
    --bg:#F1F3F2; --bg-2:#E8ECEB; --surface:#FFFFFF; --line:#D5DDDF; --line-2:#BCC8CC;
    --ink:#0D1419; --muted:#4F5E68; --faint:#56646D;
    --def:#8A5A00; --def-soft:rgba(138,90,0,.09);
    --off:#A44C17; --off-soft:rgba(180,84,28,.09);
    --ok:#1E7A4C; --warn:#865C00; --crit:#B3342B;
    --glow:rgba(138,90,0,.12);
  }
}
:root[data-theme="light"]{
  color-scheme: light;
  --bg:#F1F3F2; --bg-2:#E8ECEB; --surface:#FFFFFF; --line:#D5DDDF; --line-2:#BCC8CC;
  --ink:#0D1419; --muted:#4F5E68; --faint:#56646D;
  --def:#8A5A00; --def-soft:rgba(138,90,0,.09);
  --off:#A44C17; --off-soft:rgba(180,84,28,.09);
  --ok:#1E7A4C; --warn:#865C00; --crit:#B3342B;
  --glow:rgba(138,90,0,.12);
}

/* Tokens propios de las subpáginas (no están en la portada): oscuro por defecto */
:root{
  --nav-h:calc(60px + env(safe-area-inset-top,0px));
  --shadow-c:rgba(0,0,0,.5);
  --blue-tx:#93c5fd; --blue-solid:#93c5fd; --blue-solid-hover:#bfdbfe; --on-blue:#0A0E12;
  --blue-50:color-mix(in oklab,#3b82f6 14%,transparent); --blue-200:color-mix(in oklab,#60a5fa 40%,transparent);
  --emerald-50:color-mix(in oklab,#10b981 14%,transparent); --emerald-200:color-mix(in oklab,#10b981 42%,transparent); --emerald-tx:#6ee7b7;
  --red-50:color-mix(in oklab,#ef4444 14%,transparent); --red-200:color-mix(in oklab,#ef4444 42%,transparent); --red-tx:#fca5a5;
  --indigo-tx:#a5b4fc;
  /* Derivados (se recalculan con el tema porque dependen de los tokens base) */
  --ink-2:color-mix(in oklab,var(--ink) 78%,var(--muted));
  --surface-2:color-mix(in oklab,var(--bg-2) 55%,var(--surface));
  --surface-3:color-mix(in oklab,var(--line) 60%,var(--surface));
  --def-hover:color-mix(in oklab,var(--def) 82%,var(--ink));
  --def-5:color-mix(in oklab,var(--def) 6%,transparent);
  --def-10:color-mix(in oklab,var(--def) 12%,transparent);
  --def-line:color-mix(in oklab,var(--def) 32%,transparent);
}
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){
    --shadow-c:rgba(15,23,42,.12);
    --blue-tx:#1d4ed8; --blue-solid:#1d4ed8; --blue-solid-hover:#1e40af; --on-blue:#FFFFFF;
    --blue-50:#eff6ff; --blue-200:#bfdbfe;
    --emerald-50:#ecfdf5; --emerald-200:#a7f3d0; --emerald-tx:#047857;
    --red-50:#fef2f2; --red-200:#fecaca; --red-tx:#b91c1c;
    --indigo-tx:#4338ca;
  }
}
:root[data-theme="light"]{
  --shadow-c:rgba(15,23,42,.12);
  --blue-tx:#1d4ed8; --blue-solid:#1d4ed8; --blue-solid-hover:#1e40af; --on-blue:#FFFFFF;
  --blue-50:#eff6ff; --blue-200:#bfdbfe;
  --emerald-50:#ecfdf5; --emerald-200:#a7f3d0; --emerald-tx:#047857;
  --red-50:#fef2f2; --red-200:#fecaca; --red-tx:#b91c1c;
  --indigo-tx:#4338ca;
}

/* ---------- Base ---------- */
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--nav-h) + 72px)}
html body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--body);-webkit-font-smoothing:antialiased;overflow-x:hidden}
html body .font-sans{font-family:var(--body)}
html body .font-mono{font-family:var(--mono)}
h1,h2,h3,h4{font-family:var(--display);text-wrap:balance}
h1,h2,h3{letter-spacing:-.01em}
h4.font-mono{font-family:var(--mono)}
h1{font-stretch:112%}
/* Títulos: sin cursiva ni mayúsculas forzadas y con el peso de la portada; las etiquetas mono conservan sus mayúsculas */
:is(h1,h2,h3,h4).italic{font-style:normal}
:is(h1,h2,h3,h4).uppercase:not(.font-mono){text-transform:none}
:is(h1,h2,h3,h4):is(.font-black,.font-extrabold,.font-bold){font-weight:600}
:is(h1,h2,h3).tracking-tighter,:is(h1,h2,h3,h4).tracking-tight{letter-spacing:-.01em}
::selection{background:var(--def);color:var(--bg)}
html body :focus-visible{outline:2px solid var(--def)!important;outline-offset:3px}
html body ::placeholder{color:var(--faint);opacity:1}
html body input,html body select,html body textarea{accent-color:var(--def)}
.wrap{max-width:1180px;margin:0 auto;padding-inline:clamp(16px,4vw,40px)}
/* Etiquetas de 9 px: ilegibles; se llevan a 10,5 px */
html body .text-\[9px\]{font-size:10.5px}

/* ---------- 2a. Encabezado del sitio (copiado de continuidad/index.html y riesgo) ---------- */
.nav{position:fixed;top:0;left:0;right:0;z-index:40;padding-top:env(safe-area-inset-top,0px);
  background:color-mix(in oklab,var(--bg) 78%,transparent);backdrop-filter:blur(14px) saturate(1.2);-webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid transparent;transition:border-color .3s}
.nav.scrolled{border-bottom-color:var(--line)}
.nav .wrap{display:flex;align-items:center;justify-content:space-between;height:60px;gap:16px}
.nav .brand{display:flex;align-items:center;gap:10px;min-width:0}
.nav .logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-family:var(--display);font-stretch:140%;font-weight:600;font-size:17px;letter-spacing:.02em;white-space:nowrap;flex:none}
.nav .logo svg{flex:none;display:block}
.nav .sub{font-family:var(--mono);font-size:12.5px;color:var(--def);letter-spacing:.04em;white-space:nowrap}
.nav-links{display:flex;gap:4px;align-items:center}
.nav-links a{text-decoration:none;color:var(--muted);font-size:14px;padding:8px 12px;border-radius:999px;transition:color .2s,background .2s;white-space:nowrap}
.nav-links a:hover,.nav-links a.on{color:var(--ink);background:var(--def-soft)}
.nav-links a.home{font-family:var(--mono);font-size:12.5px}
.nav-right{display:flex;gap:8px;align-items:center}
.icon-btn{width:36px;height:36px;border-radius:999px;border:1px solid var(--line);background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;transition:color .2s,border-color .2s;flex:none}
.icon-btn:hover{color:var(--ink);border-color:var(--line-2)}
.nav .btn{display:inline-flex;align-items:center;gap:10px;font:500 14px/1 var(--body);text-decoration:none;padding:13px 18px;border-radius:999px;border:1px solid var(--line-2);color:var(--ink);background:transparent;cursor:pointer;transition:transform .25s var(--ease),background .25s,border-color .25s;white-space:nowrap}
.nav .btn:hover{transform:translateY(-1px);border-color:var(--def)}
.nav .btn.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.nav .btn.primary:hover{background:var(--def);border-color:var(--def)}
.nav .btn .arr{transition:transform .25s var(--ease)}
.nav .btn:hover .arr{transform:translateX(3px)}
.back-s{display:none;font-family:var(--mono);font-size:12px;color:var(--muted);text-decoration:none;white-space:nowrap;padding:10px 4px}
@media (max-width:1020px){.nav-links{display:none}.back-s{display:inline}}
@media (max-width:460px){.nav-right .btn{display:none}}
@media (min-width:901px) and (max-width:1320px){.nav-links{gap:0}.nav-links a{padding-inline:9px;font-size:13.5px}}
@media (max-width:420px){.nav .sub{display:none}}

/* Selector de tema con etiqueta e iconos (igual que la capa común de la portada) */
#themeBtn.dlt-theme{width:auto;padding:0 12px 0 10px;gap:8px;display:inline-flex;align-items:center;font:500 12.5px/1 var(--body)}
#themeBtn.dlt-theme .dlt-ico{position:relative;width:16px;height:16px;display:inline-block}
#themeBtn.dlt-theme .dlt-ico svg{position:absolute;inset:0;display:block;transition:opacity .45s,transform .6s var(--ease)}
#themeBtn.dlt-theme[data-now="dark"] .dlt-sun{opacity:0;transform:rotate(-90deg) scale(.6)}
#themeBtn.dlt-theme[data-now="light"] .dlt-moon{opacity:0;transform:rotate(90deg) scale(.6)}
@media (max-width:520px){#themeBtn.dlt-theme .dlt-lbl{display:none}#themeBtn.dlt-theme{padding:0;width:40px;height:40px;justify-content:center}}

/* ---------- 2b. Barra de subpáginas de la sección ---------- */
.phases{position:sticky;top:var(--nav-h);margin-top:var(--nav-h);z-index:35;
  background:color-mix(in oklab,var(--bg) 86%,transparent);backdrop-filter:blur(14px) saturate(1.2);-webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.phases-in{position:relative;display:flex;gap:4px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;
  max-width:1180px;margin:0 auto;padding:6px clamp(16px,4vw,40px)}
.phases-in::-webkit-scrollbar{display:none}
.phases-in>a:first-child{margin-left:auto}
.phases-in>a:last-child{margin-right:auto}
.phases a{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border-radius:999px;border:1px solid transparent;
  color:var(--muted);text-decoration:none;font:500 14px/1 var(--body);white-space:nowrap;transition:color .2s,background .2s,border-color .2s}
.phases a:hover{color:var(--ink);background:var(--def-soft)}
.phases a[aria-current="page"]{color:var(--ink);background:var(--def-soft);border-color:color-mix(in oklab,var(--def) 50%,transparent)}
/* Enlace a la portada de la sección, separado de las subpáginas */
.phases a.home{font-family:var(--mono);font-size:12.5px;gap:6px;position:relative;margin-right:10px}
.phases a.home::after{content:"";position:absolute;right:-8px;top:12px;bottom:12px;width:1px;background:var(--line-2)}

/* ---------- 2c. Pie del sitio (copiado de continuidad/index.html) ---------- */
footer.site{margin-top:48px;padding-block:48px calc(40px + env(safe-area-inset-bottom,0px));color:var(--faint);font-size:13px;font-family:var(--body)}
footer.site .wrap{display:flex;flex-wrap:wrap;gap:16px 32px;justify-content:space-between;border-top:1px solid var(--line);padding-top:28px}
footer.site a{color:var(--muted);text-decoration:none}
footer.site a:hover{color:var(--ink)}

/* ---------- 3. Remapeo de clases de Tailwind ---------- */
/* Fondos neutros */
html body .bg-white,html body .focus\:bg-white:focus{background-color:var(--surface)}
html body .bg-slate-50,html body .bg-slate-50\/50{background-color:var(--surface-2)}
html body .bg-slate-100{background-color:var(--surface-3)}
html body .bg-slate-200{background-color:var(--line)}
/* Recuadro de ejemplo del BIA (era un panel negro fijo) */
html body .bg-slate-900{background-color:var(--surface-2)}
/* Fichas y botones oscuros con texto blanco: se invierten con el tema */
html body .bg-slate-900.text-white{background-color:var(--ink);color:var(--bg)}
html body .bg-slate-900.text-white.hover\:bg-slate-800:hover{background-color:var(--def);color:var(--bg)}

/* Textos neutros */
html body .text-slate-900,html body .text-slate-800{color:var(--ink)}
html body .text-slate-600{color:var(--ink-2)}
html body .text-slate-500,html body .text-slate-300{color:var(--muted)}
html body .text-slate-400{color:var(--faint)}

/* Bordes neutros */
html body .border-slate-100{border-color:color-mix(in oklab,var(--line) 75%,transparent)}
html body .border-slate-200,html body .border-slate-200\/60,html body .border-slate-200\/80,html body .border-slate-800{border-color:var(--line)}
html body .border-slate-300{border-color:var(--line-2)}

/* Ámbar: es el color de la sección, pasa a --def */
html body .text-amber-400,html body .text-amber-500,html body .text-amber-600{color:var(--def)}
html body .bg-amber-500\/5{background-color:var(--def-5)}
html body .bg-amber-500\/10,html body .bg-amber-50{background-color:var(--def-10)}
/* Números ámbar sobre doble tinte ámbar (fases del BCP): en claro no llegaban a 4,5:1; se acercan a --ink */
html body .bg-amber-500\/10.text-amber-600{color:color-mix(in oklab,var(--def) 78%,var(--ink))}
html body .bg-amber-500{background-color:var(--def)}
html body .bg-amber-500.text-slate-950{color:var(--bg)}
html body .hover\:bg-amber-400:hover{background-color:var(--def-hover)}
html body .border-amber-100,html body .border-amber-500\/10,html body .border-amber-500\/20{border-color:var(--def-line)}
html body .focus\:border-amber-500:focus{border-color:var(--def)}

/* Azul (página DRP: infraestructura TI) */
html body .text-blue-500,html body .text-blue-600,html body .group:hover .group-hover\:text-blue-600{color:var(--blue-tx)}
html body .bg-blue-500\/\[0\.02\]{background-color:color-mix(in srgb,var(--blue-50) 35%,transparent)}
html body .bg-blue-500\/5{background-color:color-mix(in srgb,var(--blue-50) 55%,transparent)}
html body .bg-blue-500\/10,html body .bg-blue-50,html body .group:hover .group-hover\:bg-blue-50{background-color:var(--blue-50)}
html body .bg-blue-500,html body .bg-blue-600,html body .group:hover .group-hover\:bg-blue-500{background-color:var(--blue-solid)}
html body .bg-blue-500.text-white,html body .bg-blue-600.text-white,html body .group:hover .group-hover\:text-white{color:var(--on-blue)}
html body .bg-blue-500.hover\:bg-blue-400:hover{background-color:var(--blue-solid-hover)}
html body .border-blue-100,html body .border-blue-500\/10,html body .border-blue-500\/20,html body .group:hover .group-hover\:border-blue-100{border-color:var(--blue-200)}
html body .group:hover .group-hover\:border-blue-400{border-color:var(--blue-solid)}
html body .hover\:border-blue-500\/30:hover,html body .hover\:border-blue-500\/40:hover{border-color:color-mix(in oklab,var(--blue-tx) 55%,var(--line))}
html body .from-blue-500{--tw-gradient-from:var(--blue-tx) var(--tw-gradient-from-position);--tw-gradient-to:transparent var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}
html body .to-emerald-500{--tw-gradient-to:var(--emerald-tx) var(--tw-gradient-to-position)}

/* Otros semánticos */
html body .text-emerald-400,html body .text-emerald-500,html body .text-emerald-600{color:var(--emerald-tx)}
html body .bg-emerald-50,html body .bg-emerald-500\/10{background-color:var(--emerald-50)}
html body .border-emerald-100,html body .border-emerald-500\/20{border-color:var(--emerald-200)}
html body .text-red-500{color:var(--red-tx)}
html body .bg-red-50{background-color:var(--red-50)}
html body .border-red-100{border-color:var(--red-200)}
html body .text-indigo-500{color:var(--indigo-tx)}

/* Sombras suaves que se ven en ambos temas */
html body .shadow-sm{--tw-shadow:0 1px 2px 0 var(--shadow-c)}
html body .shadow-md,html body .shadow-lg,html body .hover\:shadow-lg:hover{--tw-shadow:0 14px 34px -20px var(--shadow-c)}
html body .shadow-amber-500\/20,html body .shadow-blue-500\/20,html body .hover\:shadow-slate-100:hover,html body .hover\:shadow-blue-500\/\[0\.02\]:hover{--tw-shadow-color:var(--shadow-c)}

/* Halos decorativos detrás de las imágenes (los valores arbitrarios no están en style.min.css) */
html body .blur-\[120px\]{filter:blur(120px)}
html body .blur-\[60px\]{filter:blur(60px)}
html body .rounded-\[3rem\]{border-radius:24px}

/* ---------- 4. Componentes de las páginas ---------- */
/* Tarjetas: antes blanco fijo; ahora superficie del tema. Los fondos de color de Tailwind (html body .x) la superan */
.glass{background:var(--surface);border:1px solid var(--line);border-radius:20px;box-shadow:0 1px 3px var(--shadow-c)}
/* Líneas de hitos con punto (BCP, ISO 22301 en ámbar; DRP en azul) */
.bcp-node,.iso-node,.architecture-node{border-left:2px solid var(--def);padding-left:1.5rem;margin-bottom:2rem;position:relative}
.bcp-node::before,.iso-node::before,.architecture-node::before{content:"";position:absolute;left:-5px;top:0;width:8px;height:8px;background:var(--def);border-radius:50%}
.architecture-node{border-left-color:var(--blue-tx)}
.architecture-node::before{background:var(--blue-tx)}

/* Simulador: campos con el tema, deslizador visible y montos con cifras tabulares */
#revenue,#employees,#criticality{color:var(--ink)}
#criticality option{background:var(--surface);color:var(--ink)}
#total-loss,#revenue-loss,#productivity-loss{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
input[type="range"]#hours{height:8px;background:var(--line);border-radius:999px}
input[type="range"]#hours::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:22px;height:22px;border-radius:50%;background:var(--def);border:3px solid var(--surface);box-shadow:0 0 0 1px var(--def);cursor:pointer}
input[type="range"]#hours::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:var(--def);border:3px solid var(--surface);box-shadow:0 0 0 1px var(--def);cursor:pointer}
@media (max-width:480px){#total-loss{font-size:2rem;line-height:2.4rem}#criticality{font-family:var(--body);font-size:13px;padding-inline:12px}}

/* DRP: títulos con icono; en celular el título ocupa varias líneas y el icono queda arriba, no al centro */
@media (max-width:640px){h3.flex.items-center>svg{align-self:flex-start;margin-top:.3em;flex:none}}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
  .nav .btn:hover{transform:none}
}
