/* Fuentes auto-hospedadas (licencia OFL) */
@font-face {
  font-family: "Source Sans 3";
  src: url("assets/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}
/* Métricas de respaldo para que el cambio de fuente no mueva la página */
@font-face {
  font-family: "Source Sans 3 Fallback";
  src: local("Segoe UI"), local("Arial");
  size-adjust: 95%;
}

/* Paleta WST Explorer */
:root {
  --wst-navy: #0f2b46;
  --wst-navy-800: #1a3f5e;
  --wst-bg: #f0f4f8;
  --wst-surface: #ffffff;
  --wst-surface-soft: #f9fafb;
  --wst-border: #e5e7eb;
  --wst-border-soft: #f3f4f6;
  --wst-green: #2e7d32;
  --wst-green-hover: #256b29;
  --wst-green-50: #e8f5e9;
  --wst-cyan: #4fc3f7;
  --wst-blue: #1976d2;
  --wst-blue-700: #1565c0; /* enlaces y etiquetas sobre el fondo #f0f4f8 (AA) */
  --wst-text: #0f2b46;
  --wst-text-2: #374151;
  --wst-muted: #6b7280;
  --wst-muted-on-bg: #4b5563; /* texto secundario sobre el fondo #f0f4f8 (AA) */
  --wst-dot-off: #9ca3af;
  --wst-map-sea: #e8eef4;

  --font: "Source Sans 3", "Source Sans 3 Fallback", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --bar: 56px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--wst-bg); color: var(--wst-text);
  font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: var(--wst-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { list-style: none; padding: 0; }
button { font: inherit; }
::selection { background: var(--wst-navy); color: #fff; }
:focus-visible { outline: 2px solid var(--wst-blue); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); }
.muted { color: var(--wst-muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }

/* Red de nodos de fondo, muy tenue */
.net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.topbar, .hero, .metrics, main, .contact, .mbar { position: relative; z-index: 1; }
.topbar { z-index: 20; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--wst-navy); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .14s var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn--lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn--green { background: var(--wst-green); color: #fff; }
.btn--green:hover { background: var(--wst-green-hover); }
.btn--glass { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn--glass:hover { background: rgba(255, 255, 255, .18); }
.btn--ghost { border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.btn--outline { border-color: var(--wst-navy); color: var(--wst-navy); background: #fff; }
.btn--outline:hover { background: var(--wst-bg); }

/* Barra superior */
.topbar {
  position: sticky; top: 0; height: var(--bar); background: var(--wst-navy);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .25); display: grid; place-items: center; font: 400 11px var(--mono); color: var(--wst-cyan); }
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.topnav { display: flex; align-items: center; gap: 2px; height: 100%; }
.topnav > a:not(.btn) {
  height: var(--bar); display: flex; align-items: center; padding: 0 12px; font-size: 13px;
  color: rgba(255, 255, 255, .72); white-space: nowrap; border-bottom: 3px solid transparent;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.topnav > a:not(.btn):hover { color: #fff; background: rgba(255, 255, 255, .05); border-bottom-color: var(--wst-cyan); text-decoration: none; }
.topnav .btn { margin-left: 10px; }
.menu-btn { display: none; width: 44px; height: 44px; margin-right: -10px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; place-items: center; }
.menu-btn:hover { background: rgba(255, 255, 255, .08); }
.menu-btn .i-close, .menu-btn[aria-expanded="true"] .i-open { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }

.drawer { position: fixed; inset: var(--bar) 0 0 0; z-index: 19; }
.drawer[hidden] { display: none; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(15, 43, 70, .45); }
.drawer__nav {
  position: relative; background: var(--wst-navy); border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 8px 0 20px; display: flex; flex-direction: column; box-shadow: 0 16px 32px rgba(15, 43, 70, .35);
  max-height: calc(100vh - var(--bar)); overflow-y: auto; animation: drop .22s var(--ease-out);
}
.drawer__nav > a { min-height: 48px; display: flex; align-items: center; padding: 0 24px; font-size: 16px; color: rgba(255, 255, 255, .85); border-left: 3px solid transparent; }
.drawer__nav > a:hover { color: #fff; background: rgba(255, 255, 255, .05); border-left-color: var(--wst-cyan); text-decoration: none; }
.drawer__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 24px 0; }
.drawer__actions .btn { height: 44px; font-size: 15px; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* Portada */
.hero { min-height: min(86vh, 760px); display: flex; align-items: flex-end; overflow: hidden; background: var(--wst-navy); }
.hero__media { position: absolute; inset: 0; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease-in-out; }
.hero__img.is-active { opacity: 1; }
.hero__img[data-scene="llanquihue"] { object-position: 74% 50%; } /* en pantallas angostas, que entre el Osorno */
.hero__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15, 43, 70, .92) 0%, rgba(15, 43, 70, 0) 55%), rgba(0, 0, 0, .38); }
.hero__scenes { position: absolute; top: 16px; right: 16px; z-index: 2; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.scene-card { background: rgba(255, 255, 255, .92); backdrop-filter: blur(4px); border-radius: 6px; padding: 8px 12px; box-shadow: 0 2px 8px rgba(15, 43, 70, .15); display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.scene-card__k { font-size: 11px; color: var(--wst-muted); text-transform: uppercase; letter-spacing: .06em; }
.scene-card__place { font-size: 13px; font-weight: 600; color: var(--wst-navy); }
.scene-card__meta { font-size: 11px; color: var(--wst-blue); }
.thumbs { display: flex; gap: 6px; }
.scene-row { display: flex; gap: 6px; align-items: center; }
.scene-toggle { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 4px; border: 2px solid rgba(255, 255, 255, .5); background: rgba(15, 43, 70, .7); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color .15s ease, transform .14s var(--ease-out); }
.scene-toggle:hover { background: rgba(15, 43, 70, .9); }
.scene-toggle:active { transform: scale(.95); }
.scene-toggle .i-play, .scene-toggle[aria-pressed="true"] .i-pause { display: none; }
.scene-toggle[aria-pressed="true"] .i-play { display: block; }
html:not(.js) .scene-toggle { display: none; }
.thumb { width: 56px; height: 40px; padding: 0; border-radius: 4px; overflow: hidden; cursor: pointer; border: 2px solid rgba(255, 255, 255, .5); background: var(--wst-navy); box-shadow: 0 2px 8px rgba(15, 43, 70, .2); transition: border-color .15s ease, transform .14s var(--ease-out); }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .7; transition: opacity .15s ease; }
.thumb:hover img, .thumb.is-active img { opacity: 1; }
.thumb.is-active { border-color: var(--wst-cyan); }
.thumb:active { transform: scale(.95); }
.hero__content { position: relative; z-index: 1; padding-top: 120px; padding-bottom: 48px; display: grid; gap: 20px; }
.hero__role { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--wst-cyan); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 999px; background: var(--wst-cyan); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--wst-cyan); animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 70%, 100% { transform: scale(2.6); opacity: 0; } }
.hero__name { color: #fff; font-weight: 700; font-size: clamp(38px, 6vw, 64px); line-height: 1.02; letter-spacing: -.02em; max-width: 820px; text-wrap: balance; }
.hero__lead { color: rgba(255, 255, 255, .9); font-size: clamp(17px, 2vw, 20px); line-height: 1.5; max-width: 620px; text-wrap: pretty; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.stack li { font: 400 12px var(--mono); color: rgba(255, 255, 255, .85); padding: 4px 9px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .22); }

/* Métricas */
.metrics { background: #fff; border-bottom: 1px solid var(--wst-border); }
.metrics__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding: 0; }
.metrics__grid > div { padding: 20px 24px; border-left: 1px solid var(--wst-border); display: flex; flex-direction: column; gap: 2px; }
.metrics__n { order: -1; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metrics dt { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--wst-navy); }
.metrics__note { font-size: 12px; color: var(--wst-muted); line-height: 1.4; margin-top: 2px; }

/* Secciones */
.section { padding: 40px 0; display: grid; gap: 24px; }
.sec-head { display: flex; flex-direction: column; gap: 8px; }
.sec-head h2 { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.sec-sub { font-size: 15px; color: var(--wst-muted-on-bg); line-height: 1.5; max-width: 620px; }
.eyebrow { font-size: 12px; color: var(--wst-blue-700); }
.eyebrow--cyan { color: var(--wst-cyan); }
.sec-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.more-link { font-size: 14px; font-weight: 600; color: var(--wst-blue-700); }
.panel { background: #fff; border: 1px solid var(--wst-border); border-radius: 8px; overflow: hidden; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; flex: none; }
.dot--on { background: var(--wst-green); }
.dot--off { background: var(--wst-dot-off); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--wst-muted-on-bg); }
.legend span { display: flex; align-items: center; gap: 6px; }

/* Sobre mí */
.perfil { padding-top: 64px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 32px 48px; }
.perfil .sec-sub { font-size: 14px; margin-top: 8px; }
.perfil__text { grid-column: span 2; display: flex; flex-direction: column; gap: 14px; line-height: 1.65; max-width: 720px; text-wrap: pretty; }
.soft { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.soft li { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--wst-border); background: #fff; color: var(--wst-text-2); }

/* Experiencia */
.exp__row { display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); gap: 4px 24px; padding: 20px 24px; border-top: 1px solid var(--wst-border-soft); transition: background-color .15s ease; }
.exp__row:first-child { border-top: 0; }
.exp__row:hover { background: var(--wst-surface-soft); }
.exp__when { display: flex; align-items: flex-start; gap: 8px; padding-top: 3px; }
.exp__when .dot { margin-top: 5px; }
.exp__when .mono { font-size: 12px; color: var(--wst-muted); white-space: nowrap; }
.exp__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.exp__body h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.exp__org { font-size: 13px; color: var(--wst-blue); font-weight: 500; }
.exp__body p { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--wst-text-2); max-width: 760px; text-wrap: pretty; }
.exp__more { border-top: 1px solid var(--wst-border); background: var(--wst-surface-soft); padding: 8px 0; }
.js .exp__more:not(.is-open) { display: none; }
.more-row { display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); gap: 4px 24px; padding: 8px 24px; font-size: 13px; line-height: 1.5; }
.more-row .mono { font-size: 12px; color: var(--wst-muted); padding-left: 16px; }
.more-row strong { font-weight: 600; }
.more-row .muted { color: var(--wst-muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.exp__toggle { width: 100%; height: 44px; border: 0; border-top: 1px solid var(--wst-border); background: #fff; color: var(--wst-navy); font-weight: 600; font-size: 13px; cursor: pointer; transition: background-color .15s ease; }
.exp__toggle:hover { background: var(--wst-bg); }
html:not(.js) .exp__toggle { display: none; }

/* Mapa de trayectoria */
.tmap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); }
.tmap__map { background: var(--wst-map-sea); border-right: 1px solid var(--wst-border); }
.tmap__stick { position: sticky; top: var(--bar); height: min(calc(100vh - var(--bar)), 760px); min-height: 560px; }
.tmap__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tmap__land { fill: #f7f9fb; stroke: #d5dde6; stroke-width: .7; }
.tmap__chile { fill: #fff; stroke: var(--wst-navy); stroke-width: .9; stroke-linejoin: round; }
.tmap__studies circle { fill: rgba(25, 118, 210, .12); stroke: rgba(25, 118, 210, .55); stroke-width: 1.2; stroke-dasharray: 3 3; transform-box: fill-box; transform-origin: center; transition: opacity .4s ease, transform .5s var(--ease-expo), fill .3s ease; }
.tmap__studies circle.is-new { fill: rgba(79, 195, 247, .28); stroke: var(--wst-blue); }
.tmap__studies circle.is-off { opacity: 0; transform: scale(.4); }
.tmap__places .halo { fill: transparent; transition: fill .3s ease; }
.tmap__places .dot { fill: var(--wst-dot-off); stroke: #fff; stroke-width: 1.5; transition: fill .3s ease; }
.tmap__places text { font: 600 11px var(--font); fill: var(--wst-navy); paint-order: stroke; stroke: var(--wst-map-sea); stroke-width: 3px; stroke-linejoin: round; opacity: .55; transition: opacity .3s ease; }
.tmap__places .is-on .halo { fill: rgba(46, 125, 50, .2); }
.tmap__places .is-on .dot { fill: var(--wst-green); }
.tmap__places .is-on text { opacity: 1; }
.tmap__badge { position: absolute; top: 12px; left: 12px; z-index: 1; background: rgba(255, 255, 255, .92); backdrop-filter: blur(4px); border-radius: 6px; padding: 6px 10px; box-shadow: 0 2px 8px rgba(15, 43, 70, .15); display: grid; gap: 1px; }
.tmap__badge b { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.tmap__badge small { font-size: 11px; color: var(--wst-muted); text-transform: uppercase; letter-spacing: .06em; }
.tmap__legend { position: absolute; left: 12px; bottom: 12px; z-index: 1; background: rgba(255, 255, 255, .95); backdrop-filter: blur(4px); border-radius: 6px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(15, 43, 70, .18); display: grid; gap: 6px; font-size: 12px; }
.tmap__legend span { display: flex; align-items: center; gap: 8px; }
.tmap__side { display: flex; flex-direction: column; min-width: 0; }
.tmap__ctrl { padding: 16px 20px; border-bottom: 1px solid var(--wst-border); display: grid; gap: 10px; }
.tmap__row { display: flex; align-items: center; gap: 12px; }
.tmap__play { width: 40px; height: 40px; flex: none; border: 0; border-radius: 8px; background: var(--wst-green); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color .15s ease, transform .14s var(--ease-out); }
.tmap__play:hover { background: var(--wst-green-hover); }
.tmap__play:active { transform: scale(.94); }
.tmap__play .i-pause, .tmap__play.is-playing .i-play { display: none; }
.tmap__play.is-playing .i-pause { display: block; }
.tmap__range { flex: 1; accent-color: var(--wst-navy); height: 24px; cursor: pointer; }
.tmap__ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--wst-muted); padding-left: 52px; }
.tmap__col { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tmap__col + .tmap__col { border-top: 1px solid var(--wst-border); }
.tmap__col h3 { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.tmap__col h3 em { font-style: normal; font-size: 12px; color: var(--wst-muted); font-weight: 400; }
.tmap__roles, .tmap__studies { display: flex; flex-direction: column; }
.tmap__roles li, .tmap__studies li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--wst-border-soft); font-size: 13px; line-height: 1.4; transition: background-color .15s ease; }
.tmap__roles li.is-hl { background: var(--wst-bg); }
.js .tmap li.is-hidden { display: none; }
.tmap li small { display: block; color: var(--wst-muted); font-size: 12px; }
.tmap .d { margin-top: 5px; width: 8px; height: 8px; border-radius: 999px; }
.d--work { background: var(--wst-green); }
.d--study { background: var(--wst-blue); }
.d--off { background: var(--wst-dot-off); }
.tmap__empty { font-size: 13px; color: var(--wst-muted); padding: 6px 0; }
.js .tmap li.is-new-in { animation: rowin .35s var(--ease-out) both; }
@keyframes rowin { from { opacity: 0; transform: translateX(-6px); } }

/* Habilidades */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1px; background: #fff; border: 1px solid var(--wst-border); border-radius: 8px; overflow: hidden; }
.skill { outline: 1px solid var(--wst-border); background: #fff; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; transition: background-color .15s ease; }
.skill:hover { background: var(--wst-surface-soft); }
.skill__h { display: flex; align-items: baseline; gap: 8px; }
.skill__h .mono { font-size: 11px; color: var(--wst-muted); }
.skill__h h3 { font-size: 15px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips li { font-size: 12px; padding: 3px 8px; border-radius: 4px; background: var(--wst-bg); color: var(--wst-navy); }

/* Proyectos */
.thesis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); background: var(--wst-navy); border-radius: 12px; overflow: hidden; }
.thesis__media { position: relative; min-height: 280px; background: var(--wst-navy-800); }
.thesis__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thesis__cap { position: absolute; left: 16px; bottom: 16px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(4px); border-radius: 6px; padding: 6px 10px; box-shadow: 0 8px 24px rgba(15, 43, 70, .25); font-size: 12px; font-weight: 600; color: var(--wst-navy); }
.thesis__body { padding: 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.kicker { font-size: 12px; color: var(--wst-cyan); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kicker--green { font-size: 11px; color: var(--wst-green); }
.thesis__body h3 { color: #fff; font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; line-height: 1.2; text-wrap: balance; }
.thesis__body > p { color: rgba(255, 255, 255, .8); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.thesis__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid rgba(255, 255, 255, .12); }
.thesis__stats > div { padding: 10px 12px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; }
.thesis__stats > div:first-child { padding-left: 0; }
.thesis__stats > div + div { border-left: 1px solid rgba(255, 255, 255, .12); }
.thesis__stats dd { color: #fff; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.thesis__stats dt { color: rgba(255, 255, 255, .7); font-size: 12px; }
.thesis__vs dd { color: var(--wst-cyan); font-size: 14px; font-weight: 600; line-height: 1.3; }
.tags-dark { display: flex; flex-wrap: wrap; gap: 6px; }
.tags-dark li { font: 400 11px var(--mono); color: #fff; padding: 3px 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); }
.thesis__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.area { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--wst-border); border-radius: 8px; overflow: hidden; color: var(--wst-navy); transition: border-color .15s ease; }
.area:hover { border-color: var(--wst-blue); text-decoration: none; }
.area__img { aspect-ratio: 16 / 10; background: var(--wst-bg); overflow: hidden; }
.area__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s var(--ease-expo); }
@media (hover: hover) { .area:hover .area__img img { transform: scale(1.04); } }
.area__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.area__t { font-size: 15px; font-weight: 600; line-height: 1.3; }
.area__d { font-size: 12px; line-height: 1.45; color: var(--wst-muted); text-wrap: pretty; }
@media (max-width: 899px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .areas { gap: 8px; } .area__body { padding: 8px 10px 10px; } .area__t { font-size: 14px; } .area__d { display: none; } }

/* Publicaciones */
.pubs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.pubs-lists { grid-column: span 2; display: grid; gap: 16px; min-width: 0; }
.hist { padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--bar) + 16px); overflow: visible; }
.hist__top { display: flex; justify-content: space-between; align-items: baseline; }
.hist__title { font-size: 13px; font-weight: 600; }
.hist__count { font-size: 12px; color: var(--wst-muted); }
.hist__bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; border-bottom: 1px solid var(--wst-border); }
.hist__bars button { flex: 1; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.hist__bars button:disabled { cursor: default; }
.hist__bars .mono { font-size: 10px; color: var(--wst-muted); }
.hist__bars i { display: block; width: 100%; height: var(--h); background: var(--wst-blue); border-radius: 2px 2px 0 0; transform-origin: bottom; transition: background-color .2s ease, transform .9s var(--ease-expo); }
.hist__bars i.is-empty { height: 2px; background: var(--wst-border); }
.hist__bars button:not(:disabled):hover i { background: #1565c0; }
.hist__bars.has-year button[aria-pressed="false"] i:not(.is-empty) { background: #c5d3e0; }
.hist__bars button[aria-pressed="true"] i { background: var(--wst-green); }
.hist__years { display: flex; gap: 4px; }
.hist__years span { flex: 1; text-align: center; font-size: 10px; color: var(--wst-muted); }
.hist__clear { height: 32px; border: 1px solid var(--wst-border); border-radius: 4px; background: #fff; color: var(--wst-navy); font-weight: 600; font-size: 12px; cursor: pointer; }
.hist__clear:hover { background: var(--wst-bg); }
.hist__note { font-size: 12px; color: var(--wst-muted); line-height: 1.5; }
.pubs li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; padding: 16px 20px; border-top: 1px solid var(--wst-border-soft); }
.pubs li:first-child { border-top: 0; }
.js .pubs li.is-hidden { display: none; }
.pubs__y { font-size: 13px; color: var(--wst-blue); font-weight: 500; padding-top: 1px; }
.pubs li > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pubs a, .pubs__t { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--wst-navy); text-wrap: pretty; }
.pubs a:hover { color: var(--wst-blue); text-decoration: underline; }
.pubs__a { font-size: 13px; color: var(--wst-muted); line-height: 1.5; }
.pubs__a strong { color: var(--wst-navy); font-weight: 600; }
.venue { align-self: flex-start; font-size: 11px; font-weight: 600; color: var(--wst-green); background: var(--wst-green-50); padding: 2px 8px; border-radius: 4px; }
.venue--blue { color: #1565c0; background: #e3f2fd; }
.pubs-sub { font-size: 15px; font-weight: 600; margin-top: 8px; }

/* Formación */
.section#formacion { padding-bottom: 64px; }
.degrees { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.degree { background: #fff; border: 1px solid var(--wst-border); border-top: 3px solid var(--wst-navy); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.degree .mono { font-size: 12px; color: var(--wst-blue); }
.degree h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.degree .muted { font-size: 13px; }
.courses summary { padding: 14px 18px; cursor: pointer; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; }
.courses summary .mono { font-size: 12px; font-weight: 400; }
.courses__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 24px; padding: 4px 18px 16px; }
.courses__grid > div { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--wst-border-soft); font-size: 13px; line-height: 1.4; }
.courses__grid .mono { font-size: 12px; color: var(--wst-muted); }
.courses__grid strong { font-weight: 600; }

/* Contacto */
.contact { background: var(--wst-navy); color: #fff; }
.contact__grid { padding-top: 64px; padding-bottom: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 40px; }
.contact__intro { display: flex; flex-direction: column; gap: 14px; }
.contact__intro h2 { font-size: clamp(32px, 4vw, 44px); font-weight: 700; line-height: 1.05; color: #fff; }
.contact__intro p { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .8); max-width: 440px; }
.contact__intro .btn { align-self: flex-start; margin-top: 6px; }
.contact__list { border-top: 1px solid rgba(255, 255, 255, .1); }
.contact__list li { border-bottom: 1px solid rgba(255, 255, 255, .1); }
.contact__list a { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; color: #fff; border-left: 3px solid transparent; transition: background-color .15s ease, padding-left .2s var(--ease-out), border-color .15s ease; }
.contact__list a:hover { background: rgba(255, 255, 255, .05); border-left-color: var(--wst-cyan); padding-left: 10px; text-decoration: none; }
.contact__k { font-size: 12px; color: rgba(255, 255, 255, .7); text-transform: uppercase; letter-spacing: .06em; }
.contact__v { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact__go { color: var(--wst-cyan); }
.contact__foot { padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12px; color: rgba(255, 255, 255, .7); }

/* Barra inferior móvil */
.mbar { display: none; }

/* Movimiento: entradas al hacer scroll (sin movimiento si el usuario lo pide) */
@media (prefers-reduced-motion: no-preference) {
  .js [data-in] { opacity: 0; transform: translateY(16px); animation: rise .8s var(--ease-expo) forwards; }
  .js .hero__content [data-in]:nth-child(2) { animation-delay: 80ms; }
  .js .hero__content [data-in]:nth-child(3) { animation-delay: 160ms; }
  .js .hero__content [data-in]:nth-child(4) { animation-delay: 240ms; }
  .js .hero__content [data-in]:nth-child(5) { animation-delay: 320ms; }
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .8s var(--ease-out); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .hist:not(.is-in) .hist__bars i:not(.is-empty) { transform: scaleY(0); }
  .js .hist__bars button:nth-child(n) i { transition-delay: calc(var(--d, 0) * 60ms); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse::after { animation: none; }
  .hero__img, .tmap__studies circle { transition: none; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* Cortes del diseño */
@media (max-width: 899px) {
  .topnav { display: none; }
  .menu-btn { display: grid; }
  .mbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 18;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(4px); border-top: 1px solid var(--wst-border);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(15, 43, 70, .12);
  }
  .mbar .btn { height: 44px; font-size: 15px; }
  .contact { padding-bottom: 72px; }
  /* la portada termina justo sobre la barra fija de contacto: las etiquetas siempre quedan a la vista */
  .hero { min-height: min(760px, calc(100vh - var(--bar) - 65px)); min-height: min(760px, calc(100svh - var(--bar) - 65px - env(safe-area-inset-bottom))); }
}
@media (max-width: 759px) {
  .perfil__text, .pubs-lists { grid-column: auto; }
  .hist { position: static; }
  .tmap { grid-template-columns: 1fr; }
  .tmap__map { border-right: 0; border-bottom: 1px solid var(--wst-border); }
  .tmap__stick { position: relative; top: 0; height: 560px; }
}
@media (max-width: 599px) {
  .container { padding-inline: 16px; }
  .topbar { padding: 0 16px; }
  .exp__row { grid-template-columns: minmax(0, 1fr); }
  .more-row { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
  .more-row .mono { padding-left: 0; }
  .scene-card { display: none; }
  .hero__scenes { left: 16px; align-items: stretch; }
  .thumbs { display: grid; grid-template-columns: repeat(4, 56px); gap: 6px; } /* 8 escenas en 2 filas */
  .scene-row { justify-content: flex-end; align-items: flex-start; }
  .hero__content { padding-top: 124px; padding-bottom: 20px; gap: 16px; }
  .thesis__body { padding: 24px; }
  .metrics__grid > div { padding: 16px; }
  .contact__list a { grid-template-columns: 92px minmax(0, 1fr) auto; }
}
@media (max-width: 599px) and (max-height: 620px) {
  /* celulares bajos: portada más compacta para que las etiquetas no queden bajo la barra */
  .hero__content { padding-top: 116px; padding-bottom: 14px; gap: 10px; }
  .hero__name { font-size: 32px; }
  .hero__lead { font-size: 16px; line-height: 1.4; }
}
