/* ════════════════════════════════════════════════════════════════
   alvarosb.com — "La sala oscura"
   Un único fondo oscuro de arriba abajo y, dentro, cosas encendidas:
   las fotos y capturas reales son lo más luminoso de cada pantalla.
   Una sola familia (Montserrat), cinco tamaños, un color de acento
   (el cian de siempre) reservado para las acciones.
   ════════════════════════════════════════════════════════════════ */

/* Montserrat (licencia OFL, ver fonts/Montserrat-OFL.txt), alojada en la propia web */
@font-face {
  font-family: 'Montserrat';
  font-style: normal; font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/montserrat-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/montserrat-latin-wght-normal.woff2) format('woff2');
  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: 'Montserrat';
  font-style: normal; font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/montserrat-latin-ext-wght-normal.woff2) format('woff2-variations'), url(../fonts/montserrat-latin-ext-wght-normal.woff2) format('woff2');
  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;
}

/* ─── 1. Tokens ─────────────────────────────────────────────────── */
:root {
  --bg:        #000000;
  --surface:   #141414;
  --surface-2: #222222;
  --ink:       #eef2f6;
  --muted:     #a8a8a8;
  --accent:    #5fd4e6;
  --accent-ink:#061219;
  --green:     #8ff0b0;

  --paper:       #F4F3F2;
  --paper-2:     #e3e8ee;
  --paper-ink:   #0d1520;
  --paper-muted: #46505d;
  --paper-accent:#0b6478;

  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step-small: 0.875rem;                                   /* 14px */
  --step-body:  clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); /* 17–19px */
  --step-lead:  clamp(1.25rem, 0.95rem + 1vw, 2rem);        /* 20–32px */
  --step-head:  clamp(2rem, 1.3rem + 3.2vw, 4rem);          /* 32–64px */

  --m: max(clamp(20px, 3vw, 44px), calc((100vw - 1240px) / 2));          /* margen exterior, igual a ambos lados */
  --gap: clamp(16px, 2vw, 28px);
  --section: clamp(96px, 13vw, 200px);  /* espacio entre secciones */
  --nav-h: 64px;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --t-fast: 160ms;
  --t: 320ms;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:        #F4F3F2;
  --surface:   #e6eaef;
  --surface-2: #d9dfe6;
  --ink:       #0d1520;
  --muted:     #46505d;
  --accent:    #0b6478;
  --accent-ink:#ffffff;
  color-scheme: light;
}

/* ─── 2. Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h2 {
  font-size: var(--step-head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  text-wrap: balance;
}
h3 { font-weight: 500; }

.skip-link {
  position: absolute; left: var(--m); top: -100px; z-index: 200;
  padding: 10px 16px; background: var(--accent); color: var(--accent-ink);
}
.skip-link:focus { top: 10px; }

.text-link {
  display: inline-flex; align-items: center; gap: 0.4em;
  color: var(--ink); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 0.3em;
  transition: color var(--t-fast) var(--ease), text-underline-offset var(--t-fast) var(--ease);
}
.text-link:hover { color: var(--accent); text-underline-offset: 0.45em; }

/* Botones: planos, esquina recta, un solo relleno */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 0;
  font-size: var(--step-body); font-weight: 600; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); color: var(--bg); }
.btn-outline { background: var(--surface-2); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }

/* ─── 3. Navegación: una barra lisa ───────────────────────────── */
#navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--m);
  background: var(--bg);
  font-size: var(--step-small);
  transition: transform var(--t) var(--ease), background-color var(--t) var(--ease);
}
#navbar.hidden { transform: translateY(-100%); }
.nav-logo { font-weight: 600; text-decoration: none; font-size: var(--step-small); }
.nav-links { display: flex; align-items: center; gap: 22px; margin-right: auto; }
.nav-links a {
  text-decoration: none; color: var(--muted);
  transition: color var(--t-fast) var(--ease);
}
.nav-links a:hover, .nav-links a.spy-active { color: var(--ink); }
.nav-cta-item { margin-left: auto; }
.nav-links .nav-cta {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-links .nav-cta:hover, .nav-links .nav-cta.spy-active { background: var(--ink); color: var(--bg); }
.nav-links { flex: 1; }

.nav-right { display: flex; align-items: center; gap: 4px; }
.lang-switch { display: flex; margin-right: 6px; }
.lang-btn {
  min-width: 40px; height: 40px; padding: 0 8px;
  border: 0; background: none; color: var(--muted);
  font-size: var(--step-small); font-weight: 600;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active, .lang-btn[aria-pressed="true"] { color: var(--ink); background: var(--surface-2); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: none; color: var(--muted);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }
#sound-toggle .icon-sound-off { display: none; }
#sound-toggle.is-muted .icon-sound-on { display: none; }
#sound-toggle.is-muted .icon-sound-off { display: block; }
#theme-toggle .icon-sun { display: none; }
[data-theme="light"] #theme-toggle .icon-sun { display: block; }
[data-theme="light"] #theme-toggle .icon-moon { display: none; }
.hamburger {
  display: none; height: 40px; padding: 0 12px; border: 0;
  background: var(--surface-2); color: var(--ink); font-size: var(--step-small); font-weight: 600;
}

/* ─── 4. Primera pantalla: dos fotos en la oscuridad ──────────── */
#hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(48px, 9vh, 110px)) var(--m) clamp(56px, 9vh, 100px);
  overflow: hidden;
}
.hero-inner { display: grid; justify-items: center; text-align: center; gap: clamp(18px, 2.6vh, 28px); }
.hero-avatar { margin: 0; width: clamp(88px, 7.5vw, 124px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--surface); }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* titular a lo Accenture: mayúsculas, grueso, ancho y centrado */
.hero-title {
  font-size: clamp(2.2rem, 6.2vw, 6.5rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 14ch;
}
.hero-tag { font-size: var(--step-lead); line-height: 1.2; }
.hero-go { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.hero-bio { color: var(--muted); max-width: 46ch; }

/* cuadrado con flecha: el único adorno, siempre en el color de acción */
.chev {
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; background: var(--accent); color: var(--accent-ink);
  transition: transform var(--t-fast) var(--ease);
}
.hero-go:active .chev, .card:active .chev { transform: scale(0.94); }

/* ─── Destacados: rejilla de tarjetas altas ───────────────────── */
.cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  padding: 0 var(--m) var(--section);
}
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  aspect-ratio: 3 / 4;
  padding: clamp(20px, 2vw, 28px);
  background: var(--surface); color: var(--ink);
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease);
}
.card:active { transform: scale(0.985); }
.card-label { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card-title { font-size: clamp(1.25rem, 0.9rem + 0.9vw, 1.75rem); font-weight: 600; line-height: 1.15; max-width: 18ch; position: relative; z-index: 1; }
.card img {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 58%;
  object-fit: cover; object-position: 50% 30%;
  filter: brightness(0.85);
  transition: transform 0.8s var(--ease), filter var(--t) var(--ease);
}
.card .chev { position: absolute; right: clamp(20px, 2vw, 28px); bottom: clamp(20px, 2vw, 28px); z-index: 1; }
.card--accent { background: var(--accent); color: var(--accent-ink); }
.card--accent .card-label { color: var(--accent-ink); opacity: 0.75; }
.card--accent .chev { background: var(--accent-ink); color: var(--accent); }
.card--paper { background: var(--paper); color: var(--paper-ink); }
.card--paper .card-label { color: var(--paper-muted); }
.card--paper .chev { background: var(--paper-ink); color: var(--paper); }
.card--big .card-title, .card--accent .card-title, .card--paper .card-title { font-size: clamp(1.6rem, 1rem + 1.6vw, 2.5rem); max-width: 14ch; }
@media (hover: hover) and (pointer: fine) {
  .card:hover img { transform: scale(1.04); filter: brightness(1); }
  .card:hover .chev, .hero-go:hover .chev { transform: translateX(4px); }
  .hero-go:hover span:first-child { color: var(--accent); }
}

/* ─── 5. Resumen: párrafo en la mitad derecha, foto sola ──────── */
.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: var(--section) var(--m);
}
.intro-text { grid-column: 7 / 13; grid-row: 1 / 3; display: grid; gap: 40px; align-content: start; }
.intro-statement {
  font-size: var(--step-lead);
  line-height: 1.3;
  text-indent: 3em;
  max-width: 30ch;
}
.intro-body { display: grid; gap: 1em; max-width: 60ch; }
.intro-photo {
  grid-column: 1 / 5; grid-row: 2;
  align-self: start;
  margin-top: 40px;
  aspect-ratio: 1;
  overflow: hidden;
}
.intro-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; filter: brightness(0.85) contrast(1.05); }
.intro-note {
  grid-column: 1 / 5; grid-row: 1;
  margin-top: 0;
  display: grid; gap: 24px;
}
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px var(--gap); }
.facts li { display: grid; gap: 2px; color: var(--muted); font-size: var(--step-small); }
.facts b { color: var(--ink); font-size: var(--step-lead); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tools { font-size: var(--step-small); color: var(--muted); max-width: 46ch; }
.tools span { color: var(--ink); }

/* ─── 6. Experiencia: foto fija y lista activa ────────────────── */
.jobs {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: 0 var(--m) var(--section);
  align-items: start;
}
.jobs-photo {
  grid-column: 1 / 6;
  position: sticky; top: 12vh;
  aspect-ratio: 4 / 5;
  max-height: 80vh;
  overflow: hidden;
  background: var(--surface);
}
.jobs-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  filter: brightness(0.8) contrast(1.05);
  transition: opacity 1.1s var(--ease), transform 6s var(--ease);
}
.jobs-photo img[data-job="aryan"] { object-position: 28% 50%; }
.jobs-photo img[data-job="efedos"] { object-position: 62% 40%; }
.jobs-photo img.is-on { opacity: 1; transform: scale(1); }
.jobs-list { grid-column: 7 / 13; padding-top: 12vh; }
.jobs-list h2 { margin-bottom: 48px; }
.job-rows { display: grid; gap: 56px; }
.job { display: grid; gap: 6px; }
.job-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.job-role {
  font-size: var(--step-lead); line-height: 1.15; font-weight: 500;
  color: var(--muted);
  transition: color var(--t) var(--ease);
}
.job.is-active .job-role { color: var(--ink); }
.job-date { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.job-company { color: var(--accent); font-size: var(--step-small); font-weight: 600; }
.job-desc { display: grid; gap: 0.8em; margin-top: 10px; max-width: 62ch; }
.job-tools { font-size: var(--step-small); color: var(--muted); }

/* ─── 7. Formación y certificados: cartel a un solo tamaño ────── */
.lineup { padding: 0 var(--m) var(--section); }
.lineup > h2 { margin-bottom: 24px; }
.lineup-part {
  padding: 56px 0 14px;
  font-size: var(--step-lead); font-weight: 400; color: var(--accent);
}
.lineup-rows li {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) minmax(8ch, auto);
  column-gap: var(--gap);
  align-items: baseline;
  padding: 0.35em 0;
  font-size: var(--step-lead); line-height: 1.25; font-weight: 400;
}
.l-where { color: var(--muted); }
.l-when { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }

