/* José Lara Navarro — portfolio
   Paleta heredada de la web anterior: azul eléctrico → violeta → magenta.
   Contraste (WCAG 2.2 AA) medido: --blue 7,6:1 y --magenta-text 5,7:1 sobre blanco;
   --muted 6,1:1 sobre blanco; en la banda nocturna, --on-night-muted 7,5:1.
   El magenta puro (#e21e80) solo se usa en degradados, texto grande o adornos. */

/* ---------------------------------------------------------------- Tokens */
:root {
  --blue: #1e30f3;
  --violet: #7a27c9;
  --magenta: #e21e80;
  --magenta-text: #c4146c;
  --grad: linear-gradient(120deg, var(--blue) 0%, var(--violet) 52%, var(--magenta) 100%);
  --grad-strong: linear-gradient(120deg, var(--blue) 0%, var(--violet) 55%, var(--magenta-text) 100%);

  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #10132a;
  --text: #2a2f45;
  --muted: #5b6178;
  --line: #e3e5f0;

  --night: #0b0e24;
  --night-2: #151937;
  --night-line: rgba(142, 156, 255, 0.18);
  --on-night: #ffffff;
  --on-night-muted: #9aa1c4;
  --blue-light: #8e9cff;
  --pink-light: #ff6fb5;

  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: 0.9375rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  --step-4: clamp(2.6rem, 1.4rem + 5.4vw, 5.6rem);

  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --wrap: 74rem;
  --measure: 40rem;
  --radius: 18px;
  --radius-sm: 10px;
  --header-h: 4rem;
  --shadow: 0 1px 2px rgba(16, 19, 42, 0.06), 0 12px 32px -12px rgba(30, 48, 243, 0.18);
}

/* ---------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--step-0); line-height: 1.65; }
@media (min-width: 64em) { body { font-size: 1.0938rem; } }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 800; line-height: 1.12; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p, ul, ol, dl, figure { margin: 0; }
p { text-wrap: pretty; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--violet); text-decoration-thickness: 2px; }
strong { font-weight: 700; color: var(--ink); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.86em; background: #eef0fb; color: var(--ink); padding: 0.08em 0.35em; border-radius: 5px; }
::selection { background: rgba(122, 39, 201, 0.22); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.on-night :focus-visible { outline-color: var(--pink-light); }

.visually-hidden { position: absolute !important; 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: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: #fff; padding: 0.6rem 1rem; font-weight: 700; border-radius: var(--radius-sm); }
.skip-link:focus { top: 0.75rem; color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-text.grad-light { background-image: linear-gradient(120deg, var(--blue-light), var(--pink-light)); }

/* ---------------------------------------------------------------- Cabecera */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(246, 247, 251, 0.78); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.3s, background-color 0.3s; }
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(246, 247, 251, 0.9); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.0625rem; color: var(--ink); text-decoration: none; white-space: nowrap; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: var(--grad); color: #fff; font-size: 0.875rem; font-weight: 800; letter-spacing: 0; }
.nav-toggle { display: none; }
.site-nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.site-nav a { position: relative; display: inline-block; color: var(--text); text-decoration: none; font-size: 0.9688rem; font-weight: 600; padding: 0.45rem 0.8rem; border-radius: 999px; }
.site-nav a:hover { color: var(--ink); background: rgba(30, 48, 243, 0.07); }
.site-nav a.is-active { color: var(--blue); background: rgba(30, 48, 243, 0.09); }
.site-nav .nav-cv { color: #fff; background: var(--ink); margin-left: 0.4rem; }
.site-nav .nav-cv:hover { color: #fff; background: var(--grad-strong); }

@media (max-width: 55.99em) {
  .js .nav-toggle { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: 700 0.9375rem var(--font); padding: 0.5rem 0.85rem; border-radius: 999px; cursor: pointer; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 2px; background: currentColor; position: relative; border-radius: 2px; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -5px; }
  .nav-toggle-bars::after { top: 5px; }
  .js .site-nav { position: absolute; inset: 100% 0 auto 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px rgba(16, 19, 42, 0.25); padding: 0.5rem var(--gutter) 1rem; }
  .js .site-nav[hidden] { display: none; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .js .site-nav a { display: block; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); }
  .js .site-nav .nav-cv { margin: 0.4rem 0 0; text-align: center; }
  html:not(.js) .site-header .wrap { flex-wrap: wrap; padding-block: 0.5rem; }
}

/* ---------------------------------------------------------------- Botones */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; font: 700 1rem/1.2 var(--font); text-decoration: none; padding: 0.9rem 1.4rem; border-radius: 999px; border: 0; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-grad { color: #fff; background: var(--grad-strong); box-shadow: 0 10px 28px -10px rgba(122, 39, 201, 0.7); }
.btn-grad:hover { color: #fff; box-shadow: 0 16px 34px -10px rgba(196, 20, 108, 0.65); }
.btn-outline { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-outline:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--violet); }
.btn-night { color: #fff; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.btn-night:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.btn small { font-weight: 500; opacity: 0.75; font-size: 0.8125rem; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------------------------------------------------------------- Portada */
.hero { position: relative; overflow: hidden; isolation: isolate; min-height: min(92vh, 56rem); display: flex; align-items: center; padding-block: 3rem 5rem; }
.hero-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::before { content: ""; position: absolute; z-index: -2; width: 46rem; height: 46rem; right: -14rem; top: -16rem; border-radius: 50%; background: radial-gradient(circle, rgba(226, 30, 128, 0.16), transparent 62%); }
.hero::after { content: ""; position: absolute; z-index: -2; width: 52rem; height: 52rem; left: -20rem; bottom: -30rem; border-radius: 50%; background: radial-gradient(circle, rgba(30, 48, 243, 0.14), transparent 62%); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 56em) { .hero-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 3rem; } }

.hero h1 { font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.035em; }
.hero h1 .hello { display: block; font-size: 0.5em; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.15em; }
.typing .ch { visibility: hidden; }
.typing .ch.on { visibility: visible; }
/* Hasta que el JavaScript prepara el efecto, el titular no se pinta (si no, en móvil se veía
   entero y luego se borraba). Si el script no llega a ejecutarse, aparece igualmente a los 3 s. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-typing]:not(.is-typing) { visibility: hidden; animation: typing-fallback 0s 3s forwards; }
}
@keyframes typing-fallback { to { visibility: visible; } }
.caret { display: inline-block; width: 0.09em; height: 0.9em; margin-left: 0.04em; vertical-align: -0.08em; background: var(--magenta); border-radius: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-title { margin-top: 1.25rem; font-size: var(--step-1); font-weight: 700; color: var(--ink); }
.hero-title span { color: var(--violet); padding-inline: 0.2em; }
.hero-stream { margin-top: 0.9rem; min-height: 3.2em; font-size: var(--step-1); color: var(--muted); }
.hero-stream .rot { color: var(--ink); font-weight: 700; box-shadow: inset 0 -0.38em 0 rgba(122, 39, 201, 0.16); }
.hero-stream .caret { background: var(--blue); }
@media (min-width: 56em) { .hero-stream { min-height: 1.7em; } }
.hero-note { margin-top: 1rem; max-width: 36rem; color: var(--muted); }
.hero-note strong { color: var(--ink); }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.hero-social { margin-top: 1.75rem; display: flex; gap: 0.5rem; list-style: none; padding: 0; }
.hero-social a { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s, color 0.2s; }
.hero-social a:hover { color: var(--violet); transform: translateY(-3px); }

/* Retrato recortado que sale del círculo de degradado (como en la web anterior), con una órbita que gira */
.portrait { --s: clamp(15rem, 10rem + 12vw, 22rem); position: relative; justify-self: center; width: var(--s); height: calc(var(--s) * 1.3); }
.portrait-disc { position: absolute; left: 0; right: 0; bottom: 0; height: var(--s); border-radius: 50%; background: var(--grad); box-shadow: 0 30px 60px -20px rgba(122, 39, 201, 0.55); }
.portrait-disc::after { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 60%); }
.portrait-ring { position: absolute; left: -16px; right: -16px; bottom: -16px; height: calc(var(--s) + 32px); border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 62%, rgba(226, 30, 128, 0.15) 70%, var(--magenta) 99%, transparent 100%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); animation: spin 6s linear infinite; }
.portrait-cut { position: absolute; inset: 0; -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--s) / 2) no-repeat, radial-gradient(circle calc(var(--s) / 2) at 50% calc(100% - var(--s) / 2), #000 99.5%, transparent 100%); mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--s) / 2) no-repeat, radial-gradient(circle calc(var(--s) / 2) at 50% calc(100% - var(--s) / 2), #000 99.5%, transparent 100%); }
.portrait-cut img { position: absolute; left: 52%; top: 0; width: calc(var(--s) * 0.98); max-width: none; transform: translateX(-50%); filter: drop-shadow(0 18px 30px rgba(16, 19, 42, 0.25)); }
@keyframes spin { to { transform: rotate(1turn); } }
.chip-float { position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.75rem; border-radius: 999px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); font-size: 0.8125rem; font-weight: 700; color: var(--ink); white-space: nowrap; animation: bob 6s ease-in-out infinite; }
.chip-float::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--grad); }
.chip-float:nth-of-type(1) { top: 30%; left: -14%; }
.chip-float:nth-of-type(2) { top: 40%; right: -14%; animation-delay: -1.5s; }
.chip-float:nth-of-type(3) { bottom: 14%; left: -16%; animation-delay: -3s; }
.chip-float:nth-of-type(4) { bottom: 4%; right: -10%; animation-delay: -4.5s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 30em) { .chip-float:nth-of-type(1), .chip-float:nth-of-type(3) { left: -4%; } .chip-float:nth-of-type(2), .chip-float:nth-of-type(4) { right: -4%; } }

