:root {
  --bg: #07060d;
  --bg2: #0e0c18;
  --text: #f4f2ff;
  --muted: #9a95b3;
  --line: rgba(255, 255, 255, 0.1);
  --violet: #7c3aed;
  --indigo: #6d5cf6;
  --cyan: #22d3ee;
  --grad: linear-gradient(100deg, #a78bfa 0%, #6d5cf6 40%, #22d3ee 100%);
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); font-size: 17px; line-height: 1.55; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
::selection { background: var(--violet); color: #fff; }

/* ---------- capas fijas ---------- */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
main, .footer { position: relative; z-index: 1; }
.grain {
  position: fixed; inset: -50%; z-index: 2; 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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -2%); } }

/* ---------- carga ---------- */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-content: center; justify-items: center; gap: 18px; }
.loader img { animation: spin 2.4s var(--ease) infinite; }
@keyframes spin { 50% { transform: rotate(180deg) scale(0.9); } 100% { transform: rotate(360deg); } }
.loader-num { font-family: var(--display); font-size: clamp(48px, 10vw, 120px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.loader-bar { width: min(260px, 60vw); height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--grad); }

/* ---------- cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: #fff; mix-blend-mode: difference; display: grid; place-items: center;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background 0.3s;
}
.cursor span { font: 600 12px var(--body); color: #000; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
.cursor.hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.cursor.label { width: 92px; height: 92px; margin: -46px 0 0 -46px; mix-blend-mode: normal; background: var(--cyan); }
.cursor.label span { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- navegación ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 24px;
  padding: 18px var(--gutter); transition: transform 0.5s var(--ease), background 0.4s, backdrop-filter 0.4s;
}
.nav.scrolled { background: rgba(7, 6, 13, 0.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav.hidden { transform: translateY(-110%); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin-right: auto; }
.links { display: flex; gap: 30px; font-size: 15px; font-weight: 600; color: var(--muted); }
.links a { position: relative; transition: color 0.3s; }
.links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease); }
.links a:hover { color: var(--text); }
.links a:hover::after { transform: scaleX(1); transform-origin: left; }
.pill { padding: 11px 20px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; display: inline-flex; gap: 8px; }
.burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.burger i { display: block; width: 18px; height: 2px; background: var(--text); transition: transform 0.4s var(--ease); }
.burger[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }
.menu {
  position: fixed; inset: 0; z-index: 45; background: rgba(7, 6, 13, 0.96); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 100px var(--gutter) 40px;
}
.menu[hidden] { display: none; }
.menu a { font-family: var(--display); font-size: clamp(36px, 10vw, 64px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.menu .menu-cta { margin-top: 28px; font-family: var(--body); font-size: 18px; font-weight: 700; padding: 18px 24px; border-radius: 999px; background: var(--grad); text-align: center; color: #fff; }

/* ---------- comunes ---------- */
section { padding: clamp(90px, 14vw, 180px) var(--gutter); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.line > span { display: inline-block; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
em { font-style: normal; color: var(--muted); }
.section-head { display: grid; gap: 22px; margin-bottom: clamp(48px, 7vw, 90px); }
.section-title { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 9vw, 140px); line-height: 0.95; letter-spacing: -0.05em; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 18px 30px; border-radius: 999px;
  font-weight: 700; font-size: 16px; overflow: hidden; isolation: isolate; transition: color 0.4s var(--ease);
}
.btn span { position: relative; z-index: 1; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 20px 60px -20px rgba(109, 92, 246, 0.8); }
.btn.ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: 0; background: var(--text); border-radius: inherit; transform: translateY(101%); transition: transform 0.55s var(--ease); }
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--bg); }
.btn.big { padding: 24px 44px; font-size: 19px; }

