/* ==========================================================
   carlos.dev · dark tech
   Escala tipográfica y espaciado basados en Tailwind.
   ========================================================== */
:root {
  --bg: #000000;
  --bg-2: #181818;
  --bg-3: #1F1F1F;
  --bg-4: #272727;
  --line: #313131;
  --text: #F2F2F2;
  --muted: #9B9B9B;
  --dim: #6B6B6B;
  --acc: #C5FF4A;          /* acento neón */
  --acc-ink: #0B0F00;
  --cyan: #4AE3FF;
  --ok: #7CF2A0;
  --err: #FF6B6B;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --s7: 40px; --s8: 48px; --s9: 64px; --s10: 80px; --s11: 96px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font: "Geist", "Manrope", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
section[id] { scroll-margin-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px; line-height: 24px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; overflow-x: clip;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
h1, h2, h3, p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
::selection { background: var(--acc); color: var(--acc-ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); }
.c-acc { color: var(--acc); }
.c-mut { color: var(--muted); }
.c-ok { color: var(--ok); }
.wrap { width: min(var(--wrap), 100% - 2 * var(--s5)); margin-inline: auto; }

.skip {
  position: fixed; left: var(--s4); top: -60px; z-index: 200;
  background: var(--acc); color: var(--acc-ink); padding: var(--s2) var(--s3); border-radius: 8px;
  font-weight: 600; transition: top .4s var(--ease);
}
.skip:focus { top: var(--s4); }

/* ---------- Splash (red de seguridad CSS: se oculta sola a los 2.6s) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  display: grid; place-items: center;
  animation: splashOut .6s var(--ease) 2.6s forwards;
}
.splash.is-done { opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility 0s .6s; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }
.splash__term { font-family: var(--mono); font-size: 14px; line-height: 20px; color: var(--muted); display: grid; gap: var(--s2); }
.splash__term p:first-child { color: var(--text); }
.splash__dots::after { content: ""; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.splash__ok { color: var(--acc); opacity: 0; animation: fadeIn .3s var(--ease) .9s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Progreso de scroll ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 150;
  background: var(--acc); transform-origin: 0 50%; transform: scaleX(0);
  box-shadow: 0 0 12px var(--acc);
}

/* ---------- Cursor custom (solo puntero fino) ---------- */
.cursor { display: none; }
@media (pointer: fine) {
  .cursor { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 400; }
  .cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 999px; will-change: transform; }
  .cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--acc); }
  .cursor__ring {
    width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1px solid rgba(197, 255, 74, .5);
    transition: width .5s var(--ease), height .5s var(--ease), margin .5s var(--ease), background-color .5s var(--ease), border-color .5s var(--ease);
  }
  .cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(197, 255, 74, .08); border-color: var(--acc); }
  .cursor.is-hidden { opacity: 0; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: 16px; line-height: 24px; font-weight: 600;
  padding: var(--s2) var(--s3); border-radius: 999px;
  transition: transform .7s var(--ease), background-color .5s var(--ease), box-shadow .7s var(--ease), color .5s var(--ease);
}
.btn--sm { font-size: 14px; line-height: 20px; }
.btn--lg { padding: var(--s3) var(--s5); }
.btn--acc { background: var(--acc); color: var(--acc-ink); box-shadow: 0 0 0 0 rgba(197, 255, 74, 0); }
.btn--acc:hover { box-shadow: 0 0 32px 0 rgba(197, 255, 74, .35); }
.btn:active { transform: scale(.98) !important; }
.btn i { font-size: 18px; transition: transform .7s var(--ease); }
.btn:hover i.ph-arrow-right, .btn:hover i.ph-paper-plane-tilt { transform: translateX(4px); }

.link-arrow { display: inline-flex; align-items: center; gap: var(--s2); color: var(--muted); font-weight: 500; transition: color .5s var(--ease); }
.link-arrow:hover { color: var(--text); }
.link-arrow i { transition: transform .7s var(--ease); }
.link-arrow:hover i { transform: translateY(3px); }

/* ---------- Nav isla flotante ---------- */
.nav {
  position: fixed; top: var(--s5); left: 50%; transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: var(--s2);
  width: max-content; max-width: calc(100% - 2 * var(--s4));
  padding: var(--s2) var(--s2) var(--s2) var(--s5);
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(24, 24, 24, .6); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: transform .7s var(--ease), background-color .7s var(--ease);
}
.nav.is-hidden { transform: translate(-50%, -140%); }
.nav__logo { font-family: var(--mono); font-weight: 500; font-size: 16px; margin-right: var(--s4); }
.nav__links { display: flex; gap: var(--s1); }
.nav__links a {
  font-size: 14px; line-height: 20px; color: var(--muted); padding: var(--s2) var(--s3); border-radius: 999px;
  transition: color .5s var(--ease), background-color .5s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); background: rgba(255, 255, 255, .08); }
