/* Víctor Marín · portfolio
   Sobrio y elegante: fondo claro, tinta casi negra, un azul profundo
   como único acento, líneas finas y mucho espacio. */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #5b5f68;
  --ink-3: #8a8e96;
  --line: #dedcd6;
  --accent: #1f3a5f;
  --dark: #121417;
  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1200px;
  --gut: clamp(20px, 4vw, 48px);
  --nav: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 12px 16px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

h1, h2, h3 { font-weight: 600; letter-spacing: -.025em; margin: 0; }
.h2 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.08; max-width: 20ch; }
.intro { font-size: clamp(17px, 1.3vw, 19px); color: var(--ink-2); max-width: 58ch; margin: 18px 0 0; }
.note { margin: 28px 0 0; font-size: 15px; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 999px; font-weight: 500; font-size: 16px; text-decoration: none; border: 1px solid transparent; transition: background-color .2s, color .2s, border-color .2s, transform .15s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--accent); }
.btn--line { border-color: var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: #e9e8e4; }
.link { font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: currentColor; }

/* Cabecera */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav); background: rgba(247, 246, 243, .94); border-bottom: 1px solid transparent; transition: border-color .2s; }
@supports (backdrop-filter: blur(8px)) { .nav { background: rgba(247, 246, 243, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); } }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__bar { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.nav__links a:not(.btn) { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.nav__links a:not(.btn):hover { color: var(--ink); }
.nav__links .btn { min-height: 40px; padding: 0 18px; font-size: 15px; }
.nav__toggle { display: none; min-height: 44px; font-size: 15px; font-weight: 500; }

/* Portada */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav) + 32px) 0 48px; }
.hero__grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.hero__name { font-size: 15px; color: var(--ink-2); margin: 0 0 20px; }
.hero__title { font-size: clamp(40px, 5.2vw, 72px); line-height: 1.02; letter-spacing: -.035em; max-width: 14ch; }
.hero__lead { font-size: clamp(17px, 1.35vw, 20px); color: var(--ink-2); max-width: 46ch; margin: 24px 0 0; }
.facts { margin-top: 32px; max-width: 520px; }
.facts th, .facts td { padding: 12px 0; border-top: 1px solid var(--line); font-weight: 400; text-align: left; font-size: 15px; color: var(--ink-2); }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 1px solid var(--line); }
.facts td { text-align: right; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 16px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.frame { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--dark); aspect-ratio: 9 / 16; box-shadow: 0 30px 60px -30px rgba(18, 20, 23, .45); }
.frame video { width: 100%; height: 100%; object-fit: cover; }
.hero .frame { width: 100%; max-width: 380px; justify-self: end; max-height: calc(100svh - var(--nav) - 80px); }
.play { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--ink); font-size: 14px; font-weight: 500; transition: background-color .2s, transform .15s var(--ease); }
.play:hover { background: #fff; transform: translateY(-1px); }
.play svg { width: 20px; height: 20px; fill: var(--ink); }
.is-playing .play { display: none; }
.is-playing video { object-fit: contain; }

/* Secciones */
.section { padding: clamp(88px, 12vh, 140px) 0; }
.section--white { background: var(--surface); }
.section--line { border-top: 1px solid var(--line); }

/* Reels: lista + reproductor */
.stage-grid { display: grid; grid-template-columns: 7fr 4fr; gap: clamp(32px, 5vw, 80px); margin-top: 56px; align-items: start; }
.acts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: act; }
.act { display: grid; grid-template-columns: 1fr auto 52px; grid-template-areas: "t c d" "r r r"; column-gap: 16px; row-gap: 2px; width: 100%; padding: 18px 0; text-align: left; border-bottom: 1px solid var(--line); transition: color .2s; position: relative; }
.act::before { content: ''; position: absolute; left: -16px; top: 18px; bottom: 18px; width: 2px; background: var(--accent); transform: scaleY(0); transition: transform .25s var(--ease); }
.act.is-active::before { transform: scaleY(1); }
.act__n { grid-area: n; color: var(--ink-3); font-size: 15px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.act__t { grid-area: t; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.act__c { grid-area: c; font-size: 14px; color: var(--ink-2); align-self: center; }
.act__d { grid-area: d; text-align: right; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; align-self: center; }
.act__r { grid-area: r; font-size: 15px; color: var(--ink-2); }
.act:hover .act__t, .act.is-active .act__t { color: var(--accent); }
.stage { position: sticky; top: calc(var(--nav) + 24px); margin: 0; }
.stage .frame { max-height: calc(100svh - var(--nav) - 140px); }
.stage .frame video { object-fit: contain; }
.stage__bar { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }

/* Resultados */
.res { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.res__head .btn { margin-top: 28px; }
.results td { font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; padding: 20px 28px 20px 0; border-top: 1px solid var(--line); width: 1%; white-space: nowrap; }
.results th { font-weight: 400; font-size: 16px; color: var(--ink-2); text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.results tr:last-child td, .results tr:last-child th { border-bottom: 1px solid var(--line); }

/* Proyectos */
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 56px 40px; margin-top: 56px; }
.project { text-decoration: none; display: block; }
.project__img { display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 4 / 3; background: #e7e5e0; }
.project__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project:hover .project__img img { transform: scale(1.03); }
.project__img--logo { position: relative; }
.project__img--logo img { position: absolute; inset: 6% 8%; width: 84%; height: 88%; object-fit: contain; }
.project__img--type { display: grid; place-content: center; text-align: center; gap: 8px; background: #2f3b37; color: #fff; transition: background-color .3s; }
.project__img--type span { font-size: clamp(30px, 3.4vw, 44px); font-weight: 600; letter-spacing: -.03em; }
.project__img--type small { font-size: 15px; color: rgba(255, 255, 255, .7); letter-spacing: .02em; }
.project:hover .project__img--type { background: #26302d; }

/* Hero con retrato */
.hero__role { margin: 18px 0 0; font-size: clamp(17px, 1.5vw, 21px); font-weight: 500; color: var(--accent); }
.portrait { margin: 0; justify-self: end; width: 100%; max-width: 420px; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: #1c1d22; box-shadow: 0 30px 60px -30px rgba(18, 20, 23, .45); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.js [data-enter] .portrait { animation: fade .9s ease-out .12s both; }
.js [data-enter] .hero__role { animation: up .6s var(--ease) .06s both; }
@media (max-width: 1023px) { .portrait { justify-self: start; max-width: 340px; } }
@media (max-width: 720px) { .portrait { max-width: none; order: -1; aspect-ratio: 1 / 1; } }
.project__meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.project__title { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.project__text { display: block; color: var(--ink-2); margin-top: 6px; max-width: 46ch; }
.project__go { display: inline-block; margin-top: 12px; font-size: 15px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .22em; transition: text-decoration-color .2s; }
.project:hover .project__go { text-decoration-color: currentColor; }

/* Sobre mí */
.about { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about__photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%; border-radius: 12px; }
.about__text p { max-width: 60ch; margin: 20px 0 0; }
.cv { margin-top: 32px; }
.cv th, .cv td { padding: 12px 0; border-top: 1px solid var(--line); text-align: left; font-size: 15px; font-weight: 400; }
.cv tr:last-child th, .cv tr:last-child td { border-bottom: 1px solid var(--line); }
.cv td { text-align: right; color: var(--ink-2); white-space: nowrap; padding-left: 16px; }
.tools { color: var(--ink-2); font-size: 15px; }

/* Contacto */
.closing { background: var(--dark); color: #fff; padding: clamp(88px, 13vh, 150px) 0 36px; }
.closing__grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.closing .intro { color: #a9adb5; }
.closing__mail { display: inline-block; margin-top: 28px; font-size: clamp(26px, 3.4vw, 44px); font-weight: 500; letter-spacing: -.025em; text-decoration: underline; text-decoration-color: #3a3e45; text-underline-offset: .2em; overflow-wrap: anywhere; transition: text-decoration-color .2s; }
.closing__mail:hover { text-decoration-color: #fff; }
.closing__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #2c3036; }
.closing__list a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 18px 0; border-bottom: 1px solid #2c3036; text-decoration: none; transition: color .2s; }
.closing__list span { font-size: 14px; color: #8f939b; }
.closing__list b { font-weight: 500; }
.closing__list a:hover b { color: #c9d6ea; }
.closing__legal { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 72px 0 0; padding-top: 24px; border-top: 1px solid #2c3036; font-size: 14px; color: #8f939b; }
.closing__legal a { text-decoration: none; }
.closing__legal a:hover { color: #fff; }

/* ---------- Páginas de proyecto ---------- */
.p-hero { padding: calc(var(--nav) + clamp(56px, 10vh, 112px)) 0 clamp(48px, 8vh, 80px); }
.back { display: inline-block; font-size: 15px; color: var(--ink-2); text-decoration: none; margin-bottom: 32px; }
.back:hover { color: var(--ink); }
.p-title { font-size: clamp(38px, 5vw, 68px); line-height: 1.04; letter-spacing: -.035em; max-width: 18ch; }
.p-lead { font-size: clamp(17px, 1.35vw, 20px); color: var(--ink-2); max-width: 56ch; margin: 22px 0 0; }
.p-facts { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.p-facts div { padding: 16px 20px 0 0; }
.p-facts dt { font-size: 14px; color: var(--ink-3); }
.p-facts dd { margin: 4px 0 0; font-weight: 500; }
.cover { margin: 0; border-radius: 14px; overflow: hidden; }
.cover img { width: 100%; max-height: 640px; object-fit: cover; }

.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.prose p { margin: 0 0 18px; max-width: 62ch; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { padding: 13px 0; border-bottom: 1px solid var(--line); }

.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; margin-top: 48px; align-items: start; }
.gallery > * { grid-column: span 4; margin: 0; }
.gallery .g3 { grid-column: span 3; }
.gallery .g6 { grid-column: span 6; }
.gallery .g8 { grid-column: span 8; }
.gallery .g12 { grid-column: span 12; }
.gallery img { width: 100%; border-radius: 10px; cursor: zoom-in; background: #fff; }
.gallery img.on-white { border: 1px solid var(--line); }

.reels-row { display: grid; grid-template-columns: repeat(3, minmax(0, 300px)); gap: 28px; margin-top: 48px; }
.reels-row--2 { grid-template-columns: repeat(2, minmax(0, 300px)); }
.reel { margin: 0; }
.reel .frame { box-shadow: none; }
.reel .frame video { object-fit: contain; }
.reel figcaption { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.reel figcaption b { display: block; color: var(--ink); font-weight: 600; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px; }
.trio > div { border-top: 1px solid var(--ink); padding-top: 18px; }
.trio h3 { font-size: 20px; letter-spacing: -.015em; }
.trio p { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; }

.next { display: block; text-decoration: none; border-top: 1px solid var(--line); padding: clamp(56px, 9vh, 96px) 0; }
.next .wrap { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.next span { font-size: 15px; color: var(--ink-3); }
.next b { display: block; font-size: clamp(30px, 4vw, 52px); font-weight: 600; letter-spacing: -.03em; margin-top: 6px; transition: color .2s; }
.next:hover b { color: var(--accent); }

.zoom { position: fixed; inset: 0; z-index: 90; background: rgba(18, 20, 23, .94); display: grid; place-items: center; padding: 24px; cursor: zoom-out; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.zoom.is-open { opacity: 1; visibility: visible; }
.zoom img { max-width: 100%; max-height: 92vh; border-radius: 8px; }

/* Entrada de la portada (una sola vez, todo clicable desde el principio) */
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.js [data-enter] .hero__title { animation: up .7s var(--ease) both; }
.js [data-enter] .hero__lead { animation: up .6s var(--ease) .1s both; }
.js [data-enter] .facts, .js [data-enter] .hero__actions { animation: up .55s var(--ease) .18s both; }
.js [data-enter] .frame { animation: fade .9s ease-out .12s both; }
.js [data-enter] .p-title { animation: up .7s var(--ease) both; }
.js [data-enter] .p-lead, .js [data-enter] .p-facts { animation: up .6s var(--ease) .1s both; }
@media (prefers-reduced-motion: reduce) {
  .js [data-enter] * { animation: fade .3s both !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .hero__grid, .stage-grid, .res, .about, .closing__grid, .split { grid-template-columns: 1fr; }
  .hero .frame { justify-self: start; max-width: 320px; max-height: none; }
  .stage { position: relative; top: auto; order: -1; max-width: 360px; }
  .about__photo { max-width: 360px; }
  .p-facts { grid-template-columns: 1fr 1fr; }
  .gallery > *, .gallery .g3, .gallery .g8 { grid-column: span 6; }
  .trio { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav__toggle { display: block; }
  .nav__links { position: fixed; inset: var(--nav) 0 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); padding: 8px var(--gut) 24px; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .nav.is-open { background: var(--bg); border-bottom-color: var(--line); }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav__links a:not(.btn) { font-size: 24px; color: var(--ink); padding: 16px 0; border-bottom: 1px solid var(--line); }
  .nav__links .btn { margin-top: 24px; min-height: 52px; font-size: 16px; }
  .hero { min-height: auto; padding-top: calc(var(--nav) + 40px); }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero .frame { max-width: none; aspect-ratio: 4 / 5; }
  .act { grid-template-columns: 1fr 44px; grid-template-areas: "t d" "c c" "r r"; }
  .act::before { left: -12px; }
  .act__c { align-self: start; }
  .stage { max-width: none; }
  .stage .frame { aspect-ratio: 4 / 5; max-height: 72svh; }
  .projects { grid-template-columns: 1fr; gap: 44px; }
  .results td { padding-right: 16px; }
  .gallery > *, .gallery .g3, .gallery .g6, .gallery .g8 { grid-column: span 12; }
  .reels-row, .reels-row--2 { grid-template-columns: 1fr 1fr; gap: 14px; }
  .p-facts { grid-template-columns: 1fr; }
  .next .wrap { flex-direction: column; align-items: start; }
}

/* =========================================================
   Reels: cada fila es una tarjeta clicable
   ========================================================= */
.acts { border-top: 0; display: grid; gap: 10px; }
.act {
  grid-template-columns: 64px 1fr auto 46px;
  grid-template-areas: "th t d pl" "th c c pl" "th r r pl";
  align-items: center; column-gap: 18px; row-gap: 2px;
  padding: 12px 14px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  cursor: pointer; transition: background-color .25s, border-color .25s, transform .3s var(--ease), box-shadow .3s var(--ease), color .2s;
}
.act::before { display: none; }
.act:hover { border-color: #c9c6be; transform: translateX(6px); box-shadow: 0 14px 30px -22px rgba(18, 20, 23, .5); }
.act:active { transform: translateX(6px) scale(.99); }
.act__thumb { grid-area: th; width: 64px; height: 88px; border-radius: 9px; overflow: hidden; background: #ddd; }
.act__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.act:hover .act__thumb img { transform: scale(1.08); }
.act__t { align-self: end; }
.act__c, .act__d { align-self: center; }
.act__r { align-self: start; }
.act__play, .act__eq { grid-area: pl; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; justify-self: end; }
.act__play { border: 1px solid var(--line); transition: background-color .25s, border-color .25s, transform .3s var(--ease); }
.act__play svg { width: 18px; height: 18px; fill: var(--ink); margin-left: 2px; transition: fill .2s; }
.act:hover .act__play { background: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.act:hover .act__play svg { fill: #fff; }
.act__eq { display: none; gap: 3px; grid-auto-flow: column; align-items: end; padding-bottom: 14px; background: rgba(255, 255, 255, .12); }
.act__eq i { width: 3px; height: 16px; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite; transform-origin: bottom; }
.act__eq i:nth-child(2) { animation-delay: .2s; } .act__eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.act.is-active { background: var(--ink); border-color: var(--ink); color: #fff; transform: none; }
.act.is-active .act__t { color: #fff; }
.act.is-active .act__c, .act.is-active .act__d, .act.is-active .act__r { color: #b9bcc3; }
.act.is-active .act__play { display: none; }
.act.is-active .act__eq { display: grid; }
.stage .frame { transition: opacity .3s ease, transform .4s var(--ease); }
.stage.is-swapping .frame { opacity: .25; transform: scale(.98); }
.hint { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; font-weight: 500; color: var(--accent); }
.hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; animation: nudge 1.6s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* =========================================================
   Movimiento general
   ========================================================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .28s ease-in both; }
::view-transition-new(root) { animation: vtIn .45s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(16px); } }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.nav { transition: transform .35s var(--ease), border-color .2s, background-color .2s; }
.nav.is-hidden { transform: translateY(-100%); }

/* Aparición al hacer scroll (cada elemento una vez) */
.js .rv { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }
.js .rv-img { clip-path: inset(14% 0 0 0 round 12px); opacity: 0; transition: clip-path 1.1s cubic-bezier(.65, 0, .25, 1), opacity .6s ease; transition-delay: var(--d, 0ms); }
.js .rv-img.in { clip-path: inset(0 0 0 0 round 12px); opacity: 1; }

/* Franja de habilidades en movimiento */
.band { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); padding: 22px 0; white-space: nowrap; }
.band__track { display: inline-flex; animation: marquee 34s linear infinite; }
.band__track span { font-size: clamp(22px, 2.6vw, 34px); font-weight: 500; letter-spacing: -.02em; padding: 0 28px; }
.band__track i { font-style: normal; color: var(--accent); align-self: center; }
.band:hover .band__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Burbuja que sigue al cursor sobre los proyectos */
.cursor-tag { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; opacity: 0; transform: translate(-50%, -50%) scale(.6); transition: opacity .2s, transform .25s var(--ease); white-space: nowrap; }
.cursor-tag.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Botones con flecha que se desliza */
.btn .arr { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

@media (max-width: 720px) {
  .act { grid-template-columns: 52px 1fr 40px; grid-template-areas: "th t pl" "th c pl" "th r pl"; column-gap: 14px; }
  .act__thumb { width: 52px; height: 74px; }
  .act__d { display: none; }
  .act__play, .act__eq { width: 40px; height: 40px; }
  .act:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .rv-img { opacity: 1; transform: none; clip-path: none; transition: none; }
  .band__track, .act__eq i, .hint svg { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* =========================================================
   Hero "Cine": reels en movimiento detrás del nombre
   ========================================================= */
.cine { position: relative; min-height: 100vh; min-height: 100svh; background: var(--dark); color: #fff; overflow: hidden; display: flex; align-items: flex-end; isolation: isolate; }
.cine__reels { position: absolute; inset: -12% -6%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; transform: rotate(-6deg); opacity: .55; z-index: -2; }
.cine__col { display: flex; flex-direction: column; gap: 14px; animation: drift 40s linear infinite; will-change: transform; }
.cine__col:nth-child(even) { animation-direction: reverse; animation-duration: 48s; }
.cine__col img, .cine__col video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; background: #1b1e24; }
@keyframes drift { to { transform: translateY(-50%); } }
.cine::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(16, 18, 22, .6) 0%, rgba(16, 18, 22, .2) 38%, rgba(16, 18, 22, .94) 86%); }
.cine__content { padding-top: calc(var(--nav) + 40px); padding-bottom: clamp(56px, 10vh, 110px); }
.cine__title { font-size: clamp(60px, 9.4vw, 148px); line-height: .9; letter-spacing: -.055em; font-weight: 600; }
.cine__title .l { display: block; overflow: hidden; padding-bottom: .06em; }
.cine__title .l > span { display: block; }
.cine__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-top: 30px; }
.cine__lead { max-width: 46ch; margin: 0; font-size: clamp(17px, 1.4vw, 20px); color: rgba(255, 255, 255, .8); }
.cine__acts { display: flex; flex-wrap: wrap; gap: 12px; }
.btn--ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.cine__down { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 42px; margin-left: -13px; border: 1.5px solid rgba(255, 255, 255, .45); border-radius: 20px; }
.cine__down span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: #fff; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* Entrada: el nombre sube línea a línea, luego texto y botones; los reels aparecen en fundido */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
.js .cine .cine__title .l > span { animation: rise .95s var(--ease) both; }
.js .cine .cine__title .l:nth-child(2) > span { animation-delay: .08s; }
.js .cine .cine__lead { animation: up .7s var(--ease) .22s both; }
.js .cine .cine__acts { animation: up .7s var(--ease) .3s both; }
.js .cine .cine__reels { animation: fade 1.4s ease-out both; }

/* Cabecera transparente encima del hero oscuro */
.has-cine .nav:not(.is-scrolled):not(.is-open) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff; }
.has-cine .nav:not(.is-scrolled):not(.is-open) .nav__links a:not(.btn) { color: rgba(255, 255, 255, .78); }
.has-cine .nav:not(.is-scrolled):not(.is-open) .nav__links a:not(.btn):hover { color: #fff; }
.has-cine .nav:not(.is-scrolled):not(.is-open) .btn--dark { background: #fff; color: var(--ink); }

/* =========================================================
   Reels en oscuro, continuando el hero
   ========================================================= */
.section--dark { background: var(--dark); color: #fff; }
.section--dark .intro, .section--dark .note { color: #a6aab2; }
.section--dark .link { text-decoration-color: #3b3f46; }
.section--dark .hint { color: #c9d6ea; }
.section--dark .act { background: #181b20; border-color: #262a31; }
.section--dark .act:hover { border-color: #3a3f48; box-shadow: 0 18px 36px -24px rgba(0, 0, 0, .9); }
.section--dark .act__t { color: #fff; }
.section--dark .act__c, .section--dark .act__d, .section--dark .act__r { color: #9599a2; }
.section--dark .act__play { border-color: #343841; }
.section--dark .act__play svg { fill: #fff; }
.section--dark .act:hover .act__play { background: #fff; border-color: #fff; }
.section--dark .act:hover .act__play svg { fill: var(--ink); }
.section--dark .act.is-active { background: #fff; border-color: #fff; }
.section--dark .act.is-active .act__t { color: var(--ink); }
.section--dark .act.is-active .act__c, .section--dark .act.is-active .act__d, .section--dark .act.is-active .act__r { color: var(--ink-2); }
.section--dark .act.is-active .act__eq { background: rgba(22, 24, 29, .08); }
.section--dark .act.is-active .act__eq i { background: var(--ink); }
.section--dark .stage__bar { color: #a6aab2; }
.section--dark .band { background: var(--dark); }

/* Titulares que entran palabra a palabra */
.js .split-h .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.js .split-h .w > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease); transition-delay: calc(var(--wi) * 45ms); }
.js .split-h.in .w > span { transform: none; }

@media (max-width: 720px) {
  .cine__reels { grid-template-columns: repeat(3, 1fr); inset: -10% -20%; }
  .cine__acts .btn { flex: 1 1 100%; }
  .cine__down { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cine__col, .cine__down span { animation: none; }
  .js .split-h .w > span { transform: none; transition: none; }
}
.band--dark { background: var(--dark); color: #fff; border-color: #23262c; }
.band--dark .band__track i { color: #6f8fbf; }
.cover img { transform: scale(1.08); }

/* Cabecera oscura de las páginas de proyecto */
.p-hero { background: var(--dark); color: #fff; position: relative; overflow: hidden; }
.p-hero::before { content: ''; position: absolute; inset: auto -10% -60% 40%; height: 120%; background: radial-gradient(closest-side, rgba(70, 104, 160, .28), transparent); pointer-events: none; }
.p-hero .wrap { position: relative; }
.p-hero .back { color: rgba(255, 255, 255, .65); }
.p-hero .back:hover { color: #fff; }
.p-hero .p-lead { color: rgba(255, 255, 255, .78); }
.p-hero .p-facts { border-top-color: #2a2e35; }
.p-hero .p-facts dt { color: rgba(255, 255, 255, .5); }
.p-hero .link { text-decoration-color: rgba(255, 255, 255, .35); }
.p-hero:has(+ .wrap .cover) { padding-bottom: clamp(140px, 18vh, 200px); }
.p-hero + .wrap .cover { margin-top: clamp(-170px, -15vh, -110px); position: relative; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .55); }
.p-title { font-size: clamp(40px, 5.6vw, 80px); }
.cover--logo { display: grid; place-items: center; height: clamp(320px, 46vw, 560px); }
.cover--logo img { width: auto; height: 86%; max-height: none; object-fit: contain; transform: none; }
.p-pdf { margin-top: 28px; }

/* Foto de Sobre mí: casi cuadrada y no más alta que el texto */
.about { align-items: center; }
.about__photo { aspect-ratio: 5 / 6; max-height: 520px; object-position: 50% 25%; }
.about__photo { height: auto; }
/* Sobre mí: foto más grande, a la misma altura que el texto */
@media (min-width: 1024px) {
  .about { grid-template-columns: 4fr 7fr; align-items: stretch; }
  .about__photo { aspect-ratio: auto; height: 100%; max-height: none; min-height: 420px; }
}
