/* =====================================================================
   KODDITA · Alex Barras — web de scroll
   Estilo «godly»: fondo con alma, interfaz sobria, luz y movimiento
   que acompaña. Todo lo animado respeta «reducir movimiento».
   ===================================================================== */

:root {
  --tinta: #08070d;
  --tinta-2: #111018;
  --tinta-3: #1a1824;
  --papel: #f3efe7;
  --papel-2: #e8e2d6;
  --texto: #f4f1ea;
  --texto-suave: rgb(244 241 234 / .66);
  --linea: rgb(255 255 255 / .1);
  --violeta: #8b5cf6;
  --violeta-2: #a78bfa;
  --ambar: #ffb547;
  --resalte: #ffb547;
  --curva: cubic-bezier(.2, .8, .2, 1);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --ancho: 1240px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--tinta); color: var(--texto);
  font: 400 17px/1.55 var(--sans); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--violeta); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--tinta); }
::-webkit-scrollbar-thumb { background: #2a2736; border-radius: 10px; border: 2px solid var(--tinta); }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 var(--gutter); }
.estrecho { max-width: 920px; }

/* ---------- Tipografía ---------- */
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--texto-suave); margin: 0 0 22px; }
.titular { font-family: var(--sans); font-weight: 600; letter-spacing: -.035em; line-height: .98; margin: 0; text-wrap: balance; }
.titular em, .manifiesto em, .gigante em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.titular-xl { font-size: clamp(40px, 6.4vw, 100px); }
.titular-l { font-size: clamp(30px, 4.2vw, 62px); line-height: 1.04; }
.titular mark, .manifiesto mark { color: inherit; background: none; position: relative; z-index: 0; padding: 0 .06em; white-space: nowrap; }
.titular mark::before, .manifiesto mark::before {
  content: ""; position: absolute; z-index: -1; inset: 52% -3% 6% -3%; border-radius: 6px; transform: rotate(-1.5deg) scaleX(var(--trazo, 1)); transform-origin: left;
  background: color-mix(in srgb, var(--resalte) 55%, transparent); transition: transform .9s var(--curva) .2s;
}
.entradilla { font-size: clamp(17px, 1.6vw, 22px); color: var(--texto-suave); margin: 22px 0 0; max-width: 44ch; }

/* ---------- Botones píldora ---------- */
.botones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.boton {
  --fondo-b: transparent; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  position: relative; overflow: hidden; isolation: isolate; white-space: nowrap;
  transition: transform .18s var(--curva), background-color .25s, border-color .25s, color .25s;
}
.boton.primario { background: var(--texto); color: var(--tinta); box-shadow: 0 10px 30px -12px rgb(139 92 246 / .7), inset 0 1px 0 rgb(255 255 255 / .6); }
.boton.primario::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(110deg, transparent 30%, rgb(139 92 246 / .35) 50%, transparent 70%); }
.boton.fantasma { border-color: rgb(255 255 255 / .22); color: var(--texto); background: rgb(255 255 255 / .03); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.boton-sm { min-height: 42px; padding: 0 18px; font-size: 14px; }
.boton-lg { min-height: 60px; padding: 0 32px; font-size: 17px; }
.flecha { display: inline-block; transition: transform .25s var(--curva); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .boton:hover { transform: translateY(-2px); }
  .boton:hover .flecha { transform: translateX(3px); }
  .boton.primario:hover::after { transform: translateX(130%); transition: transform .8s var(--curva); }
  .boton.fantasma:hover { border-color: rgb(255 255 255 / .5); background: rgb(255 255 255 / .08); }
}
.boton:active { transform: scale(.97); transition-duration: .08s; }
.boton:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--violeta-2); outline-offset: 3px; }

.pildora { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 11px; border-radius: 999px; font: 500 13px/1 var(--sans);
  background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); margin-bottom: 26px; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgb(74 222 128 / .6); }
@media (prefers-reduced-motion: no-preference) { .punto { animation: latido 2.2s infinite; } }
@keyframes latido { 70% { box-shadow: 0 0 0 9px rgb(74 222 128 / 0); } 100% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0); } }

