/* ==========================================================
   Alejandro Barrientos · web personal
   Tokens → base → comunes → portada (dashboard) → proyectos → CV → contacto → movimiento
   ========================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
/* Layout: rejilla de tarjetas tipo widgets en la portada; páginas interiores con columna de 980 px. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-raise: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --line: #d2d2d7;
  --link: #0066cc;
  --primary: #0071e3;
  --primary-ink: #ffffff;
  --frame: #1d1d1f;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --shadow-phone: 0 40px 80px -30px rgba(29, 29, 31, 0.35);
  --shadow-hover: 0 24px 48px -24px rgba(29, 29, 31, 0.28);
  --bar-edu: #d2d2d7;
  --bar-work: #1d1d1f;
  --bar-work-ink: #ffffff;
  --ok: #1a7f37;
  --error: #d70015;

  --worldfy: #5f4ee0;  --worldfy-ink: #ffffff;  --worldfy-deep: #3f2fc4;
  --nomify: #0c7d59;   --nomify-ink: #ffffff;   --nomify-soft: #e7f6ef;
  --carfy: #2861f0;    --carfy-ink: #ffffff;

  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 980px;
  --wide: 1200px;
  --gutter: max(16px, min(4vw, 24px));
  --radius-card: 28px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #161617;
    --bg-raise: #1d1d1f;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --line: #38383b;
    --link: #2997ff;
    --frame: #2c2c2e;
    --nav-bg: rgba(22, 22, 23, 0.82);
    --shadow-phone: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
    --shadow-hover: 0 24px 48px -24px rgba(0, 0, 0, 0.9);
    --bar-edu: #3a3a3c;
    --bar-work: #f5f5f7;
    --bar-work-ink: #1d1d1f;
    --ok: #3fb950;
    --error: #ff6961;
    --worldfy: #8b7bec;  --worldfy-ink: #120d33;  --worldfy-deep: #3a2bb0;
    --nomify: #10b981;   --nomify-ink: #04140d;   --nomify-soft: #0b2a1f;
    --carfy: #5a8bff;    --carfy-ink: #04102e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #161617;
  --bg-raise: #1d1d1f;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --line: #38383b;
  --link: #2997ff;
  --frame: #2c2c2e;
  --nav-bg: rgba(22, 22, 23, 0.82);
  --shadow-phone: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  --shadow-hover: 0 24px 48px -24px rgba(0, 0, 0, 0.9);
  --bar-edu: #3a3a3c;
  --bar-work: #f5f5f7;
  --bar-work-ink: #1d1d1f;
  --ok: #3fb950;
  --error: #ff6961;
  --worldfy: #8b7bec;  --worldfy-ink: #120d33;  --worldfy-deep: #3a2bb0;
  --nomify: #10b981;   --nomify-ink: #04140d;   --nomify-soft: #0b2a1f;
  --carfy: #5a8bff;    --carfy-ink: #04102e;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.5; letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100svh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
.footer { width: 100%; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, p, ul, dl, dd, figure { margin: 0; }
h1, h2, h3, .lead, .sub { text-wrap: balance; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.date { color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: #0077ed; }
.btn--hue { background: var(--hue); color: var(--hue-ink); }
.btn--hue:hover { filter: brightness(1.08); }
.btn--ghost { color: var(--hue, var(--link)); border-color: currentColor; background: transparent; }
.btn--ghost:hover { background: var(--hue, var(--link)); color: var(--hue-ink, #fff); border-color: transparent; }
.btn--block { width: 100%; }
.link { color: var(--link); text-decoration: none; }
.link:hover { text-decoration: underline; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  background: var(--bg); color: var(--ink-2);
}
.pill--live::before, .pill--dev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.pill--live::before { background: var(--ok); }
.pill--dev::before { background: #ff9f0a; }

/* ---------- Navegación ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
  view-transition-name: nav;
}
.nav.is-scrolled { border-bottom-color: color-mix(in srgb, var(--line) 60%, transparent); }
.nav__inner { max-width: var(--wide); margin: 0 auto; height: 52px; padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px; }
.nav__name { font-weight: 600; font-size: 15px; text-decoration: none; letter-spacing: -0.02em; margin-right: auto; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { font-size: 13px; color: var(--ink); opacity: .72; text-decoration: none; transition: opacity .2s; }
.nav__links a:hover, .nav__links a[aria-current="page"] { opacity: 1; }
.nav__links a[aria-current="page"] { font-weight: 600; }
.lang { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--bg-alt); }
.lang button { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; min-width: 36px; height: 26px; border-radius: 999px; color: var(--ink-2); transition: background-color .25s var(--ease), color .25s var(--ease); }
.lang button[aria-pressed="true"] { background: var(--bg-raise); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.nav__menu { display: none; }

@media (max-width: 640px) {
  .nav__inner { gap: 12px; }
  .nav__menu { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; border: 0; background: transparent; cursor: pointer; }
  .nav__menu span { display: block; width: 18px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform .35s var(--ease); }
  .nav__menu[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav__menu[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav__links {
    position: absolute; top: 52px; left: 0; right: 0; flex-direction: column; gap: 0;
    padding: 8px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
  .nav__links a { font-size: 24px; font-weight: 600; opacity: 1; padding: 10px 0; letter-spacing: -0.02em; }
}

/* ---------- Cabecera de página interior ---------- */
.page-head { max-width: 760px; margin: 0 auto; padding: clamp(64px, 10vw, 112px) var(--gutter) 0; text-align: center; }
.page-head h1 { font-size: clamp(48px, 8vw, 88px); font-weight: 680; line-height: 1; letter-spacing: -0.05em; }
.page-head .sub { margin-top: 16px; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.35; color: var(--ink-2); letter-spacing: -0.02em; }
.page-head .btn { margin-top: 28px; }