.lineup--certs .lineup-rows {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 96px); margin-top: 24px;
}
.lineup--certs .lineup-rows li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 0.6em 0; }
.lineup--certs .l-where { grid-column: 1; grid-row: 2; font-size: var(--step-small); }
.lineup--certs .l-when { grid-column: 2; grid-row: 1; }

/* ─── 8. Prácticas (Redes · Sistemas · UX/UI) ─────────────────── */
.work { padding: 0 var(--m) var(--section); }
.work-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap); row-gap: 24px;
  align-items: end;
  margin-bottom: 48px;
}
.work-head h2 { grid-column: 1 / 8; }
.work-intro { grid-column: 8 / 13; max-width: 52ch; }
.work--sys .work-head h2 { grid-column: 6 / 13; grid-row: 1; }
.work--sys .work-intro { grid-column: 1 / 6; grid-row: 1; }



.labs-empty { color: var(--muted); padding: 40px 0; }
.labs-note { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: var(--step-small); }

/* Pestañas de apartado: texto, sin cajas */
.ex-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.ex-tab {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 16px;
  border: 0; border-radius: 0;
  background: transparent; color: var(--muted);
  font-size: var(--step-body); font-weight: 500;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.ex-tab:hover { color: var(--ink); background: var(--surface); }
.ex-tab.active { color: var(--ink); background: var(--surface-2); }
.ex-tab-icon { width: 20px; height: 20px; display: grid; place-items: center; }
.ex-tab-icon svg { width: 20px; height: 20px; }
.ex-tab.active .ex-tab-icon { color: var(--accent); }
.ex-tab-count { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }

.ex-panel[hidden] { display: none; }
.ex-module-head {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: var(--gap); row-gap: 8px; align-items: baseline;
  margin-bottom: 28px;
}
.ex-module-name { font-size: var(--step-lead); font-weight: 500; line-height: 1.2; }
.ex-module-desc { grid-column: 2; grid-row: 1 / 3; color: var(--ink); max-width: 52ch; }
.ex-module-count { font-size: var(--step-small); color: var(--muted); }

/* Selector de ejercicios dentro del apartado */
.exc-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: var(--step-small); color: var(--muted); }
.exc-progress-bar { position: relative; width: 140px; height: 4px; background: var(--surface-2); overflow: hidden; }
.exc-progress-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width var(--t) var(--ease); }
.exc-progress.done .exc-progress-text { color: var(--ink); }
.exc-bar { margin-bottom: 32px; }
.exc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.exc-pill {
  min-width: 0; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; max-width: 100%; padding: 8px 14px;
  border: 0; border-radius: 0;
  background: var(--surface); color: var(--muted);
  font-size: var(--step-small); text-align: left;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.exc-pill:hover { color: var(--ink); background: var(--surface-2); }
.exc-pill.active { background: var(--ink); color: var(--bg); }
.exc-pill.seen:not(.active)::after { content: ""; flex: none; width: 6px; height: 6px; background: var(--accent); }
.exc-pill.empty { opacity: 0.75; }
.exc-pill-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }
.exc-pill-exam { font-weight: 600; color: var(--accent); }
.exc-pill.active .exc-pill-exam { color: inherit; }
.exc-stage { position: relative; }
.exc-stage > .ex[hidden] { display: none; }
.exc-from-right { animation: excRight 0.5s var(--ease) both; }
.exc-from-left  { animation: excLeft 0.5s var(--ease) both; }
@keyframes excRight { from { opacity: 0; transform: translateX(32px); } }
@keyframes excLeft  { from { opacity: 0; transform: translateX(-32px); } }
.exc-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Un ejercicio: la captura encendida y el texto al lado */
.ex {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "media info" "explain explain";
  column-gap: clamp(24px, 3vw, 56px); row-gap: 48px;
  align-items: start;
}
.work--sys .ex { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "info media" "explain explain"; }
.work--ux .ex  { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "info" "explain"; row-gap: 32px; }
.ex-media { grid-area: media; min-width: 0; }
.ex-info  { grid-area: info; display: grid; gap: 32px; min-width: 0; }
.work--ux .ex-info { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--gap); }
.work--ux .ex-info.no-side { grid-template-columns: minmax(0, 1fr); }
.ex-info-main { display: grid; gap: 14px; align-content: start; }
.ex-num { font-size: var(--step-small); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ex-exam-badge { color: var(--accent); font-weight: 600; }
.ex-title { font-size: var(--step-lead); font-weight: 500; line-height: 1.2; text-wrap: balance; }
.ex-desc { max-width: 60ch; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; background: var(--surface-2); color: var(--ink); font-size: var(--step-small); }
.ex-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ex-size { opacity: 0.8; font-weight: 400; }

.ex-verify { background: var(--surface); padding: 20px 22px; }
.ex-verify-head { font-size: var(--step-small); color: var(--muted); margin-bottom: 10px; }
.ex-verify ul { display: grid; gap: 6px; }
.ex-verify code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: var(--step-small); color: var(--ink);
}

.ex-explain { grid-area: explain; columns: 2 30ch; column-gap: clamp(32px, 5vw, 80px); }
.ex-explain-title { column-span: all; margin-bottom: 20px; font-size: var(--step-lead); font-weight: 500; line-height: 1.2; }
.ex-explain p { margin-bottom: 1em; break-inside: avoid-column; }

/* Carrusel */
.ex-carousel {
  position: relative; width: 100%;
  aspect-ratio: 16 / 10; max-height: 70vh;
  overflow: hidden; background: #05080c;
  touch-action: pan-y;
}
.work--ux .ex-carousel { aspect-ratio: 16 / 8; background: var(--surface); }
.ex-track { display: flex; height: 100%; transition: transform 0.5s var(--ease); }
.ex-carousel.dragging .ex-track { transition: none; }
.ex-slide { flex: 0 0 100%; height: 100%; margin: 0; position: relative; overflow: hidden; }
.ex-slide::before {
  content: ''; position: absolute; inset: -40px;
  background: var(--slide-bg, none) center / cover no-repeat;
  filter: blur(30px) brightness(0.35);
  transform: scale(1.1); opacity: 0; transition: opacity 0.4s ease;
}
.work--ux .ex-slide::before { filter: blur(30px) brightness(1.1) saturate(0.6); opacity: 0; }
.ex-slide.ready::before { opacity: 1; }
.work--ux .ex-slide.ready::before { opacity: 0.35; }
.ex-slide-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: clamp(8px, 2.4%, 22px);
  border: 0; background: none; cursor: zoom-in;
}
.ex-slide img { width: auto; height: auto; max-width: 100%; max-height: 100%; flex: none; user-select: none; -webkit-user-drag: none; }
.ex-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 0;
  display: grid; place-items: center;
  background: rgba(10, 14, 20, 0.82); color: #eef2f6; font-size: 1.5rem; line-height: 1;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.ex-nav:hover { background: #eef2f6; color: #0a0e14; }
