/* =========================================================
   Tokens
   ========================================================= */
:root {
  --bg: #F4F3EE;
  --surface: #FBFBF8;
  --ink: #121815;
  --muted: #5B6660;
  --line: rgba(18, 24, 21, .12);
  --accent: #1F6B58;
  --accent-ink: #F4F3EE;

  /* Sección invertida (proyectos) */
  --inv-bg: #121815;
  --inv-surface: #1A221F;
  --inv-ink: #ECEFEA;
  --inv-muted: #8E9A94;
  --inv-line: rgba(236, 239, 234, .12);
  --inv-accent: #8FD3BD;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --radius: 18px;
  --container: 1240px;
  --header-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B100E;
    --surface: #111815;
    --ink: #ECEFEA;
    --muted: #8E9A94;
    --line: rgba(236, 239, 234, .1);
    --accent: #8FD3BD;
    --accent-ink: #0B100E;

    --inv-bg: #E9ECE6;
    --inv-surface: #F6F7F3;
    --inv-ink: #0F1512;
    --inv-muted: #56615B;
    --inv-line: rgba(15, 21, 18, .12);
    --inv-accent: #1F6B58;
    color-scheme: dark;
  }
}

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h3 { font-size: 1.125rem; font-weight: 500; line-height: 1.3; letter-spacing: -.005em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: italic; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

.mono { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .02em; text-transform: uppercase; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Cambio de idioma: fundido con blur para que el cambio no sea brusco */
main, .nav, .site-footer { transition: filter 160ms ease, opacity 160ms ease; }
.swapping main, .swapping .nav, .swapping .site-footer { filter: blur(3px); opacity: .35; }

/* =========================================================
   Header
   ========================================================= */
/* Barra de progreso de lectura */
.progress {
  position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: transform 420ms var(--ease-drawer), background-color 200ms ease, border-color 200ms ease;
}
/* Se esconde al bajar (para leer) y vuelve al subir */
.site-header.tucked { transform: translateY(-100%); transition-duration: 300ms, 200ms, 200ms; }
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--ink); color: var(--bg);
}

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: .9375rem;
  padding: 6px 12px; border-radius: 999px;
  transition: color 150ms ease, background-color 150ms ease;
}
.nav a[aria-current="true"] { color: var(--ink); background: var(--line); }
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ink); }
}

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Selector de idioma: la píldora activa es una copia recortada con clip-path */
.lang { position: relative; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-track, .lang-active { display: flex; }
.lang-track button, .lang-active span {
  width: 40px; height: 28px; display: grid; place-items: center;
  font: 500 .75rem/1 var(--font-mono); letter-spacing: .04em;
}
.lang-track button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; border-radius: 999px;
}
.lang-active {
  position: absolute; inset: 3px; pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 999px;
  clip-path: inset(0 50% 0 0 round 999px);
  transition: clip-path 280ms var(--ease-out);
}
.lang[data-active="en"] .lang-active { clip-path: inset(0 0 0 50% round 999px); }

.menu-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: transparent;
  cursor: pointer; border-radius: 999px; color: var(--ink);
  transition: transform 160ms var(--ease-out);
}
.menu-toggle:active { transform: scale(.94); }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 16px; height: 1.5px; background: currentColor;
  margin: 0 auto; position: relative; transition: transform 240ms var(--ease-out), background-color 120ms ease;
}
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .header-actions { margin-left: auto; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 24px 16px;
    background: var(--bg);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav a {
    font-family: var(--font-serif); font-size: 2.5rem; line-height: 1.1;
    color: var(--ink); padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--line);
    /* Links en cascada al abrir; al cerrar, todo sale junto y rápido */
    opacity: 0; transform: translateY(16px);
    transition: opacity 120ms ease, transform 120ms ease;
  }
  .nav.open a {
    opacity: 1; transform: none;
    transition: opacity 300ms ease calc(var(--i, 0) * 45ms + 60ms),
                transform 500ms var(--ease-out) calc(var(--i, 0) * 45ms + 60ms);
  }
  .nav a[aria-current="true"] { background: none; color: var(--accent); }
  .site-header:has(.nav.open) { background: var(--bg); border-bottom-color: var(--line); }
  /* En celulares acostados (poca altura) el menú scrollea en vez de cortarse */
  .nav { overflow-y: auto; overscroll-behavior: contain; }
}