.nav__k, .nav__lang {
  display: inline-flex; align-items: center; gap: var(--s1); height: 36px; padding: 0 var(--s3);
  border-radius: 999px; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--muted);
  transition: color .5s var(--ease), border-color .5s var(--ease);
}
.nav__k:hover, .nav__lang:hover { color: var(--text); border-color: var(--dim); }
.nav__lang span { transition: color .5s var(--ease); }
.nav__lang span + span::before { content: "/"; margin-right: var(--s1); color: var(--dim); }
html[lang="es"] .nav__lang [data-lang="es"], html[lang="en"] .nav__lang [data-lang="en"] { color: var(--acc); }

.nav__burger { display: none; position: relative; width: 40px; height: 40px; border-radius: 999px; background: var(--bg-4); }
.nav__burger span {
  position: absolute; left: 12px; width: 16px; height: 1.5px; background: var(--text); border-radius: 2px;
  transition: transform .7s var(--ease), top .7s var(--ease);
}
.nav__burger span:first-child { top: 16px; }
.nav__burger span:last-child { top: 23px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 19.5px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 19.5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  display: flex; flex-direction: column; justify-content: center; padding: var(--s6);
  opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility 0s .7s;
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity .7s var(--ease); }
.menu__links { display: grid; gap: var(--s3); }
.menu__links a {
  font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.02em;
  opacity: 0; transform: translateY(48px); transition: opacity .7s var(--ease), transform .7s var(--ease), color .5s var(--ease);
}
.menu.is-open .menu__links a { opacity: 1; transform: none; }
.menu.is-open .menu__links a:nth-child(1) { transition-delay: .1s; }
.menu.is-open .menu__links a:nth-child(2) { transition-delay: .15s; }
.menu.is-open .menu__links a:nth-child(3) { transition-delay: .2s; }
.menu.is-open .menu__links a:nth-child(4) { transition-delay: .25s; }
.menu.is-open .menu__links a:nth-child(5) { transition-delay: .3s; }
.menu.is-open .menu__links a:nth-child(6) { transition-delay: .35s; color: var(--acc); }
.menu__foot { position: absolute; bottom: var(--s6); left: var(--s6); color: var(--muted); font-size: 14px; }

/* ---------- Reveal (IntersectionObserver) ---------- */
.reveal { opacity: 0; transform: translateY(64px); filter: blur(12px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; filter: none; }
.no-js .reveal, .reveal[data-split] { opacity: 1; transform: none; filter: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 140px 0 var(--s11); overflow: hidden; isolation: isolate; }
.hero__grid {
  position: absolute; inset: 0; z-index: -2; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero__glow {
  position: absolute; z-index: -2; width: 640px; height: 640px; left: 0; top: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 255, 74, .14), transparent 65%);
  transform: translate(calc(var(--gx, 70vw) - 50%), calc(var(--gy, 30vh) - 50%));
  transition: transform 1.2s var(--ease); pointer-events: none;
}
.hero__inner { display: grid; gap: var(--s5); justify-items: start; }
.badge {
  display: inline-flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s3) var(--s1) var(--s2);
  border: 1px solid var(--line); border-radius: 999px; background: rgba(24, 24, 24, .7);
  font-size: 14px; line-height: 20px; color: var(--muted);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); flex: none; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--acc); animation: ping 2s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(3); opacity: 0; } }

.hero__title {
  max-width: 680px; font-size: 48px; line-height: 1; letter-spacing: -0.04em; font-weight: 600;
  background: linear-gradient(90deg, #FFFFFF, #9B9B9B); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 6px;
}
@media (min-width: 900px) { .hero__title { font-size: 72px; max-width: 820px; } }
.hero__sub { max-width: 680px; font-size: 18px; line-height: 28px; color: var(--muted); }
.hero__type { font-size: 14px; line-height: 20px; color: var(--muted); min-height: 20px; }
.typed { color: var(--text); }
.caret { display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -3px; background: var(--acc); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); margin-top: var(--s2); }

.stats { list-style: none; padding: 0; margin: var(--s7) 0 0; display: grid; grid-template-columns: repeat(4, auto); gap: var(--s7); }
.stats li { display: grid; gap: var(--s1); }
.stats b { font-size: 30px; line-height: 36px; font-weight: 500; color: var(--text); }
.stats li > span { font-size: 14px; line-height: 20px; color: var(--muted); }

