/* ==========================================================================
   Benjamín Lang — sistema visual
   Motivo: puntos. Cada punto es una persona, un registro, un aviso.
   Paleta: niebla (fondo), tinta (texto), cobalto (único acento, sale del
   azul de Educación Pública en la foto), noche (secciones oscuras).
   ========================================================================== */

:root {
  --niebla: #ECEDF0;
  --papel: #F7F7F9;
  --tinta: #141833;
  --grafito: #565B74;
  --linea: #D3D6E0;
  --cobalto: #2B3BF5;
  --cobalto-hondo: #1E2BC4;
  --cobalto-claro: #93A0FF;
  --noche: #0E1238;
  --noche-2: #181E52;
  --noche-texto: #E6E8F5;
  --noche-grafito: #A6ABCB;
  --alerta: #E5484D;

  --f-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --f-body: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --f-code: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* escala tipográfica (razón 1.25, cuerpo 17px) */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.3125rem;
  --t-xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --t-2xl: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  --t-3xl: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  --t-hero: clamp(2.9rem, 1.4rem + 5.8vw, 6.25rem);

  --wrap: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 64ch;
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --header-h: 68px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--niebla);
  color: var(--tinta);
  font-family: var(--f-body);
  font-size: var(--t-md);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video, canvas, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--cobalto); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
button { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--f-code); font-size: .9em; }
::selection { background: var(--cobalto); color: #fff; }
:focus-visible { outline: 2.5px solid var(--cobalto); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--tinta); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm); }
.skip:focus { top: 1rem; color: #fff; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.measure { max-width: var(--measure); }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in .42s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* ── Botones y enlaces de acción ─────────────────────────────────────── */

.btn {
  --btn-bg: transparent; --btn-fg: var(--tinta); --btn-bd: var(--tinta);
  display: inline-flex; align-items: center; gap: .55em;
  min-height: 48px; padding: .7em 1.35em;
  border: 1.5px solid var(--btn-bd); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: var(--t-sm); line-height: 1.1; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background .25s var(--ease-out), color .25s var(--ease-out), border-color .25s, transform .25s var(--ease-out);
}
.btn:hover { --btn-bg: var(--tinta); --btn-fg: var(--niebla); color: var(--btn-fg); }
.btn:active { transform: scale(.97); }
.btn-solid { --btn-bg: var(--cobalto); --btn-fg: #fff; --btn-bd: var(--cobalto); }
.btn-solid:hover { --btn-bg: var(--cobalto-hondo); --btn-bd: var(--cobalto-hondo); --btn-fg: #fff; }
.btn-small { min-height: 40px; padding: .5em 1.1em; }
.ico { width: 1.1em; height: 1.1em; flex: none; }
.on-dark .btn { --btn-fg: var(--noche-texto); --btn-bd: rgba(230, 232, 245, .45); }
.on-dark .btn:hover { --btn-bg: var(--noche-texto); --btn-fg: var(--noche); }
.on-dark .btn-solid { --btn-bg: var(--cobalto); --btn-bd: var(--cobalto); --btn-fg: #fff; }
.on-dark .btn-solid:hover { --btn-bg: #fff; --btn-fg: var(--cobalto-hondo); --btn-bd: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.link-more { font-weight: 600; text-decoration: none; border-bottom: 1.5px solid currentColor; padding-bottom: 1px; }

/* ── Encabezado ──────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--niebla) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--linea); }
.header-row { display: flex; align-items: center; gap: 1.5rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--tinta); }
.brand-mark { width: 22px; height: 22px; fill: var(--cobalto); transition: transform .6s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(90deg); }
.nav { margin-left: auto; }
.nav-list { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: .5rem .8rem; border-radius: 999px; text-decoration: none; font-size: var(--t-sm); font-weight: 500; color: var(--grafito); transition: color .2s, background .2s; }
.nav-list a:hover { color: var(--tinta); background: rgba(20, 24, 51, .06); }
.nav-list a[aria-current="page"] { color: var(--tinta); background: rgba(43, 59, 245, .1); }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--linea); border-radius: 999px; text-decoration: none; font-size: var(--t-xs); font-weight: 600; background: var(--papel); }
.lang-switch span { padding: .3rem .6rem; border-radius: 999px; color: var(--grafito); transition: background .25s, color .25s; }
.lang-switch span.is-on { background: var(--tinta); color: var(--niebla); }
.lang-switch:hover span:not(.is-on) { color: var(--cobalto); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--cobalto); transform-origin: 0 50%; transform: scaleX(0); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; position: relative; }
.menu-icon, .menu-icon::before { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--tinta); border-radius: 2px; transition: transform .35s var(--ease-out), top .35s var(--ease-out); }
.menu-icon { top: 17px; }
.menu-icon::before { content: ""; left: 0; right: 0; top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-icon { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(-90deg); }
.menu-overlay { position: fixed; inset: var(--header-h) 0 0; z-index: 49; background: var(--niebla); padding-block: 1.5rem 3rem; overflow-y: auto; }
.menu-overlay ul { list-style: none; margin: 0 0 2rem; padding: 0; }
.menu-overlay li { border-bottom: 1px solid var(--linea); }
.menu-overlay li a { display: flex; align-items: center; min-height: 64px; font-family: var(--f-display); font-size: var(--t-xl); font-weight: 600; text-decoration: none; }
.menu-overlay:not([hidden]) li { animation: menu-in .5s var(--ease-out) both; }
.menu-overlay li:nth-child(2) { animation-delay: .04s; } .menu-overlay li:nth-child(3) { animation-delay: .08s; }
.menu-overlay li:nth-child(4) { animation-delay: .12s; } .menu-overlay li:nth-child(5) { animation-delay: .16s; }
@keyframes menu-in { from { opacity: 0; transform: translateY(14px); } }
.lang-switch-big { padding: .8rem 1.2rem; font-size: var(--t-sm); }

@media (max-width: 900px) {
  .nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .header-actions { margin-left: auto; }
}

/* ── Secciones ───────────────────────────────────────────────────────── */

.section { padding-block: clamp(4.5rem, 9vw, 8.5rem); position: relative; }
.section-tight { padding-block: clamp(3rem, 6vw, 5rem); }
.on-dark { background: var(--noche); color: var(--noche-texto); }
.on-dark a:hover { color: var(--cobalto-claro); }
.on-paper { background: var(--papel); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: var(--t-3xl); }
.section-head p { color: var(--grafito); font-size: var(--t-lg); line-height: 1.5; margin: 0; max-width: 46ch; }
.on-dark .section-head p { color: var(--noche-grafito); }
.kicker { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--t-sm); font-weight: 500; color: var(--grafito); margin-bottom: 1rem; }
.on-dark .kicker { color: var(--noche-grafito); }
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalto); }
.on-dark .kicker::before { background: var(--cobalto-claro); }
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; } }

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero { padding-block: clamp(2rem, 5vw, 4.5rem) clamp(3rem, 6vw, 5.5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.status { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .9rem .45rem .7rem; border: 1px solid var(--linea); border-radius: 999px; background: var(--papel); font-size: var(--t-sm); font-weight: 500; margin-bottom: 1.75rem; }
.status i { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #1FA971; }
.status i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #1FA971; opacity: 0; animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .9; } 80%, 100% { transform: scale(1.4); opacity: 0; } }
.hero .kicker { margin-bottom: .75rem; }
.hero-name { font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5rem) !important; font-variation-settings: "opsz" 96, "wdth" 92; letter-spacing: -0.035em; line-height: 1; margin-bottom: .6rem; }
.hero-role { font-size: var(--t-xl); font-weight: 500; color: var(--tinta); margin-bottom: 1.25rem; letter-spacing: -0.01em; }
.hero-badges { margin: -0.5rem 0 1.75rem; }
.hero .status { margin: 1.5rem 0 0; }
.hero h1 {
  font-size: var(--t-hero);
  font-weight: 750;
  font-variation-settings: "opsz" 96, "wdth" 88;
  letter-spacing: -0.035em;
  line-height: .96;
  margin-bottom: 1.75rem;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; }
.hero-lede { font-size: var(--t-lg); line-height: 1.5; color: var(--grafito); max-width: 40ch; margin-bottom: 2rem; }
.hero-lede strong { color: var(--tinta); font-weight: 600; }
.hero-photo { margin: 0; width: 100%; position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; background: var(--noche); isolation: isolate; max-width: 100%; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 30%; }
.js .hero-photo img { opacity: 0; transform: scale(1.04); transition: opacity 1.2s var(--ease-out), transform 2.4s var(--ease-out); }
.hero-photo.is-photo img { opacity: 1; transform: none; }
.hero-photo canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.hero-photo figcaption { position: absolute; left: 1rem; bottom: 1rem; right: 1rem; z-index: 3; display: flex; justify-content: space-between; gap: 1rem; align-items: end; color: #fff; font-size: var(--t-xs); line-height: 1.35; text-shadow: 0 1px 12px rgba(0,0,0,.45); }
.hero-photo figcaption b { display: block; font-size: var(--t-sm); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--linea); }
.hero-meta div { font-size: var(--t-sm); color: var(--grafito); line-height: 1.35; }
.hero-meta b { display: block; font-family: var(--f-display); font-size: var(--t-xl); font-weight: 700; color: var(--tinta); letter-spacing: -0.02em; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { aspect-ratio: 5 / 4; }
  .hero-photo img { object-position: 45% 28%; }
}

/* entrada orquestada del hero (única animación no provocada por el usuario) */
.js .hero h1 .line > span { transform: translateY(105%); }
.js .hero .status, .js .hero-lede, .js .hero .actions, .js .hero-meta { opacity: 0; transform: translateY(14px); }
.is-ready .hero h1 .line > span { transform: none; transition: transform 1s var(--ease-out); }
.is-ready .hero h1 .line:nth-child(2) > span { transition-delay: .08s; }
.is-ready .hero h1 .line:nth-child(3) > span { transition-delay: .16s; }
.is-ready .hero .status, .is-ready .hero-lede, .is-ready .hero .actions, .is-ready .hero-meta { opacity: 1; transform: none; transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.is-ready .hero-lede { transition-delay: .35s; }
.is-ready .hero .actions { transition-delay: .45s; }
.is-ready .hero-meta { transition-delay: .6s; }

/* ── Franja de instituciones ─────────────────────────────────────────── */

.logos { padding-block: 2.25rem; border-block: 1px solid var(--linea); }
.logos-row { display: flex; align-items: center; gap: 1.25rem 3rem; flex-wrap: wrap; }
.logos-row > p { margin: 0; font-size: var(--t-sm); color: var(--grafito); flex: none; }
.logos-list { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.75rem; list-style: none; margin: 0; padding: 0; }
.logos-list img { height: 34px; width: auto; filter: grayscale(1) contrast(1.1); opacity: .7; mix-blend-mode: multiply; transition: filter .35s, opacity .35s; }
.logos-list a:hover img, .logos-list a:focus-visible img { filter: none; opacity: 1; }
.logos-list .is-square img { height: 42px; }

/* ── Relato con puntos (de la pregunta a la decisión) ─────────────────── */

.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); }
.story-stage { position: sticky; top: calc(var(--header-h) + 4vh); height: min(78vh, 640px); border-radius: var(--r-lg); background: var(--noche-2); overflow: hidden; }
.story-stage canvas { width: 100%; height: 100%; }
.story-stage .stage-label { position: absolute; left: 1.25rem; bottom: 1.1rem; right: 1.25rem; display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--noche-grafito); }
.story-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.story-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; padding-block: 2rem; counter-increment: step; opacity: .35; transition: opacity .5s var(--ease-out); }
.story-step:first-child { min-height: 60vh; }
.story-step.is-active { opacity: 1; }
.story-step .step-n { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1.5px solid currentColor; font-size: var(--t-sm); font-weight: 600; margin-bottom: 1.25rem; }
.story-step .step-n::before { content: counter(step); }
.story-step h3 { font-size: var(--t-2xl); margin-bottom: 1rem; }
.story-step p { color: var(--noche-grafito); font-size: var(--t-lg); line-height: 1.55; max-width: 38ch; }
.story-step p strong { color: var(--noche-texto); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.chips li { padding: .3rem .7rem; border-radius: 999px; font-size: var(--t-xs); font-weight: 500; background: rgba(20, 24, 51, .06); color: var(--tinta); }
.on-dark .chips li { background: rgba(230, 232, 245, .1); color: var(--noche-texto); }
@media (max-width: 860px) {
  .story { grid-template-columns: 1fr; }
  .story-stage { top: calc(var(--header-h) + 8px); height: 38vh; z-index: 1; }
  .story-step { min-height: 70vh; position: relative; z-index: 2; }
  .story-step > * { background: color-mix(in srgb, var(--noche) 88%, transparent); }
  .story-step h3, .story-step p, .story-step .chips { padding: .25rem .5rem; border-radius: 8px; }
}

/* ── Laboratorio (proyectos propios) ─────────────────────────────────── */

.lab-list { display: grid; gap: clamp(4rem, 8vw, 7rem); }
.lab-item { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.lab-item:nth-child(even) .lab-visual { order: 2; }
.lab-visual { position: relative; display: block; border-radius: var(--r-md); text-decoration: none; perspective: 1200px; }
.browser { border-radius: var(--r-md); overflow: hidden; background: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 30px 80px -30px rgba(0,0,0,.6); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease-out); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding-inline: 12px; background: #E3E5EE; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #C3C7D6; }
.browser-bar span { margin-left: 10px; font-size: 11px; color: #6A6F88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.lab-body h3 { font-size: var(--t-2xl); margin-bottom: .9rem; }
.lab-body h3 a { text-decoration: none; }
.lab-body .hook { font-size: var(--t-lg); line-height: 1.5; color: var(--noche-grafito); margin-bottom: 1.5rem; }
.facts { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; gap: .6rem; }
.facts li { display: grid; grid-template-columns: 1.25rem 1fr; gap: .6rem; font-size: var(--t-sm); line-height: 1.5; }
.facts li::before { content: ""; width: 7px; height: 7px; margin-top: .55em; border-radius: 50%; background: var(--cobalto); }
.on-dark .facts li::before { background: var(--cobalto-claro); }
.lab-body .chips { margin-bottom: 1.75rem; }
.live-number { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .lab-item { grid-template-columns: 1fr; }
  .lab-item:nth-child(even) .lab-visual { order: 0; }
}

.more-experiments { margin-top: clamp(4rem, 8vw, 6rem); padding-top: 2.5rem; border-top: 1px solid rgba(230, 232, 245, .16); }
.more-experiments h3 { font-size: var(--t-xl); margin-bottom: .5rem; }
.more-experiments > p { color: var(--noche-grafito); max-width: 60ch; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; margin-top: 1.75rem; background: rgba(230, 232, 245, .14); border: 1px solid rgba(230, 232, 245, .14); border-radius: var(--r-md); overflow: hidden; }
.mini-grid a { display: block; padding: 1.25rem 1.25rem 1.4rem; background: var(--noche); text-decoration: none; transition: background .25s; }
.mini-grid a:hover { background: var(--noche-2); color: var(--noche-texto); }
.mini-grid b { display: block; font-family: var(--f-display); font-size: var(--t-lg); margin-bottom: .3rem; }
.mini-grid span { font-size: var(--t-sm); color: var(--noche-grafito); line-height: 1.45; display: block; }

/* ── Índice de proyectos en los que participé ────────────────────────── */

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter { min-height: 40px; padding: .45rem 1rem; border: 1px solid var(--linea); border-radius: 999px; background: transparent; font-size: var(--t-sm); font-weight: 500; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.filter:hover { border-color: var(--tinta); }
.filter[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--niebla); }
.filter sup { font-size: .7em; margin-left: .2em; opacity: .7; }

.work-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tinta); }
.work-row { border-bottom: 1px solid var(--linea); }
.work-row[hidden] { display: none; }
.work-open {
  width: 100%; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, .7fr) 2.75rem; gap: 1.5rem; align-items: center;
  padding: 1.35rem .25rem; border: 0; background: none; text-align: left; cursor: pointer; position: relative;
}
.work-open::before { content: ""; position: absolute; inset: 0; background: var(--papel); transform: scaleY(0); transform-origin: bottom; transition: transform .35s var(--ease-out); z-index: -1; border-radius: 6px; }
.work-row { position: relative; z-index: 0; }
.work-open:hover::before, .work-open:focus-visible::before { transform: scaleY(1); }
.work-years { font-size: var(--t-sm); color: var(--grafito); font-variant-numeric: tabular-nums; }
.work-title { font-family: var(--f-display); font-size: var(--t-xl); font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; }
.work-title small { display: block; font-family: var(--f-body); font-size: var(--t-sm); font-weight: 400; color: var(--grafito); letter-spacing: 0; margin-top: .3rem; }
.work-role { font-size: var(--t-sm); color: var(--grafito); line-height: 1.4; }
.work-plus { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1.5px solid var(--linea); display: grid; place-items: center; transition: background .25s, border-color .25s, transform .4s var(--ease-out); }
.work-plus svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; }
.work-open:hover .work-plus { background: var(--cobalto); border-color: var(--cobalto); color: #fff; transform: rotate(90deg); }
.work-preview { position: fixed; left: 0; top: 0; width: 280px; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; pointer-events: none; z-index: 40; opacity: 0; transform: translate(-50%, -50%) scale(.85); transition: opacity .25s, transform .35s var(--ease-out); box-shadow: 0 25px 60px -20px rgba(14, 18, 56, .45); }
.work-preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.work-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .work-open { grid-template-columns: minmax(0, 1fr) 2.75rem; gap: .35rem 1rem; }
  .work-years { grid-column: 1; grid-row: 1; }
  .work-title { grid-column: 1; grid-row: 2; }
  .work-role { grid-column: 1; grid-row: 3; }
  .work-plus { grid-column: 2; grid-row: 1 / 4; }
  .work-preview { display: none; }
}
@media (hover: none) { .work-preview { display: none; } }

