/* ROB-IT · estilos del sitio público (portados de src/styles/global.css del prototipo) */
@font-face { font-family: 'Sora Variable'; font-style: normal; font-display: swap; font-weight: 100 800; src: url(../fonts/sora-latin-wght.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/plex-sans-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-display: swap; font-weight: 500; src: url(../fonts/plex-sans-500.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url(../fonts/plex-sans-600.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/plex-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url(../fonts/plex-mono-500.woff2) format('woff2'); }

/* Concepto: "bitácora de ejecución" — sitio claro y técnico, bandas navy para resultados,
   numerales grandes en Sora, datos y registros en mono. Un solo acento (azul Rob-iT). */
:root {
  color-scheme: light;
  /* Color */
  --ink: #0c1433;          /* texto principal */
  --ink-2: #3c4a63;        /* texto secundario */
  --muted: #627086;        /* notas, metadatos (WCAG AA 4.6:1 sobre --paper) */
  --navy: #080d3a;         /* bandas oscuras (azul marino de la marca) */
  --navy-2: #121a52;
  --blue: #0079c1;         /* azul Rob-iT (acento) */
  --blue-dk: #005e97;
  --sky: #4cbfef;          /* acento sobre fondos oscuros */
  --steel: #c3cdd8;        /* tono metálico: líneas y marcos */
  --steel-lt: #e4e9ef;
  --paper: #f4f6f9;        /* fondo de sección alterna, gris azulado */
  --white: #ffffff;
  --ok: #1a855b;
  --warn: #9a661a;
  --warn-bg: #fff7e8;
  /* Tipografía */
  --f-display: 'Sora Variable', 'Sora', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --t-xs: 0.8125rem; --t-sm: 0.9375rem; --t-md: 1.0625rem; --t-lg: 1.25rem;
  --t-xl: 1.625rem; --t-2xl: clamp(1.875rem, 3.4vw, 2.5rem); --t-3xl: clamp(2.125rem, 4.2vw, 3.25rem);
  /* Layout */
  --wrap: 1180px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --shadow: 0 1px 2px rgba(8, 13, 58, .06), 0 8px 24px -12px rgba(8, 13, 58, .18);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--f-body); font-size: var(--t-md); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--navy); color: var(--white); padding: 10px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

.wrap {
  width: 100%; max-width: calc(var(--wrap) + 64px); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px), 4vw);
  padding-right: max(16px, env(safe-area-inset-right, 0px), 4vw);
}
@media (min-width: 1300px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

.section { padding-block: clamp(64px, 9vw, 112px); }
.section--paper { background: var(--paper); }
.section--navy { background: var(--navy); color: #d6deea; }
.section--navy h2, .section--navy h3 { color: var(--white); }

.eyebrow {
  font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.section--navy .eyebrow { color: var(--sky); }
.section-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: var(--t-2xl); font-weight: 600; }
.section-head p { color: var(--ink-2); font-size: var(--t-lg); line-height: 1.5; max-width: 62ch; }
.section--navy .section-head p { color: #b8c4d6; }
.section-head--split { max-width: none; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
@media (max-width: 760px) { .section-head--split { grid-template-columns: 1fr; } }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: var(--t-sm); text-decoration: none;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-dk); }
.btn--ghost { border-color: var(--steel); color: var(--ink); background: var(--white); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--light { background: var(--white); color: var(--navy); }
.btn--light:hover { background: var(--steel-lt); }
.btn--outline-light { border-color: rgba(255,255,255,.35); color: var(--white); }
.btn--outline-light:hover { border-color: var(--white); }
.btn--wa { background: #1a7f4d; color: var(--white); } /* 5:1 con texto blanco (WCAG AA) */
.btn--wa:hover { background: #145f3a; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Etiquetas */
.tag { font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--steel); color: var(--ink-2); background: var(--white); white-space: nowrap; }
.tag--blue { border-color: rgba(0,121,193,.3); color: var(--blue-dk); background: #eef6fc; }
.pill-ok { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ok); }
.pill-ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-dev { color: var(--warn); }
.badge-ejemplo {
  display: inline-block; justify-self: start; width: fit-content; font-family: var(--f-mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--warn); background: var(--warn-bg); border: 1px dashed var(--warn); padding: 2px 8px; border-radius: 4px;
}

/* ───────── Header ───────── */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--steel-lt); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand img { height: 34px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500; }
.nav a:not(.btn):hover { color: var(--blue); }
.nav .btn { min-height: 42px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--steel); border-radius: var(--r-sm); width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }
@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--steel-lt); box-shadow: var(--shadow);
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px));
  }
  .nav:not(.is-open) { display: none; }
  .nav a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--steel-lt); font-size: var(--t-md); }
  .nav .btn { margin-top: 16px; }
}