.ex-nav.prev { left: 10px; }
.ex-nav.next { right: 10px; }
.ex-counter, .ex-zoom-hint {
  position: absolute; padding: 4px 10px;
  background: rgba(10, 14, 20, 0.82); color: #eef2f6;
  font-size: var(--step-small); font-variant-numeric: tabular-nums; pointer-events: none;
}
.ex-counter { top: 10px; right: 10px; }
.ex-zoom-hint { left: 10px; bottom: 10px; opacity: 0; transition: opacity var(--t) var(--ease); }
.ex-carousel:hover .ex-zoom-hint, .ex-carousel:focus-visible .ex-zoom-hint { opacity: 1; }
.ex-caption { min-height: 1.5em; margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.ex-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ex-thumb {
  width: 72px; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 0;
  background: var(--surface); overflow: hidden; opacity: 0.55;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.ex-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-thumb:hover { opacity: 0.85; }
.ex-thumb.active { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-noimg { aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.ex-noimg svg { width: 96px; height: 96px; }
.ex--soon { opacity: 0.8; }

/* Visor a pantalla completa */
#lab-viewer {
  margin: auto; width: min(94vw, 1500px); height: min(90vh, 940px);
  max-width: none; max-height: none; padding: 0; border: 0; border-radius: 0;
  background: #05080c; color: #eef2f6; overflow: hidden;
}
#lab-viewer[open] { display: flex; flex-direction: column; }
#lab-viewer::backdrop { background: rgba(3, 5, 8, 0.94); }
.lab-viewer-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: zoom-in; touch-action: none; overscroll-behavior: contain; }
#lab-viewer img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; will-change: transform; }
#lab-viewer.zoomed .lab-viewer-stage { cursor: grab; }
#lab-viewer.zoomed .lab-viewer-stage.dragging { cursor: grabbing; }
#lab-viewer-caption {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px;
  padding: 12px 20px; background: #0d131b; font-size: var(--step-small); color: #c9d1da;
}
.lab-viewer-help { margin-left: auto; color: #a7b1bd; }
.lab-viewer-zoom { display: flex; gap: 4px; }
.lab-viewer-zoom button { min-width: 40px; height: 36px; padding: 0 10px; border: 0; background: #1b2531; color: #eef2f6; font-size: var(--step-small); }
.lab-viewer-zoom button:hover:not(:disabled) { background: #eef2f6; color: #0a0e14; }
.lab-viewer-zoom button:disabled { opacity: 0.4; cursor: default; }
.lab-viewer-close, .lab-viewer-nav {
  position: absolute; z-index: 2; border: 0; border-radius: 0;
  display: grid; place-items: center;
  background: rgba(13, 19, 27, 0.9); color: #eef2f6;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lab-viewer-close { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 1.1rem; }
.lab-viewer-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 1.8rem; }
.lab-viewer-nav.prev { left: 12px; }
.lab-viewer-nav.next { right: 12px; }
.lab-viewer-nav[hidden] { display: none; }
.lab-viewer-close:hover, .lab-viewer-nav:hover { background: #eef2f6; color: #0a0e14; }

/* ─── 9. Contacto: tarjeta sobre una foto, con el ticket ──────── */
.contact {
  position: relative;
  padding: var(--section) var(--m);
  display: flex; justify-content: center; align-items: flex-start;
  overflow: hidden;
}
.contact-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 50%;
  filter: brightness(0.55) contrast(1.05) saturate(0.85);
}
.contact-card {
  position: relative;
  width: min(480px, 100%);
  padding: 32px;
  background: var(--paper); color: var(--paper-ink);
  display: grid; gap: 22px;
  --ink: var(--paper-ink); --muted: var(--paper-muted); --surface: var(--paper-2); --accent: var(--paper-accent);
  --green: #0f6b38;
}
.contact-card h2 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
.contact-intro { color: var(--paper-ink); }
.contact-rows { display: grid; gap: 6px; }
.contact-rows > div { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: 12px; align-items: baseline; }
.contact-rows dt { font-size: var(--step-small); color: var(--paper-muted); }
.contact-rows dd { overflow-wrap: anywhere; }
.contact-rows a { color: var(--paper-ink); text-decoration-color: var(--paper-accent); text-decoration-thickness: 2px; }
.contact-rows a:hover { color: var(--paper-accent); }

.ticket { display: grid; gap: 16px; margin-top: 6px; }
.ticket-head { background: var(--paper-ink); color: var(--paper); padding: 16px 18px; display: grid; gap: 6px; }
.ticket-id { font-size: var(--step-body); }
.ticket-id b { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--step-small); color: #c9d1da; }
.ticket-meta b { color: var(--paper); font-weight: 600; }
#tk-prio.is-high { color: #7fe3f1; }
.ticket.is-sent #tk-status { color: #8ff0b0; }
.ticket-type { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ticket-type legend { padding: 0; margin-bottom: 8px; font-size: var(--step-small); color: var(--paper-muted); }
.ticket-type label { position: relative; }
.ticket-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ticket-type span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  background: var(--paper-2); font-size: var(--step-small); font-weight: 500;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.ticket-type label:hover span { background: #d3dae2; }
.ticket-type input:checked + span { background: var(--paper-accent); color: #fff; }
.ticket-type input:focus-visible + span { outline: 2px solid var(--paper-accent); outline-offset: 2px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-size: var(--step-small); color: var(--paper-muted); }
.form-group input, .form-group textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid #b9c2cc; border-radius: 0;
  background: #fff; color: var(--paper-ink);
  font-size: 1rem;
  transition: border-color var(--t-fast) var(--ease);
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--paper-accent); outline-offset: -1px; border-color: var(--paper-accent); }
.ticket .btn-primary { width: 100%; min-height: 52px; background: var(--paper-ink); color: var(--paper); }
.ticket .btn-primary:hover { background: var(--paper-accent); color: #fff; }
#form-status { min-height: 1.5em; font-size: var(--step-small); }

/* ─── 10. Pie: una sola línea tranquila ───────────────────────── */
.site-footer {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 16px 24px;
  padding: 22vh var(--m) 30px;
  font-size: var(--step-small); color: var(--muted);
}
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--ink); text-decoration: none; transition: color var(--t-fast) var(--ease); }
.footer-nav a:hover { color: var(--accent); }
.footer-copyright { text-align: right; }

.icon-wa:hover { color: #25d366; }

/* ─── 11. Entradas ────────────────────────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.8s var(--ease) var(--d, 0ms), transform 0.8s var(--ease) var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .jobs-photo img { transform: none; }
}

/* ─── 12. Protección del contenido (proteccion.js) ────────────── */
.protegido body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.protegido #contacto, .protegido input, .protegido textarea, .protegido select { -webkit-user-select: text; user-select: text; }
.protegido img { -webkit-user-drag: none; }
.proteccion-tapa {
  position: fixed; inset: 0; z-index: 10000; display: none;
  align-items: center; justify-content: center; padding: 2rem; text-align: center;
  background: #000; color: #a7b1bd; font-size: var(--step-small);
}
.tapado .proteccion-tapa { display: flex; }
.proteccion-aviso {
  position: fixed; left: 50%; bottom: 24px; z-index: 10001;
  transform: translate(-50%, 1rem);
  padding: 10px 16px; background: var(--ink); color: var(--bg);
  font-size: var(--step-small); white-space: nowrap; max-width: calc(100vw - 2rem); overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.proteccion-aviso.visible { opacity: 1; transform: translate(-50%, 0); }
@media print {
  body > * { display: none !important; }
  body::after { content: "© Álvaro Sánchez Benítez — alvarosb.com. Contenido protegido: no se permite imprimir esta página."; display: block; padding: 3rem; font: 14px/1.6 sans-serif; color: #000; }
  body { background: #fff !important; }
}

/* ─── 13. Tableta ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .nav-links { gap: 16px; }
}
@media (max-width: 960px) {
  #navbar { gap: 12px; }
  .hamburger { display: inline-flex; align-items: center; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--m) 24px;
    background: var(--bg);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35); /* taste-skill-ignore: menú desplegable que flota */
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t);
  }
  #navbar.menu-open .nav-links { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .nav-links a { display: flex; align-items: center; min-height: 52px; font-size: var(--step-lead); color: var(--ink); }
  .nav-cta-item { margin: 12px 0 0; }
  .nav-links .nav-cta { justify-content: center; min-height: 52px; font-size: var(--step-body); }
  .nav-right { margin-left: auto; }

  .intro-text { grid-column: 5 / 13; }
  .intro-photo, .intro-note { grid-column: 1 / 5; }
  .jobs-photo { grid-column: 1 / 6; }
  .jobs-list { grid-column: 6 / 13; }
  .work-head h2, .work--sys .work-head h2 { grid-column: 1 / 13; grid-row: auto; }
  .work-intro, .work--sys .work-intro { grid-column: 1 / 10; grid-row: auto; }
  .ex, .work--sys .ex { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "info" "explain"; row-gap: 32px; }
    .lineup-rows li { grid-template-columns: minmax(0, 1fr) auto; }
  .lineup-rows .l-where { grid-column: 1; grid-row: 2; font-size: var(--step-small); }
  .lineup-rows .l-when { grid-column: 2; grid-row: 1; }
}

/* ─── 14. Teléfono: su propia composición ─────────────────────── */
@media (max-width: 640px) {
  :root { --nav-h: 56px; --section: 88px; }
  .lang-btn { min-width: 36px; padding: 0 6px; }
  .icon-btn { width: 36px; height: 36px; }
  #sound-toggle { display: none; }

  .lineup--certs .lineup-rows { grid-template-columns: minmax(0, 1fr); }

  .intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .intro-text { grid-column: 1 / 3; grid-row: 1; gap: 28px; }
  .intro-statement { text-indent: 0; font-size: 22px; }
  .intro-photo { grid-column: 1 / 3; grid-row: 2; margin-top: 48px; aspect-ratio: 4 / 3; }
  .intro-note { grid-column: 1 / 3; grid-row: 3; margin-top: 32px; }

  .jobs { display: block; padding-top: 0; }
  .jobs-photo { position: relative; top: auto; aspect-ratio: 4 / 3; width: 100%; max-height: none; }
  .jobs-list { padding-top: 40px; }
  .jobs-list h2 { margin-bottom: 32px; }
  .job-rows { gap: 44px; }

  .lineup-rows li { font-size: 20px; padding: 9px 0; }

  .work-intro, .work--sys .work-intro { grid-column: 1 / 13; }
  .ex-tab { min-height: 44px; padding: 0 12px; font-size: 15px; }
  .ex-module-head { grid-template-columns: minmax(0, 1fr); }
  .ex-module-desc { grid-column: 1; grid-row: auto; }
  .work--ux .ex-info { grid-template-columns: minmax(0, 1fr); }
  .ex-carousel, .work--ux .ex-carousel { aspect-ratio: 4 / 3; }
  .exc-pill { width: 100%; }
  .exc-pill-title { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .lab-viewer-help { display: none; }
  #lab-viewer { width: 100vw; height: 86svh; }

  .contact { display: block; padding: 48px 16px; min-height: 0; }
  .contact-card { width: auto; margin: 0; padding: 24px 20px; }
  .ticket .btn-primary { min-height: 56px; }

  .site-footer { grid-template-columns: 1fr; gap: 8px; padding-top: 18svh; }
  .footer-nav { justify-content: flex-start; }
  .footer-copyright { text-align: left; }
}


/* ═══ 13. Capa de movimiento ═══════════════════════════════════════
   Reglas: solo transform y opacity (más clip-path y filter puntuales),
   ease-out fuerte, entradas lentas y respuestas rápidas, nada con
   ease-in, y el hover solo con ratón. Pulsar siempre da respuesta. */

/* Pulsación: todo lo que se puede pulsar responde al instante */
.btn, .text-link, .nav-links .nav-cta, .ex-tab, .exc-pill, .ex-nav, .ex-thumb,
.lang-btn, .ticket-type span, .lab-viewer-nav, .lab-viewer-close { transition-property: background-color, color, transform, opacity, text-underline-offset; }
.btn:active, .nav-links .nav-cta:active, .ex-tab:active, .exc-pill:active, .ex-nav:active,
.lang-btn:active, .ticket-type label:active span, .lab-viewer-nav:active, .lab-viewer-close:active { transform: scale(0.97); }
.text-link:active { transform: translateY(1px); }

/* Titulares: cada palabra sube desde una máscara */
.js .split .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.14em 0.04em 0.12em; margin: -0.14em -0.04em -0.12em; }
.js .split .w > span {
  display: inline-block;
  transform: translate3d(0, 108%, 0);
  transition: transform 0.9s var(--ease) calc(var(--d, 0ms) + var(--i, 0) * 70ms);
}
.js .split.is-in .w > span, .js .is-in .split .w > span { transform: none; }
.js .split.reveal { opacity: 1; transform: none; }

/* Foto de perfil: entra creciendo desde 0,9 y sigue al cursor con inercia */
.js .hero-avatar.reveal { transform: scale(0.9); transition-duration: 1s; }
.js .hero-avatar.reveal.is-in { transform: none; }
.hero-avatar { will-change: transform; }

/* Fotos: se destapan de abajo arriba al entrar */
.js .clip-reveal { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s var(--ease-io); }
.js .clip-reveal.is-in { clip-path: inset(0 0 0 0); }

/* Experiencia: el puesto activo manda; los demás se apagan */
.job-desc, .job-company, .job-date { transition: opacity var(--t) var(--ease); }
.job:not(.is-active) .job-desc, .job:not(.is-active) .job-tools { opacity: 0.45; }
.job:not(.is-active) .job-company, .job:not(.is-active) .job-date { opacity: 0.7; }
/* la foto cambia con un desenfoque corto que une las dos imágenes */
.jobs-photo img { filter: blur(6px) brightness(0.8) contrast(1.05); transition-property: opacity, transform, filter; transition-duration: 1s, 6s, 0.8s; }
.jobs-photo img.is-on { filter: brightness(0.8) contrast(1.05); }

/* Cifras: no se mueven al contar */
.facts b { font-variant-numeric: tabular-nums; }

/* Navegación: subrayado que crece desde la izquierda */
.nav-links a:not(.nav-cta) { position: relative; }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t) var(--ease);
}
.nav-links a.spy-active:not(.nav-cta)::after { transform: scaleX(1); }

/* Ticket: el cambio de prioridad y de estado se nota */
@keyframes bump { 0% { opacity: 0; filter: blur(3px); transform: translateY(4px); } 100% { opacity: 1; filter: none; transform: none; } }
#tk-prio.bump, #tk-status.bump { animation: bump 0.32s var(--ease) both; display: inline-block; }
@keyframes stamp { 0% { transform: scale(1); } 40% { transform: scale(0.985); } 100% { transform: scale(1); } }
.ticket.is-sent .ticket-head { animation: stamp 0.5s var(--ease); }

/* Visor: entra desde 0,97, con fondo que aparece; al cerrar sale más rápido */
#lab-viewer {
  opacity: 0; transform: scale(0.97);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), overlay 0.18s allow-discrete, display 0.18s allow-discrete, filter 0.25s ease;
}
#lab-viewer[open] { opacity: 1; transform: none; transition-duration: 0.28s, 0.28s, 0.28s, 0.28s, 0.25s; }
#lab-viewer::backdrop { opacity: 0; transition: opacity 0.18s var(--ease), overlay 0.18s allow-discrete, display 0.18s allow-discrete; }
#lab-viewer[open]::backdrop { opacity: 1; transition-duration: 0.28s; }
@starting-style {
  #lab-viewer[open] { opacity: 0; transform: scale(0.97); }
  #lab-viewer[open]::backdrop { opacity: 0; }
}

/* Solo con ratón: los efectos de hover no se disparan al tocar */
@media (hover: hover) and (pointer: fine) {
  .nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
  .lineup-rows li > * { transition: transform var(--t) var(--ease), color var(--t-fast) var(--ease); }
  .lineup-rows li:hover > :first-child { transform: translateX(8px); }
  .lineup-rows li:hover .l-where, .lineup-rows li:hover .l-when { color: var(--ink); }
  .btn-primary:hover, .nav-cta:hover { transform: translateY(-1px); }
  .btn:hover:active, .nav-cta:hover:active { transform: scale(0.97); }
  .ex-thumb:hover { transform: translateY(-2px); }
  .contact-rows a { transition: color var(--t-fast) var(--ease), text-underline-offset var(--t-fast) var(--ease); }
  .contact-rows a:hover { text-underline-offset: 0.4em; }
}

@media (prefers-reduced-motion: reduce) {
  .js .split .w > span, .js .hero-avatar.reveal { transform: none; }
  .js .clip-reveal { clip-path: none; }
  .jobs-photo img { filter: brightness(0.8) contrast(1.05); }
  .hero-print img, .hero-avatar { animation: none; }
}

/* ═══ 14. Fondos animados (fondos.js) ═══ */
#hero { position: relative; isolation: isolate; }
.section-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }
@media (prefers-reduced-motion: reduce) { .section-bg { opacity: 0.8; } }