/* ── Ventanas emergentes (dialog) ────────────────────────────────────── */

.modal {
  width: min(100% - 2rem, 920px); max-height: min(92vh, 1000px); margin: auto; padding: 0;
  border: 0; border-radius: var(--r-lg); background: var(--papel); color: var(--tinta);
  box-shadow: 0 40px 120px -30px rgba(14, 18, 56, .55);
  overscroll-behavior: contain;
}
.modal::backdrop { background: rgba(14, 18, 56, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in .5s var(--ease-out); }
.modal[open]::backdrop { animation: fade-in .35s ease-out; }
.modal.is-closing { animation: modal-out .22s ease-in forwards; }
.modal.is-closing::backdrop { animation: fade-in .22s ease-in reverse forwards; }
@keyframes modal-in { from { opacity: 0; transform: translateY(28px) scale(.97); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.modal-inner { position: relative; }
.modal-close { position: sticky; top: .9rem; float: right; margin: .9rem .9rem 0 0; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--tinta); color: var(--niebla); cursor: pointer; display: grid; place-items: center; transition: transform .3s var(--ease-out), background .2s; }
.modal-close:hover { transform: rotate(90deg); background: var(--cobalto); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; }
.modal-head { padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem) 1.5rem; }
.modal-head .work-years { display: block; margin-bottom: .6rem; }
.modal-head h2 { font-size: var(--t-2xl); margin-bottom: .75rem; max-width: 22ch; }
.modal-head .org { color: var(--grafito); margin: 0; }
.modal-cover { margin: 0 clamp(1.5rem, 4vw, 3rem); border-radius: var(--r-md); overflow: hidden; background: var(--niebla); }
.modal-cover img { width: 100%; max-height: 380px; object-fit: cover; }
.modal-cover figcaption { font-size: var(--t-xs); color: var(--grafito); padding: .6rem .9rem; }
.modal-body { padding: 1.5rem clamp(1.5rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem); display: grid; gap: 2rem; }
.modal-body .intro { font-size: var(--t-lg); line-height: 1.55; max-width: 60ch; margin: 0; }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--linea); border: 1px solid var(--linea); border-radius: var(--r-md); overflow: hidden; }
.numbers div { background: var(--papel); padding: 1.1rem 1.2rem 1.2rem; }
.numbers b { display: block; font-family: var(--f-display); font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.03em; color: var(--cobalto); line-height: 1; margin-bottom: .45rem; font-variant-numeric: tabular-nums; }
.numbers span { font-size: var(--t-sm); color: var(--grafito); line-height: 1.35; display: block; }
.did h3, .modal-body h3 { font-size: var(--t-lg); margin-bottom: 1rem; }
.did-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.did-list li { padding: 1rem 1.1rem; border-radius: var(--r-sm); background: var(--niebla); font-size: var(--t-sm); line-height: 1.5; }
.did-list li b { display: block; font-size: var(--t-md); margin-bottom: .25rem; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; counter-reset: flow; }
.flow li { flex: 1 1 140px; position: relative; padding: .9rem 1rem; border: 1.5px solid var(--linea); border-radius: var(--r-sm); font-size: var(--t-sm); line-height: 1.4; counter-increment: flow; background: var(--papel); }
.flow li::before { content: counter(flow); display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--cobalto); color: #fff; font-size: var(--t-xs); font-weight: 600; margin-bottom: .5rem; }
.flow li b { display: block; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--linea); }
.modal-foot .note { font-size: var(--t-xs); color: var(--grafito); margin: 0; max-width: 60ch; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.gallery figure { margin: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--niebla); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.gallery figcaption { font-size: var(--t-xs); color: var(--grafito); padding: .5rem .7rem .6rem; line-height: 1.4; }
html.modal-open { overflow: hidden; }

/* barras simples dentro de modales y páginas */
.bars { display: grid; gap: .6rem; }
.bar { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr 3.5rem; gap: .75rem; align-items: center; font-size: var(--t-sm); }
.bar-track { height: 12px; border-radius: 999px; background: var(--niebla); overflow: hidden; }
.bar-fill { height: 100%; width: var(--v); background: var(--cobalto); border-radius: inherit; transform-origin: 0 50%; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
.js .reveal-bars .bar-fill { transform: scaleX(0); }
.js .reveal-bars.is-in .bar-fill { transform: none; transition: transform 1.1s var(--ease-out); }
@media (max-width: 560px) { .bar { grid-template-columns: 1fr 3rem; } .bar > span:first-child { grid-column: 1 / -1; } }

/* ── Trayectoria ─────────────────────────────────────────────────────── */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7.25rem; top: .6rem; bottom: .6rem; width: 1.5px; background: var(--linea); }
.timeline::after { content: ""; position: absolute; left: 7.25rem; top: .6rem; width: 1.5px; height: calc(var(--p, 0) * (100% - 1.2rem)); background: var(--cobalto); }
.tl-item { display: grid; grid-template-columns: 6rem 1fr; gap: 2.5rem; padding-block: 1.1rem; position: relative; }
.tl-item::before { content: ""; position: absolute; left: calc(7.25rem - 5px); top: 1.55rem; width: 11px; height: 11px; border-radius: 50%; background: var(--niebla); border: 2px solid var(--cobalto); }
.tl-item.is-current::before { background: var(--cobalto); box-shadow: 0 0 0 5px rgba(43, 59, 245, .18); }
.tl-when { font-size: var(--t-sm); color: var(--grafito); padding-top: .2rem; font-variant-numeric: tabular-nums; }
.tl-what h3 { font-size: var(--t-lg); line-height: 1.25; margin-bottom: .2rem; font-weight: 650; letter-spacing: -0.01em; }
.tl-what .org { color: var(--grafito); font-size: var(--t-sm); margin-bottom: .5rem; }
.tl-what p { font-size: var(--t-sm); max-width: 62ch; margin: 0; }
@media (max-width: 640px) {
  .timeline::before, .timeline::after { left: 5px; }
  .tl-item { grid-template-columns: 1fr; gap: .25rem; padding-left: 2rem; }
  .tl-item::before { left: 0; }
}

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.split-sticky { position: sticky; top: calc(var(--header-h) + 2rem); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split-sticky { position: static; } }

/* ── Docencia y charlas ──────────────────────────────────────────────── */

.talk { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.talk-photo { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; }
.talk-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 35% 40%; }
.talk h3 { font-size: var(--t-2xl); margin-bottom: 1rem; }
.slides { position: relative; margin-top: 1.5rem; }
.slides-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(78%, 1fr); gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .75rem; scrollbar-width: thin; }
.slide-card { scroll-snap-align: start; border-radius: var(--r-md); padding: 1.25rem 1.35rem; background: var(--noche-2); border: 1px solid rgba(230, 232, 245, .1); color: var(--noche-texto); min-height: 170px; display: flex; flex-direction: column; justify-content: space-between; }
.slide-card b { font-family: var(--f-display); font-size: var(--t-lg); line-height: 1.2; }
.slide-card span { font-size: var(--t-sm); color: var(--noche-grafito); margin-top: .75rem; }
.talk-list { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--linea); }
.talk-list li { display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; padding-block: 1rem; border-bottom: 1px solid var(--linea); font-size: var(--t-sm); }
.talk-list time { color: var(--grafito); }
@media (max-width: 860px) { .talk { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .talk-list li { grid-template-columns: 1fr; gap: .15rem; } }

/* ── Publicaciones ───────────────────────────────────────────────────── */

.pub-feature { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; padding: clamp(1.75rem, 4vw, 3rem); border-radius: var(--r-lg); background: var(--noche); color: var(--noche-texto); }
.pub-feature h3 { font-size: var(--t-xl); line-height: 1.2; max-width: 34ch; margin-bottom: 1rem; }
.pub-feature p { color: var(--noche-grafito); margin: 0; font-size: var(--t-sm); }
.pub-counts { display: flex; flex-wrap: wrap; gap: 2rem 3.5rem; margin-top: 2.5rem; }
.pub-counts div { font-size: var(--t-sm); color: var(--grafito); max-width: 16ch; line-height: 1.35; }
.pub-counts b { display: block; font-family: var(--f-display); font-size: var(--t-3xl); line-height: 1; letter-spacing: -0.04em; color: var(--tinta); margin-bottom: .35rem; font-variant-numeric: tabular-nums; }
.pub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tinta); }
.pub-list li { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1.5rem; align-items: baseline; padding-block: 1.2rem; border-bottom: 1px solid var(--linea); }
.pub-list .y { color: var(--grafito); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.pub-list .t { font-family: var(--f-display); font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.pub-list .a { display: block; font-size: var(--t-sm); color: var(--grafito); margin-top: .3rem; }
.pub-list .go { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }
@media (max-width: 700px) { .pub-feature { grid-template-columns: 1fr; } .pub-list li { grid-template-columns: 1fr; gap: .3rem; } }

/* ── Contacto (pie) ──────────────────────────────────────────────────── */

.contact { background: var(--noche); color: var(--noche-texto); padding-block: clamp(5rem, 10vw, 9rem) 2rem; position: relative; overflow: hidden; }
.contact-dots { position: absolute; inset: 0; opacity: .5; pointer-events: none; }
.contact .wrap { position: relative; }
.contact h2 { font-size: var(--t-hero); font-variation-settings: "opsz" 96, "wdth" 85; letter-spacing: -0.04em; line-height: .95; max-width: 12ch; margin-bottom: 1.5rem; }
.contact-lede { font-size: var(--t-lg); color: var(--noche-grafito); max-width: 44ch; margin-bottom: 2.5rem; }
.mail-big { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 3rem; }
.mail-big a { font-family: var(--f-display); font-size: clamp(1.4rem, .8rem + 3vw, 3rem); font-weight: 600; letter-spacing: -0.02em; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .5s var(--ease-out), color .2s; word-break: break-all; }
.mail-big a:hover { background-size: 100% 2px; color: var(--cobalto-claro); }
.copy-btn { min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1px solid rgba(230, 232, 245, .35); background: transparent; color: var(--noche-texto); font-size: var(--t-sm); cursor: pointer; transition: background .2s, color .2s; }
.copy-btn:hover { background: var(--noche-texto); color: var(--noche); }
.copy-btn.is-done { background: #1FA971; border-color: #1FA971; color: #fff; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: rgba(230, 232, 245, .14); border: 1px solid rgba(230, 232, 245, .14); border-radius: var(--r-md); overflow: hidden; }
.contact-grid a { display: flex; flex-direction: column; gap: .25rem; padding: 1.25rem 1.35rem; background: var(--noche); text-decoration: none; transition: background .25s; }
.contact-grid a:hover { background: var(--noche-2); color: var(--noche-texto); }
.contact-grid span { font-size: var(--t-xs); color: var(--noche-grafito); }
.contact-grid b { font-weight: 600; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid rgba(230, 232, 245, .14); font-size: var(--t-xs); color: var(--noche-grafito); }
.footer-bottom a { color: var(--noche-texto); }

/* ── Página de proyecto ──────────────────────────────────────────────── */

.p-hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.crumbs { font-size: var(--t-sm); color: var(--grafito); margin-bottom: 1.5rem; }
.crumbs a { text-decoration: none; }
.p-hero h1 { font-size: var(--t-3xl); font-variation-settings: "opsz" 96, "wdth" 90; letter-spacing: -0.035em; max-width: 18ch; margin-bottom: 1.25rem; }
.p-hero .hook { font-size: var(--t-xl); line-height: 1.4; color: var(--grafito); max-width: 44ch; font-family: var(--f-body); font-weight: 400; letter-spacing: -0.01em; }
.p-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem 2rem; margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--linea); }
.p-meta dt { font-size: var(--t-xs); color: var(--grafito); }
.p-meta dd { margin: .2rem 0 0; font-weight: 600; font-size: var(--t-sm); }
.p-cover { margin-block: 0 clamp(3rem, 6vw, 5rem); }
.p-cover .browser img { aspect-ratio: 16 / 9; }
.prose { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.toc { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; font-size: var(--t-sm); }
.toc p { font-weight: 600; margin-bottom: .75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; border-left: 1.5px solid var(--linea); }
.toc a { display: block; padding: .35rem 0 .35rem 1rem; margin-left: -1.5px; border-left: 1.5px solid transparent; text-decoration: none; color: var(--grafito); line-height: 1.35; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--tinta); }
.toc a.is-active { color: var(--cobalto); border-left-color: var(--cobalto); }
.article { max-width: 72ch; }
.article section { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.article h2 { font-size: var(--t-2xl); margin-bottom: 1.25rem; padding-top: .5rem; }
.article h3 { font-size: var(--t-lg); margin: 2rem 0 .75rem; }
.article p, .article li { font-size: 1.125rem; line-height: 1.7; }
.article ul { padding-left: 1.2rem; }
.article li { margin-bottom: .5rem; }
.article li::marker { color: var(--cobalto); }
.article figure { margin: 2rem 0; }
.article figure img { border-radius: var(--r-md); border: 1px solid var(--linea); }
.article figcaption { font-size: var(--t-sm); color: var(--grafito); margin-top: .6rem; }
.article .wide { margin-inline: 0; }
.callout { padding: 1.25rem 1.5rem; border-radius: var(--r-md); background: var(--papel); border: 1px solid var(--linea); margin: 1.75rem 0; }
.callout p:last-child { margin: 0; }
.callout-cobalto { background: rgba(43, 59, 245, .07); border-color: rgba(43, 59, 245, .25); }
.pull { font-family: var(--f-display); font-size: var(--t-xl); line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; margin: 2.25rem 0; padding-left: 1.25rem; border-left: 3px solid var(--cobalto); }
pre.code { background: var(--noche); color: #DDE1F7; border-radius: var(--r-md); padding: 1.25rem 1.4rem; overflow-x: auto; font-size: .875rem; line-height: 1.65; margin: 1.5rem 0; }
pre.code .c { color: #8189B5; }
pre.code .k { color: var(--cobalto-claro); }
pre.code .s { color: #9FE3C3; }
:not(pre) > code { background: rgba(20, 24, 51, .07); padding: .1em .35em; border-radius: 5px; font-size: .88em; }
.p-next { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding: clamp(2rem, 5vw, 3.5rem); border-radius: var(--r-lg); background: var(--papel); border: 1px solid var(--linea); }
.p-next h2 { font-size: var(--t-2xl); }
.p-next p { color: var(--grafito); margin: .5rem 0 0; }
@media (max-width: 960px) { .prose { grid-template-columns: 1fr; } .toc { display: none; } }
@media (max-width: 640px) { .p-next { grid-template-columns: 1fr; } }

/* embudo */
.funnel { display: grid; gap: .5rem; margin: 2rem 0; }
.funnel-step { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr) 4.5rem; gap: 1rem; align-items: center; }
.funnel-step em { font-style: normal; font-size: var(--t-sm); font-weight: 500; line-height: 1.3; }
.funnel-bar { position: relative; height: 40px; border-radius: 10px; background: var(--papel); border: 1px solid var(--linea); overflow: hidden; }
.funnel-bar span { position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--cobalto); border-radius: inherit; transform-origin: 0 50%; }
@media (max-width: 560px) { .funnel-step { grid-template-columns: minmax(0, 1fr) 4rem; gap: .25rem .75rem; } .funnel-step em { grid-column: 1 / -1; } }
.funnel-step b { font-family: var(--f-display); font-size: var(--t-xl); text-align: right; font-variant-numeric: tabular-nums; }
.funnel-step:last-child .funnel-bar span { background: #1FA971; }
.js .funnel .funnel-bar span { transform: scaleX(0); }
.js .funnel.is-in .funnel-bar span { transform: none; transition: transform 1.2s var(--ease-out); }
.js .funnel.is-in .funnel-step:nth-child(2) span { transition-delay: .12s; }
.js .funnel.is-in .funnel-step:nth-child(3) span { transition-delay: .24s; }
.js .funnel.is-in .funnel-step:nth-child(4) span { transition-delay: .36s; }
.js .funnel.is-in .funnel-step:nth-child(5) span { transition-delay: .48s; }

/* pipeline animado */
.pipeline { list-style: none; margin: 2rem 0; padding: 0; display: grid; gap: 0; position: relative; }
.pipeline li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding-bottom: 1.4rem; position: relative; }
.pipeline li::before { content: ""; position: absolute; left: calc(1.5rem - .75px); top: 2.4rem; bottom: 0; width: 1.5px; background: var(--linea); }
.pipeline li:last-child::before { display: none; }
.pipeline .node { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; background: var(--papel); border: 1.5px solid var(--linea); font-size: var(--t-xs); font-weight: 600; font-family: var(--f-code); position: relative; z-index: 1; transition: background .4s, border-color .4s, color .4s; }
.pipeline li.is-lit .node { background: var(--cobalto); border-color: var(--cobalto); color: #fff; }
.pipeline b { display: block; font-size: var(--t-md); margin-top: .15rem; }
.pipeline span { font-size: var(--t-sm); color: var(--grafito); line-height: 1.5; }
.pipeline code { font-size: .8em; }

/* terminal */
.terminal { border-radius: var(--r-md); background: var(--noche); color: #DDE1F7; overflow: hidden; margin: 1.75rem 0; font-family: var(--f-code); font-size: .85rem; line-height: 1.7; }
.terminal-bar { display: flex; gap: 6px; padding: .7rem .9rem; background: var(--noche-2); }
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.2); }
.terminal-body { padding: 1rem 1.2rem 1.2rem; min-height: 11rem; white-space: pre-wrap; }
.terminal-body .p { color: var(--cobalto-claro); }
.terminal-body .ok { color: #9FE3C3; }
.terminal-body .dim { color: #8189B5; }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -0.2em; background: #DDE1F7; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* datos vivos */
.live b { font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.4rem) !important; overflow-wrap: anywhere; }
.live { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1px; background: var(--linea); border: 1px solid var(--linea); border-radius: var(--r-md); overflow: hidden; margin: 2rem 0 .75rem; }
.live div { background: var(--papel); padding: 1.1rem 1.2rem; }
.live b { display: block; font-family: var(--f-display); font-size: var(--t-2xl); letter-spacing: -0.03em; line-height: 1; margin-bottom: .4rem; font-variant-numeric: tabular-nums; }
.live span { font-size: var(--t-sm); color: var(--grafito); line-height: 1.35; display: block; }
.live-note { font-size: var(--t-xs); color: var(--grafito); display: flex; align-items: center; gap: .5rem; }
.live-note i { width: 8px; height: 8px; border-radius: 50%; background: #1FA971; }

/* visor embebido */
.embed { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--linea); background: var(--noche); position: relative; aspect-ratio: 16 / 10; margin: 2rem 0; }
.embed iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.embed-cover { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--noche-texto); padding: 2rem; }
.embed-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.embed-cover div { position: relative; }
.embed-cover p { margin: .75rem 0 0; font-size: var(--t-sm); color: var(--noche-grafito); }
@media (max-width: 640px) { .embed { aspect-ratio: 3 / 4; } }

/* simulador: la casa siempre gana */
.sim { border-radius: var(--r-lg); background: var(--noche); color: var(--noche-texto); padding: clamp(1.25rem, 3vw, 2rem); margin: 2rem 0; }
.sim-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1.25rem; }
.sim-controls label { display: grid; gap: .35rem; font-size: var(--t-sm); color: var(--noche-grafito); }
.sim-controls output { color: var(--noche-texto); font-weight: 600; font-variant-numeric: tabular-nums; }
.sim input[type="range"] { width: 100%; accent-color: var(--cobalto-claro); min-height: 32px; }
.sim canvas { width: 100%; height: 320px; border-radius: var(--r-sm); background: var(--noche-2); }
.sim-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.sim-result div { font-size: var(--t-sm); color: var(--noche-grafito); line-height: 1.35; }
.sim-result b { display: block; font-family: var(--f-display); font-size: var(--t-2xl); color: var(--noche-texto); letter-spacing: -0.03em; line-height: 1.05; margin-bottom: .25rem; font-variant-numeric: tabular-nums; }
.sim-result b.neg { color: #FF8A8E; }
.sim-legend { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; font-size: var(--t-xs); color: var(--noche-grafito); margin-top: .75rem; }
.sim-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .4rem; }

.margin-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: var(--t-sm); }
.margin-table th, .margin-table td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--linea); }
.margin-table th { font-weight: 600; color: var(--grafito); }
.margin-table td:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.margin-table .meter { height: 8px; border-radius: 99px; background: var(--alerta); width: var(--v); }