/* ---------- hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; gap: 34px; padding-top: 130px; padding-bottom: 60px; position: relative; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: clamp(42px, 7vw, 122px); line-height: 0.96; letter-spacing: -0.055em; max-width: 13ch; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.hero-sub { max-width: 46ch; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); }
.hero-sub strong { color: var(--text); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.scroll-hint { position: absolute; right: var(--gutter); top: 50%; writing-mode: vertical-rl; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 14px; }
.scroll-hint i { width: 1px; height: 60px; background: linear-gradient(var(--cyan), transparent); animation: drip 2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- marquesina ---------- */
.marquee { padding: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: rgba(7, 6, 13, 0.55); backdrop-filter: blur(6px); }
.marquee-track { display: flex; align-items: center; gap: 40px; width: max-content; font-family: var(--display); font-weight: 600; font-size: clamp(36px, 6vw, 90px); letter-spacing: -0.04em; white-space: nowrap; will-change: transform; }
.marquee-track span:nth-of-type(even) { -webkit-text-stroke: 1.5px var(--text); color: transparent; }
.marquee-track b { font-size: 0.45em; color: var(--cyan); }

/* ---------- manifiesto ---------- */
.manifesto { display: grid; gap: 40px; }
.manifesto-text { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 4.6vw, 72px); line-height: 1.12; letter-spacing: -0.04em; max-width: 22ch; }
.manifesto-text .w { opacity: 0.14; transition: opacity 0.2s; }

/* ---------- servicios ---------- */
.svc-list { border-top: 1px solid var(--line); }
.svc {
  position: relative; display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 24px;
  padding: clamp(26px, 3.4vw, 46px) 0; border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate;
}
.svc::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad); transform: scaleY(0); transform-origin: bottom; transition: transform 0.6s var(--ease); }
.svc:hover::before { transform: scaleY(1); }
.svc-n { font-family: var(--display); font-size: 15px; color: var(--muted); transition: color 0.4s, transform 0.6s var(--ease); }
.svc h3 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.4vw, 68px); letter-spacing: -0.045em; line-height: 1; transition: transform 0.6s var(--ease); }
.svc p { color: var(--muted); margin-top: 10px; max-width: 52ch; transition: color 0.4s; }
.svc-price { font-size: 15px; color: var(--muted); text-align: right; white-space: nowrap; transition: color 0.4s; }
.svc-price b { display: block; font-family: var(--display); font-size: clamp(20px, 2vw, 28px); color: var(--text); letter-spacing: -0.03em; }
.svc:hover h3 { transform: translateX(18px); }
.svc:hover .svc-n { transform: translateX(10px); }
.svc:hover .svc-n, .svc:hover p, .svc:hover .svc-price { color: rgba(255, 255, 255, 0.85); }

/* ---------- proyectos ---------- */
.projects { display: grid; gap: clamp(28px, 4vw, 48px); }
.project {
  position: sticky; top: 90px; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(24px, 4vw, 56px); border-radius: clamp(24px, 3vw, 40px); overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--p1) 38%, transparent), transparent 60%), var(--bg2);
  border: 1px solid var(--line); min-height: min(78vh, 720px); max-height: calc(100vh - 110px); transform-origin: center top;
}
.project-link { position: absolute; inset: 0; z-index: 5; }
.project-n { font-family: var(--display); font-size: 14px; color: var(--muted); }
.project h3 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4vw, 66px); letter-spacing: -0.05em; line-height: 0.95; margin: 14px 0 20px; }
.project h3 span { color: var(--p2); display: block; }
.project p { color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); max-width: 44ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 30px; }
.tags li { font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.project-go { font-weight: 700; display: inline-flex; gap: 8px; border-bottom: 1px solid var(--p2); padding-bottom: 4px; }
.project-go b { transition: transform 0.4s var(--ease); }
.project:hover .project-go b { transform: translate(4px, -4px); }
.project-media { position: relative; padding: 0 9% 8% 0; width: 100%; max-width: calc((100vh - 230px) * 1.45); justify-self: end; }
.browser img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.browser { border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8); transition: transform 0.8s var(--ease); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #1b1928; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3650; }
.browser-bar span { margin-left: 12px; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.05); padding: 3px 12px; border-radius: 6px; }
.phone {
  position: absolute; right: 0; bottom: 0; width: 26%; aspect-ratio: 390 / 844; border-radius: 26px; overflow: hidden;
  border: 6px solid #111; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9); transition: transform 0.8s var(--ease);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project:hover .browser { transform: translateY(-8px) rotate(-0.6deg); }
.project:hover .phone { transform: translateY(-18px) rotate(2deg); }
.work-next { margin-top: 60px; text-align: center; font-family: var(--display); font-size: clamp(20px, 2.4vw, 32px); color: var(--muted); letter-spacing: -0.03em; }

/* ---------- proceso ---------- */
.process { padding-left: 0; padding-right: 0; }
.process .section-head { padding: 0 var(--gutter); }
.steps { display: flex; gap: 24px; padding: 0 var(--gutter); width: max-content; }
.step {
  width: min(420px, 78vw); min-height: 340px; padding: 34px; border-radius: 28px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.04) 60%), var(--bg2);
  display: flex; flex-direction: column; justify-content: space-between;
}
.step span { font-family: var(--display); font-size: clamp(64px, 7vw, 110px); font-weight: 700; letter-spacing: -0.06em; line-height: 1; -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.35); color: transparent; }
.step h3 { font-family: var(--display); font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -0.04em; margin: 30px 0 10px; }
.step p { color: var(--muted); }