.motion-toggle { position: absolute; right: var(--gutter); bottom: 1.25rem; display: inline-flex; align-items: center; gap: 0.45rem; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); color: var(--muted); font: 600 0.8125rem var(--font); padding: 0.4rem 0.8rem; border-radius: 999px; cursor: pointer; }
.motion-toggle:hover { color: var(--ink); }
.scroll-cue { position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%); width: 1.6rem; height: 2.6rem; border-radius: 999px; box-shadow: inset 0 0 0 2px rgba(16, 19, 42, 0.25); }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 0.5rem; width: 4px; height: 0.55rem; margin-left: -2px; border-radius: 2px; background: var(--violet); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(0.8rem); } }
@media (max-width: 40em) { .scroll-cue { display: none; } }

/* Banda de tecnologías en movimiento */
.marquee { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding-block: 1rem; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 2.75rem; animation: slide 38s linear infinite; }
.marquee-track ul { list-style: none; display: flex; gap: 2.75rem; padding: 0; }
.marquee li { display: inline-flex; align-items: center; gap: 2.75rem; font-weight: 700; font-size: 1.0625rem; white-space: nowrap; }
.marquee li::after { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--grad); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Pausa global de animaciones (botón) y movimiento reducido */
.is-paused *, .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .typing .ch { visibility: visible; }
  .caret { display: none; }
}

/* ---------------------------------------------------------------- Secciones */
.section { padding-block: clamp(4rem, 3rem + 4vw, 7rem); }
.section-head { margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem); max-width: 44rem; }
.section-head h2 { font-size: var(--step-3); }
.section-head p { margin-top: 0.9rem; color: var(--muted); font-size: 1.0625rem; }
.section-flush { padding-top: 0; }
.section-white { background: var(--surface); }
.section-white .pub, .section-white .award { background: var(--bg); box-shadow: none; }
.kicker { display: inline-block; font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.75rem; }
.night { background: var(--night); color: var(--on-night-muted); position: relative; overflow: hidden; isolation: isolate; }
.night::before { content: ""; position: absolute; z-index: -1; inset: -20% -10% auto auto; width: 60rem; height: 60rem; background: radial-gradient(circle, rgba(122, 39, 201, 0.25), transparent 60%); }
.night h2, .night h3, .night h4, .night strong { color: var(--on-night); }
.night .section-head p { color: var(--on-night-muted); }
.night a { color: var(--blue-light); }
.night a:hover { color: var(--pink-light); }