/* Destacados en tableta y móvil */
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { aspect-ratio: 4 / 3.4; }
  .card img { height: 52%; }
  .hero-title { font-size: 9.6vw; }
  .hero-tag { font-size: 18px; }
  .hero-bio { font-size: 15px; }
}

/* Menú alineado con el contenido: mismos bordes que la página y enlaces centrados */
@media (min-width: 961px) {
  #navbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 24px; }
  .nav-logo { justify-self: start; }
  .nav-links { flex: none; margin: 0; justify-self: center; }
  .nav-cta-item { margin-left: 8px; }
  .nav-right { justify-self: end; }
}

/* ═══ 15. Fotos de fondo (img/fondos, de Unsplash: Jonakoh, Conny Schneider, Christopher Gower) ═══ */
/* Inicio: la onda de partículas, oscurecida, bajo el titular */
#hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url("../img/fondos/inicio-ondas.jpg") center 70% / cover no-repeat;
  opacity: 0.45;
  animation: bg-drift 30s var(--ease-io) infinite alternate;
  /* bordes fundidos con el negro para que no se note dónde acaba */
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 62%, transparent), linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(transparent, #000 18%, #000 62%, transparent), linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}
@keyframes bg-drift { from { transform: scale(1.08); } to { transform: scale(1) translate3d(-1.5%, 0, 0); } }

/* Redes: la red de conexiones detrás del título, que se funde con el negro */
#redes { position: relative; isolation: isolate; padding-top: clamp(72px, 9vw, 140px); }
#redes::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: min(90vh, 820px); z-index: -1;
  background: url("../img/fondos/redes-conexiones.jpg") center 40% / cover no-repeat;
  opacity: 0.45;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
          mask-image: linear-gradient(#000 35%, transparent);
}

/* Sistemas y UX/UI: mismo tratamiento que Redes */
#sistemas, #uxui { position: relative; isolation: isolate; padding-top: clamp(72px, 9vw, 140px); }
#sistemas::before, #uxui::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: min(90vh, 820px); z-index: -1;
  background: url("../img/fondos/sistemas-servidores.jpg") center 35% / cover no-repeat;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
          mask-image: linear-gradient(#000 35%, transparent);
}
#uxui::before { background-image: url("../img/fondos/uxui-bocetos.jpg"); background-position: center 45%; opacity: 0.3; filter: grayscale(0.3); }

/* Contacto: el escritorio con código, oscuro, detrás de la tarjeta */
.contact { isolation: isolate; }
.contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../img/fondos/contacto-escritorio.jpg") 30% 50% / cover no-repeat;
  filter: brightness(0.38) saturate(0.8);
}
.contact { justify-content: flex-end; }