/* arquitectura (diagrama de agentes) */
.arch { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin: 2rem 0; }
.arch-card { padding: 1.1rem 1.2rem; border-radius: var(--r-md); background: var(--papel); border: 1px solid var(--linea); position: relative; }
.arch-card b { display: block; margin-bottom: .3rem; }
.arch-card span { font-size: var(--t-sm); color: var(--grafito); line-height: 1.45; display: block; }
.arch-card code { font-size: .78em; }
.arch-card.is-core { background: var(--noche); color: var(--noche-texto); border-color: var(--noche); }
.arch-card.is-core span { color: var(--noche-grafito); }

/* ── Tarjetas de la página de proyectos ──────────────────────────────── */

.lab-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.lab-card { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--noche); color: var(--noche-texto); text-decoration: none; transition: transform .5s var(--ease-out); }
.lab-card:hover { color: var(--noche-texto); transform: translateY(-4px); }
.lab-card .cover { aspect-ratio: 16 / 10; overflow: hidden; background: var(--noche-2); }
.lab-card .cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease-out); }
.lab-card:hover .cover img { transform: scale(1.04); }
.lab-card .body { padding: 1.5rem 1.6rem 1.75rem; display: grid; gap: .6rem; }
.lab-card h3 { font-size: var(--t-xl); }
.lab-card p { color: var(--noche-grafito); margin: 0; font-size: var(--t-sm); line-height: 1.55; }
@media (max-width: 760px) { .lab-cards { grid-template-columns: 1fr; } }