/* ---------- Cargador ---------- */
.cargador { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 26px; background: var(--tinta); transition: opacity .7s var(--curva), visibility .7s; }
.cargador img { width: 150px; opacity: .95; }
.cargador-barra { width: 160px; height: 2px; background: rgb(255 255 255 / .12); border-radius: 2px; overflow: hidden; }
.cargador-barra i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violeta), var(--ambar)); transition: width .3s; }
.cargado .cargador { opacity: 0; visibility: hidden; }

/* ---------- Navegación ---------- */
.nav { position: fixed; z-index: 40; top: 14px; left: 50%; transform: translateX(-50%); width: min(var(--ancho), calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: rgb(12 11 18 / .45); border: 1px solid rgb(255 255 255 / .1); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  transition: transform .5s var(--curva), background-color .3s; }
.nav.oculta { transform: translate(-50%, -140%); }
.nav-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 14px/1 var(--mono); letter-spacing: .12em; }
.nav-marca img { width: 46px; }
.nav-enlaces { display: flex; gap: 4px; }
.nav-enlaces a { padding: 10px 14px; border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--texto-suave); transition: color .2s, background-color .2s; }
.nav-enlaces a:hover { color: var(--texto); background: rgb(255 255 255 / .07); }
@media (max-width: 760px) { .nav-enlaces { display: none; } .nav-marca span { display: none; } }

/* ---------- Hero con secuencia de fotogramas ---------- */
.hero { height: 300vh; position: relative; }
.hero-fijo { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#heroLienzo { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-velo { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 40%, transparent 30%, rgb(8 7 13 / .55) 100%), linear-gradient(180deg, rgb(8 7 13 / .55) 0%, rgb(8 7 13 / .05) 30%, rgb(8 7 13 / .2) 60%, rgb(8 7 13 / .9) 100%); }
.tiempo { position: absolute; left: max(var(--gutter), calc((100vw - var(--ancho)) / 2 + var(--gutter))); right: var(--gutter); bottom: clamp(70px, 12vh, 140px); max-width: 1100px;
  opacity: 0; transform: translateY(30px); filter: blur(8px); pointer-events: none; text-shadow: 0 2px 30px rgb(0 0 0 / .45); will-change: opacity, transform, filter; }
.tiempo.visible { pointer-events: auto; }
.t1 { max-width: 980px; }
.t1 .titular-xl { font-size: clamp(40px, 6.2vw, 96px); }
.t2 { max-width: 900px; }
.hero-pista { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--texto-suave); transition: opacity .4s; }
.hero-pista i { width: 1px; height: 34px; background: linear-gradient(var(--texto), transparent); transform-origin: top; }
@media (prefers-reduced-motion: no-preference) { .hero-pista i { animation: gotear 1.8s var(--curva) infinite; } }
@keyframes gotear { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.hero-progreso { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgb(255 255 255 / .08); }
.hero-progreso i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--violeta), var(--ambar)); }