@media (max-width: 640px) {
  #hero::before { background-image: url("../img/fondos/inicio-ondas-movil.jpg"); background-position: 60% 80%; }
  #redes::before { background-image: url("../img/fondos/redes-conexiones-movil.jpg"); height: 70vh; }
  .contact::before { background-image: url("../img/fondos/contacto-escritorio-movil.jpg"); }
  #sistemas::before { background-image: url("../img/fondos/sistemas-servidores-movil.jpg"); height: 70vh; }
  #uxui::before { background-image: url("../img/fondos/uxui-bocetos-movil.jpg"); height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { #hero::before { animation: none; } }

/* Nombre: cada línea en su renglón; al pasar el ratón la primera va a la izquierda y la segunda a la derecha */
.hero-title .hl { display: block; will-change: transform; }
@media (hover: hover) and (pointer: fine) {
}


/* Foto de fondo alternativa de un apartado (p. ej. telefonía): sustituye a la de la sección con un fundido */
#redes::before, #sistemas::before, #uxui::before { transition: opacity 0.7s var(--ease); }
#redes::after, #sistemas::after, #uxui::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: min(90vh, 820px); z-index: -1;
  background: var(--alt-bg, none) center 55% / cover no-repeat;
  opacity: 0; transition: opacity 0.7s var(--ease);
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
          mask-image: linear-gradient(#000 35%, transparent);
  pointer-events: none;
}
#redes.alt-bg::before, #sistemas.alt-bg::before, #uxui.alt-bg::before { opacity: 0; }
#redes.alt-bg::after, #sistemas.alt-bg::after, #uxui.alt-bg::after { opacity: 0.45; }
@media (max-width: 640px) { #redes::after, #sistemas::after, #uxui::after { height: 70vh; } }

/* Tarjetas de la portada: al pasar el ratón se tiñen del color de acción */
.card { transition: transform var(--t-fast) var(--ease), background-color 220ms ease, color 220ms ease; }
.card-label { transition: color 220ms ease; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { background: var(--accent); color: var(--accent-ink); }
  .card:hover .card-label { color: var(--accent-ink); opacity: 0.75; }
}
.card:focus-visible { background: var(--accent); color: var(--accent-ink); outline: 2px solid var(--ink); outline-offset: 3px; }

/* Lo básico: la lupa sobre un CV, muy oscurecida para que el texto se lea */
#sobre-mi { position: relative; isolation: isolate; }
#sobre-mi::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -1;
  background: url("../img/fondos/basico-cv.jpg") 30% 40% / cover no-repeat;
  opacity: 0.16; filter: grayscale(0.2);
  -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 60%, transparent);
          mask-image: linear-gradient(transparent, #000 15%, #000 60%, transparent);
}

/* Experiencia: título arriba, y la foto empieza a la misma altura que el primer puesto */
.jobs { padding-top: clamp(72px, 9vw, 140px); }
.jobs-title { grid-column: 7 / 13; grid-row: 1; margin-bottom: 56px; }
.jobs-photo { grid-row: 2; }
.jobs-list { grid-row: 2; padding-top: 0; }
.job-rows { gap: clamp(140px, 24vh, 240px); padding-bottom: 12vh; }
@media (max-width: 960px) { .jobs-title { grid-column: 1 / 13; } }
@media (max-width: 640px) { .jobs-title { margin-bottom: 28px; } .job-rows { gap: 72px; padding-bottom: 0; } }

/* Lo básico: resumen rápido de experiencia y formación */
.quick { display: grid; gap: 14px; margin: 8px 0 4px; }
.quick-h { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-top: 12px; }
.quick-list { display: grid; gap: 10px; }
.quick-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; align-items: baseline; }
.q-what { color: var(--ink); font-weight: 500; line-height: 1.3; }
.q-where { grid-column: 1; font-size: var(--step-small); color: var(--muted); }
.q-when { grid-column: 2; grid-row: 1; font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }


/* Aviso de cookies: tarjeta abajo a la izquierda, entra subiendo y sale más rápido */
.cookie-banner {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  width: min(720px, calc(100vw - 32px));
  margin-left: calc(min(720px, calc(100vw - 32px)) / -2);
  display: grid; gap: 12px; justify-items: center; text-align: center;
  padding: 32px 36px 30px;
  background: var(--surface); color: var(--ink);
  border-top: 3px solid var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); /* taste-skill-ignore: aviso que flota sobre el contenido */
  opacity: 0; transform: translate3d(0, 16px, 0);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.cookie-banner.is-in { opacity: 1; transform: none; }
.cookie-banner.is-out { opacity: 0; transform: translate3d(0, 12px, 0); transition-duration: 0.2s; }
.cookie-title { font-weight: 600; font-size: var(--step-lead); }
.cookie-text { font-size: var(--step-body); color: var(--muted); line-height: 1.55; max-width: 56ch; }
.cookie-actions { display: flex; gap: 12px; margin-top: 10px; }
.cookie-actions .btn { min-height: 50px; padding: 0 32px; font-size: var(--step-body); }
@media (max-width: 640px) { .cookie-banner { bottom: 16px; padding: 24px 20px; } .cookie-actions { width: 100%; } .cookie-actions .btn { flex: 1; justify-content: center; padding: 0 12px; } }

/* Mientras sale el aviso de cookies, la página se ve desenfocada detrás */
.cookie-backdrop {
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.cookie-backdrop.is-in { opacity: 1; }

/* Portada: la primera pantalla ocupa toda la ventana; lo siguiente empieza justo debajo */
#hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--nav-h) + 24px); padding-bottom: 130px;
}
.hero-scroll {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 14px;
  color: var(--muted); font-size: 1rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
}
.hero-scroll i { display: block; width: 3px; height: 64px; background: var(--muted); opacity: 0.4; position: relative; overflow: hidden; }
.hero-scroll i::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: var(--accent); animation: scroll-hint 1.8s var(--ease-io) infinite; }
@keyframes scroll-hint { from { transform: translateY(-100%); } to { transform: translateY(250%); } }
@media (hover: hover) and (pointer: fine) { .hero-scroll:hover { color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .hero-scroll i::after { animation: none; } }
@media (max-height: 640px) { .hero-scroll { display: none; } }

/* Portada: nombre enlazado al inicio, frase como enlace de texto y datos rápidos */
.hero-name { color: inherit; text-decoration: none; display: inline-block; }
.hero-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; }
.hero-go { text-decoration: none; transition: color var(--t-fast) var(--ease); }
@media (hover: hover) and (pointer: fine) { .hero-go:hover { color: var(--accent); } }
.hero-bio { max-width: 60ch; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.hero-meta li { padding: 6px 14px; background: rgba(255, 255, 255, 0.06); color: var(--ink); font-size: var(--step-small); font-weight: 500; }
.hero-meta li:nth-child(2) { color: var(--accent); }
@media (max-width: 640px) { .hero-scroll { font-size: 0.875rem; } .hero-scroll i { height: 48px; } }

/* Portada: contacto directo con iconos */
.hero-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.hero-contact a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  background: rgba(255, 255, 255, 0.07); color: var(--ink); text-decoration: none;
  font-size: var(--step-small); font-weight: 500;
  transition: background-color 200ms ease, color 200ms ease, transform var(--t-fast) var(--ease);
}
.hero-contact svg { flex: none; color: var(--accent); transition: color 200ms ease; }
.hero-contact a:active { transform: scale(0.97); }
.hero-contact a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .hero-contact a:hover { background: var(--accent); color: var(--accent-ink); }
  .hero-contact a:hover svg { color: var(--accent-ink); }
}
@media (max-width: 640px) { .hero-contact a { padding: 0 14px; } }