/* ───────── Hero ───────── */
.hero { position: relative; overflow: hidden; padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 104px); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--steel-lt) 1px, transparent 1px), linear-gradient(90deg, var(--steel-lt) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 70% 80% at 85% 30%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 30%, #000 10%, transparent 70%); opacity: .7;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(36px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 24px; min-width: 0; }
.hero h1 { font-size: var(--t-3xl); font-weight: 600; letter-spacing: -0.025em; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero-sub { font-size: var(--t-lg); color: var(--ink-2); max-width: 56ch; line-height: 1.55; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-proof { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 8px; font-size: var(--t-xs); color: var(--muted); }
.hero-proof strong { font-family: var(--f-mono); font-weight: 500; color: var(--ink-2); letter-spacing: .02em; }
.hero-proof { border-top: 1px solid var(--steel-lt); padding-top: 18px; margin-top: 4px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }

/* Bitácora de ejecución (visual del hero) */
.runlog { background: var(--navy); color: #c9d4e5; border-radius: var(--r-lg); box-shadow: 0 30px 60px -30px rgba(8,13,58,.55); overflow: hidden; font-family: var(--f-mono); font-size: 0.8125rem; min-width: 0; border: 1px solid #1d2766; }
.runlog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #1d2766; background: var(--navy-2); }
.runlog-head .bot { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 500; min-width: 0; }
.runlog-head .bot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.runlog-head .ilus { font-size: 0.6875rem; color: #8090ad; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.runlog ol { list-style: none; margin: 0; padding: 10px 0; }
.runlog li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 7px 18px; line-height: 1.45; border-left: 2px solid transparent; transition: background .4s, border-color .4s; }
.runlog li time { color: #6e7fa0; font-variant-numeric: tabular-nums; }
.runlog li .ok { color: #34d399; }
.runlog li .ai { color: var(--sky); }
.runlog li .rev { color: #f5b454; }
.runlog li.is-active { background: rgba(76,191,239,.08); border-left-color: var(--sky); }
.runlog-foot { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #1d2766; }
.runlog-foot div { padding: 14px 18px; display: grid; gap: 2px; }
.runlog-foot div + div { border-left: 1px solid #1d2766; }
.runlog-foot b { font-family: var(--f-display); font-size: 1.375rem; color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }
.runlog-foot small { font-size: 0.6875rem; color: #8090ad; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 480px) { .runlog li { grid-template-columns: 1fr auto; } .runlog li time { display: none; } .runlog-foot b { font-size: 1.125rem; } }

/* ───────── Resultados ───────── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #222b6a; }
.stat { padding: 28px 24px 30px 0; display: grid; gap: 10px; align-content: start; min-width: 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid #222b6a; }
.stat-num { font-family: var(--f-display); font-weight: 600; font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 1; color: var(--white); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-num .pre, .stat-num .suf { color: var(--sky); }
.stat-label { font-weight: 600; color: var(--white); font-size: var(--t-md); }
.stat-desc { font-size: var(--t-sm); color: #9aa8bf; line-height: 1.5; }
.stat--pendiente .stat-num { color: #5c6a8c; }
.stat--pendiente { position: relative; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(3) { padding-left: 0; border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid #222b6a; } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .stat + .stat { padding-left: 0; border-left: 0; border-top: 1px solid #222b6a; } }

.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 48px; align-items: start; }
.chart { background: var(--navy-2); border: 1px solid #222b6a; border-radius: var(--r-md); padding: 22px 24px; min-width: 0; }
.chart h3 { font-size: var(--t-sm); font-weight: 600; margin-bottom: 4px; }
.chart > p { font-size: var(--t-xs); color: #8090ad; margin-bottom: 18px; }
.bars { list-style: none; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2ch; align-items: center; gap: 12px; font-size: var(--t-xs); color: #c9d4e5; }
.bars .track { display: block; height: 8px; background: #1b2463; border-radius: 4px; overflow: hidden; }
.bars .fill { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: 4px; transform-origin: left; }
.bars b { font-family: var(--f-mono); color: var(--white); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .charts { grid-template-columns: 1fr; } .bars li { grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) 2ch; } }

/* ───────── Servicios ───────── */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--steel-lt); border-left: 1px solid var(--steel-lt); }
.service { padding: 32px 28px 36px; border-right: 1px solid var(--steel-lt); border-bottom: 1px solid var(--steel-lt); display: grid; gap: 14px; align-content: start; transition: background .25s; min-width: 0; }
.service:hover { background: var(--paper); }
.service .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: var(--blue); background: linear-gradient(145deg, #ffffff, #e6ecf2); border: 1px solid var(--steel); }
.service .ico svg { width: 24px; height: 24px; }
.service h3 { font-size: var(--t-lg); font-weight: 600; }
.service p { color: var(--ink-2); font-size: var(--t-sm); }
.service .benefit { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--blue-dk); display: flex; gap: 8px; align-items: baseline; }
.service .benefit::before { content: "→"; }
@media (max-width: 900px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .services { grid-template-columns: 1fr; } }

.platforms { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.platforms > .lbl { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 8px; }

/* ───────── Proyectos ───────── */
.filters { display: grid; gap: 14px; margin-bottom: 32px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-row > span { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; min-width: 9ch; }
.chip { border: 1px solid var(--steel); background: var(--white); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-size: var(--t-xs); font-weight: 500; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.result-count { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); }

.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 14px; padding: 24px; background: var(--white); border: 1px solid var(--steel-lt);
  border-radius: var(--r-lg); text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s, transform .2s; min-width: 0;
}
.project:hover { border-color: var(--steel); box-shadow: var(--shadow); transform: translateY(-2px); }
.project-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.project h2, .project h3 { font-size: 1.1875rem; font-weight: 600; }
.project .client { font-size: var(--t-xs); color: var(--muted); margin-top: 6px; }
.project .sum { font-size: var(--t-sm); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.project-metric { display: flex; align-items: baseline; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--steel); flex-wrap: wrap; }
.project-metric b { font-family: var(--f-display); font-size: 1.75rem; font-weight: 600; color: var(--blue); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.project-metric span { font-size: var(--t-xs); color: var(--ink-2); }
.project-hours { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ok); }
.project-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.project-foot .techs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.project-foot .more { font-size: var(--t-xs); font-weight: 600; color: var(--blue); white-space: nowrap; }
.project[hidden] { display: none; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--steel); border-radius: var(--r-lg); }
@media (max-width: 1000px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .projects { grid-template-columns: 1fr; } }

/* ───────── Clientes ───────── */
.logos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--steel-lt); border-left: 1px solid var(--steel-lt); background: var(--white); }
.logo-tile { aspect-ratio: 3 / 2; display: grid; place-items: center; padding: 18px 22px; border-right: 1px solid var(--steel-lt); border-bottom: 1px solid var(--steel-lt); max-width: 100%; }
.logo-tile img { max-height: 64px; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1); opacity: .72; transition: filter .25s, opacity .25s; }
.logo-tile:hover img { filter: none; opacity: 1; }
.logo-tile .name { font-family: var(--f-display); font-weight: 600; color: var(--ink-2); text-align: center; font-size: var(--t-sm); }
.logos-note { margin-top: 20px; display: flex; gap: 12px; align-items: center; font-size: var(--t-sm); color: var(--ink-2); }
.logos-note::before { content: ""; width: 24px; height: 1px; background: var(--steel); }
@media (max-width: 1000px) { .logos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); } .logo-tile img { max-height: 44px; } }

/* ───────── Videos ───────── */
.videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.video { display: grid; gap: 14px; align-content: start; min-width: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: var(--r-md); overflow: hidden; background: var(--navy); border: 1px solid var(--steel-lt); }
.video-frame img, .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video-play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, rgba(8,13,58,0) 40%, rgba(8,13,58,.55)); border: 0; cursor: pointer; padding: 0; width: 100%; }
.video-play span { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; color: var(--navy); transition: transform .2s; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.video-play:hover span { transform: scale(1.06); }
.video-play svg { width: 22px; height: 22px; margin-left: 3px; }
.video-pending { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; padding: 20px; color: #9aa8bf; font-size: var(--t-xs);
  background-image: linear-gradient(#141c5a 1px, transparent 1px), linear-gradient(90deg, #141c5a 1px, transparent 1px); background-size: 28px 28px; }
.video-pending svg { width: 36px; height: 36px; color: var(--sky); margin-inline: auto; }
.video h3 { font-size: var(--t-md); font-weight: 600; }
.video p { font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 900px) { .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .videos { grid-template-columns: 1fr; } }

/* ───────── Contacto ───────── */
.contact .wrap { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
.contact-copy { display: grid; gap: 28px; min-width: 0; }
.contact-copy h2 { font-size: var(--t-2xl); font-weight: 600; }
.steps { list-style: none; display: grid; gap: 0; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid #222b6a; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--f-mono); color: var(--sky); font-size: var(--t-sm); padding-top: 1px; }
.steps b { color: var(--white); font-weight: 600; display: block; }
.steps span { color: #a8b5ca; font-size: var(--t-sm); }
.direct { display: grid; gap: 12px; }
.direct-row { display: flex; flex-wrap: wrap; gap: 10px; }
.direct dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 8px 0 0; font-size: var(--t-sm); }
.direct dt { font-family: var(--f-mono); font-size: var(--t-xs); color: #8090ad; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.direct dd { margin: 0; color: var(--white); overflow-wrap: anywhere; user-select: all; }

.form-card { background: var(--white); color: var(--ink); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); min-width: 0; }
.form-card h3 { font-size: var(--t-xl); font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.form-card > p { color: var(--ink-2); font-size: var(--t-sm); margin-bottom: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: var(--t-sm); color: var(--ink); background: var(--paper); border: 1px solid var(--steel-lt);
  border-radius: var(--r-sm); padding: 12px 14px; transition: border-color .15s, background .15s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 3px rgba(0,121,193,.15); }
.field .err { color: #b42318; font-size: var(--t-xs); min-height: 1em; }
.field.invalid input, .field.invalid textarea { border-color: #d92d20; }
.consent { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-xs); color: var(--ink-2); }
.consent input { margin-top: 3px; accent-color: var(--blue); width: 16px; height: 16px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 4px; }
.form-status { font-size: var(--t-sm); }
.form-status.ok { color: var(--ok); }
.form-status.error { color: #b42318; }
@media (max-width: 900px) { .contact .wrap { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ───────── Footer ───────── */
.site-footer { background: var(--paper); border-top: 1px solid var(--steel-lt); padding-block: 48px 32px; font-size: var(--t-sm); color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-grid h2 { font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; display: grid; gap: 8px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--blue); }
.footer-brand { display: grid; gap: 14px; align-content: start; }
.footer-brand img { height: 32px; width: auto; }
.footer-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--steel-lt); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: var(--t-xs); color: var(--muted); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ───────── Ficha de proyecto ───────── */
.crumbs { font-size: var(--t-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.case-hero { padding-block: clamp(40px, 6vw, 72px) clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--steel-lt); }
.case-hero h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); font-weight: 600; max-width: 22ch; margin-block: 14px 18px; }
.case-hero .lead { font-size: var(--t-lg); color: var(--ink-2); max-width: 62ch; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.case-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; background: var(--navy); border-radius: var(--r-lg); overflow: hidden; margin-top: 40px; }
.case-metrics div { padding: 24px 28px; display: grid; gap: 6px; border-right: 1px solid #222b6a; }
.case-metrics b { font-family: var(--f-display); font-size: clamp(1.75rem, 3vw, 2.5rem); color: var(--white); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.case-metrics span { color: #a8b5ca; font-size: var(--t-sm); }
.case-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: clamp(32px, 6vw, 80px); padding-block: clamp(48px, 7vw, 80px); }
.case-body section + section { margin-top: 40px; }
.case-body h2 { font-size: var(--t-xl); font-weight: 600; margin-bottom: 14px; }
.case-body p { color: var(--ink-2); max-width: 65ch; }
.checklist { list-style: none; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; color: var(--ink-2); }
.checklist li::before { content: ""; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: #e7f3fb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230079c1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.case-aside { display: grid; gap: 20px; align-content: start; }
.aside-card { border: 1px solid var(--steel-lt); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 12px; }
.aside-card h3 { font-family: var(--f-mono); font-size: var(--t-xs); font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.aside-card .techs { display: flex; flex-wrap: wrap; gap: 6px; }
.aside-cta { background: var(--navy); color: #c9d4e5; border: 0; }
.aside-cta h3 { color: var(--sky); }
.aside-cta p { color: #c9d4e5; font-size: var(--t-sm); }
@media (max-width: 860px) { .case-body { grid-template-columns: 1fr; } }

/* Página legal */
.prose { max-width: 72ch; padding-block: clamp(40px, 6vw, 72px); }
.prose h1 { font-size: var(--t-2xl); margin-bottom: 20px; }
.prose h2 { font-size: var(--t-lg); margin: 32px 0 10px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.prose p + p { margin-top: 12px; }

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

/* ───────── Chat flotante ───────── */
.chat-fab {
  position: fixed; z-index: 70; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 8px; border-radius: 999px; border: 0;
  background: var(--navy); color: var(--white); font-weight: 600; font-size: var(--t-sm); cursor: pointer; box-shadow: 0 12px 30px -10px rgba(8,13,58,.6);
}
.chat-fab img { width: 40px; height: 40px; border-radius: 50%; background: var(--white); padding: 4px; object-fit: contain; }
.chat-fab:hover { background: var(--navy-2); }
.chat-fab[aria-expanded="true"] { display: none; }
.chat-panel[hidden] { display: none; }
.chat-panel {
  position: fixed; z-index: 71; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 40px)); display: grid; grid-template-rows: auto 1fr auto;
  background: var(--white); border-radius: var(--r-lg); box-shadow: 0 30px 70px -20px rgba(8,13,58,.45); overflow: hidden; border: 1px solid var(--steel-lt);
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--navy); color: var(--white); }
.chat-head img { width: 38px; height: 38px; border-radius: 50%; background: var(--white); padding: 4px; }
.chat-head div { display: grid; flex: 1; min-width: 0; }
.chat-head b { font-size: var(--t-sm); }
.chat-head small { font-size: 0.75rem; color: #a8b5ca; }
.chat-close { background: none; border: 0; color: var(--white); width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.chat-close:hover { background: rgba(255,255,255,.1); }
.chat-close svg { width: 20px; height: 20px; }
.chat-log { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); overscroll-behavior: contain; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: var(--t-sm); line-height: 1.45; overflow-wrap: anywhere; }
.msg--bot { background: var(--white); border: 1px solid var(--steel-lt); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg--user { background: var(--blue); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg a.btn { margin-top: 10px; min-height: 40px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.quick button { border: 1px solid var(--blue); color: var(--blue); background: var(--white); border-radius: 999px; padding: 7px 12px; font-size: var(--t-xs); font-weight: 600; cursor: pointer; }
.quick button:hover { background: #eef6fc; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--white); border: 1px solid var(--steel-lt); border-radius: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--steel-lt); background: var(--white); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: var(--t-sm); border: 1px solid var(--steel-lt); border-radius: 999px; padding: 10px 16px; background: var(--paper); }
.chat-form input:focus { outline: none; border-color: var(--blue); background: var(--white); }
.chat-form button { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--blue); color: var(--white); display: grid; place-items: center; cursor: pointer; }
.chat-form button svg { width: 18px; height: 18px; }
.chat-legal { font-size: 0.6875rem; color: var(--muted); text-align: center; padding: 0 12px 10px; background: var(--white); }
@media (max-width: 480px) {
  .chat-fab { padding-right: 8px; } .chat-fab span { display: none; }
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ───────── Utilidades del sitio PHP (reemplazan los style="" del prototipo: la CSP no permite estilos en línea) ───────── */
.stack-14 { display: grid; gap: 14px; }
.lead-text { color: var(--ink-2); font-size: var(--t-lg); max-width: 62ch; }
.contact-lead { color: #b8c4d6; font-size: var(--t-lg); }
.runlog { margin: 0; }
.section--compact { padding-block: clamp(48px, 7vw, 80px); }
.section-head--tight { margin-bottom: 28px; }
.mt-16 { margin-top: 16px; }
.fill.w-0 { width: 0%; }
.fill.w-5 { width: 5%; }
.fill.w-10 { width: 10%; }
.fill.w-15 { width: 15%; }
.fill.w-20 { width: 20%; }
.fill.w-25 { width: 25%; }
.fill.w-30 { width: 30%; }
.fill.w-35 { width: 35%; }
.fill.w-40 { width: 40%; }
.fill.w-45 { width: 45%; }
.fill.w-50 { width: 50%; }
.fill.w-55 { width: 55%; }
.fill.w-60 { width: 60%; }
.fill.w-65 { width: 65%; }
.fill.w-70 { width: 70%; }
.fill.w-75 { width: 75%; }
.fill.w-80 { width: 80%; }
.fill.w-85 { width: 85%; }
.fill.w-90 { width: 90%; }
.fill.w-95 { width: 95%; }
.fill.w-100 { width: 100%; }

/* Imagen opcional en la ficha de un caso */
.case-figure { margin-top: clamp(28px, 4vw, 48px); margin-bottom: 0; }
.case-figure img { width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--steel-lt); }

/* Accesibilidad: el azul de marca sobre fondo gris no alcanza 4.5:1 en texto pequeño → azul oscuro de la paleta */
.section--paper .eyebrow, .case-hero .eyebrow { color: var(--blue-dk); }

/* Redes sociales en el pie: solo se dibujan las que tienen enlace */
.social, .footer-grid .social { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 0; padding: 0; }
.social a { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--steel-lt); background: var(--white); color: var(--ink-2); transition: color .2s, border-color .2s, background .2s; }
.social a:hover, .social a:focus-visible { color: var(--white); background: var(--blue); border-color: var(--blue); }
.social svg { display: block; }