.hero__scroll { position: absolute; bottom: var(--s6); left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: var(--s2); font-size: 12px; color: var(--dim); }
.hero__scroll i { width: 1px; height: 40px; background: var(--line); position: relative; overflow: hidden; }
.hero__scroll i::after { content: ""; position: absolute; inset: 0; background: var(--acc); animation: drip 2s var(--ease) infinite; }
@keyframes drip { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: var(--s5) 0; background: var(--bg); }
.marquee__track { display: flex; align-items: center; gap: var(--s6); width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span { font-size: 30px; line-height: 36px; font-weight: 500; color: var(--dim); letter-spacing: -0.02em; transition: color .5s var(--ease); white-space: nowrap; }
.marquee span:hover { color: var(--text); }
.marquee i { color: var(--acc); font-style: normal; font-size: 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.section { padding: var(--s11) 0; }
@media (min-width: 900px) { .section { padding: 160px 0; } }
.label { font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); margin-bottom: var(--s4); }
.h2 { font-size: 36px; line-height: 40px; letter-spacing: -0.03em; max-width: 680px; margin-bottom: var(--s8); }
@media (min-width: 900px) { .h2 { font-size: 48px; line-height: 1; } }
.lead { font-size: 18px; line-height: 28px; color: var(--muted); max-width: 560px; }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.card {
  position: relative; overflow: hidden; display: grid; align-content: start; gap: var(--s3);
  padding: var(--s6); border-radius: 24px; background: var(--bg-2); border: 1px solid rgba(255, 255, 255, .06);
  transition: border-color .7s var(--ease), transform .7s var(--ease);
}
.card:hover { border-color: rgba(197, 255, 74, .25); }
.card--wide { grid-column: span 2; }
.card h3 { font-size: 24px; line-height: 32px; letter-spacing: -0.02em; }
.card p { color: var(--muted); max-width: 460px; }
.card__icon { font-size: 30px; color: var(--acc); margin-bottom: var(--s4); }
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease);
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(197, 255, 74, .09), transparent 60%);
}
.spot:hover::before { opacity: 1; }
.mini-term {
  margin-top: var(--s4); padding: var(--s4); border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  font-size: 14px; line-height: 20px; display: grid; gap: var(--s1); max-width: 420px;
}
.mini-term p { color: var(--text); opacity: 0; transform: translateY(8px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.is-in .mini-term p { opacity: 1; transform: none; }
.is-in .mini-term p:nth-child(2) { transition-delay: .4s; } .is-in .mini-term p:nth-child(3) { transition-delay: .9s; } .is-in .mini-term p:nth-child(4) { transition-delay: 1.4s; }
.mini-term p.c-ok { color: var(--ok); }
.card--gauge { grid-template-columns: 1fr auto; align-items: center; gap: var(--s6); }
.gauge { position: relative; width: 160px; height: 160px; display: grid; place-items: center; align-content: center; }
.gauge svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 6; }
.gauge__bg { stroke: var(--bg-4); }
.gauge__fg { stroke: var(--acc); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 2s var(--ease); filter: drop-shadow(0 0 6px rgba(197,255,74,.5)); }
.gauge b { font-size: 36px; line-height: 40px; font-weight: 500; color: var(--acc); }
.gauge span { font-size: 12px; line-height: 16px; color: var(--muted); }

/* ---------- Tagline reveal ---------- */
.tagline { padding: 160px 0; border-block: 1px solid var(--line); }
.tagline__text { max-width: 900px; font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.03em; }
@media (min-width: 900px) { .tagline__text { font-size: 60px; line-height: 1.05; } }
.tagline__text .w { color: rgba(242, 242, 242, .22); transition: color .8s var(--ease), text-shadow .8s var(--ease); }
.tagline__text .w.on { color: var(--text); }
.tagline__text .w.acc.on { color: var(--acc); text-shadow: 0 0 24px rgba(197,255,74,.35); }

/* ---------- Proyectos ---------- */
.projects { display: grid; gap: var(--s11); }
.project { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s9); align-items: center; }
.project--alt .project__frame { order: 2; }
.project__frame {
  border-radius: 16px; overflow: hidden; background: var(--bg-3); border: 1px solid var(--line);
  transform-style: preserve-3d; transition: transform .8s var(--ease), box-shadow .8s var(--ease);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
}
a.project__frame { display: block; color: inherit; }
.project__live { justify-self: start; margin-top: var(--s2); color: var(--text); }
.project__live:hover i { transform: translate(2px, -2px); }
.project__frame:hover { box-shadow: 0 40px 80px -30px rgba(197, 255, 74, .18); }
.project__bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.project__bar i, .editor__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-4); }
.project__bar span { margin-left: var(--s3); font-size: 12px; color: var(--dim); }
.project__frame img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease); }
.project__frame:hover img { transform: scale(1.03); }
.project__meta { display: grid; gap: var(--s3); }
.project__meta > p.mono { font-size: 12px; line-height: 16px; }
.project__meta h3 { font-size: 30px; line-height: 36px; letter-spacing: -0.02em; }
.project__meta > p:not(.mono) { color: var(--muted); }
.tags { list-style: none; padding: 0; margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.tags li { font-size: 12px; line-height: 16px; padding: var(--s1) var(--s3); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }

.project-next {
  position: relative; overflow: hidden; display: grid; gap: var(--s3); padding: var(--s9) var(--s6);
  border-radius: 24px; border: 1px dashed var(--line); background: var(--bg-2);
  transition: border-color .7s var(--ease);
}
.project-next:hover { border-color: var(--acc); }
.project-next > .mono { font-size: 12px; }
.project-next h3 { font-size: 36px; line-height: 40px; letter-spacing: -0.03em; max-width: 560px; }
.project-next p { color: var(--muted); }
.project-next__go {
  position: absolute; right: var(--s6); top: 50%; width: 64px; height: 64px; margin-top: -32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--acc); color: var(--acc-ink); font-size: 24px;
  transition: transform .7s var(--ease);
}
.project-next:hover .project-next__go { transform: rotate(45deg) scale(1.1); }