/* Contacto de la portada: solo los iconos llevan el color de cada servicio */
.hero-contact a { background: transparent; padding: 0 10px; font-size: var(--step-body); }
.hero-contact svg { width: 26px; height: 26px; }
.hero-contact .hc-mail svg { color: #ea4335; }
.hero-contact .hc-wa svg { color: #25d366; }
@media (hover: hover) and (pointer: fine) {
  .hero-contact a:hover { background: transparent; color: var(--ink); }
  .hero-contact a:hover span { text-decoration: underline; text-underline-offset: 0.3em; }
  .hero-contact .hc-mail:hover svg { color: #ea4335; }
  .hero-contact .hc-wa:hover svg { color: #25d366; }
}
.hero-contact .hc-icon { flex: none; width: 28px; height: auto; }

/* Contacto de la portada: solo iconos; crecen al pasar el ratón */
.hero-contact { gap: 40px; margin-top: 10px; }
.hero-contact a { padding: 0; min-height: 0; width: 56px; height: 56px; justify-content: center; }
.hero-contact .hc-icon { width: 40px; height: auto; }
.hero-contact .hc-wa svg { width: 38px; height: 38px; }
.hero-contact .hc-icon, .hero-contact svg { transition: transform 200ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .hero-contact a:hover span { text-decoration: none; }
  .hero-contact a:hover .hc-icon, .hero-contact a:hover svg { transform: scale(1.25); }
}
.hero-contact a:active .hc-icon, .hero-contact a:active svg { transform: scale(1.1); }

/* ═══ 18. Tarjetas de la portada al estilo de la referencia ═══
   La foto ocupa toda la tarjeta con el título encima. Al pasar el ratón
   un panel de color tapa la foto y aparecen el resumen y "Saber más". */
.cards .card { color: #ffffff; background: var(--surface); }
.cards .card img { inset: 0; height: 100%; z-index: 0; filter: none; object-position: 50% 60%; transition: transform 0.9s var(--ease), opacity 0.25s var(--ease); }
.cards .card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.6) 38%, rgba(0,0,0,0.1) 70%, rgba(0,0,0,0) 100%);
  transition: opacity 0.35s var(--ease);
}
.cards .card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--accent); opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.cards .card-label, .cards .card-title, .card-desc, .card-more { position: relative; z-index: 2; }
.cards .card-label { color: rgba(255,255,255,0.85); }
.card-desc {
  font-size: var(--step-body); line-height: 1.5; max-width: 34ch;
  opacity: 0; transform: translate3d(0, 14px, 0);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.card-more {
  margin-top: auto; align-self: flex-end;
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: var(--step-body);
  opacity: 0; transform: translate3d(0, 14px, 0);
  transition: opacity 0.3s var(--ease) 60ms, transform 0.4s var(--ease) 60ms;
}
.card-more svg { transition: transform 0.25s var(--ease); }
.cards .card:hover, .cards .card:focus-visible { background: var(--surface); color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) {
  .cards .card:hover::before { opacity: 0; }
  .cards .card:hover::after { opacity: 1; }
  .cards .card:hover img { transform: scale(1.06); filter: none; opacity: 0; }
  .cards .card:hover .card-label { color: var(--accent-ink); opacity: 0.75; }
  .cards .card:hover .card-desc, .cards .card:hover .card-more { opacity: 1; transform: none; }
  .cards .card:hover .card-more svg { transform: translateX(4px); }
}
.cards .card:focus-visible::before { opacity: 0; }
.cards .card:focus-visible::after { opacity: 1; }
.cards .card:focus-visible img { opacity: 0; }
.cards .card:focus-visible .card-label { color: var(--accent-ink); }
.cards .card:focus-visible .card-desc, .cards .card:focus-visible .card-more { opacity: 1; transform: none; }
/* táctil: sin hover, se ve la foto con el título y "Saber más" abajo */
@media (hover: none), (pointer: coarse) {
  .card-desc { display: none; }
  .card-more { opacity: 1; transform: none; color: #fff; }
  .cards .card::before { background: linear-gradient(to bottom, rgba(0,0,0,0.78), rgba(0,0,0,0.2) 45%, rgba(0,0,0,0.6)); }
}
@media (max-width: 640px) { .cards .card { aspect-ratio: 4 / 4.4; } .cards .card img { height: 100%; } }
.hero-contact .hc-li svg { width: 44px; height: 44px; }
.hero-contact .hc-icon--li { width: 34px; border-radius: 4px; }

/* Arreglo: las secciones que entran inclinadas no deben ensanchar la página
   (en el móvil eso hacía que el navegador alejara el zoom y saliera scroll lateral) */
html, body { overflow-x: clip; }

/* ═══ Arreglos de la revisión ═══ */
/* Pie y logo: zonas de toque de al menos 44 px en el móvil */
.footer-nav a, .nav-logo { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 640px) { .footer-nav { gap: 4px 20px; } }
/* Tema claro: la foto oscura de la portada se invierte para que no quede una neblina gris */
[data-theme="light"] #hero::before { filter: invert(1) hue-rotate(180deg); opacity: 0.35; }
[data-theme="light"] #sistemas::before, [data-theme="light"] #uxui::before { opacity: 0.18; }
/* Contacto: la foto se funde con el negro arriba y abajo, sin cortes rectos */
.contact::before {
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}

/* ═══ 19. Scroll más notorio ═══ */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    /* Fotos de fondo de las secciones: se mueven más despacio que el contenido (paralaje) */
    @keyframes bg-parallax { from { transform: translate3d(0, -8%, 0) scale(1.1); } to { transform: translate3d(0, 8%, 0) scale(1.1); } }
    #sobre-mi::before, #redes::before, #redes::after, #sistemas::before, #sistemas::after, #uxui::before, #uxui::after, .contact::before {
      animation: bg-parallax linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
  }
}

/* ═══ 20. Movimiento de estilo profesional ═══
   Un solo lenguaje para toda la web: curva "expo" (arranca rápida y se
   posa despacio), entradas cortas desde abajo, fotos que se destapan con
   una máscara y se asientan desde un pequeño zoom, desplazamiento suave
   con inercia (Lenis) y una línea de progreso de lectura arriba. */
:root { --ease-expo: cubic-bezier(0.16, 1, 0.3, 1); }

/* Bloques: suben 40 px y aparecen */
.js .reveal {
  opacity: 0; transform: translate3d(0, 40px, 0); filter: none;
  transition: opacity 1s var(--ease-expo) var(--d, 0ms), transform 1.2s var(--ease-expo) var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.js .split.reveal { opacity: 1; transform: none; }
/* Titulares: palabra a palabra desde su máscara */
.js .split .w > span { transition: transform 1.1s var(--ease-expo) calc(var(--d, 0ms) + var(--i, 0) * 60ms); }

/* Tarjetas: se destapan de abajo arriba y la foto se asienta desde un zoom */
.js .cards .card.reveal { opacity: 1; transform: none; clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease-expo) var(--d, 0ms); }
.js .cards .card.reveal.is-in { clip-path: inset(0 0 0 0); }
.js .cards .card.reveal img { transform: scale(1.3); transition: transform 1.8s var(--ease-expo) var(--d, 0ms), opacity 0.25s var(--ease); }
.js .cards .card.reveal.is-in img { transform: scale(1); }
.js .cards .card.reveal .card-label, .js .cards .card.reveal .card-title { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity 0.8s var(--ease-expo) calc(var(--d, 0ms) + 350ms), transform 1s var(--ease-expo) calc(var(--d, 0ms) + 350ms), color 220ms ease; }
.js .cards .card.reveal.is-in .card-label, .js .cards .card.reveal.is-in .card-title { opacity: 1; transform: none; }

/* Foto de Experiencia: misma máscara */
.js .clip-reveal { transition: clip-path 1.3s var(--ease-expo); }

/* Línea de progreso de lectura */
.scroll-progress { display: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .scroll-progress {
      display: block; position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 150;
      background: var(--accent); transform-origin: 0 50%; pointer-events: none;
      animation: read-progress linear both; animation-timeline: scroll(root);
    }
    @keyframes read-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    /* Portada: al bajar, el contenido sube un poco y se desvanece */
    .hero-inner, .hero-scroll { animation: hero-out linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    @keyframes hero-out { to { opacity: 0; transform: translate3d(0, -70px, 0) scale(0.97); } }
    .hero-scroll { animation-name: hero-out-fade; }
    @keyframes hero-out-fade { to { opacity: 0; } }
  }
}

/* Lenis (desplazamiento suave) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .js .cards .card.reveal { clip-path: none; }
  .js .cards .card.reveal img, .js .cards .card.reveal .card-label, .js .cards .card.reveal .card-title { transform: none; opacity: 1; }
}


/* ═══ 21. Animaciones al hacer scroll (funcionan en todos los navegadores) ═══
   Se disparan al entrar cada elemento en pantalla, sin tocar el scroll. */

/* Fotos de fondo de las secciones: aparecen desenfocadas y se enfocan */
#sobre-mi::before, #redes::before, #sistemas::before, #uxui::before, .contact::before {
  transition: opacity 1.4s var(--ease-expo), filter 1.6s var(--ease-expo);
}
.js #sobre-mi:not(.in-view)::before, .js #redes:not(.in-view)::before, .js #sistemas:not(.in-view)::before,
.js #uxui:not(.in-view)::before, .js .contact:not(.in-view)::before { opacity: 0; filter: blur(16px); }