/* =========================================================
   Botones y links
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 24px; border-radius: 999px; cursor: pointer;
  font: 500 .9375rem/1 var(--font-sans); text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-arrow { display: inline-block; transition: transform 240ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover .btn-arrow { transform: translateY(3px); }
  .btn-ghost:hover { border-color: var(--ink); }
}

.link {
  display: inline-flex; gap: 6px; align-items: center;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .9375rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size 300ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .link:hover { background-size: 0 1px; background-position: 100% 100%; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font: 400 .75rem/1 var(--font-mono); padding: 7px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: calc(var(--header-h) + 48px) 0 clamp(40px, 7vh, 80px);
  isolation: isolate;
}
.hero-spot {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px circle at var(--x, 70%) var(--y, 30%),
              color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  opacity: 0; transition: opacity 600ms ease;
}
.hero-spot.on { opacity: 1; }
.hero .container { width: 100%; }

.status { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: clamp(24px, 5vh, 56px); }
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.status-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(3); opacity: 0; } }

.display {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 15vw, 13.5rem);
  line-height: .9; letter-spacing: -.035em;
}
/* La máscara de cada línea deja lugar para acentos (arriba) y descendentes como la "g" (abajo);
   el margen negativo compensa para que el interlineado no cambie. */
.display .line { display: block; overflow: hidden; padding: .2em .06em .2em; margin: -.2em -.06em -.14em; }
.display .line-inner { display: flex; align-items: center; gap: .12em; }
.display em { color: var(--accent); }

.ecg { flex: 1; min-width: 60px; height: .42em; overflow: visible; }
.ecg path {
  fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round;
}
.ecg-base { stroke-dasharray: 1; stroke-dashoffset: 1; }
/* Pulso que recorre la línea, como en un monitor */
.ecg .ecg-pulse {
  stroke-width: 3.5; opacity: 0;
  stroke-dasharray: .14 .86; stroke-dashoffset: .14;
  filter: drop-shadow(0 0 6px var(--accent));
}
.caret {
  display: inline-block; width: .06em; height: .72em; background: var(--accent);
  margin-left: .04em; align-self: center; opacity: 0;
}

.hero-foot {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px 64px; align-items: end;
  margin-top: clamp(32px, 6vh, 72px); padding-top: 28px; border-top: 1px solid var(--line);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (max-width: 800px) {
  .hero-foot { grid-template-columns: 1fr; }
  .hero-cta { justify-content: flex-start; }
}

.lead { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 58ch; line-height: 1.55; }

/* Entrada del hero (solo una vez, al cargar) */
.js .intro-line { transform: translateY(105%); }
.js .intro { opacity: 0; transform: translateY(12px); }
.ready .intro-line {
  transform: none;
  transition: transform 1100ms var(--ease-out) calc(var(--d) * 90ms + 80ms);
}
.ready .intro {
  opacity: 1; transform: none;
  transition: opacity 800ms ease calc(var(--d) * 90ms + 200ms), transform 900ms var(--ease-out) calc(var(--d) * 90ms + 200ms);
}
.ready .ecg-base {
  stroke-dashoffset: 0; opacity: .4;
  transition: stroke-dashoffset 1600ms var(--ease-in-out) 500ms, opacity 900ms ease 2100ms;
}
.ready .ecg .ecg-pulse { animation: ecg-pulse 2.6s linear 2.1s infinite; }
@keyframes ecg-pulse {
  0% { stroke-dashoffset: .14; opacity: 1; }
  85% { opacity: 1; }
  100% { stroke-dashoffset: -.86; opacity: 0; }
}
.ready .caret { animation: blink 1.1s steps(1) 1.8s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Nada se anima fuera de pantalla */
.hero-off .ecg-pulse, .hero-off .caret, .hero-off .status-dot::after { animation-play-state: paused; }

/* Parallax: se mueve todo el contenido del hero junto (título, texto y botones)
   para que nunca se pisen; el hero recorta lo que baja, así "se esconde" debajo de la cinta. */
.hero { overflow: clip; }
.hero > .container { will-change: transform; }

/* =========================================================
   Marquee
   ========================================================= */
.marquee {
  border-block: 1px solid var(--line); overflow: hidden; padding: 22px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee ul { display: flex; align-items: center; gap: 40px; padding-right: 40px; }
.marquee li {
  font-family: var(--font-serif); font-style: italic; font-size: clamp(1.75rem, 3.4vw, 3rem);
  white-space: nowrap; line-height: 1;
}
.marquee li:nth-child(even) { font-style: normal; font-size: 1.25rem; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =========================================================
   Secciones
   ========================================================= */
.section { padding: clamp(96px, 14vw, 180px) 0; }
.label {
  display: flex; gap: 14px; align-items: center; color: var(--muted); margin-bottom: 28px;
}
.label span:first-child { color: var(--accent); }
.label::after { content: ""; flex: 0 0 40px; height: 1px; background: var(--line); order: 1; }
.label span:last-child { order: 2; }

.section-head { margin-bottom: clamp(48px, 7vw, 88px); }
.h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 7vw, 6rem); line-height: .95; letter-spacing: -.03em;
  max-width: 14ch;
}
.h2 em { color: var(--accent); }

/* ---------- Sobre mí ---------- */
.about { display: grid; grid-template-columns: 1fr 3fr; gap: 32px 48px; }
.about .label { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } .about .label { position: static; } }

.statement {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.4vw, 3.9rem); line-height: 1.08; letter-spacing: -.02em;
}
.js .statement .w { opacity: .16; transition: opacity 260ms ease; }
.js .statement .w.on { opacity: 1; }