/* ---------- Proceso ---------- */
.steps { list-style: none; padding: 0; margin: 0; position: relative; display: grid; gap: var(--s4); }
.steps::before { content: ""; position: absolute; left: 27px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.steps::after {
  content: ""; position: absolute; left: 27px; top: 0; width: 1px; height: calc(var(--p, 0) * 100%);
  background: var(--acc); box-shadow: 0 0 12px var(--acc);
}
.step { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: var(--s6); padding: var(--s5) 0; }
.step__n {
  position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: 14px;
  transition: border-color .7s var(--ease), color .7s var(--ease), background-color .7s var(--ease);
}
.step.is-lit .step__n { border-color: var(--acc); color: var(--acc-ink); background: var(--acc); }
.step h3 { font-size: 24px; line-height: 32px; margin: var(--s3) 0 var(--s2); letter-spacing: -0.02em; }
.step p { color: var(--muted); max-width: 560px; }

/* ---------- Stack / editor ---------- */
.stack { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s9); align-items: center; }
.guarantees { list-style: none; padding: 0; margin: var(--s6) 0 0; display: grid; gap: var(--s3); }
.guarantees li { display: flex; align-items: center; gap: var(--s3); }
.guarantees i { font-size: 20px; color: var(--acc); }
.editor { border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 40px 80px -40px rgba(0,0,0,.9); }
.editor__bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: var(--bg-3); }
.editor__bar span { margin-left: var(--s3); font-size: 12px; color: var(--muted); }
.editor__code { margin: 0; padding: var(--s5); font-size: 14px; line-height: 24px; overflow-x: auto; color: var(--text); min-height: 260px; }
.editor__code .k { color: #FF7AC6; } .editor__code .v { color: var(--cyan); } .editor__code .s { color: var(--acc); } .editor__code .n { color: #FFB86B; }
.editor__code .caret { height: 14px; }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--s9); align-items: start; }
.faq__list { display: grid; gap: var(--s3); }
.faq details { border-radius: 16px; background: var(--bg-2); border: 1px solid rgba(255,255,255,.06); transition: border-color .7s var(--ease); }
.faq details[open] { border-color: var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: var(--s5); font-size: 18px; line-height: 28px; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { color: var(--acc); font-size: 20px; transition: transform .7s var(--ease); flex: none; }
.faq details[open] summary i { transform: rotate(45deg); }
.faq details p { padding: 0 var(--s5) var(--s5); color: var(--muted); }

/* ---------- Contacto ---------- */
.contact { border-top: 1px solid var(--line); }
.contact__inner { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s9); }
.contact__title {
  font-size: 48px; line-height: 1; letter-spacing: -0.04em; margin-bottom: var(--s5);
  background: linear-gradient(90deg, #FFFFFF, #9B9B9B); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 6px;
}
@media (min-width: 900px) { .contact__title { font-size: 60px; } }
.email {
  display: inline-flex; align-items: center; gap: var(--s3); margin-top: var(--s6); padding: var(--s3) var(--s5);
  border-radius: 999px; border: 1px solid var(--line); font-size: 16px; transition: border-color .7s var(--ease), background-color .7s var(--ease);
}
.email:hover { border-color: var(--acc); background: rgba(197,255,74,.06); }
.email i { font-size: 18px; color: var(--acc); }
.email__icon { color: var(--muted) !important; }
.clock { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s5); font-size: 14px; color: var(--muted); }
.socials { list-style: none; padding: 0; margin: var(--s6) 0 0; display: flex; gap: var(--s3); }
.socials a {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-size: 20px;
  transition: border-color .7s var(--ease), color .7s var(--ease), transform .7s var(--ease);
}
.socials a:hover { border-color: var(--acc); color: var(--acc); }

.form { display: grid; gap: var(--s5); padding: var(--s6); border-radius: 24px; background: var(--bg-2); border: 1px solid rgba(255,255,255,.06); align-content: start; }
.field { display: grid; gap: var(--s2); border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: 14px; line-height: 20px; color: var(--muted); padding: 0; margin-bottom: var(--s2); }
.field label { margin-bottom: 0; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: var(--s3) var(--s4); transition: border-color .5s var(--ease), box-shadow .5s var(--ease); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(197,255,74,.12); }
.err { display: none; font-size: 14px; line-height: 20px; color: var(--err); }
.field.is-err input, .field.is-err textarea { border-color: var(--err); }
.field.is-err .err { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips label { margin: 0; position: relative; }
.chips input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block; padding: var(--s2) var(--s4); border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 20px; cursor: pointer;
  transition: border-color .5s var(--ease), color .5s var(--ease), background-color .5s var(--ease);
}
.chips span:hover { color: var(--text); }
.chips input:checked + span { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 3px; }
.form .btn { justify-self: start; }
.form__ok { display: none; color: var(--ok); font-size: 14px; line-height: 20px; }
.form__ok.is-on { display: block; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-top: var(--s7); overflow: hidden; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); font-size: 14px; line-height: 20px; }
.footer__legal { display: flex; gap: var(--s5); }
.footer__legal a { color: var(--muted); transition: color .5s var(--ease); }
.footer__legal a:hover { color: var(--text); }
.footer__big {
  font-size: 22vw; line-height: .8; font-weight: 600; letter-spacing: -0.06em; text-align: center; margin-top: var(--s9);
  color: var(--bg-4); user-select: none; transform: translateY(8%);
}