.page-intro { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.page-intro h1 { font-size: var(--t-3xl); font-variation-settings: "opsz" 96, "wdth" 90; letter-spacing: -0.035em; max-width: 16ch; margin-bottom: 1.25rem; }
.page-intro p { font-size: var(--t-lg); color: var(--grafito); max-width: 52ch; }

/* ── CV ──────────────────────────────────────────────────────────────── */

.cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cv-card { padding: 1.4rem 1.5rem; border-radius: var(--r-md); background: var(--papel); border: 1px solid var(--linea); }
.cv-card h3 { font-size: var(--t-lg); margin-bottom: .35rem; line-height: 1.2; }
.cv-card p { font-size: var(--t-sm); color: var(--grafito); margin: 0; }
.skills { display: grid; gap: 1.1rem; }
.skill { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 1rem; align-items: center; }
.skill b { font-weight: 600; }
.skill-dots { display: flex; gap: 5px; }
.skill-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--linea); }
.skill-dots i.on { background: var(--cobalto); }
.skill small { grid-column: 2; font-size: var(--t-sm); color: var(--grafito); margin-top: -.6rem; }
@media (max-width: 560px) { .skill { grid-template-columns: 1fr; gap: .4rem; } .skill small { grid-column: 1; margin: 0; } }
.refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.refs div { padding: 1.25rem; border-radius: var(--r-md); border: 1px solid var(--linea); font-size: var(--t-sm); line-height: 1.5; }
.refs b { display: block; font-size: var(--t-md); }