.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
  margin-top: clamp(56px, 8vw, 104px);
}
.pillar { padding-top: 20px; border-top: 1px solid var(--ink); }
.pillar-num { color: var(--accent); display: block; margin-bottom: 28px; }
.pillar p { color: var(--muted); font-size: .9375rem; margin-top: 8px; }
@media (max-width: 760px) { .pillars { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Servicios ---------- */
.services { border-bottom: 1px solid var(--line); }
.service { border-top: 1px solid var(--line); }
.service-link {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 72px 1.1fr 1fr 40px; gap: 24px; align-items: baseline;
  padding: 34px 0; text-decoration: none; color: var(--ink);
  transition: color 200ms ease;
}
/* Relleno que entra por el lado donde entró el mouse y sale por donde se fue.
   Entrada 420ms, salida 240ms: lento al decidir, rápido al soltar. */
.service-link::before {
  /* Sobresale hacia el margen lateral, pero nunca más que el margen (si no, la página se mueve de costado en celulares) */
  content: ""; position: absolute; inset: 0 -20px; z-index: -1;
  background: var(--ink); border-radius: 4px;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 240ms var(--ease-out);
}
.service-link[data-dir="top"]::before { clip-path: inset(0 0 100% 0); }
.service-num { color: var(--accent); transition: color 200ms ease; }
.service h3 {
  font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.05; letter-spacing: -.015em;
  transition: transform 240ms var(--ease-out);
}
.service p { color: var(--muted); font-size: .9375rem; transition: color 200ms ease; }
.service-arrow {
  justify-self: end; font-size: 1.5rem; line-height: 1;
  opacity: .35; transform: translateX(-10px);
  transition: transform 240ms var(--ease-out), opacity 200ms ease;
}
.service-link:active h3 { transform: scale(.98); transform-origin: left center; }
@media (hover: hover) and (pointer: fine) {
  .service-link:hover { color: var(--bg); transition-duration: 300ms; }
  .service-link:hover::before { clip-path: inset(0 0 0 0); transition-duration: 420ms; }
  .service-link:hover p { color: color-mix(in srgb, var(--bg) 72%, transparent); transition-duration: 300ms; }
  .service-link:hover .service-num { color: var(--bg); transition-duration: 300ms; }
  .service-link:hover h3 { transform: translateX(8px); transition-duration: 420ms; }
  .service-link:hover .service-arrow { opacity: 1; transform: none; transition-duration: 420ms, 300ms; }
}
@media (max-width: 640px) { .service-link::before { inset: 0 -12px; } }
@media (max-width: 760px) {
  .service-link { grid-template-columns: 44px 1fr; gap: 10px 12px; padding: 26px 0; }
  .service p { grid-column: 2; }
  .service-arrow { display: none; }
}

/* ---------- Proyectos (sección invertida) ---------- */
.section-invert {
  --bg: var(--inv-bg); --surface: var(--inv-surface); --ink: var(--inv-ink);
  --muted: var(--inv-muted); --line: var(--inv-line); --accent: var(--inv-accent);
  background: var(--bg); color: var(--ink);
  border-radius: clamp(24px, 4vw, 48px);
  margin: 0 clamp(8px, 1.2vw, 16px);
}
.projects { display: grid; gap: clamp(80px, 12vw, 160px); }
.project { display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px clamp(32px, 6vw, 96px); align-items: center; }
.project:nth-child(even) .shot { order: 2; }
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .shot { order: 0; }
}

.project-body { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.project-meta { color: var(--muted); }
.project-meta span:first-child { color: var(--accent); }
.project-body h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1; letter-spacing: -.02em; }
.project-body > p:not(.project-meta) { color: var(--muted); }
.project .link { margin-top: 10px; }

.projects-note {
  display: flex; align-items: center; gap: 14px;
  margin-top: clamp(64px, 9vw, 120px); padding: 22px 26px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: .9375rem;
}
.projects-note .status-dot { flex: none; }

/* Capturas simuladas */
.shot {
  aspect-ratio: 16 / 10.5; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .45);
}
.shot-bar {
  display: flex; align-items: center; gap: 6px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.shot-bar span {
  margin: 0 auto; font: 400 .6875rem/1 var(--font-mono); color: var(--muted);
  padding: 5px 14px; border-radius: 999px; background: var(--line);
}
/* Todo lo de adentro se mide en cqw (% del ancho de la captura), así la maqueta
   escala entera y nunca se corta, sea de 280px o de 700px. */
.shot { will-change: transform; container-type: inline-size; }
.shot-body {
  flex: 1; min-height: 0; padding: 5cqw 6cqw; display: flex; flex-direction: column; gap: 5cqw;
}
.sk-nav { display: flex; align-items: center; gap: 2cqw; }
.sk-nav b { width: 4.5cqw; height: 4.5cqw; border-radius: 1.4cqw; background: var(--accent); }
.sk-nav span { width: 8cqw; height: 1.4cqw; border-radius: 1cqw; background: var(--line); }
.sk-nav span:first-of-type { margin-left: auto; }
.sk-hero { display: flex; flex-direction: column; gap: 2cqw; }
.sk-h { display: block; height: 3.6cqw; width: 72%; border-radius: 1.2cqw; background: var(--ink); opacity: .85; }
.sk-h.short { width: 46%; opacity: .3; }
.sk-btn { display: block; width: 22cqw; height: 5.6cqw; border-radius: 999px; background: var(--accent); margin-top: 1cqw; }
.sk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; flex: 1; min-height: 0; }
.sk-cards span { border-radius: 2cqw; background: color-mix(in srgb, var(--accent) 14%, transparent); }