/* Formación y certificados: cada fila entra desde la izquierda, una tras otra */
.js .lineup-rows li.reveal { transform: translate3d(-70px, 0, 0); }
.js .lineup-rows li.reveal.is-in { transform: none; }

/* Experiencia: cada puesto entra desde la derecha */
.js .job.reveal { transform: translate3d(80px, 0, 0); }
.js .job.reveal.is-in { transform: none; }

/* Lo básico: cifras y resumen rápido, en cascada */
.js .intro-note.reveal { opacity: 1; transform: none; }
.js .intro-note .facts li, .js .intro-note .quick-h, .js .intro-note .quick-list li, .js .intro-note .tools {
  opacity: 0; transform: translate3d(0, 28px, 0);
  transition: opacity 0.8s var(--ease-expo), transform 1s var(--ease-expo);
}
.js .intro-note.is-in .facts li, .js .intro-note.is-in .quick-h, .js .intro-note.is-in .quick-list li, .js .intro-note.is-in .tools { opacity: 1; transform: none; }
.js .intro-note.is-in .facts li:nth-child(2) { transition-delay: 0.08s; }
.js .intro-note.is-in .facts li:nth-child(3) { transition-delay: 0.16s; }
.js .intro-note.is-in .facts li:nth-child(4) { transition-delay: 0.24s; }
.js .intro-note.is-in .quick-h { transition-delay: 0.3s; }
.js .intro-note.is-in .quick-list li:nth-child(1) { transition-delay: 0.36s; }
.js .intro-note.is-in .quick-list li:nth-child(2) { transition-delay: 0.42s; }
.js .intro-note.is-in .quick-list li:nth-child(3) { transition-delay: 0.48s; }
.js .intro-note.is-in .quick-list li:nth-child(4) { transition-delay: 0.54s; }
.js .intro-note.is-in .tools { transition-delay: 0.6s; }

/* Prácticas: el carrusel se destapa de abajo arriba y el texto entra desde la derecha */
.js .work .ex-carousel { transition: clip-path 1.3s var(--ease-expo) 0.25s; }
.js .work:not(.in-view) .ex-carousel { clip-path: inset(0 0 100% 0); }
.js .work .ex-info, .js .work .ex-tabs { transition: opacity 0.9s var(--ease-expo) 0.35s, transform 1.1s var(--ease-expo) 0.35s; }
.js .work:not(.in-view) .ex-info { opacity: 0; transform: translate3d(60px, 0, 0); }
.js .work:not(.in-view) .ex-tabs { opacity: 0; transform: translate3d(0, 30px, 0); }

/* Contacto: la tarjeta entra deslizándose desde la derecha */
.js .contact .contact-card { transition: opacity 1s var(--ease-expo) 0.2s, transform 1.2s var(--ease-expo) 0.2s; }
.js .contact:not(.in-view) .contact-card { opacity: 0; transform: translate3d(90px, 0, 0); }

