/* ===== Portafolio TaytheProducer — mismos colores y estilo que la página principal ===== */
:root {
  --bg: #08070c;
  --bg-2: #110e1a;
  --line: rgba(255, 255, 255, .12);
  --text: #f6f4fb;
  --muted: #a9a3ba;
  --violet: #7b2cff;
  --magenta: #d43cff;
  --cyan: #3fe0ff;
  --grad: linear-gradient(100deg, #6a2cff 0%, #b13cff 55%, #e04bff 100%);
  --radius: 22px;
  --pad: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: clamp(16px, 1.05vw, 18px); line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.cursor-glow { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(123, 44, 255, .13), transparent 60%); }

/* ===== Navegación ===== */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad); background: rgba(8, 7, 12, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.logo { display: block; text-decoration: none; }
.logo img { height: 22px; width: auto; }
.chrome { position: relative; display: inline-block; }
.chrome img { display: block; }
.chrome::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.95) 47%, rgba(230,200,255,1) 50%, rgba(255,255,255,.95) 53%, transparent 62%);
  background-size: 300% 100%; background-repeat: no-repeat;
  -webkit-mask: url("img/logo.png") center / 100% 100% no-repeat; mask: url("img/logo.png") center / 100% 100% no-repeat;
  animation: shine 6s ease-in-out .6s infinite; }
@keyframes shine { 0% { background-position: 120% 0; } 30%, 100% { background-position: -20% 0; } }
.nav ul { display: flex; gap: clamp(10px, 2.4vw, 32px); align-items: center; }
.nav a { text-decoration: none; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--text); }
.nav .nav-cta { color: var(--text); padding: 8px 14px; border-radius: 999px; background: var(--grad); }
@media (max-width: 640px) { .nav li:not(:last-child) { display: none; } }