.section-title { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section-title h2 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 650; letter-spacing: -0.04em; line-height: 1.08; }
.section-title p { margin-top: 8px; color: var(--ink-2); font-size: 19px; letter-spacing: -0.015em; }

/* ---------- Teléfono ---------- */
.phone {
  --pw: 260px;
  width: var(--pw); max-width: 100%; aspect-ratio: 600 / 1298;
  padding: calc(var(--pw) * 0.034); border-radius: calc(var(--pw) * 0.16);
  background: var(--frame);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), var(--shadow-phone);
  flex: none;
}
.phone img, .phone picture { width: 100%; height: 100%; }
.phone img { object-fit: cover; object-position: top; border-radius: calc(var(--pw) * 0.13); }

/* ==========================================================
   PORTADA · dashboard de datos
   ========================================================== */
.dash { max-width: var(--wide); margin: 0 auto; padding: 0 12px 96px; }
.dash-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: clamp(40px, 6vw, 72px) 12px clamp(24px, 3vw, 32px);
}
.dash-head h1 { font-size: clamp(40px, 5.6vw, 72px); font-weight: 690; line-height: 0.96; letter-spacing: -0.05em; }
.dash-head .sub { margin-top: 12px; font-size: clamp(17px, 1.8vw, 21px); color: var(--ink-2); letter-spacing: -0.015em; max-width: 34em; }
.dash-head__meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.dash-head__meta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }

.bento { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.card {
  position: relative;
  display: flex; flex-direction: column; min-width: 0;
  padding: 24px; border-radius: var(--radius-card);
  background: var(--bg-alt); color: var(--ink); text-decoration: none;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
a.card:hover { transform: scale(1.012); box-shadow: var(--shadow-hover); }
a.card:active { transform: scale(0.99); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.card__label { font-size: 14px; font-weight: 600; color: var(--ink-2); letter-spacing: -0.01em; }
.card__title { margin-top: 6px; font-size: 22px; font-weight: 650; line-height: 1.15; letter-spacing: -0.03em; }
.card__text { margin-top: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.card__foot { margin-top: auto; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.go {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--bg);
  transition: transform .4s var(--ease);
}
.go svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
a.card:hover .go, a.go:hover { transform: scale(1.12); }
.textlink { font-size: 14px; font-weight: 500; color: var(--link); text-decoration: none; }
.textlink:hover { text-decoration: underline; }

/* Tooltip compartido: cualquier elemento con data-tip */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 5;
  transform: translate(-50%, 4px);
  padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 500; line-height: 1.3; letter-spacing: 0;
  width: max-content; max-width: min(260px, 72vw); white-space: normal; text-align: left;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s var(--ease);
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.tip--left::after { left: 0; transform: translate(0, 4px); }
.tip--left:hover::after, .tip--left:focus-visible::after { transform: none; }
.tip--right::after { left: auto; right: 0; transform: translate(0, 4px); }
.tip--right:hover::after, .tip--right:focus-visible::after { transform: none; }

/* KPI */
.kpi { min-height: 208px; }
.kpi__value { margin-top: 10px; display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.kpi__value strong { font-size: clamp(44px, 4.4vw, 56px); font-weight: 650; letter-spacing: -0.045em; line-height: 1; }
.kpi__value span { font-size: 17px; font-weight: 550; color: var(--ink-2); }
.kpi__note { margin-top: 6px; font-size: 13px; color: var(--ink-2); line-height: 1.35; }

/* Mini barras por año */
.spark { margin-top: auto; padding-top: 16px; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 6px; align-items: end; }
.spark__col { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.spark__track { height: 44px; display: flex; align-items: flex-end; }
.spark__bar { width: 100%; height: calc(var(--v, 0) / 12 * 100%); min-height: 2px; background: var(--primary); border-radius: 4px 4px 0 0; transition: height .9s var(--ease); }
.spark__col span { font-size: 11px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }

/* Barra segmentada de estado */
.segbar { margin-top: auto; padding-top: 16px; }
.segbar__track { display: flex; gap: 2px; height: 10px; }
.segbar__track i { flex: 1; border-radius: 2px; }
.segbar__track i:first-child { border-radius: 4px 2px 2px 4px; }
.segbar__track i:last-child { border-radius: 2px 4px 4px 2px; }
.seg--live { background: var(--ok); }
.seg--dev { background: #ff9f0a; }
.segbar__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.segbar__legend span { display: inline-flex; align-items: center; gap: 6px; }
.segbar__legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.segbar__legend .l-live::before { background: var(--ok); }
.segbar__legend .l-dev::before { background: #ff9f0a; }

/* Anillo */
.ring { position: absolute; top: 22px; right: 22px; width: 52px; height: 52px; }
.ring circle { fill: none; stroke-width: 6; }
.ring .ring__bg { stroke: var(--bar-edu); }
.ring .ring__fg { stroke: var(--ok); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: 125.66; stroke-dashoffset: calc(125.66 * (1 - var(--v, 0))); transition: stroke-dashoffset 1.1s var(--ease); }

.langs-mini { margin-top: auto; padding-top: 16px; display: grid; gap: 6px; font-size: 13px; }
.langs-mini li { display: flex; justify-content: space-between; gap: 8px; }
.langs-mini span { color: var(--ink-2); }

/* Trayectoria (cronograma) */
.tl { margin-top: 22px; display: grid; gap: 10px; }
.tl__lane { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 12px; }
.tl__lane > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.tl__track { position: relative; height: 36px; }
.tl__bar {
  position: absolute; top: 0; bottom: 0;
  left: calc((var(--s) - 2020) / 7 * 100%);
  width: calc((var(--e) - var(--s)) / 7 * 100%);
  min-width: 14px;
  display: flex; align-items: center; padding: 0 10px;
  border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: filter .25s, translate .3s var(--ease);
}
.tl__bar > b { min-width: 0; overflow: hidden; font-weight: 600; }
.tl__bar--edu { background: var(--bar-edu); color: var(--ink); }
.tl__bar--work { background: var(--bar-work); color: var(--bar-work-ink); }
.tl__bar--now { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.tl__bar:hover, .tl__bar:focus-visible { translate: 0 -2px; filter: brightness(1.12); z-index: 4; }
.tl__axis { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
.tl__ticks { position: relative; height: 18px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tl__ticks span { position: absolute; transform: translateX(-50%); left: calc((var(--y) - 2020) / 7 * 100%); }
.tl__ticks span:first-child { transform: none; }
.tl__today { position: absolute; top: -6px; bottom: -6px; width: 2px; left: calc((var(--today, 2026.8) - 2020) / 7 * 100%); background: var(--primary); border-radius: 2px; }
.tl__legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.tl__legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl__legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.tl__legend .l-edu::before { background: var(--bar-edu); }
.tl__legend .l-work::before { background: var(--bar-work); }
.tl__legend .l-today::before { width: 2px; height: 12px; border-radius: 1px; background: var(--primary); }

/* Experiencia por área + SQL */
.seg {
  display: inline-flex; padding: 2px; border-radius: 999px; background: var(--bg-raise);
}
.seg button { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; height: 28px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); transition: background-color .25s var(--ease), color .25s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
[data-panel] { flex: 1; display: flex; flex-direction: column; }
.hbars { margin-top: 20px; display: grid; gap: 14px; }
.hbars__total { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hbars__total b { color: var(--ink); font-weight: 600; }
.hbars + .hbars__total { margin-top: auto; }
[data-panel="chart"] .hbars { margin-bottom: 20px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.hbar__label { font-size: 14px; font-weight: 500; }
.hbar__value { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.hbar__track { grid-column: 1 / -1; height: 12px; border-radius: 4px; background: var(--bar-edu); }
.hbar__fill { display: block; height: 100%; width: calc(var(--v, 0) * 100%); border-radius: 4px; background: var(--primary); transition: width 1s var(--ease); }
.code {
  margin: 20px 0 0; padding: 18px 20px; border-radius: 16px;
  background: var(--bg-raise); overflow-x: auto;
  font: 500 13.5px/1.7 ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color: var(--ink); tab-size: 2;
}
.code .kw { color: var(--link); font-weight: 600; }
.code .fn { color: var(--ink); font-weight: 600; }
.code-result { margin-top: 12px; width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.code-result th, .code-result td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.code-result th { color: var(--ink-2); font-weight: 600; }
.code-result td:last-child, .code-result th:last-child { text-align: right; }

/* Matriz de tecnologías por app */
.matrix { margin-top: 16px; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.matrix th, .matrix td { padding: 7px 4px; text-align: center; }
.matrix thead th { font-size: 12px; font-weight: 600; color: var(--ink-2); vertical-align: bottom; }
.matrix thead a { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: inherit; }
.matrix thead a:hover { color: var(--ink); }
.matrix thead img { width: 22px; height: 22px; border-radius: 6px; }
.matrix tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.matrix td.cell i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line); vertical-align: middle; }
.matrix td.cell.on i { background: var(--ink); border-color: var(--ink); }
.matrix tbody tr { transition: background-color .2s; }
.matrix tbody tr:hover th, .matrix tbody tr:hover td { background: var(--bg-raise); }
.matrix tbody tr:hover th:first-child { border-radius: 8px 0 0 8px; }
.matrix tbody tr:hover td:last-child { border-radius: 0 8px 8px 0; }
.matrix .col-hl { background: var(--bg-raise); }
.matrix .use { width: 34%; text-align: left; }
.use__bar { display: flex; align-items: center; gap: 8px; }
.use__bar b { display: block; height: 8px; width: calc(var(--n) / 3 * 100%); max-width: 80%; border-radius: 0 4px 4px 0; background: var(--ink-2); }
.use__bar span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Lista de proyectos */
.plist { margin-top: 12px; display: grid; }
.plist a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 8px; margin: 0 -8px; border-radius: 14px; text-decoration: none; color: inherit; transition: background-color .2s; }
.plist a:hover { background: var(--bg-raise); }
.plist li + li a { border-top: 1px solid var(--line); border-radius: 0; }
.plist li + li a:hover { border-radius: 14px; border-top-color: transparent; }
.plist img { width: 40px; height: 40px; border-radius: 10px; }
.plist strong { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.plist small { display: block; font-size: 13px; color: var(--ink-2); }
.plist .pill { background: var(--bg-raise); white-space: nowrap; }
.plist a:hover .pill { background: var(--bg); }
.plist .p-worldfy img { view-transition-name: icon-worldfy; }
.plist .p-nomify img { view-transition-name: icon-nomify; }
.plist .p-carfy img { view-transition-name: icon-carfy; }

/* CV y contacto */
.doc__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-raise); }
.doc__icon svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.card--doc .card__title, .card--contact .card__title { margin-top: 16px; }
.card--contact { background: var(--ink); color: var(--bg); }
.card--contact .card__text { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.card--contact .doc__icon { background: color-mix(in srgb, var(--bg) 14%, transparent); }
.card--contact .doc__icon svg { stroke: var(--bg); }
.card--contact .go { background: var(--bg); color: var(--ink); }

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: span 2; }
  .card--degree { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento { gap: 10px; }
  .card { padding: 18px; border-radius: 22px; }
  .kpi { min-height: 188px; }
  .kpi__value strong { font-size: 40px; }
  .ring { top: 16px; right: 16px; width: 40px; height: 40px; }
  .tl__lane, .tl__axis { grid-template-columns: 1fr; gap: 6px; }
  .tl__axis > span { display: none; }
  .matrix { font-size: 13px; }
  .matrix .use { width: 26%; }
  .plist .pill { font-size: 11px; padding: 3px 8px; }
}

/* ==========================================================
   PROYECTOS
   ========================================================== */
.feature {
  --hue: var(--worldfy); --hue-ink: var(--worldfy-ink);
  max-width: var(--wide); margin: clamp(48px, 7vw, 72px) auto 0; padding: 0 12px;
}
.feature__card {
  position: relative; overflow: hidden;
  background: var(--bg-alt); border-radius: var(--radius-card);
  padding: clamp(48px, 6vw, 72px) var(--gutter) 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-height: 820px;
}
.feature__icon { width: 64px; height: 64px; border-radius: 15px; margin-bottom: 18px; view-transition-name: icon-worldfy; }
.feature h2 { font-size: clamp(44px, 6vw, 72px); font-weight: 680; letter-spacing: -0.05em; line-height: 1; }
.feature__tag { margin-top: 10px; font-size: clamp(21px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.025em; }
.feature__status { margin-top: 10px; color: var(--ink-2); }
.feature__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }

.fan { --p: 1; position: relative; width: 100%; flex: 1; margin-top: 56px; min-height: 440px; }
.fan .phone { --pw: clamp(200px, 22vw, 290px); position: absolute; top: 0; left: 50%; }
.fan__center { z-index: 3; transform: translateX(-50%) translateY(calc((1 - var(--p)) * 60px)); }
.fan__left { z-index: 2; transform: translateX(calc(-50% - var(--p) * 78%)) translateY(calc(40px + (1 - var(--p)) * 30px)) rotate(calc(var(--p) * -6deg)) scale(.92); }
.fan__right { z-index: 1; transform: translateX(calc(-50% + var(--p) * 78%)) translateY(calc(40px + (1 - var(--p)) * 30px)) rotate(calc(var(--p) * 6deg)) scale(.92); }

.feature__detail { max-width: var(--wrap); margin: 0 auto; padding: clamp(56px, 8vw, 88px) var(--gutter) 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.gallery { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 40px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery .phone { --pw: 190px; scroll-snap-align: start; --shadow-phone: 0 24px 48px -24px rgba(0,0,0,.4); }
.feature__detail .gallery { overflow: visible; justify-content: center; gap: 12px; }
.feature__detail .gallery .phone { --pw: clamp(104px, 11vw, 128px); }

.facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }

.dev { padding: clamp(96px, 12vw, 140px) 0 0; }
.dev__grid { max-width: var(--wrap); margin: 40px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.devcard { --hue: var(--link); --hue-ink: #fff; background: var(--bg-alt); border-radius: var(--radius-card); padding: 32px; display: flex; flex-direction: column; min-width: 0; }
.devcard--nomify { --hue: var(--nomify); --hue-ink: var(--nomify-ink); }
.devcard--carfy { --hue: var(--carfy); --hue-ink: var(--carfy-ink); }
.devcard__head { display: flex; align-items: center; gap: 14px; }
.devcard__head img { width: 52px; height: 52px; border-radius: 12px; }
.devcard--nomify .devcard__head img { view-transition-name: icon-nomify; }
.devcard--carfy .devcard__head img { view-transition-name: icon-carfy; }
.devcard h3 { font-size: 28px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.1; }
.devcard__head .pill { margin-top: 4px; background: var(--bg-raise); }
.devcard__tag { margin-top: 18px; font-size: 19px; font-weight: 550; letter-spacing: -0.02em; line-height: 1.3; }
.devcard .facts { margin-top: 18px; font-size: 15px; }
.devcard .facts > div { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 12px 0; }
.devcard .facts > div:last-child { border-bottom: 0; }
.devcard__visual { margin-top: 20px; }
.devcard__shots { display: flex; gap: 12px; }
.devcard__shots .phone { --pw: 132px; --shadow-phone: 0 16px 32px -16px rgba(0,0,0,.35); }
.devcard__actions { margin-top: 22px; }
.modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.modules li { position: relative; aspect-ratio: 1.3; display: flex; align-items: flex-end; padding: 10px; border-radius: 14px; background: var(--nomify-soft); font-size: 13px; font-weight: 550; line-height: 1.15; letter-spacing: -0.01em; hyphens: auto; }
.modules li::before { content: ""; position: absolute; top: 10px; left: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--nomify); }
.modules__cap { margin-top: 10px; font-size: 13px; color: var(--ink-2); }

@media (max-width: 860px) {
  .feature__detail { grid-template-columns: minmax(0, 1fr); }
  .dev__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .feature__card { min-height: 700px; border-radius: 24px; }
  .fan .phone { --pw: 190px; }
  .fan__left  { transform: translateX(calc(-50% - var(--p) * 58%)) translateY(calc(36px + (1 - var(--p)) * 30px)) rotate(calc(var(--p) * -6deg)) scale(.88); }
  .fan__right { transform: translateX(calc(-50% + var(--p) * 58%)) translateY(calc(36px + (1 - var(--p)) * 30px)) rotate(calc(var(--p) * 6deg)) scale(.88); }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .devcard { padding: 24px 20px; }
  .devcard .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .feature__detail .gallery { overflow-x: auto; justify-content: flex-start; }
  .feature__detail .gallery .phone { --pw: 104px; }
}

/* ==========================================================
   CURRÍCULUM
   ========================================================== */
.subnav {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 52px); z-index: 40;
  margin-top: clamp(40px, 6vw, 64px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.subnav ul { max-width: var(--wrap); margin: 0 auto; padding: 10px var(--gutter); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { display: block; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; transition: background-color .25s var(--ease), color .25s var(--ease); }
.subnav a:hover { color: var(--ink); }
.subnav a.is-active { background: var(--ink); color: var(--bg); }

.specs { max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gutter) 0; }
.spec { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 40px 0; border-top: 1px solid var(--line); }
.spec:first-child { border-top: 0; }
.spec > h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.spec__body { max-width: 680px; }
.spec__intro { font-size: 21px; line-height: 1.45; letter-spacing: -0.02em; }
.job + .job { margin-top: 40px; }
.job__head h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.job__where { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.role { margin-top: 18px; }
.role__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.role__head h4 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.role ul { margin-top: 8px; display: grid; gap: 6px; }
.role li { position: relative; padding-left: 18px; }
.role li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-2); }
.entries { display: grid; gap: 24px; }
.entries dt { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.entries dd { color: var(--ink-2); font-size: 15px; }
.entries dd.date { margin-top: 2px; }
.skills { display: grid; gap: 20px; }
.skills dt { font-weight: 600; font-size: 17px; letter-spacing: -0.015em; }
.skills dd { color: var(--ink-2); margin-top: 2px; }
.langs { display: flex; flex-wrap: wrap; gap: 12px 40px; }
.langs li { display: flex; flex-direction: column; }
.langs strong { font-weight: 600; font-size: 17px; }
.langs span { color: var(--ink-2); font-size: 15px; }
@media (max-width: 640px) {
  .subnav ul { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); padding-right: 48px; }
  .subnav ul.at-end { -webkit-mask-image: none; mask-image: none; }
  .spec { grid-template-columns: 1fr; gap: 14px; padding: 32px 0; }
  .spec__intro { font-size: 19px; }
}

/* ==========================================================
   CONTACTO
   ========================================================== */
.form { max-width: 560px; margin: clamp(40px, 6vw, 56px) auto 0; padding: 0 var(--gutter); display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg-alt); border: 1px solid transparent; border-radius: 14px; padding: 14px 16px; transition: border-color .2s, background-color .2s; }
.field textarea { resize: vertical; min-height: 160px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--link); background: var(--bg); }
.form .btn { margin-top: 8px; }
.form__status { min-height: 1.5em; text-align: center; font-size: 15px; color: var(--ink-2); }
.form__status.is-ok { color: var(--ink); }
.form__status.is-error { color: var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.socials { display: flex; justify-content: center; gap: 12px; margin-top: 40px; padding: 0 var(--gutter); }
.socials a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 20px; border-radius: 999px; background: var(--bg-alt); text-decoration: none; font-weight: 500; font-size: 15px; transition: transform .3s var(--ease); }
.socials a:hover { transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Pie ---------- */
.page-end { padding-bottom: clamp(96px, 12vw, 140px); }
.footer { max-width: var(--wide); margin: 0 auto; padding: 20px var(--gutter) 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--ink-2); }
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }
@media (max-width: 640px) { .footer { flex-direction: column; gap: 8px; } }

/* ==========================================================
   MOVIMIENTO
   ========================================================== */
/* Transición suave entre páginas (Chrome, Edge, Safari 18.2+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s ease-in both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* Portada: las tarjetas entran una vez, escalonadas */
.js .bento > .card { opacity: 0; transform: translateY(24px) scale(.985); }
.js .bento.is-in > .card { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform 1s var(--ease), box-shadow .5s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .bento.is-in > a.card:hover { transform: scale(1.012); transition-delay: 0s; }
.js .bento.is-in > a.card:active { transform: scale(0.99); }

/* Los gráficos crecen desde cero al entrar */
.js .bento:not(.is-in) .spark__bar { height: 2px; }
.js .bento:not(.is-in) .hbar__fill { width: 0; }
.js .bento:not(.is-in) .ring__fg { stroke-dashoffset: 125.66; }

/* Páginas interiores: aparición al hacer scroll */
.js .reveal { opacity: 0; transform: translateY(32px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1.2s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .bento > .card, .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .fan { --p: 1 !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