/* ---------- Cinta ---------- */
.cinta { overflow: hidden; border-block: 1px solid var(--linea); background: var(--tinta-2); padding: 22px 0; }
.cinta-pista { display: flex; width: max-content; gap: 34px; align-items: center; font: 500 clamp(22px, 3vw, 38px)/1 var(--sans); letter-spacing: -.02em; color: var(--texto-suave); }
.cinta-pista b { color: var(--violeta-2); font-weight: 400; font-size: .6em; }
@media (prefers-reduced-motion: no-preference) { .cinta-pista { animation: cinta 38s linear infinite; } }
@keyframes cinta { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.seccion { padding: clamp(96px, 14vw, 180px) 0; position: relative; }
.claro { background: var(--papel); color: var(--tinta); color-scheme: light; --texto-suave: rgb(8 7 13 / .6); --resalte: #ffb547; }
.claro .eyebrow { color: rgb(8 7 13 / .55); }
.manifiesto { font: 500 clamp(26px, 3.4vw, 48px)/1.15 var(--sans); letter-spacing: -.03em; margin: 0; max-width: 22ch; text-wrap: pretty; }
.manifiesto .palabra { display: inline-block; opacity: .14; transition: opacity .5s var(--curva); }
.manifiesto .palabra.on { opacity: 1; }
.datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(56px, 8vw, 100px); }
.dato { padding: 28px; border-radius: 22px; background: #fff; border: 1px solid rgb(8 7 13 / .07); box-shadow: 0 20px 50px -30px rgb(8 7 13 / .35); }
.dato-num, .dato-mas { font: 600 clamp(48px, 5.4vw, 76px)/1 var(--sans); letter-spacing: -.05em; }
.dato-mas { color: var(--violeta); }
.dato p { margin: 10px 0 0; color: rgb(8 7 13 / .62); font-size: 15px; }
@media (max-width: 760px) { .datos { grid-template-columns: 1fr; } }

/* ---------- Trabajo: scroll horizontal fijado ---------- */
.trabajo { position: relative; height: var(--alto-trabajo, 400vh); background: var(--tinta); }
.trabajo-fijo { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: clamp(24px, 4vh, 48px); }
.trabajo-cabecera { padding-top: 70px; }
.pista { display: flex; gap: clamp(16px, 2.4vw, 32px); padding: 0 var(--gutter); width: max-content; will-change: transform; }
.proyecto { width: min(78vw, 980px); flex: none; display: grid; grid-template-columns: 1.7fr 1fr; gap: 0; border-radius: 28px; overflow: hidden;
  background: var(--tinta-2); border: 1px solid var(--linea); position: relative; }
.proyecto-imagen { display: block; position: relative; overflow: hidden; background: var(--tinta-3); aspect-ratio: 16 / 10; border: 0; padding: 0; cursor: pointer; }
.proyecto-imagen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 1.1s var(--curva); }
@media (hover: hover) { .proyecto:hover .proyecto-imagen img { transform: scale(1.04); } }
.proyecto-texto { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; }
.proyecto h3 { font: 600 clamp(26px, 2.6vw, 38px)/1.05 var(--sans); letter-spacing: -.03em; margin: 14px 0 12px; }
.proyecto p { margin: 0; color: var(--texto-suave); font-size: 16px; }
.proyecto .botones { margin-top: auto; padding-top: 24px; }
.etiquetas { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.etiquetas li { font: 500 12px/1 var(--mono); padding: 7px 11px; border-radius: 999px; border: 1px solid var(--linea); color: var(--texto-suave); }
.sello { position: absolute; left: 16px; bottom: 16px; padding: 8px 13px; border-radius: 999px; font: 600 12px/1 var(--sans); background: rgb(8 7 13 / .55); border: 1px solid rgb(255 255 255 / .2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.video { cursor: default; }
.video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.video .play { position: absolute; z-index: 2; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; font-size: 22px; padding-left: 4px; color: var(--tinta); background: var(--texto); box-shadow: 0 10px 40px -8px rgb(0 0 0 / .6); transition: transform .3s var(--curva), opacity .3s; }
.video .play:hover { transform: scale(1.08); }
.video .sello { z-index: 2; top: 16px; bottom: auto; }
.video.reproduciendo .play, .video.reproduciendo .sello { opacity: 0; pointer-events: none; }
/* Foco que sigue al cursor */
.foco::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgb(139 92 246 / .16), transparent 60%); }
@media (hover: hover) { .foco:hover::before { opacity: 1; } }

@media (max-width: 860px) {
  .trabajo { height: auto; }
  .trabajo-fijo { position: relative; height: auto; padding: 96px 0; }
  .pista { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: none; transform: none !important; }
  .pista::-webkit-scrollbar { display: none; }
  .proyecto { width: 84vw; grid-template-columns: 1fr; scroll-snap-align: center; }
}

/* ---------- Servicios ---------- */
.servicios { list-style: none; padding: 0; margin: clamp(48px, 7vw, 90px) 0 0; border-top: 1px solid var(--linea); }
.servicio { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 20px; padding: clamp(22px, 3vw, 34px) 8px; border-bottom: 1px solid var(--linea); position: relative; overflow: hidden; isolation: isolate; }
.servicio::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(139 92 246 / .14), rgb(255 181 71 / .08)); transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--curva); }
.servicio h3 { margin: 0; font: 500 clamp(22px, 2.6vw, 36px)/1.1 var(--sans); letter-spacing: -.025em; transition: transform .45s var(--curva); }
.servicio p { margin: 0; color: var(--texto-suave); font-size: 16px; }
@media (hover: hover) {
  .servicio:hover::after { transform: scaleY(1); }
  .servicio:hover h3 { transform: translateX(10px); }
  .servicio:hover }
