@font-face {
  font-family: "Geist";
  src: url("../fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Tipos: Bricolage Grotesque en titulos, Geist en texto, Geist Mono en etiquetas */
/* Tema oscuro unico. Acento de marca: #9900ff */
:root {
  --bg: #0b0810;
  --surface: #14101c;
  --surface-2: #1b1526;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f0fa;
  --muted: #aaa1ba;
  --accent: #9900ff;
  --accent-soft: #c58bff;
  --radius: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  --max: 1400px;
  /* capas: grain 60, nav 50, progress 55 */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 4px; border-radius: 6px; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 70;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 999px;
}
.skip:focus { top: 16px; }

.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 55;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transform: scaleX(0); transform-origin: left;
}
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Iconos (Phosphor) como mascara para heredar color */
.ico {
  display: inline-block; width: 1.15em; height: 1.15em; flex: none;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}
.ico--arrow { --src: url("../icons/ph-arrow-up-right.svg"); }
.ico--down { --src: url("../icons/ph-arrow-down.svg"); }
.ico--linkedin { --src: url("../icons/ph-linkedin-logo.svg"); }
.ico--github { --src: url("../icons/ph-github-logo.svg"); }

/* NAV */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 50;
  width: min(calc(100% - 28px), 980px); height: 60px;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 10px 0 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(17, 12, 25, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.5s var(--ease);
}
.nav.is-hidden { transform: translate(-50%, -90px); }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.nav__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
}
.nav__links { display: flex; gap: 28px; font-size: 15px; color: var(--muted); }
.nav__links a { position: relative; padding: 6px 0; transition: color 0.3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent-soft); transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__toggle {
  display: none; place-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04);
}
.nav__toggle span { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.35s var(--ease); }

/* BOTONES */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 14px 24px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 12px 32px -14px rgba(153, 0, 255, 0.9);
  transition: background 0.3s, box-shadow 0.3s;
  will-change: transform;
}
.btn:hover { background: #a826ff; }
.btn:active { scale: 0.98; }
.btn--ghost {
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: none;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn--small { padding: 10px 18px; font-size: 14px; }
.btn--big { padding: 18px 30px; font-size: 18px; }

.link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent-soft); font-weight: 600;
}
.link .ico { transition: transform 0.4s var(--ease); }
a:hover > .link .ico, .link:hover .ico { transform: translate(3px, -3px); }

.eyebrow {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-soft);
}

/* HERO */
.hero {
  position: relative; min-height: 100dvh;
  max-width: var(--max); margin: 0 auto; padding: 96px var(--pad) 48px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center; gap: clamp(24px, 4vw, 64px);
}
.hero__glow, .contact__glow {
  position: absolute; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(153, 0, 255, 0.34), rgba(153, 0, 255, 0) 65%);
}
.hero__glow { width: 900px; height: 900px; right: -260px; top: -180px; }
.hero__copy { position: relative; }
.hero__title {
  margin: 18px 0 26px;
  font-family: var(--display);
  font-size: clamp(2.3rem, 5.3vw, 5.5rem);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.035em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.1em; white-space: nowrap; }