/* ---------- Paleta de comandos ---------- */
.palette { position: fixed; inset: 0; z-index: 250; display: grid; place-items: start center; padding: 15vh var(--s4) 0; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.palette[hidden] { display: none; }
.palette__box { width: min(560px, 100%); border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 40px 120px rgba(0,0,0,.8); animation: palIn .5s var(--ease); }
@keyframes palIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.palette__search { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--line); }
.palette__search i { font-size: 20px; color: var(--muted); }
.palette__search input { flex: 1; background: none; border: 0; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.palette kbd { font-size: 12px; padding: 2px var(--s2); border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.palette__list { list-style: none; margin: 0; padding: var(--s2); max-height: 360px; overflow: auto; }
.palette__list li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: 8px; cursor: pointer; color: var(--muted); }
.palette__list li i { font-size: 18px; }
.palette__list li.is-sel { background: var(--bg-4); color: var(--text); }
.palette__list li.is-sel i { color: var(--acc); }
.palette__empty { padding: var(--s5); color: var(--muted); font-size: 14px; }

.toast {
  position: fixed; bottom: var(--s5); left: 50%; z-index: 260; transform: translate(-50%, 24px); opacity: 0;
  padding: var(--s2) var(--s4); border-radius: 999px; background: var(--acc); color: var(--acc-ink); font-size: 14px; line-height: 20px; font-weight: 500;
  transition: opacity .5s var(--ease), transform .7s var(--ease); pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .nav__links, .nav__k { display: none; }
  .nav__burger { display: block; }
}
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .card--gauge { grid-template-columns: 1fr; }
  .project, .stack, .faq, .contact__inner { grid-template-columns: 1fr; gap: var(--s6); }
  .project--alt .project__frame { order: 0; }
  .stats { grid-template-columns: repeat(2, auto); gap: var(--s5) var(--s7); }
  .project-next { padding: var(--s7) var(--s5) 112px; }
  .project-next__go { top: auto; bottom: var(--s5); right: auto; left: var(--s5); margin: 0; }
  .tagline { padding: var(--s11) 0; }
}
@media (max-width: 560px) {
  .nav { padding-left: var(--s4); }
  .nav__logo { margin-right: var(--s2); }
  .nav .btn--sm { display: none; }
  .hero { padding-top: 120px; }
  .hero__sub { font-size: 16px; line-height: 24px; }
  .card, .form { padding: var(--s5); }
  .stats b { font-size: 24px; line-height: 32px; }
  .hero__scroll { display: none; }
}

/* Solo efectos intrusivos se apagan con reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation-duration: 120s; }
}

/* ==========================================================
   Capa personal: retrato 3D, sobre mí y galería
   ========================================================== */

/* ---------- Hero con retrato ---------- */
.hero__layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: var(--s9); align-items: center; }
.portrait { margin: 0; position: relative; perspective: 1200px; }
.portrait__stage {
  position: relative; transform-style: preserve-3d; will-change: transform;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 1.2s var(--ease);
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.portrait__card {
  position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 5;
  background: var(--bg-3); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(197, 255, 74, .08);
  transform: translateZ(0);
}
.portrait__card img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.03); transform: scale(1.06); transition: transform 1.6s var(--ease); }
.portrait:hover .portrait__card img { transform: scale(1.1); }
.portrait__card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .75));
}
.portrait__scan {
  position: absolute; left: 0; right: 0; height: 2px; top: 0; z-index: 1; pointer-events: none;
  background: var(--acc); box-shadow: 0 0 16px 2px var(--acc); opacity: 0;
  animation: scan 5s var(--ease) infinite;
}
@keyframes scan { 0% { top: 0; opacity: 0; } 10% { opacity: .7; } 60% { opacity: .7; } 70%, 100% { top: 100%; opacity: 0; } }
.portrait__tag {
  position: absolute; left: var(--s4); bottom: var(--s4); z-index: 2; display: inline-flex; align-items: center; gap: var(--s2);
  font-size: 12px; line-height: 16px; color: var(--text); padding: var(--s1) var(--s3); border-radius: 999px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .12);
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.portrait__ring {
  position: absolute; inset: -14px; border-radius: 32px; z-index: -1; transform: translateZ(-60px);
  background: conic-gradient(from var(--ang, 0deg), transparent 0deg, var(--acc) 60deg, transparent 120deg, transparent 200deg, var(--cyan) 260deg, transparent 320deg);
  filter: blur(18px); opacity: .55; animation: spinRing 8s linear infinite;
}
@keyframes spinRing { to { --ang: 360deg; } }
.portrait__chip {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap;
  font-size: 12px; line-height: 16px; padding: var(--s2) var(--s3); border-radius: 999px;
  background: rgba(24, 24, 24, .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); color: var(--text); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8);
}
.portrait__chip i { color: var(--acc); font-size: 16px; }
.portrait__chip--a { top: 12%; left: -18%; transform: translateZ(90px); }
.portrait__chip--b { top: 46%; right: -12%; transform: translateZ(130px); }
.portrait__chip--c { bottom: 14%; left: -10%; transform: translateZ(60px); }