.cal-head { display: flex; justify-content: space-between; align-items: center; }
.cal-head .sk-btn { margin: 0; width: 18cqw; }
.cal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1.6cqw; }
.cal-grid span { border-radius: 1.6cqw; background: var(--line); }
.cal-grid .on { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.cal-grid .sel { background: var(--accent); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.kpis span { height: 11cqw; border-radius: 2cqw; border: 1px solid var(--line); padding: 2cqw; display: flex; align-items: flex-end; }
.kpis b { width: 50%; height: 2.4cqw; border-radius: 1cqw; background: var(--ink); opacity: .8; }
.bars { flex: 1; display: flex; align-items: flex-end; gap: 4%; border-bottom: 1px solid var(--line); }
.bars span {
  flex: 1; height: calc(var(--h) * 100%); border-radius: 6px 6px 0 0;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}
.bars span:last-child { background: var(--accent); }

/* Revelado con clip-path al entrar en pantalla */
.js .clip-reveal { clip-path: inset(10% 8% 10% 8% round var(--radius)); transition: clip-path 1200ms var(--ease-in-out); }
.js .clip-reveal .shot-body { opacity: 0; transform: scale(1.06); transition: opacity 900ms ease 200ms, transform 1200ms var(--ease-out); }
.js .clip-reveal.visible { clip-path: inset(0 0 0 0 round var(--radius)); }
.js .clip-reveal.visible .shot-body { opacity: 1; transform: none; }

/* Las barras del panel crecen desde abajo, una tras otra */
.js .bars span { transform: scaleY(0); transform-origin: bottom; transition: transform 900ms var(--ease-out) calc(var(--i, 0) * 60ms + 500ms); }
.js .clip-reveal.visible .bars span { transform: none; }
/* El turno elegido del calendario "late" una vez al aparecer */
.js .clip-reveal.visible .cal-grid .sel { animation: sel-pop 600ms var(--ease-out) 1100ms both; }
@keyframes sel-pop { 0% { transform: scale(.85); opacity: .4; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }

/* Una vez revelado, el hover responde rápido (no con los 1200ms de la entrada)
   y se quita el recorte: si no, clip-path se come la sombra y las esquinas al inclinarse en 3D. */
.js .clip-reveal.settled { clip-path: none; }
.js .clip-reveal.settled .shot-body { transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .js .project:hover .clip-reveal.settled .shot-body { transform: scale(1.025); }
}

/* ---------- Proceso ---------- */
.process { display: grid; grid-template-columns: 1fr 1fr; gap: 48px clamp(48px, 8vw, 128px); }
.process-head { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; }
@media (max-width: 860px) { .process { grid-template-columns: 1fr; } .process-head { position: static; } }

.steps-wrap { position: relative; padding-left: 44px; }
.steps-wrap::before, .steps-fill {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line);
}
.steps-fill { background: var(--accent); transform-origin: top; transform: scaleY(0); width: 2px; left: 6.5px; }
.steps li { position: relative; padding-bottom: clamp(48px, 7vw, 88px); }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: ""; position: absolute; left: -44px; top: 4px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  transition: background-color 250ms ease, border-color 250ms ease, box-shadow 500ms var(--ease-out);
}
/* El punto se enciende cuando la línea lo alcanza */
.steps li.reached::before {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}
.step-num { color: var(--accent); display: block; margin-bottom: 10px; }
.steps h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1; letter-spacing: -.015em; }
.steps p { color: var(--muted); margin-top: 10px; max-width: 40ch; }