/* Aparición suave al entrar en pantalla */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Proyectos destacados (banda nocturna) */
.showcase { display: grid; gap: 1.5rem; }
.case-card { position: relative; display: grid; gap: 2rem; padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); border-radius: 24px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--night-line); overflow: hidden; isolation: isolate; }
.case-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(28rem circle at var(--mx, 70%) var(--my, 20%), rgba(122, 39, 201, 0.32), transparent 55%); opacity: 0.7; transition: opacity 0.3s; }
.case-card:hover::before { opacity: 1; }
.case-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.case-card:hover::after, .case-card:focus-within::after { opacity: 1; }
@media (min-width: 60em) { .case-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 3rem; } .case-card.is-flipped .case-media { order: -1; } }
.case-card .kicker { color: var(--pink-light); }
.case-card h3 { font-size: var(--step-3); }
.case-card h3 a { color: inherit; text-decoration: none; }
.case-card h3 a:hover { color: inherit; text-decoration: underline; text-decoration-color: var(--pink-light); }
.case-lead { margin-top: 1rem; font-size: var(--step-1); line-height: 1.5; color: #dfe2f5; }
.case-points { list-style: none; padding: 0; margin-top: 1.5rem; display: grid; gap: 0.7rem; }
.case-points li { position: relative; padding-left: 1.6rem; }
.case-points li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--grad); }
.tags { list-style: none; padding: 0; margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags li { font-size: 0.8125rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 999px; background: rgba(142, 156, 255, 0.12); color: #c9cff5; }
.case-actions { position: relative; z-index: 2; margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.night .case-actions .btn-grad { color: #fff; }
.case-actions .link-video { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; color: #fff; text-decoration: none; padding: 0.6rem 0.2rem; }
.case-actions .link-video:hover { color: var(--pink-light); }
.case-media { position: relative; z-index: 2; }

/* Marco de navegador para la captura */
.browser { border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08); transform: perspective(1200px) rotateY(-6deg) rotateX(2deg); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.case-card:hover .browser { transform: perspective(1200px) rotateY(0) rotateX(0); }
.browser-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.8rem; background: #eceef6; }
.browser-bar i { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #c9ccdb; }
.browser-bar span { margin-left: 0.6rem; font-size: 0.75rem; color: #555b73; background: #fff; padding: 0.15rem 0.7rem; border-radius: 999px; }
.media-caption { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--on-night-muted); }

/* Más proyectos */
.more { margin-top: clamp(3.5rem, 3rem + 2vw, 5rem); }
.more-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; align-items: end; margin-bottom: 1.5rem; }
.more-head h3 { font-size: var(--step-2); }
.more-head p { color: var(--on-night-muted); max-width: 34rem; }
.mini-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.mini { position: relative; display: flex; flex-direction: column; gap: 0.6rem; padding: 1.4rem; border-radius: var(--radius); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--night-line); transition: transform 0.25s, background-color 0.25s; }
.mini:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.07); }
.mini h4 { font-size: 1.1875rem; letter-spacing: -0.01em; }
.mini p { font-size: 0.9688rem; }
.mini .tags { margin-top: auto; padding-top: 0.5rem; }
.mini-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.9375rem; font-weight: 700; }
.badge { align-self: flex-start; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.01em; padding: 0.25rem 0.65rem; border-radius: 999px; color: #fff; background: rgba(255, 255, 255, 0.1); }
.mini.is-volunteer { grid-column: 1 / -1; display: grid; gap: 1.25rem 2rem; background: linear-gradient(120deg, rgba(30, 48, 243, 0.18), rgba(226, 30, 128, 0.16)); box-shadow: inset 0 0 0 1px rgba(255, 111, 181, 0.35); }
@media (min-width: 52em) { .mini.is-volunteer { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; } }
.mini.is-volunteer .badge { background: var(--grad-strong); }
.mini.is-volunteer h4 { font-size: var(--step-2); }
.mini.is-volunteer .vol-text { display: flex; flex-direction: column; gap: 0.6rem; }
.mini.is-volunteer img { border-radius: 12px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8); width: 100%; }

/* ---------------------------------------------------------------- Trayectoria */
.timeline { list-style: none; padding: 0; position: relative; max-width: 54rem; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 1.05rem; top: 0.5rem; width: 3px; border-radius: 3px; }
.timeline::before { bottom: 0.5rem; background: var(--line); }
.timeline::after { height: calc(var(--progress, 0) * (100% - 1rem)); background: linear-gradient(180deg, var(--blue), var(--violet), var(--magenta)); }
.timeline > li { position: relative; padding-left: 3.5rem; }
.timeline > li + li { margin-top: 2rem; }
.t-dot { position: absolute; left: 0.3rem; top: 0.25rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 3px var(--line); display: grid; place-items: center; transition: box-shadow 0.4s; z-index: 1; }
.t-dot::after { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line); transition: background-color 0.4s, transform 0.4s; }
.timeline > li.is-reached .t-dot { box-shadow: inset 0 0 0 3px var(--violet); }
.timeline > li.is-reached .t-dot::after { background: var(--violet); transform: scale(1.15); }
html:not(.js) .timeline::after { height: calc(100% - 1rem); }
.t-card { padding: 1.4rem 1.5rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.t-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.t-date { font-weight: 800; color: var(--ink); }
.t-type { font-size: 0.75rem; font-weight: 800; padding: 0.2rem 0.6rem; border-radius: 999px; }
.t-type.is-work { color: var(--blue); background: rgba(30, 48, 243, 0.09); }
.t-type.is-study { color: var(--magenta-text); background: rgba(226, 30, 128, 0.09); }
.t-type.is-now { color: #fff; background: var(--grad-strong); }
.t-card h3 { font-size: var(--step-1); letter-spacing: -0.015em; }
.t-org { margin-top: 0.25rem; color: var(--muted); }
.t-grade { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; }
.t-grade li { font-size: 0.875rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 999px; background: #f0f1fa; color: var(--ink); }
.t-grade li.is-hl { color: #fff; background: var(--grad-strong); }
.t-points { list-style: disc; margin-top: 0.85rem; padding-left: 1.1rem; }
.t-points li + li { margin-top: 0.35rem; }
.t-points li::marker { color: var(--violet); }
.t-link { display: inline-block; margin-top: 0.9rem; font-weight: 700; }
.t-card details { margin-top: 0.85rem; }
.t-card summary { cursor: pointer; font-weight: 700; color: var(--blue); width: fit-content; }
.t-card summary:hover { color: var(--violet); }
/* En escritorio, la línea va por el centro y las tarjetas se alternan a cada lado */
@media (min-width: 64em) {
  .timeline { max-width: none; }
  .timeline::before, .timeline::after { left: calc(50% - 1.5px); }
  .timeline > li { width: 50%; padding-left: 0; padding-right: 3rem; }
  .timeline > li:nth-child(even) { margin-left: 50%; padding-right: 0; padding-left: 3rem; }
  .timeline > li + li { margin-top: -3.5rem; }
  .t-dot { left: auto; right: -0.8rem; }
  .timeline > li:nth-child(even) .t-dot { right: auto; left: -0.8rem; }
  .js .timeline > li:nth-child(odd) .reveal { transform: translateX(-32px); }
  .js .timeline > li:nth-child(even) .reveal { transform: translateX(32px); }
  .js .timeline > li .reveal.is-visible { transform: none; }
}

/* ---------------------------------------------------------------- Competencias */
.skills { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
@media (min-width: 64em) { .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.skill { padding: 1.4rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.skill h3 { font-size: 1.125rem; display: flex; align-items: center; gap: 0.6rem; }
.skill h3::before { content: ""; width: 0.75rem; height: 0.75rem; border-radius: 4px; background: var(--grad); }
.skill ul { list-style: none; padding: 0; margin-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill li { font-size: 0.875rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 999px; background: #f0f1fa; color: var(--ink); transition: background-color 0.2s, color 0.2s; }
.skill li:hover { background: var(--ink); color: #fff; }
.langs { margin-top: 1rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.lang { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.lang b { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.lang span { color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.lang span strong { display: block; color: var(--ink); }

/* ---------------------------------------------------------------- Reconocimientos */
.awards { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.award { position: relative; padding: 1.6rem 1.5rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.3s; }
.award::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.award::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent); transform: skewX(-20deg); transition: left 0.8s; pointer-events: none; }
.award:hover { transform: translateY(-4px); }
.award:hover::after { left: 130%; }
.award-img { display: block; width: calc(100% + 3rem); max-width: none; margin: -1.6rem -1.5rem 1.1rem; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; background: #fff; border-bottom: 1px solid var(--line); transition: transform 0.6s; }
.award:hover .award-img { transform: scale(1.04); }
.award-icon { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.award-year { margin-top: 0; font-weight: 800; color: var(--magenta-text); font-size: 0.9375rem; }
.award h4 { margin-top: 0.25rem; font-size: 1.1875rem; letter-spacing: -0.015em; }
.award p { margin-top: 0.5rem; color: var(--muted); font-size: 0.9375rem; }
.award p.award-for { color: var(--ink); font-weight: 600; }
@media (min-width: 56em) and (max-width: 73.99em) { .awards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.block + .block { margin-top: clamp(3rem, 2.5rem + 2vw, 4.5rem); }
.block-title { font-size: var(--step-2); margin-bottom: 1.25rem; }
.pubs { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.pub { display: grid; gap: 0.35rem 1.5rem; padding: 1.25rem 1.4rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
@media (min-width: 52em) { .pub { grid-template-columns: 12rem minmax(0, 1fr) auto; align-items: center; } }
.pub-thumb { display: block; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.pub-thumb img { width: 100%; aspect-ratio: 720 / 316; object-fit: cover; object-position: top; transition: transform 0.5s; }
.pub:hover .pub-thumb img { transform: scale(1.05); }
.pub-title { font-weight: 700; color: var(--ink); line-height: 1.4; }
.pub-meta { color: var(--muted); font-size: 0.9375rem; }
.pub-meta cite { font-style: italic; }
.pub-role { color: var(--magenta-text); font-weight: 700; }
.doi { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.9375rem; white-space: nowrap; padding: 0.5rem 0.9rem; border-radius: 999px; background: #f0f1fa; text-decoration: none; justify-self: start; }
.doi:hover { background: var(--ink); color: #fff; }
.pub-more { margin-top: 1rem; color: var(--muted); font-size: 0.9375rem; }

.talks { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 56em) { .talks { grid-template-columns: 15rem 1fr 1fr; } }
.poster img { border-radius: 12px; box-shadow: var(--shadow); }
.poster figcaption { margin-top: 0.6rem; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 55.99em) { .poster { max-width: 20rem; } }
.talks h4 { font-size: 1rem; color: var(--violet); margin-bottom: 0.5rem; letter-spacing: 0; }
.talks ul { list-style: none; padding: 0; }
.talks li { padding-block: 0.75rem; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.talk-meta { display: block; font-weight: 400; color: var(--muted); font-size: 0.9375rem; }
.talk-meta b { color: var(--magenta-text); font-weight: 700; }

/* ---------------------------------------------------------------- Música */
.music { display: grid; gap: 2rem; align-items: center; padding: clamp(1.75rem, 1rem + 3vw, 3rem); border-radius: 28px; background: var(--grad-strong); color: #fff; overflow: hidden; position: relative; }
@media (min-width: 52em) { .music { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.music h2 { color: #fff; font-size: var(--step-3); }
.music p { margin-top: 1rem; font-size: var(--step-1); line-height: 1.5; color: #fff; max-width: 34rem; }
.music a { color: #fff; }
.eq { display: flex; align-items: flex-end; justify-content: center; gap: 0.45rem; height: 9rem; }
.eq span { width: 0.75rem; height: 100%; border-radius: 999px; background: rgba(255, 255, 255, 0.9); transform-origin: bottom; animation: eq 1.2s ease-in-out infinite; }
.eq span:nth-child(odd) { animation-duration: 0.9s; }
.eq span:nth-child(3n) { animation-duration: 1.4s; }
.eq span:nth-child(1) { animation-delay: -0.2s; } .eq span:nth-child(2) { animation-delay: -0.5s; } .eq span:nth-child(3) { animation-delay: -0.1s; }
.eq span:nth-child(4) { animation-delay: -0.7s; } .eq span:nth-child(5) { animation-delay: -0.3s; } .eq span:nth-child(6) { animation-delay: -0.9s; }
.eq span:nth-child(7) { animation-delay: -0.4s; } .eq span:nth-child(8) { animation-delay: -0.6s; } .eq span:nth-child(9) { animation-delay: -0.15s; }
.eq span:nth-child(10) { animation-delay: -0.8s; } .eq span:nth-child(11) { animation-delay: -0.35s; } .eq span:nth-child(12) { animation-delay: -0.55s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .eq span { transform: scaleY(0.6); } }

/* ---------------------------------------------------------------- Contacto */
.contact { padding-block: clamp(4rem, 3rem + 4vw, 7rem) 2rem; }
.contact-card { position: relative; text-align: center; padding: clamp(2rem, 1.5rem + 3vw, 4rem) clamp(1.25rem, 1rem + 2vw, 3rem); border-radius: 28px; background: var(--night); color: var(--on-night-muted); overflow: hidden; isolation: isolate; }
.contact-card::before { content: ""; position: absolute; z-index: -1; inset: auto -20% -60% -20%; height: 120%; background: radial-gradient(ellipse at center, rgba(122, 39, 201, 0.45), transparent 60%); }
.contact-card h2 { color: #fff; font-size: var(--step-4); letter-spacing: -0.035em; }
.contact-card > p { margin: 1rem auto 0; max-width: 34rem; font-size: 1.0625rem; }
.email-row { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; align-items: center; }
.email { font-size: clamp(1.1rem, 0.8rem + 1.6vw, 1.9rem); font-weight: 800; color: #fff; text-decoration: none; overflow-wrap: anywhere; }
.email:hover { color: var(--pink-light); }
.copy-status { min-height: 1.5em; margin-top: 0.5rem; font-size: 0.9375rem; color: var(--pink-light); font-weight: 700; }
.contact-links { list-style: none; padding: 0; margin: 2rem auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.contact-links a { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.1rem; border-radius: 999px; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); color: #fff; font-weight: 700; text-decoration: none; transition: background-color 0.2s, transform 0.2s; }
.contact-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }
.site-footer { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; font-size: 0.875rem; color: var(--muted); }

/* ---------------------------------------------------------------- Páginas de proyecto */
.case-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--night); color: var(--on-night-muted); padding-block: clamp(2.5rem, 2rem + 3vw, 5rem); }
.case-hero::before { content: ""; position: absolute; z-index: -1; right: -15rem; top: -20rem; width: 50rem; height: 50rem; background: radial-gradient(circle, rgba(226, 30, 128, 0.3), transparent 60%); }
.case-hero::after { content: ""; position: absolute; z-index: -1; left: -20rem; bottom: -30rem; width: 50rem; height: 50rem; background: radial-gradient(circle, rgba(30, 48, 243, 0.35), transparent 60%); }
.crumbs { font-size: 0.9375rem; margin-bottom: 1.25rem; }
.crumbs a { color: #fff; }
.case-hero h1 { color: #fff; font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.035em; max-width: 18ch; }
.case-hero .lead { margin-top: 1.25rem; font-size: var(--step-1); line-height: 1.5; max-width: 40rem; color: #dfe2f5; }
.case-facts { margin-top: 2.25rem; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.case-facts div { padding: 1rem 1.1rem; border-radius: 14px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--night-line); }
.case-facts dt { color: var(--pink-light); font-size: 0.8125rem; font-weight: 800; }
.case-facts dd { margin: 0.25rem 0 0; color: #fff; font-size: 0.9688rem; line-height: 1.45; }

.case-body { padding-block: clamp(2.5rem, 2rem + 3vw, 5rem); }
.case-section + .case-section { margin-top: clamp(3rem, 2.5rem + 2.5vw, 5rem); }
.case-section > h2 { font-size: var(--step-3); margin-bottom: 1.25rem; }
.case-section > .intro { max-width: var(--measure); margin-bottom: 1.5rem; color: var(--muted); }
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1rem; }
.prose ul { list-style: none; padding: 0; display: grid; gap: 0.85rem; }
.prose ul li { position: relative; padding-left: 1.6rem; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--grad); }
.note { margin-top: 1.25rem; padding: 1rem 1.2rem; border-radius: 14px; background: #fff; box-shadow: inset 4px 0 0 var(--magenta), var(--shadow); font-size: 0.9688rem; max-width: var(--measure); }

.stack { list-style: none; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.stack li { padding: 1.1rem 1.25rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.stack b { display: block; font-size: 0.8125rem; font-weight: 800; color: var(--violet); }
.stack span { display: block; margin-top: 0.2rem; color: var(--ink); font-weight: 600; }

/* Diagrama de arquitectura con recorrido animado */
.arch-wrap { padding: clamp(1.25rem, 1rem + 2vw, 2.25rem); border-radius: 24px; background: var(--night); color: var(--on-night-muted); position: relative; overflow: hidden; isolation: isolate; }
.arch-wrap::before { content: ""; position: absolute; z-index: -1; inset: -40% -20% auto auto; width: 40rem; height: 40rem; background: radial-gradient(circle, rgba(122, 39, 201, 0.3), transparent 60%); }
.arch { display: grid; gap: 1.5rem; }
@media (min-width: 62em) { .arch { grid-template-columns: repeat(var(--tiers, 3), minmax(0, 1fr)); gap: 2.25rem; } .arch.is-4 { --tiers: 4; } }
.tier { position: relative; }
.tier-label { font-size: 0.8125rem; font-weight: 800; color: var(--pink-light); margin-bottom: 0.6rem; }
.tier-nodes { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.node { position: relative; padding: 0.85rem 1rem; border-radius: 14px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--night-line); transition: box-shadow 0.35s, transform 0.35s, background-color 0.35s; }
.node.is-core { box-shadow: inset 0 0 0 1.5px rgba(142, 156, 255, 0.55); }
.node.is-external { background: transparent; box-shadow: inset 0 0 0 1px rgba(154, 161, 196, 0.35); }
.node strong { display: block; color: #fff; font-size: 1rem; }
.node > span { display: block; font-size: 0.875rem; line-height: 1.4; margin-top: 0.15rem; }
.node ul { list-style: none; padding: 0; margin-top: 0.6rem; display: grid; gap: 0.35rem; }
.node ul li { font-size: 0.875rem; padding: 0.35rem 0.6rem; border-radius: 8px; background: rgba(142, 156, 255, 0.1); color: #dfe2f5; transition: background-color 0.35s, color 0.35s, box-shadow 0.35s; }
.node ul li b { color: #fff; }
.node code { background: rgba(142, 156, 255, 0.16); color: #fff; }
.node.is-lit, .node ul li.is-lit { box-shadow: inset 0 0 0 2px var(--pink-light), 0 0 28px -4px rgba(226, 30, 128, 0.75); }
.node.is-lit { transform: translateY(-2px); }
.node ul li.is-lit { background: rgba(226, 30, 128, 0.25); color: #fff; }
.tier + .tier::before { content: ""; position: absolute; left: 1.5rem; top: -1.5rem; height: 1.5rem; border-left: 2px dashed rgba(142, 156, 255, 0.45); }
@media (min-width: 62em) { .tier + .tier::before { left: -2.25rem; top: 2.9rem; width: 2.25rem; height: 0; border-left: 0; border-top: 2px dashed rgba(142, 156, 255, 0.45); } }
.arch-legend { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.8125rem; }
.arch-legend span::before { content: ""; display: inline-block; width: 1.1rem; height: 0.8rem; margin-right: 0.45rem; vertical-align: -0.1rem; border-radius: 4px; }
.arch-legend .lg-core::before { box-shadow: inset 0 0 0 1.5px rgba(142, 156, 255, 0.8); }
.arch-legend .lg-ext::before { box-shadow: inset 0 0 0 1px rgba(154, 161, 196, 0.6); }

.player { margin-top: 1.5rem; display: grid; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--night-line); }
@media (min-width: 48em) { .player { grid-template-columns: auto minmax(0, 1fr); align-items: center; } }
.player-step { min-height: 3.2em; color: #fff; font-weight: 600; }
.player-step span { display: block; font-size: 0.8125rem; font-weight: 800; color: var(--pink-light); }
.player-steps { grid-column: 1 / -1; display: flex; gap: 0.4rem; list-style: none; padding: 0; }
.player-steps li { flex: 1; height: 4px; border-radius: 4px; background: rgba(142, 156, 255, 0.2); transition: background-color 0.3s; }
.player-steps li.is-done { background: var(--pink-light); }
html:not(.js) .player { display: none; }
.flow-title { margin-top: 2.5rem; font-size: var(--step-1); }
.flow-list { margin-top: 1rem; padding-left: 1.25rem; max-width: var(--measure); }
.flow-list li + li { margin-top: 0.5rem; }
.flow-list li::marker { color: var(--violet); font-weight: 800; }

/* Vídeo: miniatura que se sustituye por el reproductor al pulsar */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: var(--night); max-width: 60rem; box-shadow: 0 30px 60px -30px rgba(30, 48, 243, 0.55); }
.video a, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.video a:hover img { transform: scale(1.03); }
.video-play { position: absolute; left: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: 0.6rem; background: var(--grad-strong); color: #fff; font-weight: 800; padding: 0.8rem 1.25rem; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.video-play::before { content: ""; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; }
@media (max-width: 39.99em) { .video-play { left: 0.6rem; bottom: 0.6rem; padding: 0.55rem 0.9rem; font-size: 0.9375rem; } }
.video-caption { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }

.results { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.results li { position: relative; padding: 1.4rem 1.4rem 1.5rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.results li::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.results strong { display: block; font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.015em; }
.results span { display: block; margin-top: 0.35rem; font-size: 0.9375rem; color: var(--text); }

.next-case { margin-top: clamp(3rem, 2.5rem + 3vw, 5rem); display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.next-case a { display: block; padding: 1.25rem 1.4rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: var(--step-1); color: var(--ink); text-decoration: none; transition: transform 0.2s; }
.next-case a:hover { transform: translateY(-3px); color: var(--violet); }
.next-case small { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }

.page-footer { padding-block: 0 3rem; }
.page-footer .contact-card { text-align: left; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; padding: 1.75rem 2rem; }
.page-footer .contact-card p { margin: 0; color: #fff; font-weight: 700; font-size: var(--step-1); max-width: none; }

.is-full { min-height: 100vh; display: flex; align-items: center; }

@media print {
  .site-header, .skip-link, .hero-actions, .video, .hero-net, .motion-toggle, .marquee, .scroll-cue, .chip-float { display: none !important; }
  .night, .case-hero, .contact-card, .arch-wrap { background: #fff !important; color: #000 !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* En móvil el diagrama es alto: el texto del paso se queda fijo abajo mientras se recorre */
@media (max-width: 61.99em) {
  .player { position: sticky; bottom: 0; z-index: 3; margin-inline: calc(-1 * clamp(1.25rem, 1rem + 2vw, 2.25rem)); padding: 1rem clamp(1.25rem, 1rem + 2vw, 2.25rem); background: rgba(11, 14, 36, 0.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}

/* ---------------------------------------------------------------- Galerías de capturas en las tarjetas */
.slides { position: relative; aspect-ratio: 1440 / 730; background: #fff; overflow: hidden; }
.browser.is-dark { background: #0b0e24; }
.browser.is-dark .slides { background: #0b0e24; }
.browser.is-dark .browser-bar { background: #1b1f3d; }
.browser.is-dark .browser-bar i { background: #3a3f6b; }
.browser.is-dark .browser-bar span { background: #0b0e24; color: #c9cff5; }
.slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transition: opacity 0.8s ease, transform 4s ease; transform: scale(1.02); }
.slides img.is-active { opacity: 1; transform: scale(1); }
.slide-dots { display: flex; justify-content: center; gap: 0.25rem; margin-top: 0.9rem; }
.slide-dots button { position: relative; width: 2.25rem; height: 1.5rem; border: 0; padding: 0; background: none; cursor: pointer; }
.slide-dots button::before { content: ""; position: absolute; left: 0.25rem; right: 0.25rem; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(142, 156, 255, 0.3); transition: background-color 0.3s; }
.slide-dots button[aria-pressed="true"]::before { background: var(--pink-light); }
.slide-dots button:hover::before { background: var(--blue-light); }
.case-media.has-phone { padding-right: 9%; padding-bottom: 2.5rem; }
.phone { position: absolute; right: 0; bottom: 0; width: 30%; aspect-ratio: 720 / 1124; border-radius: 22px; overflow: hidden; border: 6px solid #05071a; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12); background: #fff; transform: rotate(4deg); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); z-index: 3; }
.case-card:hover .phone { transform: rotate(0) translateY(-6px); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.case-media.has-phone .media-caption { padding-right: 24%; }

/* ---------------------------------------------------------------- Móvil (repensado) */
.swipe-hint { display: none; margin-top: -0.5rem; margin-bottom: 0.75rem; font-size: 0.8125rem; color: var(--muted); }
.night .swipe-hint { color: var(--on-night-muted); }
@media (max-width: 55.99em) {
  .hero { min-height: 0; padding-block: 1.5rem 4.5rem; }
  .hero-grid { text-align: center; gap: 1.25rem; }
  .portrait { --s: min(13.5rem, 60vw); order: -1; margin-bottom: 0.5rem; }
  .portrait-ring { left: -10px; right: -10px; bottom: -10px; height: calc(var(--s) + 20px); }
  .chip-float { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
  .chip-float:nth-of-type(1) { left: -22%; }
  .chip-float:nth-of-type(2) { right: -22%; }
  .chip-float:nth-of-type(3) { left: -20%; }
  .chip-float:nth-of-type(4) { right: -16%; }
  .hero h1 { font-size: clamp(2.4rem, 1.2rem + 7vw, 3.6rem); }
  .hero-stream { min-height: 3.4em; font-size: 1.125rem; }
  .hero-note { margin-inline: auto; font-size: 1rem; }
  .hero-actions, .hero-social { justify-content: center; }
  .hero-actions .btn { flex: 1 1 12rem; }
  .motion-toggle { left: 50%; right: auto; transform: translateX(-50%); }

  .section { padding-block: 3.5rem; }
  .case-card { padding: 1.1rem 1.1rem 1.5rem; border-radius: 20px; gap: 1.25rem; }
  .case-card .case-media { order: -1; }
  .case-card h3 { font-size: clamp(1.75rem, 1.2rem + 3vw, 2.4rem); }
  .case-lead { font-size: 1.0625rem; }
  .browser { transform: none; }
  .phone { width: 32%; border-width: 4px; border-radius: 16px; }
  .case-actions .btn { flex: 1 1 auto; }

  /* Proyectos de asignatura y premios: carruseles que se deslizan con el dedo */
  .mini-grid, .awards { grid-auto-flow: column; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding: 0.5rem var(--gutter) 1rem; scroll-padding-inline: var(--gutter); }
  .mini-grid { grid-auto-columns: min(80%, 18rem); }
  .awards { grid-auto-columns: min(84%, 19rem); }
  .mini-grid > li, .awards > li { scroll-snap-align: start; }
  .mini.is-volunteer { margin-bottom: 1.5rem; }
  .more-head { margin-bottom: 1rem; }
  .swipe-hint { display: block; }

  .t-card { padding: 1.15rem 1.2rem; }
  .timeline > li { padding-left: 2.9rem; }
  .contact-card h2 { font-size: clamp(2.4rem, 1.4rem + 6vw, 3.5rem); }
  .contact-links a { padding: 0.6rem 0.9rem; }

  .js .site-nav { min-height: calc(100vh - var(--header-h)); padding-top: 1.25rem; }
  .js .site-nav a { font-size: 1.375rem; font-weight: 800; padding: 0.85rem 0.9rem; }
}

/* ---------------------------------------------------------------- Carrusel de las páginas de proyecto */
.carousel { position: relative; container-type: inline-size; }
.carousel-track { display: flex; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; border-radius: 20px; background: var(--night); box-shadow: 0 30px 60px -30px rgba(30, 48, 243, 0.55); scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; display: flex; flex-direction: column; }
.carousel-slide a { position: relative; display: block; overflow: hidden; min-height: 0; aspect-ratio: 16 / 9; background: var(--night); cursor: zoom-in; }
.carousel-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.carousel-slide.is-diagram a { background: #fff; }
.carousel-slide.is-diagram img { padding: 1rem; box-sizing: border-box; }
.carousel-slide figcaption { padding: 0.85rem 1.25rem 1rem; color: #dfe2f5; font-size: 0.9375rem; }
.zoom-hint { position: absolute; right: 0.9rem; top: 0.9rem; padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(11, 14, 36, 0.8); color: #fff; font-size: 0.8125rem; font-weight: 700; opacity: 0; transition: opacity 0.3s; }
.carousel-slide a:hover .zoom-hint, .carousel-slide a:focus-visible .zoom-hint { opacity: 1; }
.carousel-btn { position: absolute; top: calc(28.125cqi - 1.5rem); display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: var(--ink); font: 800 1.75rem/1 var(--font); box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.5); cursor: pointer; transition: transform 0.2s, opacity 0.2s; z-index: 2; }
.carousel-btn:hover { transform: scale(1.08); }
.carousel-btn:disabled { opacity: 0; pointer-events: none; }
.carousel-btn.is-prev { left: 0.75rem; }
.carousel-btn.is-next { right: 0.75rem; }
.carousel-count { position: absolute; left: 0.9rem; top: 0.9rem; padding: 0.3rem 0.75rem; border-radius: 999px; background: rgba(11, 14, 36, 0.8); color: #fff; font-size: 0.8125rem; font-weight: 700; pointer-events: none; }
.carousel-thumbs { display: flex; gap: 0.6rem; margin-top: 0.9rem; overflow-x: auto; padding: 0.25rem 0.1rem 0.5rem; }
.carousel-thumbs button { flex: 0 0 7.5rem; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; opacity: 0.55; box-shadow: inset 0 0 0 1px var(--line); transition: opacity 0.2s, box-shadow 0.2s; }
.carousel-thumbs button:hover { opacity: 0.9; }
.carousel-thumbs button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 3px var(--violet); }
.carousel-thumbs img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
@media (max-width: 47.99em) {
  .carousel-btn { width: 2.5rem; height: 2.5rem; font-size: 1.4rem; top: calc(37.5cqi - 1.25rem); }
  .carousel-slide a { aspect-ratio: 4 / 3; }
  .carousel-thumbs button { flex-basis: 5.5rem; }
}

/* ---------------------------------------------------------------- Imagen a pantalla completa, sin scroll */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.lightbox::backdrop { background: rgba(5, 7, 26, 0.92); }
.lightbox-stage { width: 100%; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 3.5rem clamp(0.5rem, 4vw, 5rem) 1rem; }
.lightbox-stage img { max-width: 100%; max-height: calc(100vh - 7.5rem); width: auto; height: auto; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox-caption { color: #dfe2f5; font-size: 0.9375rem; text-align: center; max-width: 60rem; }
.lightbox-btn { position: absolute; display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: var(--ink); font: 800 1.75rem/1 var(--font); cursor: pointer; }
.lightbox-btn:hover { background: #fff; transform: scale(1.06); }
.lightbox-close { top: 0.75rem; right: 0.75rem; }
.lightbox-prev { left: 0.75rem; top: 50%; margin-top: -1.5rem; }
.lightbox-next { right: 0.75rem; top: 50%; margin-top: -1.5rem; }
.lightbox-btn[hidden] { display: none; }
.lightbox :focus-visible { outline-color: var(--pink-light); }

.slides-zoom { position: absolute; right: 0.75rem; bottom: 0.75rem; z-index: 2; border: 0; border-radius: 999px; padding: 0.4rem 0.85rem; background: rgba(11, 14, 36, 0.85); color: #fff; font: 700 0.8125rem var(--font); cursor: pointer; opacity: 0; transition: opacity 0.3s; }
.slides:hover .slides-zoom, .slides-zoom:focus-visible { opacity: 1; }
.slides img { cursor: zoom-in; }
@media (hover: none) { .slides-zoom { opacity: 1; } }

.award-link { display: inline-block; margin-top: 0.85rem; font-weight: 700; font-size: 0.9375rem; }

/* Cabecera de las páginas de proyecto con captura */
.case-hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 62em) { .case-hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } .case-hero-grid .case-facts { grid-template-columns: 1fr 1fr; } }
.case-hero-media .browser { transform: perspective(1200px) rotateY(-8deg) rotateX(3deg); }
.case-hero-media .browser img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
@media (max-width: 61.99em) { .case-hero-media { order: -1; } .case-hero-media .browser { transform: none; } }
.mini-img { display: block; width: calc(100% + 2.8rem); max-width: none; margin: -1.4rem -1.4rem 0.4rem; aspect-ratio: 16 / 8; object-fit: cover; object-position: top; border-radius: var(--radius) var(--radius) 0 0; background: #fff; transition: transform 0.6s; }
.mini { overflow: hidden; }
.mini:hover .mini-img { transform: scale(1.04); }
.mini.is-volunteer { margin-bottom: 1rem; }
@media (min-width: 60em) { .case-card.is-flipped { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } .case-card.is-flipped > div:first-child { order: 2; } .case-card.is-flipped .case-media { order: 1; } }
.poster a { display: block; border-radius: 12px; transition: transform 0.3s; }
.poster a:hover { transform: translateY(-3px); }
/* Línea de tiempo colocada por JavaScript en escritorio (ver initTimeline) */
@media (min-width: 64em) {
  .timeline.is-masonry > li { position: absolute; left: 0; margin: 0; }
  .timeline.is-masonry > li:nth-child(even) { left: 50%; margin: 0; }
}

/* Selector de idioma */
.site-nav .nav-lang { font-weight: 800; letter-spacing: 0.02em; box-shadow: inset 0 0 0 1.5px var(--line); }
.site-nav .nav-lang:hover { box-shadow: inset 0 0 0 1.5px var(--violet); background: transparent; }
@media (max-width: 55.99em) { .js .site-nav .nav-lang { box-shadow: none; } }
.site-footer a { color: var(--blue); }
.pub-en { margin-top: 0.15rem; color: var(--muted); font-size: 0.9375rem; font-style: italic; }

/* Visor: mientras llega la versión a máxima resolución se ve la de la página con un indicador */
.lightbox-original { color: var(--blue-light); font-weight: 700; white-space: nowrap; }
.lightbox-original:hover { color: var(--pink-light); }
.lightbox.is-loading .lightbox-stage::after { content: ""; position: absolute; top: 1.1rem; left: 50%; width: 1.5rem; height: 1.5rem; margin-left: -0.75rem; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.lightbox-stage { position: relative; }