/* ---------- Sobre mí ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--s10); align-items: center; }
.about__photo { margin: 0; position: relative; }
.about__frame {
  border-radius: 24px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-3);
  transition: transform .8s var(--ease), box-shadow .8s var(--ease); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
}
.about__frame img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter 1.4s var(--ease) .3s, transform 1.6s var(--ease); }
.about__photo.is-in .about__frame img { filter: grayscale(0); }
.about__photo:hover .about__frame img { transform: scale(1.04); }
.about__photo::before {
  content: ""; position: absolute; inset: var(--s5) calc(var(--s5) * -1) calc(var(--s5) * -1) var(--s5); z-index: -1;
  border-radius: 24px; border: 1px solid rgba(197, 255, 74, .35);
}
.about__badge {
  position: absolute; right: var(--s5); bottom: calc(var(--s5) * -1); display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s4); border-radius: 999px; background: var(--acc); color: var(--acc-ink); font-size: 14px; line-height: 20px; font-weight: 500;
  box-shadow: 0 20px 40px -12px rgba(197, 255, 74, .45); transition: transform .7s var(--ease);
}
.about__badge:hover { transform: translateY(-3px) rotate(-2deg); }
.about__badge i { font-size: 18px; }
.about__text { display: grid; gap: var(--s5); }
.about__text .h2 { margin-bottom: 0; }
.about__facts { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.about__facts li { display: grid; gap: var(--s1); padding: var(--s4); border-radius: 16px; background: var(--bg-2); border: 1px solid rgba(255, 255, 255, .06); }
.about__facts b { font-size: 36px; line-height: 40px; font-weight: 500; color: var(--acc); }
.about__facts span { font-size: 14px; line-height: 20px; color: var(--muted); }
.about__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); margin-top: var(--s3); }
.about__ctas .link-arrow i { font-size: 20px; }

@media (max-width: 1000px) {
  .hero__layout { grid-template-columns: 1fr; gap: var(--s7); }
  .portrait { order: -1; width: min(300px, 70vw); }
  .portrait__chip--a { left: auto; right: -34%; top: 10%; }
  .portrait__chip--b { right: -30%; top: 48%; }
  .portrait__chip--c { left: auto; right: -26%; bottom: 10%; }
  .about__grid { grid-template-columns: 1fr; gap: var(--s9); }
  .about__photo { max-width: 440px; }
}
@media (max-width: 560px) {
  .portrait { width: 200px; }
  .portrait__chip--b, .portrait__chip--c { display: none; }
  .portrait__chip--a { right: -60%; top: auto; bottom: 18%; }
  .about__facts { gap: var(--s2); }
  .about__facts li { padding: var(--s3); }
  .about__facts b { font-size: 30px; line-height: 36px; }
  .about__facts span { font-size: 12px; line-height: 16px; }
  .about__photo::before { inset: var(--s4) calc(var(--s3) * -1) calc(var(--s3) * -1) var(--s4); }
}

@media (min-width: 1001px) { .hero__layout .hero__title { font-size: 60px; } }

/* ==========================================================
   Capa "capítulos": mundo de partículas, titulares palabra
   a palabra, riel de capítulos, dock y luz ambiental
   ========================================================== */
@property --amb { syntax: "<color>"; inherits: true; initial-value: rgba(197, 255, 74, .10); }
:root { --amb: rgba(197, 255, 74, .10); transition: --amb 1.6s var(--ease); }