/* ===== Botones y textos ===== */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; letter-spacing: .01em;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s; }
.btn-grad { background: var(--grad); box-shadow: 0 10px 30px -10px rgba(177, 60, 255, .7); }
.btn-grad:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -12px rgba(177, 60, 255, .9); }
.btn-ghost { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.04); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.12); transform: translateY(-3px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row.center { justify-content: center; margin-top: 40px; }

.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big { font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: clamp(44px, 8vw, 120px); line-height: .9; letter-spacing: -.02em; }
.huge { font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: clamp(42px, 9vw, 150px); line-height: .88; letter-spacing: -.02em; margin: 18px 0 30px; }
.lead { max-width: 40ch; font-size: clamp(17px, 1.4vw, 21px); color: #d8d3e6; margin: 24px 0 22px; }

/* ===== Portada ===== */
.p-hero { position: relative; z-index: 2; min-height: 100svh; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(30px, 5vw, 80px);
  padding: 120px var(--pad) 80px; overflow: hidden;
  background: radial-gradient(50% 60% at 85% 45%, rgba(123,44,255,.22), transparent 70%), radial-gradient(40% 40% at 10% 90%, rgba(63,224,255,.07), transparent 70%); }
.p-hero h1 { margin-top: 18px; }
.skills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; max-width: 560px; }
.skills li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; color: #d8d3e6; background: rgba(255,255,255,.03); }

/* Collage 3D de portadas */
.stack { position: relative; display: block; width: 100%; perspective: 1400px; height: min(70vh, 620px); padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stack-inner { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transform: rotateY(-18deg) rotateX(8deg);
  transition: transform .8s var(--ease); }
/* Cada imagen ocupa uno de 5 lugares; al tocar, todas avanzan un lugar dando una vuelta */
.st { position: absolute; border-radius: 18px; object-fit: cover; object-position: 50% 35%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 40px 80px -30px rgba(0,0,0,.9), 0 30px 70px -40px rgba(177,60,255,.8);
  transform: translateZ(var(--z, 0)) rotateY(var(--rot, 0deg));
  transition: left .9s var(--ease), top .9s var(--ease), width .9s var(--ease), aspect-ratio .9s var(--ease), transform 1.1s var(--ease), opacity .6s, filter .6s;
  animation: float 9s ease-in-out infinite; backface-visibility: visible; }
.st[data-pos="0"] { width: 56%; aspect-ratio: 1; left: 22%; top: 16%; --z: 90px; z-index: 6; animation-delay: 0s; }
.st[data-pos="1"] { width: 32%; aspect-ratio: 9/14; left: 66%; top: 0; --z: 30px; z-index: 5; animation-delay: -6s; }
.st[data-pos="2"] { width: 50%; aspect-ratio: 3/2; left: 50%; top: 62%; --z: -10px; z-index: 4; animation-delay: -4s; }
.st[data-pos="3"] { width: 46%; aspect-ratio: 3/2; left: 0; top: 64%; --z: -30px; z-index: 3; animation-delay: -3s; }
.st[data-pos="4"] { width: 50%; aspect-ratio: 3/2; left: 0; top: 2%; --z: -60px; z-index: 2; animation-delay: -2s; filter: brightness(.7); }
.st[data-pos="5"] { width: 48%; aspect-ratio: 16/9; left: 30%; top: -4%; --z: -90px; z-index: 1; animation-delay: -5s; filter: brightness(.55); }
@keyframes float { 50% { translate: 0 -14px; } }

@media (max-width: 900px) {
  .p-hero { grid-template-columns: 1fr; padding-top: 100px; }
  .stack { order: -1; height: 380px; max-width: 520px; width: 100%; margin: 0 auto; }
}

/* ===== Secciones ===== */
.section { position: relative; z-index: 2; padding: clamp(80px, 12vw, 160px) var(--pad); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head p { max-width: 32ch; color: var(--muted); }

/* ===== Tarjetas de proyectos ===== */
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; perspective: 1200px; }
.work { display: flex; flex-direction: column; padding: 0; overflow: hidden; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(123,44,255,.16), rgba(255,255,255,.02) 50%), var(--bg-2);
  transform-style: preserve-3d; transition: border-color .3s, box-shadow .3s; }
.work:hover { border-color: rgba(177,60,255,.6); box-shadow: 0 30px 60px -30px rgba(177,60,255,.6); }
.work-media { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; }
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.work:hover .work-media img { transform: scale(1.07); }
.work-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(17,14,26,.9)); }
.badge { position: absolute; z-index: 2; top: 14px; left: 14px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(8,7,12,.65); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.work-body { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px 26px; transform: translateZ(30px); }
.work-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.num { font-weight: 800; color: var(--cyan); letter-spacing: .12em; }
.work-title { font-size: clamp(20px, 1.7vw, 26px); font-weight: 800; font-stretch: 106%; line-height: 1.15; }
.work-role { color: var(--muted); font-size: 15px; }

/* ===== Ventana de detalle del proyecto ===== */
.project-modal { margin: auto; width: min(820px, calc(100% - 24px)); max-height: min(92vh, 1000px); overflow-y: auto; padding: 0;
  border: 1px solid rgba(177,60,255,.45); border-radius: 26px; color: var(--text);
  background: radial-gradient(120% 50% at 0% 100%, rgba(123,44,255,.22), transparent 60%), #0e0b16;
  box-shadow: 0 40px 120px -20px rgba(123,44,255,.6); }
.project-modal[open] { animation: modal-in .5s var(--ease); }
.project-modal::backdrop { background: rgba(5, 4, 9, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(30px) scale(.95); } }
.pm-media { background: #000; }
.pm-media video, .pm-media img { width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.pm-media.vertical video { width: auto; max-width: 100%; height: min(70vh, 640px); margin: 0 auto; }
.pm-media.square img { aspect-ratio: 16/9; object-fit: cover; }
.pm-body { padding: clamp(22px, 4vw, 40px); }
.pm-body .num { font-size: 13px; text-transform: uppercase; }
.pm-body h3 { font-size: clamp(26px, 4vw, 42px); font-weight: 900; font-stretch: 112%; text-transform: uppercase; line-height: 1.02; margin: 8px 0 8px; overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 560px) { .pm-body h3 { font-size: 24px; } }
.pm-role { color: var(--magenta); font-weight: 700; margin-bottom: 18px; }
.pm-body > p:not(.pm-role) { color: #dcd7e8; margin-bottom: 12px; max-width: 62ch; }
.pm-body h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 26px 0 10px; }
.credits { display: grid; grid-template-columns: minmax(140px, auto) 1fr; border-top: 1px solid var(--line); }
.credits dt, .credits dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.credits dt { color: var(--muted); font-size: 14px; padding-right: 18px; }
.credits dd { font-weight: 600; }
@media (max-width: 560px) { .credits { grid-template-columns: 1fr; } .credits dt { border-bottom: 0; padding-bottom: 0; } .credits dd { padding-top: 2px; } }
.modal-close { position: absolute; z-index: 5; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(8,7,12,.7);
  backdrop-filter: blur(6px); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; transition: background .2s, transform .3s var(--ease); }
.modal-close:hover { background: rgba(255,255,255,.2); transform: rotate(90deg); }
body.modal-open { overflow: hidden; }

/* Reproductor de audio propio */
.audio { display: flex; align-items: center; gap: 16px; margin: 0; padding: 18px clamp(22px, 4vw, 40px); border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(123,44,255,.2), rgba(255,255,255,.02)); }
.au-play { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; color: #fff; background: var(--grad); cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(177,60,255,.8); transition: transform .3s var(--ease); }
.au-play:hover { transform: scale(1.07); }
.au-play svg { width: 24px; height: 24px; }
.au-play .i-pause, .audio.playing .i-play { display: none; }
.audio.playing .i-pause { display: block; }
.au-info { flex: 1; min-width: 0; }
.au-title { display: block; font-weight: 800; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-bar { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.14); cursor: pointer; }
.au-bar::before { content: ""; position: absolute; inset: -10px 0; }
.au-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); border-radius: 6px; background: var(--grad); box-shadow: 0 0 12px rgba(177,60,255,.8); }
.au-times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===== Contacto ===== */
.contact { text-align: center; min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(50% 60% at 50% 60%, rgba(123,44,255,.2), transparent 70%); }
.mail { font-size: clamp(20px, 3.4vw, 46px); font-weight: 800; font-stretch: 110%; text-decoration: none; border-bottom: 3px solid var(--magenta); padding-bottom: 4px; word-break: break-all; }
.mail, .mail:visited, .mail:hover, .mail:focus, .mail:active { color: #fff; -webkit-tap-highlight-color: transparent; }

.footer { position: relative; z-index: 2; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 24px var(--pad); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ===== Animación al aparecer ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.tilt { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