/* ---------- por qué ---------- */
.why { padding-top: 40px; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.why-item { padding: 40px 24px 40px 0; display: grid; gap: 10px; border-right: 1px solid var(--line); }
.why-item + .why-item { padding-left: 24px; }
.why-item:last-child { border-right: 0; }
.why-item b { font-family: var(--display); font-size: clamp(44px, 5vw, 80px); letter-spacing: -0.05em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.why-item span { color: var(--muted); max-width: 22ch; }

/* ---------- contacto ---------- */
.contact { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 30px; }
.contact-title { font-family: var(--display); font-weight: 700; font-size: clamp(52px, 11vw, 190px); line-height: 0.92; letter-spacing: -0.06em; }
.contact-sub { color: var(--muted); max-width: 48ch; font-size: clamp(17px, 1.5vw, 20px); }

/* ---------- pie ---------- */
.footer { padding: 0 var(--gutter); border-top: 1px solid var(--line); overflow: hidden; }
.footer-row { display: flex; justify-content: space-between; padding: 26px 0; color: var(--muted); font-size: 14px; }
.wordmark {
  font-family: var(--display); font-weight: 800; font-size: 17.2vw; line-height: 0.8; letter-spacing: -0.07em; text-align: center;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: -2vw; user-select: none;
}

.mobile-cta { display: none; }

/* ---------- celular y tablet ---------- */
@media (max-width: 900px) {
  .links, .nav .pill { display: none; }
  .burger { display: flex; }
  .scroll-hint { display: none; }
  .hero { justify-content: flex-end; gap: 24px; padding-bottom: 36px; }
  .hero-title { font-size: clamp(34px, 10.2vw, 64px); max-width: none; }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn { flex: 1 1 100%; }
  .hero-ctas .ghost { display: none; }
  .svc { grid-template-columns: 1fr; gap: 6px; }
  .svc-n { display: none; }
  .svc-price { text-align: left; display: flex; gap: 8px; align-items: baseline; margin-top: 8px; }
  .svc-price b { display: inline; }
  .project { grid-template-columns: 1fr; position: relative; top: 0; min-height: 0; max-height: none; }
  .project-media { max-width: none; }
  .project-media { order: -1; }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .why-item { padding: 28px 16px 28px 0; border-bottom: 1px solid var(--line); }
  .why-item:nth-child(2n) { border-right: 0; padding-left: 16px; }
  .why-item:nth-child(3) { padding-left: 0; }
  .steps { flex-direction: column; width: auto; }
  .step { width: auto; min-height: 0; }
  .step h3 { margin-top: 18px; }
  .mobile-cta {
    display: block; position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
    padding: 17px; border-radius: 999px; text-align: center; font-weight: 700; background: var(--grad); color: #fff;
    box-shadow: 0 18px 50px -12px rgba(109, 92, 246, 0.9); transform: translateY(160%); transition: transform 0.5s var(--ease);
  }
  .mobile-cta.on { transform: none; }
  .footer { padding-bottom: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .manifesto-text .w { opacity: 1; }
}