.ambient {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% 115%, var(--amb), transparent 70%),
    radial-gradient(60% 40% at 85% -10%, rgba(74, 227, 255, .05), transparent 70%);
}
.world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.marquee { background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Capítulo en el hero */
.chapter { display: inline-flex; align-items: center; gap: var(--s3); margin-bottom: 0; color: var(--muted); }
.chapter::before { content: ""; width: 1px; height: 14px; background: var(--acc); }

/* Titulares que entran palabra a palabra */
.reveal.split { opacity: 1; transform: none; filter: none; }
.split .wd {
  display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(.45em) rotate(2deg);
  transition: opacity .9s var(--ease), filter .9s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--i) * 55ms);
}
.split.is-in .wd { opacity: 1; filter: none; transform: none; }
.hero__title.split, .contact__title.split { background: none; color: var(--text); -webkit-text-fill-color: currentColor; }
.hero__title.split .wd { transition-delay: calc(var(--i) * 70ms + .15s); }
body:not(.is-ready) .hero__title.split .wd { opacity: 0; filter: blur(10px); transform: translateY(.45em) rotate(2deg); }
.split .wd.grad {
  background: linear-gradient(100deg, var(--acc) 10%, var(--cyan) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding-bottom: .08em;
}

/* Riel de capítulos (escritorio) */
.rail {
  position: fixed; right: var(--s5); top: 50%; transform: translateY(-50%); z-index: 100;
  display: none; flex-direction: column; align-items: flex-end; gap: var(--s2);
}
@media (min-width: 1200px) { .rail { display: flex; } }
.rail a {
  display: flex; align-items: center; gap: var(--s3); font-family: var(--mono); font-size: 11px; line-height: 16px;
  color: var(--dim); letter-spacing: .08em; text-transform: uppercase; padding: 2px 0;
  transition: color .5s var(--ease);
}
.rail a i { width: 14px; height: 1px; background: currentColor; transition: width .7s var(--ease), background-color .5s var(--ease); }
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity .5s var(--ease), transform .7s var(--ease); white-space: nowrap; }
.rail a:hover, .rail a.is-on { color: var(--text); }
.rail a.is-on i { width: 32px; background: var(--acc); }
.rail a.is-on span, .rail a:hover span { opacity: 1; transform: none; }
.rail b { font-weight: 500; min-width: 28px; text-align: right; }

/* Dock inferior */
.dock {
  position: fixed; left: 50%; bottom: var(--s5); z-index: 115;
  display: flex; align-items: center; gap: var(--s1);
  padding: 6px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(24, 24, 24, .65); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .9);
  transform: translate(-50%, 160%); opacity: 0;
  transition: transform .8s var(--ease), opacity .6s var(--ease);
}
.dock.is-on { transform: translate(-50%, 0); opacity: 1; }
.dock a { font-size: 14px; line-height: 20px; color: var(--muted); padding: var(--s2) var(--s4); border-radius: 999px; transition: color .5s var(--ease), background-color .5s var(--ease); white-space: nowrap; }
.dock a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.dock .dock__cta { display: inline-flex; align-items: center; gap: var(--s2); background: var(--acc); color: var(--acc-ink); font-weight: 600; }
.dock .dock__cta:hover { background: var(--acc); color: var(--acc-ink); box-shadow: 0 0 28px rgba(197, 255, 74, .35); }
.dock .dock__cta .pulse { background: var(--acc-ink); }
.dock .dock__cta .pulse::after { background: var(--acc-ink); }
.toast { bottom: 92px; }
@media (max-width: 560px) {
  .dock { bottom: var(--s3); }
  .dock .dock__opt { display: none; }
  .dock a { padding: var(--s2) var(--s3); }
  .toast { bottom: 80px; }
}

/* ==========================================================
   Showreel: vídeo cinematográfico interactivo
   ========================================================== */
.hero__reel { display: inline-flex; align-items: center; gap: var(--s3); color: var(--text); font-weight: 500; }
.hero__reel-btn {
  position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(24, 24, 24, .7); font-size: 18px; color: var(--acc);
  transition: transform .7s var(--ease), border-color .7s var(--ease), background-color .7s var(--ease);
}
.hero__reel-btn::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--acc); animation: ping 2.4s var(--ease) infinite; opacity: .5; }
.hero__reel:hover .hero__reel-btn { transform: scale(1.08); border-color: var(--acc); background: rgba(197, 255, 74, .1); }

.reel { position: relative; padding: var(--s11) 0; }
.reel__head { margin-bottom: var(--s7); }
.reel__head .h2 { margin-bottom: 0; }
.reel__stage { position: relative; width: min(1200px, calc(100% - 2 * var(--s5))); margin-inline: auto; perspective: 1600px; }
.reel__ambient {
  position: absolute; inset: 4% 2%; width: 96%; height: 92%; z-index: 0; pointer-events: none;
  filter: blur(64px) saturate(1.6); opacity: .5; transform: scale(1.08); transition: opacity 1s var(--ease);
}
.reel__frame {
  position: relative; z-index: 1; aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; background: #000;
  border: 1px solid rgba(255, 255, 255, .1); outline: none;
  box-shadow: 0 80px 160px -60px rgba(0, 0, 0, 1), 0 0 0 1px rgba(197, 255, 74, .06);
  transform-origin: 50% 0;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--sc, 1));
  transition: border-color .7s var(--ease), box-shadow .7s var(--ease);
  will-change: transform;
}
.reel__frame:focus-visible { border-color: var(--acc); }
.reel__frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, .7)); opacity: 1; transition: opacity .7s var(--ease); }