@media (max-width: 760px) { .servicio { grid-template-columns: 1fr; gap: 8px; } }
.aviso { margin-top: 56px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(24px, 3vw, 36px); border-radius: 24px;
  background: radial-gradient(120% 140% at 0% 0%, rgb(139 92 246 / .22), transparent 60%), var(--tinta-2); border: 1px solid var(--linea); }
.aviso p { margin: 0; font-size: clamp(18px, 1.8vw, 22px); max-width: 40ch; }

/* ---------- Trayectoria ---------- */
.linea { list-style: none; padding: 0 0 0 34px; margin: clamp(48px, 7vw, 80px) 0 0; position: relative; }
.linea::before, .linea-relleno { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--linea); }
.linea-relleno { display: block; background: linear-gradient(var(--violeta), var(--ambar)); transform: scaleY(0); transform-origin: top; }
.linea li { position: relative; display: grid; grid-template-columns: 90px 1fr; gap: 18px; padding: 18px 0; }
.linea li::before { content: ""; position: absolute; left: -34px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--tinta); border: 2px solid var(--violeta-2); }
.linea span { font: 500 15px/1.6 var(--mono); color: var(--ambar); }
.linea p { margin: 0; font-size: clamp(18px, 1.9vw, 24px); letter-spacing: -.01em; }

/* ---------- Fuera del código ---------- */
.fuera { background: radial-gradient(60% 60% at 80% 30%, rgb(139 92 246 / .16), transparent 70%), var(--tinta); }
.aficiones { list-style: none; padding: 0; margin: 48px 0; display: flex; flex-wrap: wrap; gap: 12px; }
.aficiones li { padding: 14px 22px; border-radius: 999px; font: 500 clamp(17px, 1.8vw, 22px)/1 var(--sans); background: rgb(255 255 255 / .05); border: 1px solid var(--linea); }
@media (prefers-reduced-motion: no-preference) {
  .aficiones li { animation: flotar 5.5s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s); }
}
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1deg); } }

/* ---------- Contacto ---------- */
.contacto { background: radial-gradient(70% 60% at 50% 100%, rgb(139 92 246 / .22), transparent 70%), var(--tinta); text-align: center; }
.contacto .eyebrow { text-align: center; }
.gigante { font: 600 clamp(60px, 11vw, 170px)/.9 var(--sans); letter-spacing: -.06em; margin: 0; }
.gigante span { color: var(--ambar); }
.correo { margin: 40px auto 0; display: grid; gap: 8px; justify-items: center; background: none; border: 0; color: var(--texto); cursor: pointer; padding: 10px; }
.correo span { font: 400 clamp(24px, 3.6vw, 52px)/1.1 var(--serif); font-style: italic; border-bottom: 1px solid rgb(255 255 255 / .3); transition: border-color .3s; word-break: break-all; }
.correo:hover span { border-color: var(--ambar); }
.correo small { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); }
.redes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 44px; }

.pie { border-top: 1px solid var(--linea); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--texto-suave); font-size: 14px; }
.pie-fila { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.pie a { text-decoration: none; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; z-index: 90; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: #fff; pointer-events: none; mix-blend-mode: difference;
  transform: translate(-50%, -50%); transition: width .25s var(--curva), height .25s var(--curva), opacity .3s; opacity: 0; }
.cursor.grande { width: 46px; height: 46px; }
@media (hover: none), (prefers-reduced-motion: reduce) { .cursor { display: none; } }

/* ---------- Entradas al hacer scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .revela { opacity: 0; transform: translateY(26px); filter: blur(6px); transition: opacity .9s var(--curva), transform .9s var(--curva), filter .9s var(--curva); transition-delay: calc(var(--orden, 0) * 70ms); }
  .js .revela.on { opacity: 1; transform: none; filter: none; }
  .js mark { --trazo: 0; }
  .js .on mark, .js mark.on, .js .tiempo.visible mark { --trazo: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero-fijo { position: relative; }
  .tiempo { position: relative; opacity: 1; transform: none; filter: none; inset: auto; padding: 24px var(--gutter); }
  .t1 { padding-top: 120px; }
  .hero-pista, .hero-progreso { display: none; }
  .manifiesto .palabra { opacity: 1; }
}