/* En el móvil los desplazamientos laterales son más cortos */
@media (max-width: 640px) {
  .js .lineup-rows li.reveal, .js .job.reveal { transform: translate3d(0, 40px, 0); }
  .js .work:not(.in-view) .ex-info, .js .contact:not(.in-view) .contact-card { transform: translate3d(0, 40px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .js .lineup-rows li.reveal, .js .job.reveal, .js .intro-note *, .js .contact-card, .js .ex-info, .js .ex-tabs { transform: none !important; opacity: 1 !important; }
  .js .ex-carousel { clip-path: none !important; }
}



/* ═══ 22. Animaciones de scroll más visibles ═══
   Mismos efectos, con más recorrido y algo más de duración para que se
   noten. Se disparan al entrar cada cosa en pantalla (no tocan el scroll). */
.js .reveal {
  transform: translate3d(0, 110px, 0) scale(0.94);
  filter: blur(4px);
  transition: opacity 1.1s var(--ease-expo) var(--d, 0ms), transform 1.4s var(--ease-expo) var(--d, 0ms), filter 1.1s var(--ease-expo) var(--d, 0ms);
}
.js .reveal.is-in { transform: none; filter: none; }
.js .split.reveal { filter: none; transform: none; }

/* Titulares: cada palabra sube girando un poco */
.js .split .w > span { transform: translate3d(0, 115%, 0) rotate(7deg); transform-origin: 0 100%; transition: transform 1.2s var(--ease-expo) calc(var(--d, 0ms) + var(--i, 0) * 80ms); }
.js .split.is-in .w > span, .js .is-in .split .w > span { transform: none; }

/* Formación y certificados: las filas llegan desde lejos por la izquierda */
.js .lineup-rows li.reveal { transform: translate3d(-160px, 0, 0); }
/* Experiencia: los puestos llegan desde la derecha, ligeramente girados */
.js .job.reveal { transform: translate3d(180px, 0, 0) rotate(2deg); transform-origin: 100% 50%; }

/* Tarjetas: además de destaparse, suben y la foto se asienta desde más zoom */
.js .cards .card.reveal { transform: translate3d(0, 90px, 0); transition: clip-path 1.4s var(--ease-expo) var(--d, 0ms), transform 1.4s var(--ease-expo) var(--d, 0ms); }
.js .cards .card.reveal.is-in { transform: none; }
.js .cards .card.reveal img { transform: scale(1.45); }

/* Prácticas: el carrusel crece mientras se destapa; el texto viene de más lejos */
.js .work .ex-carousel { transition: clip-path 1.4s var(--ease-expo) 0.25s, transform 1.6s var(--ease-expo) 0.25s; }
.js .work:not(.in-view) .ex-carousel { transform: scale(0.88); }
.js .work:not(.in-view) .ex-info { transform: translate3d(140px, 0, 0); }

/* Contacto: la tarjeta entra desde más lejos */
.js .contact:not(.in-view) .contact-card { transform: translate3d(200px, 0, 0) rotate(2deg); }

/* Fotos de fondo: más desenfoque de partida */
.js #sobre-mi:not(.in-view)::before, .js #redes:not(.in-view)::before, .js #sistemas:not(.in-view)::before,
.js #uxui:not(.in-view)::before, .js .contact:not(.in-view)::before { filter: blur(24px); }

@media (max-width: 640px) {
  .js .reveal { transform: translate3d(0, 70px, 0) scale(0.96); }
  .js .lineup-rows li.reveal { transform: translate3d(-60px, 0, 0); }
  .js .job.reveal { transform: translate3d(0, 70px, 0); }
  .js .work:not(.in-view) .ex-info, .js .contact:not(.in-view) .contact-card { transform: translate3d(0, 70px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .split .w > span, .js .job.reveal, .js .lineup-rows li.reveal, .js .cards .card.reveal, .js .cards .card.reveal img { transform: none !important; filter: none !important; }
}

/* Arreglo: la tarjeta entera no puede empezar recortada (el navegador la
   consideraba invisible, no llegaba a aparecer y dejaba un hueco negro).
   Ahora la tarjeta sube y aparece, y es la foto de dentro la que se destapa. */
.js .cards .card.reveal { clip-path: none; opacity: 0; transition: opacity 0.9s var(--ease-expo) var(--d, 0ms), transform 1.4s var(--ease-expo) var(--d, 0ms); }
.js .cards .card.reveal.is-in { opacity: 1; }
.js .cards .card.reveal img { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--ease-expo) calc(var(--d, 0ms) + 150ms), transform 1.8s var(--ease-expo) var(--d, 0ms), opacity 0.25s var(--ease); }
.js .cards .card.reveal.is-in img { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { .js .cards .card.reveal, .js .cards .card.reveal img { opacity: 1 !important; clip-path: none !important; } }

/* ═══ 23. Animaciones de scroll muy visibles ═══
   Más recorrido, giro en 3D, más duración y escalonado más lento.
   Además se repiten: si subes y vuelves a bajar, se animan otra vez. */
.js .reveal {
  transform: perspective(1200px) translate3d(0, 170px, 0) rotateX(28deg) scale(0.86);
  transform-origin: 50% 100%;
  filter: blur(6px);
  transition: opacity 1.2s var(--ease-expo) var(--d, 0ms), transform 1.8s var(--ease-expo) var(--d, 0ms), filter 1.2s var(--ease-expo) var(--d, 0ms);
}
.js .reveal.is-in { transform: none; filter: none; opacity: 1; }
.js .split.reveal { transform: none; filter: none; opacity: 1; }

/* Titulares: palabras que suben girando, una a una y más despacio */
.js .split .w > span { transform: translate3d(0, 120%, 0) rotate(12deg); transition: transform 1.4s var(--ease-expo) calc(var(--d, 0ms) + var(--i, 0) * 120ms); }

/* Formación y certificados: filas desde muy lejos por la izquierda */
.js .lineup-rows li.reveal { transform: translate3d(-260px, 0, 0) rotate(-3deg); transform-origin: 0 50%; }
/* Experiencia: puestos desde muy lejos por la derecha, girados */
.js .job.reveal { transform: perspective(1200px) translate3d(280px, 0, 0) rotateY(-24deg); transform-origin: 100% 50%; }

/* Tarjetas: suben volteándose hacia delante */
.js .cards .card.reveal { transform: perspective(1000px) translate3d(0, 200px, 0) rotateX(35deg) scale(0.85); transform-origin: 50% 100%; transition: opacity 1s var(--ease-expo) var(--d, 0ms), transform 1.9s var(--ease-expo) var(--d, 0ms); }
.js .cards .card.reveal.is-in { transform: none; }
.js .cards .card.reveal img { transform: scale(1.6); }

/* Lo básico: cifras y resumen desde más abajo */
.js .intro-note .facts li, .js .intro-note .quick-h, .js .intro-note .quick-list li, .js .intro-note .tools { transform: translate3d(0, 70px, 0); transition: opacity 1s var(--ease-expo), transform 1.4s var(--ease-expo); }

/* Prácticas: el carrusel crece mucho mientras se destapa; el texto desde lejos */
.js .work .ex-carousel { transition: clip-path 1.6s var(--ease-expo) 0.3s, transform 2s var(--ease-expo) 0.3s; }
.js .work:not(.in-view) .ex-carousel { transform: scale(0.75) rotate(-2deg); }
.js .work:not(.in-view) .ex-info { transform: translate3d(240px, 0, 0); }
.js .work:not(.in-view) .ex-tabs { transform: translate3d(0, 80px, 0); }

/* Contacto: la tarjeta entra girando desde muy lejos */
.js .contact .contact-card { transition: opacity 1.2s var(--ease-expo) 0.2s, transform 1.8s var(--ease-expo) 0.2s; }
.js .contact:not(.in-view) .contact-card { transform: perspective(1200px) translate3d(300px, 0, 0) rotateY(-30deg); }

/* Foto de Experiencia: se destapa más despacio */
.js .clip-reveal { transition: clip-path 1.8s var(--ease-expo); }

@media (max-width: 640px) {
  .js .reveal { transform: translate3d(0, 120px, 0) scale(0.9); }
  .js .lineup-rows li.reveal { transform: translate3d(-120px, 0, 0); }
  .js .job.reveal, .js .work:not(.in-view) .ex-info, .js .contact:not(.in-view) .contact-card { transform: translate3d(0, 120px, 0) scale(0.92); }
  .js .cards .card.reveal { transform: translate3d(0, 140px, 0) scale(0.9); }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .split .w > span, .js .job.reveal, .js .lineup-rows li.reveal, .js .cards .card.reveal, .js .cards .card.reveal img, .js .contact-card, .js .ex-carousel, .js .ex-info { transform: none !important; filter: none !important; opacity: 1 !important; }
}

/* Arreglo: las fotos de fondo de las secciones (que se desplazan un poco con el
   efecto de profundidad) tapaban el final de la portada y robaban los clics
   (por ejemplo a "Desliza") y el movimiento del ratón. Ahora no capturan nada. */
#hero::before, #sobre-mi::before, #redes::before, #redes::after, #sistemas::before, #sistemas::after,
#uxui::before, #uxui::after, .contact::before { pointer-events: none; }

/* Arreglo importante: el aviso de cookies, una vez aceptado o rechazado, seguía
   ocupando su sitio invisible abajo en el centro y bloqueaba los clics de esa zona */
.cookie-banner[hidden], .cookie-backdrop[hidden] { display: none !important; }

/* Encuadre: todas las fotos de fondo de las secciones se funden con el negro
   arriba y abajo, igual que la de Lo básico (sin bordes rectos) */
#redes::before, #redes::after, #sistemas::before, #sistemas::after, #uxui::before, #uxui::after, .contact::before {
  -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 60%, transparent);
          mask-image: linear-gradient(transparent, #000 15%, #000 60%, transparent);
}

/* Formación: mesa de estudio de fondo, con el mismo encuadre que las demás */
#formacion { position: relative; isolation: isolate; padding-top: clamp(72px, 9vw, 140px); }
#formacion::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("../img/fondos/formacion-estudio.jpg") center bottom / cover no-repeat;
  opacity: 0.3;
  /* bordes fundidos con el negro arriba y abajo, como en los demás apartados */
  -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 70%, transparent);
          mask-image: linear-gradient(transparent, #000 15%, #000 70%, transparent);
  transition: opacity 1.4s var(--ease-expo), filter 1.6s var(--ease-expo);
}
.js #formacion:not(.in-view)::before { opacity: 0; filter: blur(24px); }
[data-theme="light"] #formacion::before { opacity: 0.18; }
@media (max-width: 640px) { #formacion::before { background-image: url("../img/fondos/formacion-estudio-movil.jpg"); } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    #formacion::before { animation: bg-parallax linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  }
}

/* Contacto: mismo tratamiento que las demás fotos de fondo (atenuada con
   opacidad, no con brillo) y con fundidos más largos arriba y abajo */
.contact::before {
  filter: saturate(0.8);
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(transparent, #000 28%, #000 58%, transparent);
          mask-image: linear-gradient(transparent, #000 28%, #000 58%, transparent);
}
[data-theme="light"] .contact::before { opacity: 0.25; }

/* Contacto: fundido mucho más suave y largo arriba y abajo (curva gradual, sin bandas) */
.contact::before {
  opacity: 0.36;
  -webkit-mask-image: linear-gradient(transparent 0%, rgba(0,0,0,0.08) 12%, rgba(0,0,0,0.3) 24%, rgba(0,0,0,0.7) 36%, #000 46%, #000 54%, rgba(0,0,0,0.7) 64%, rgba(0,0,0,0.3) 76%, rgba(0,0,0,0.08) 88%, transparent 100%);
          mask-image: linear-gradient(transparent 0%, rgba(0,0,0,0.08) 12%, rgba(0,0,0,0.3) 24%, rgba(0,0,0,0.7) 36%, #000 46%, #000 54%, rgba(0,0,0,0.7) 64%, rgba(0,0,0,0.3) 76%, rgba(0,0,0,0.08) 88%, transparent 100%);
}

/* ─── 24. Contacto en modo claro: más contraste ─────────────────
   La tarjeta tenía el mismo color que el fondo de la página y se
   perdía; ahora es blanca, con borde y sombra, y los textos
   secundarios, botones y campos son más oscuros.                  */
[data-theme="light"] .contact-card {
  --paper: #ffffff; --paper-2: #dfe5ec; --paper-muted: #2f3843;
  background: #fff;
  border: 1px solid #c3ccd6;
  box-shadow: 0 24px 60px -20px rgba(13, 21, 32, 0.35), 0 2px 6px rgba(13, 21, 32, 0.08);
}
[data-theme="light"] .contact-rows dt,
[data-theme="light"] .ticket-type legend,
[data-theme="light"] .form-group label { color: #2f3843; font-weight: 500; }
[data-theme="light"] .ticket-type span { background: #dfe5ec; color: #0d1520; border: 1px solid #b9c3ce; }
[data-theme="light"] .ticket-type label:hover span { background: #ccd5df; }
[data-theme="light"] .ticket-type input:checked + span { background: var(--paper-accent); color: #fff; border-color: var(--paper-accent); }
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea { border-color: #8e99a6; background: #fff; }
[data-theme="light"] .form-group input::placeholder,
[data-theme="light"] .form-group textarea::placeholder { color: #5b6672; opacity: 1; }
[data-theme="light"] .ticket .btn-primary { background: #0d1520; color: #fff; }