/* ---------- Experiencia ---------- */
.xp { border-bottom: 1px solid var(--line); }
.xp li {
  display: grid; grid-template-columns: 220px 1.1fr 1fr; gap: 12px 24px; align-items: baseline;
  padding: 30px 0; border-top: 1px solid var(--line);
}
.xp-date { color: var(--muted); }
.xp h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; }
.xp p { color: var(--muted); font-size: .9375rem; }
@media (max-width: 760px) { .xp li { grid-template-columns: 1fr; } }

.skills { margin-top: 56px; display: grid; grid-template-columns: 220px 1fr; gap: 16px 24px; align-items: start; }
.skills-label { color: var(--muted); padding-top: 6px; }
@media (max-width: 760px) { .skills { grid-template-columns: 1fr; } }

/* ---------- Contacto ---------- */
.contact { padding-bottom: clamp(64px, 8vw, 104px); }
.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(3.25rem, 10vw, 9rem); line-height: .9; letter-spacing: -.035em;
  max-width: 12ch;
}
.contact-title em { color: var(--accent); }
.contact .lead { margin-top: 28px; }

.contact-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
  margin-top: clamp(48px, 7vw, 88px); padding: 28px 0; border-block: 1px solid var(--line);
}
.contact-email {
  position: relative; display: inline-block; text-decoration: none;
  font-family: var(--font-serif); font-size: clamp(1.75rem, 5.2vw, 4.25rem); line-height: 1.1; letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.contact-email-fill {
  position: absolute; inset: 0; color: var(--accent);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .contact-email:hover .contact-email-fill { clip-path: inset(0 0 0 0); transition-duration: 650ms; }
}
.copy-label { display: inline-block; transition: filter 200ms ease, opacity 200ms ease, transform 200ms var(--ease-out); }
.copy-btn.swap .copy-label { filter: blur(3px); opacity: 0; transform: scale(.96); }
.copy-btn.done { border-color: var(--accent); color: var(--accent); }

.socials { display: flex; gap: 28px; margin-top: 28px; }
.socials a { color: var(--muted); text-decoration: none; font-size: .9375rem; transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .socials a:hover { color: var(--ink); } }

/* ---------- Footer ---------- */
.site-footer { overflow: hidden; padding-top: 24px; }
.wordmark {
  font-family: var(--font-serif); white-space: nowrap;
  font-size: clamp(3rem, 13.2vw, 14.5rem); line-height: .8; letter-spacing: -.045em;
  color: var(--ink); margin-bottom: 28px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  border-top: 1px solid var(--line); padding: 22px 0 28px;
  font-size: .8125rem; color: var(--muted);
}
.to-top { text-decoration: none; color: var(--ink); }

/* =========================================================
   Aparición al hacer scroll
   ========================================================= */
.js .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 800ms ease calc(var(--d, 0) * 80ms), transform 1000ms var(--ease-out) calc(var(--d, 0) * 80ms);
}
.js .reveal.visible { opacity: 1; transform: none; }

/* =========================================================
   Movimiento reducido: sin desplazamientos, solo fundidos
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .intro-line, .js .intro, .js .reveal { transform: none; }
  .ready .intro-line, .ready .intro, .js .reveal { transition: opacity 300ms ease; }
  .ecg-base { stroke-dashoffset: 0; }
  .ready .ecg-base { transition: none; opacity: 1; }
  .ready .ecg .ecg-pulse { animation: none; }
  .js .bars span, .js .clip-reveal.visible .cal-grid .sel { transform: none; animation: none; transition: none; }
  .nav a, .nav.open a { transform: none; }
  .site-header.tucked { transform: none; }
  .service-link:hover h3 { transform: none; }
  .ready .caret { animation: none; opacity: 1; }
  .status-dot::after, .marquee-track { animation: none; }
  .js .clip-reveal, .js .clip-reveal .shot-body { clip-path: none; transform: none; transition: opacity 300ms ease; }
  .js .statement .w { opacity: 1; }
  .hero-spot { display: none; }
  .service-link::before { transition: none; }
}