.hero__title .line > span { display: block; }
.hero__title .line:last-child > span {
  background: linear-gradient(95deg, #fff 10%, var(--accent-soft) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { max-width: 46ch; color: var(--muted); font-size: clamp(1.05rem, 1.3vw, 1.25rem); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.hero__visual { position: relative; perspective: 1600px; }
.hero__stage {
  position: relative; aspect-ratio: 1 / 0.92;
  transform: rotateY(-20deg) rotateX(8deg) rotateZ(2deg);
  transform-style: preserve-3d;
}
.shot {
  position: absolute; width: 92%; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 40px 80px -30px rgba(40, 0, 70, 0.9), 0 0 0 1px rgba(153, 0, 255, 0.12);
  will-change: transform;
}
.shot--1 { left: 0; top: 30%; }
.shot--2 { left: 12%; top: 12%; opacity: 0.9; }
.shot--3 { left: 24%; top: -6%; opacity: 0.75; }

/* SECCIONES */
.section { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(90px, 13vw, 180px) var(--pad); }
.section__head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 80px); }
.h2 { font-family: var(--display); font-size: clamp(2.3rem, 5.2vw, 4.4rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.lead { margin-top: 20px; max-width: 58ch; color: var(--muted); font-size: clamp(1.05rem, 1.25vw, 1.2rem); }
.lead + .lead { margin-top: 10px; }

/* STACK DE PROYECTOS */
.stack { display: grid; gap: 28px; }
.card {
  position: sticky; top: calc(92px + var(--i) * 16px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
  min-height: min(620px, 76vh);
  padding: clamp(24px, 3.4vw, 52px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 -24px 60px -30px rgba(0, 0, 0, 0.9);
  transform-origin: 50% 0;
  will-change: transform;
}
.card__status { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; color: var(--accent-soft); }
.card__title { margin: 14px 0 20px; font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.025em; }
.card__text { color: var(--muted); max-width: 46ch; }
.card__text + .card__text { margin-top: 10px; }
.card__apis { margin-top: 20px; font-size: 14.5px; line-height: 1.6; color: #d9d1e6; max-width: 46ch; }
.card__apis span {
  display: block; margin-bottom: 4px;
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-soft);
}
.card .link { margin-top: 26px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tags li {
  padding: 6px 13px; border-radius: 999px; font-size: 13.5px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: #d9d1e6;
}
.card__media { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform 1.2s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }

/* INICIOS */
.early__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.early__intro { position: sticky; top: 120px; }
.feature {
  display: block; padding: clamp(26px, 3.4vw, 48px);
  border-radius: var(--radius); border: 1px solid rgba(153, 0, 255, 0.45);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(153, 0, 255, 0.42), transparent 62%),
    var(--surface);
  transition: border-color 0.4s, transform 0.6s var(--ease);
}
.feature:hover { border-color: var(--accent-soft); transform: translateY(-4px); }
.feature__title { margin: 16px 0 14px; font-family: var(--display); font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.feature__text { color: #d5cbe3; max-width: 52ch; }
.feature .tags { margin-top: 22px; }
.rows { margin-top: 18px; }
.rows a {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto auto;
  align-items: center; gap: 18px; padding: 24px 6px;
  border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease), background 0.4s;
}
.rows a:hover { padding-left: 18px; padding-right: 18px; background: rgba(153, 0, 255, 0.08); }
.rows__name { font-family: var(--display); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
.rows__desc { color: var(--muted); font-size: 15.5px; }
.rows__tech { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; color: var(--muted); }
.rows .ico { color: var(--accent-soft); transition: transform 0.4s var(--ease); }
.rows a:hover .ico { transform: translate(3px, -3px); }

/* SOBRE MI */
.about { max-width: none; padding-left: 0; padding-right: 0; }
.about__grid {
  max-width: 1180px; margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px); align-items: center;
}
.about__photo { margin: 0; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.about__photo img { width: 100%; height: 100%; object-fit: cover; }
.about__text { font-family: var(--display); font-size: clamp(1.5rem, 2.9vw, 2.5rem); font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
.about__text p + p { margin-top: 0.75em; }
.about__text .w { opacity: 1; }
.marquee {
  margin-top: clamp(60px, 9vw, 120px); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; width: max-content; gap: clamp(48px, 7vw, 96px); padding-right: clamp(48px, 7vw, 96px); }
.marquee__track img { width: 40px; height: 40px; opacity: 0.6; transition: opacity 0.3s; }
.marquee__track img:hover { opacity: 1; }

/* CONTACTO */
.contact { text-align: center; display: grid; justify-items: center; overflow: hidden; }
.contact__glow { width: 1000px; height: 1000px; left: 50%; bottom: -620px; transform: translateX(-50%); }
.contact__title { position: relative; font-family: var(--display); font-size: clamp(2.6rem, 8.4vw, 7.4rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.04em; }
.contact .lead { position: relative; }
.contact__cta { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 40px; }

.contact__mail { position: relative; margin-top: 28px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color 0.3s, border-color 0.3s; }
.contact__mail:hover { color: var(--text); border-color: var(--accent-soft); }

.footer {
  max-width: var(--max); margin: 0 auto; padding: 28px var(--pad) 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px;
}
.footer a:hover { color: var(--text); }

/* MOVIL */
@media (max-width: 900px) {
  .nav .btn--small { margin-left: auto; }
  .nav__toggle { display: grid; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: calc(100% + 10px);
    flex-direction: column; gap: 0; padding: 10px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: #130e1c; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9);
    font-size: 17px; color: var(--text);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.4s var(--ease), visibility 0.3s;
  }
  .nav__links a { padding: 14px 16px; border-radius: 14px; }
  .nav__links a::after { display: none; }
  .nav__links a:active { background: rgba(153, 0, 255, 0.16); }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .hero { grid-template-columns: 1fr; padding-top: 110px; gap: 40px; }
  .hero__visual { order: 2; padding: 0 6% 12%; }
  .hero__stage { aspect-ratio: 1 / 0.8; }
  .card { position: relative; top: auto; grid-template-columns: 1fr; min-height: 0; }
  .early__grid { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: 220px; }
  .hero__title { font-size: clamp(2rem, 10.2vw, 4.2rem); }
  .early__intro { position: static; }
  .rows a { grid-template-columns: 1fr auto; row-gap: 4px; }
  .rows__desc { grid-column: 1; grid-row: 2; }
  .rows__tech { display: none; }
  .rows .ico { grid-column: 2; grid-row: 1 / span 2; }
  .btn--big { padding: 16px 24px; font-size: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: marquee 32s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: no-preference) {
  .nav { animation: nav-in 1s var(--ease) 0.5s backwards; }
}
@keyframes nav-in { from { opacity: 0; transform: translate(-50%, -80px); } }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { flex-wrap: wrap; width: auto; justify-content: center; padding: 0 var(--pad); }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  * { transition-duration: 0.01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: #110c19; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