/* Botón grande central */
.reel__play {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: var(--s4);
  background: rgba(0, 0, 0, .28); transition: opacity .7s var(--ease), visibility 0s, background-color .7s var(--ease);
}
.reel__play:hover { background: rgba(0, 0, 0, .12); }
.reel__play-btn {
  position: relative; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
  background: var(--acc); color: var(--acc-ink); font-size: 40px; box-shadow: 0 0 64px rgba(197, 255, 74, .45);
  transition: transform .8s var(--ease);
}
.reel__play-btn i { margin-left: 6px; }
.reel__play:hover .reel__play-btn { transform: scale(1.1); }
.reel__play:active .reel__play-btn { transform: scale(.98); }
.reel__play-ring { position: absolute; inset: -12px; border-radius: 50%; border: 1px solid rgba(197, 255, 74, .6); animation: ping 2.4s var(--ease) infinite; }
.reel__play-t {
  font-size: 14px; line-height: 20px; color: var(--text); padding: var(--s1) var(--s3); border-radius: 999px;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.reel.is-sound .reel__play { opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s .5s; }

/* Barra de controles */
.reel__ui {
  position: absolute; left: var(--s4); right: var(--s4); bottom: var(--s4); z-index: 3;
  display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: 999px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .1);
  opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reel.is-sound .reel__frame:hover .reel__ui, .reel.is-sound .reel__frame:focus-within .reel__ui, .reel.is-sound.is-paused .reel__ui, .reel.is-sound.is-touch .reel__ui { opacity: 1; transform: none; }
.reel__ui button { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: var(--text); transition: background-color .5s var(--ease), color .5s var(--ease); }
.reel__ui button:hover { background: rgba(255, 255, 255, .1); color: var(--acc); }
.reel__bar { position: relative; flex: 1; height: 24px; cursor: pointer; outline: none; }
.reel__bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255, 255, 255, .18); }
.reel__fill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; width: 0; border-radius: 4px; background: var(--acc); box-shadow: 0 0 12px var(--acc); }
.reel__fill::after { content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--acc); transform: scale(0); transition: transform .4s var(--ease); }
.reel__bar:hover .reel__fill::after, .reel__bar:focus-visible .reel__fill::after { transform: scale(1); }
.reel__bar:focus-visible::before { box-shadow: 0 0 0 2px var(--acc); }
.reel__tick { position: absolute; top: 50%; width: 2px; height: 8px; margin-top: -4px; background: rgba(0, 0, 0, .7); pointer-events: none; }
.reel__time { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; min-width: 84px; text-align: right; }

/* Capítulos */
.reel__chapters {
  list-style: none; margin: var(--s6) auto 0; padding: 0; width: min(1200px, calc(100% - 2 * var(--s5)));
  display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2);
}
.reel__chapters button {
  width: 100%; display: grid; gap: var(--s1); justify-items: start; text-align: left; padding: var(--s3); border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .06); background: var(--bg-2); color: var(--muted); font-size: 12px; line-height: 16px;
  position: relative; overflow: hidden;
  transition: border-color .6s var(--ease), color .6s var(--ease), background-color .6s var(--ease), transform .6s var(--ease);
}
.reel__chapters button b { font-weight: 500; color: var(--dim); transition: color .6s var(--ease); }
.reel__chapters button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--cp, 0) * 100%); background: var(--acc); }
.reel__chapters button:hover { color: var(--text); transform: translateY(-2px); }
.reel__chapters button.is-on { color: var(--text); border-color: rgba(197, 255, 74, .35); background: var(--bg-3); }
.reel__chapters button.is-on b { color: var(--acc); }

/* Escritorio con JS: el vídeo se fija y se "aplana" con el scroll */
.reel.is-pinned { padding: 0; height: 200vh; }
.reel.is-pinned .reel__pin { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.reel.is-pinned .reel__head { margin-bottom: var(--s5); }
.reel.is-pinned .reel__stage { width: min(calc((100vh - 300px) * 16 / 9), calc(100% - 2 * var(--s5)), 1200px); }
.reel.is-pinned .reel__chapters { width: min(calc((100vh - 300px) * 16 / 9), calc(100% - 2 * var(--s5)), 1200px); margin-top: var(--s4); }

/* Cursor sobre el vídeo */
@media (pointer: fine) {
  .cursor.is-reel .cursor__ring { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: rgba(197, 255, 74, .9); border-color: var(--acc); }
  .cursor.is-reel .cursor__ring::after { content: "play"; position: absolute; inset: 0; display: grid; place-items: center; font: 500 12px/16px var(--mono); color: var(--acc-ink); }
  .cursor.is-reel.is-reel-pause .cursor__ring::after { content: "pausa"; }
  .cursor.is-reel .cursor__dot { opacity: 0; }
}

/* Móvil: vídeo vertical tipo story */
.reel--tall .reel__stage { width: min(380px, calc(100% - 2 * var(--s5))); }
.reel--tall .reel__frame { aspect-ratio: 9 / 16; }
@media (max-width: 900px) {
  .reel__chapters { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 112px; overflow-x: auto; scrollbar-width: none; padding-bottom: var(--s2); }
  .reel__chapters::-webkit-scrollbar { display: none; }
  .reel__play-btn { width: 88px; height: 88px; font-size: 32px; }
}
@media (max-width: 560px) {
  .reel__time { display: none; }
  .reel__ui { left: var(--s2); right: var(--s2); bottom: var(--s2); }
}