/* ── Aparición al hacer scroll (sutil, respeta movimiento reducido) ──── */

.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js .hero h1 .line > span, .js .hero .status, .js .hero-lede, .js .hero .actions, .js .hero-meta { opacity: 1; transform: none; }
  .js .funnel .funnel-bar span, .js .reveal-bars .bar-fill { transform: none; }
  @view-transition { navigation: none; }
}

/* ── Ajustes de contexto (claro / oscuro) ────────────────────────────── */
.lab-body .hook { color: var(--grafito); }
.on-dark .lab-body .hook { color: var(--noche-grafito); }
.lab-body h3 a:hover { color: var(--cobalto); }
.browser { box-shadow: 0 1px 2px rgba(14, 18, 56, .06), 0 24px 60px -28px rgba(14, 18, 56, .35); }
.more-experiments { border-top-color: var(--linea); }
.more-experiments > p { color: var(--grafito); }
.mini-grid { background: var(--linea); border-color: var(--linea); }
.mini-grid a { background: var(--papel); }
.mini-grid a:hover { background: #fff; color: var(--tinta); }
.mini-grid span { color: var(--grafito); }
.logos-list .is-dark a { display: block; padding: 6px 10px; border-radius: 8px; background: #2B35C8; }
.logos-list .is-dark img { filter: none; opacity: .9; mix-blend-mode: normal; height: 26px; }
.logos-list .is-dark a:hover img { opacity: 1; }
.work-preview { background: var(--papel); }
.work-preview img[src$=".svg"], .work-preview img[src$=".png"] { object-fit: contain; padding: 2rem; }

/* ── Gráficos de salud y herramienta en el navegador ─────────────────── */
.vbars { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .5rem; align-items: end; height: 300px; margin: 2rem 0 1.5rem; }
.vbar { display: grid; grid-template-rows: auto 1fr auto; gap: .4rem; height: 100%; text-align: center; }
.vbar b { font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.vbar em { font-style: normal; font-size: var(--t-xs); color: var(--grafito); }
.vbar-track { position: relative; border-radius: 8px 8px 3px 3px; overflow: hidden; }
.vbar-track .bar-fill { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: var(--v); border-radius: 8px 8px 3px 3px; transform-origin: 50% 100%; }
.vbar.low .bar-fill { background: var(--noche-grafito); }
.vbar.top .bar-fill { background: #1FA971; }
.vbar.thin .bar-fill { opacity: .45; }
.vbar.gap .bar-fill { background: repeating-linear-gradient(-45deg, transparent 0 5px, var(--linea) 5px 7px); }
.js .reveal-bars .vbar-track .bar-fill { transform: scaleY(0); }
.js .reveal-bars.is-in .vbar-track .bar-fill { transform: none; transition: transform 1s var(--ease-out); }
.js .reveal-bars.is-in .vbar:nth-child(n+4) .bar-fill { transition-delay: .1s; }
.js .reveal-bars.is-in .vbar:nth-child(n+7) .bar-fill { transition-delay: .2s; }
@media (max-width: 560px) { .vbars { gap: .2rem; height: 240px; } .vbar b { font-size: 10px; writing-mode: vertical-rl; transform: rotate(180deg); margin-inline: auto; } }
.bar-track.stack { display: flex; height: 16px; }
.seg { height: 100%; }
.seg-Walking, i.seg-Walking { background: var(--cobalto); }
.seg-Cycling, i.seg-Cycling { background: #1FA971; }
.seg-Running, i.seg-Running { background: #F5A524; }
.seg-Other, i.seg-Other { background: var(--noche-grafito); }
.health-tool { margin: 2rem 0; }
.drop { position: relative; display: grid; gap: .35rem; justify-items: center; text-align: center; padding: 2.5rem 1.5rem 2rem; border: 2px dashed var(--linea); border-radius: var(--r-lg); background: var(--papel); cursor: pointer; transition: border-color .2s, background .2s; overflow: hidden; }
.drop:hover, .drop.is-over { border-color: var(--cobalto); background: rgba(43, 59, 245, .05); }
.drop b { font-family: var(--f-display); font-size: var(--t-xl); }
.drop span { font-size: var(--t-sm); color: var(--grafito); }
.drop .drop-lock { margin-top: .75rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(31, 169, 113, .12); color: #137A52; font-weight: 500; }
.drop-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.drop-progress span { display: block; height: 100%; background: var(--cobalto); transform: scaleX(0); transform-origin: 0 50%; transition: transform .3s; }
.drop-status { min-height: 1.4em; font-weight: 500; color: var(--tinta) !important; }
.drop.is-busy { cursor: progress; }
.health-out h3 { margin-top: 2rem; }
.hbars { color: var(--cobalto); }
.hbars-svg { width: 100%; height: 180px; }
.hbars-labels { display: flex; }
.hbars-labels span { flex: 1; text-align: center; font-size: var(--t-xs); color: var(--grafito); }
.hbars-labels b { display: block; color: var(--tinta); font-variant-numeric: tabular-nums; }

/* Áreas de trabajo: una matriz sobria, como la sección de competencias de un CV */
.area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--linea); border: 1px solid var(--linea); border-radius: var(--r-md); overflow: hidden; }
.area-card { background: var(--papel); padding: clamp(1.5rem, 3vw, 2.25rem); display: grid; align-content: start; gap: .75rem; }
.area-card h3 { font-size: var(--t-lg); line-height: 1.25; }
.area-card p { color: var(--grafito); margin: 0; font-size: var(--t-sm); line-height: 1.6; }
@media (max-width: 720px) { .area-grid { grid-template-columns: minmax(0, 1fr); } }

/* Los hijos de grilla no deben estirar la página con contenido largo (código, botones, URLs) */
.hero-grid > *, .story > *, .lab-item > *, .split > *, .talk > *, .prose > *, .section-head > *,
.lab-cards > *, .pub-feature > *, .p-next > *, .modal-body > *, .did-list > *, .tl-item > * { min-width: 0; }
.browser-bar span { min-width: 0; }
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: left; }
  .mail-big a { font-size: 1.35rem; }
}

/* ── Tarjetas de acceso a cada sección (portada) ─────────────────────── */
.nav-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.nav-card { display: grid; align-content: start; gap: .6rem; padding: clamp(1.5rem, 3vw, 2rem); border: 1px solid var(--linea); border-radius: var(--r-md); background: var(--niebla); text-decoration: none; transition: border-color .25s, transform .4s var(--ease-out), background .25s; }
.nav-card:hover { border-color: var(--tinta); transform: translateY(-3px); color: var(--tinta); background: #fff; }
.nav-card h3 { font-size: var(--t-xl); line-height: 1.2; }
.nav-card p { color: var(--grafito); font-size: var(--t-sm); line-height: 1.6; margin: 0; }
.nav-card-go { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--t-sm); font-weight: 600; color: var(--cobalto); margin-top: .25rem; }
.nav-card:hover .nav-card-go .ico { transform: translateX(3px); }
.nav-card-go .ico { transition: transform .3s var(--ease-out); }
@media (max-width: 720px) { .nav-cards { grid-template-columns: minmax(0, 1fr); } }

/* ── CV: rol objetivo y grupos de herramientas ───────────────────────── */
.target { margin-top: 2rem; padding: clamp(1.25rem, 3vw, 1.75rem); border: 1px solid var(--linea); border-left: 3px solid var(--cobalto); border-radius: var(--r-md); background: var(--papel); max-width: 64ch; }
.target h2 { font-size: var(--t-xl); margin-bottom: .5rem; }
.target p { color: var(--grafito); font-size: var(--t-sm); margin-bottom: 1rem; }
.skill-group { font-size: var(--t-sm); font-weight: 600; color: var(--grafito); margin: 2rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--linea); }
.skill-group:first-child { margin-top: 0; }
