/* ==========================================================
   Webcodecol — Estilos principales
   ========================================================== */
:root {
  --bg: #060913;
  --bg-2: #0a0f1e;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e8ecf5;
  --muted: #8b95ab;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --grad: linear-gradient(120deg, var(--cyan), var(--violet) 55%, var(--pink));
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Space Grotesk', var(--font);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --particle-rgb: 148, 163, 255;
  --line-rgb: 139, 92, 246;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--violet); color: #fff; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--mono); }

.gradient-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s linear infinite;
}
@keyframes gradientShift { to { background-position: 200% center; } }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: grid; place-content: center; gap: 22px; justify-items: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader__logo { font-family: var(--mono); font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 500; }
.preloader__logo .bracket { color: var(--cyan); }
.preloader__text { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; width: 0; animation: typeIn 1s steps(10) .2s forwards; }
@keyframes typeIn { to { width: 10ch; } }
.preloader__bar { width: 180px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--grad); animation: load 1.3s var(--ease) forwards; }
@keyframes load { to { width: 100%; } }

/* ---------- Cursor glow ---------- */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 480px; height: 480px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(139, 92, 246, .12), transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
  overflow: hidden; isolation: isolate;
}
.btn--primary { background: var(--grad); background-size: 150% auto; color: #fff; box-shadow: 0 10px 30px -10px rgba(139, 92, 246, .6); }
.btn--primary:hover { box-shadow: 0 16px 40px -10px rgba(139, 92, 246, .8); background-position: right center; }
.btn--primary::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .8s var(--ease);
}
.btn--primary:hover::after { transform: translateX(100%); }
.btn--ghost { border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: rgba(34, 211, 238, .5); background: var(--surface-2); }
.btn--sm { padding: 10px 20px; font-size: .88rem; }
.btn--lg { padding: 18px 34px; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px 0; transition: padding .4s var(--ease), background .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
/* El desenfoque va en una capa aparte: si estuviera en .header, el menú
   móvil (position: fixed) quedaría atrapado dentro del header */
.header::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: var(--header-bg, rgba(6, 9, 19, .75)); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.header.is-scrolled { padding: 12px 0; border-color: var(--border); }
.header.is-scrolled::before { opacity: 1; }
.header__inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.35rem; font-weight: 600; }
.logo__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); color: #fff; font-family: var(--mono); font-size: .85rem; font-weight: 500;
  box-shadow: 0 6px 20px -6px rgba(34, 211, 238, .6);
}
.logo__text strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav__link { position: relative; font-size: .93rem; color: var(--muted); transition: color .3s; }
.nav__link::after { content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 100%; background: var(--grad); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav__link:hover, .nav__link.is-active { color: var(--text); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle { display: none; width: 42px; height: 42px; position: relative; z-index: 110; }
.menu-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .4s var(--ease), opacity .3s; }
.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 20px; }
.menu-toggle span:nth-child(3) { top: 26px; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 140px 0 100px; overflow: hidden; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__grid {
  position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.hero__blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; z-index: 0; animation: float 14s ease-in-out infinite; }
.hero__blob--1 { width: 520px; height: 520px; background: var(--violet); top: -120px; right: -100px; }
.hero__blob--2 { width: 420px; height: 420px; background: var(--cyan); bottom: -140px; left: -120px; opacity: .3; animation-delay: -7s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.1); } }

.hero__inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: .85rem; color: var(--muted); backdrop-filter: blur(8px);
}
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.hero__title { font-family: var(--display); font-size: clamp(2.4rem, 5.4vw, 4.4rem); line-height: 1.07; letter-spacing: -.03em; margin: 26px 0 22px; font-weight: 700; }
.caret { color: var(--cyan); font-weight: 400; animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero__subtitle { font-size: 1.1rem; color: var(--muted); max-width: 540px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero__stats { display: flex; gap: 44px; margin-top: 54px; flex-wrap: wrap; }
.stat { display: grid; grid-template-columns: auto 1fr; justify-content: start; align-items: baseline; }
.stat__num, .stat__plus { font-family: var(--display); font-size: 2.3rem; font-weight: 700; }
.stat__plus { color: var(--cyan); }
.stat__label { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }

.hero__visual { position: relative; perspective: 1000px; }
.code-window {
  background: rgba(13, 18, 35, .8); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(20px); box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(139,92,246,.1), 0 0 80px -20px rgba(139,92,246,.35);
  overflow: hidden; transform-style: preserve-3d; transition: transform .2s ease-out;
}
.code-window__bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--red { background: #ff5f57; } .dot--yellow { background: #febc2e; } .dot--green { background: #28c840; }
.code-window__title { margin-left: 12px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.code-window__body { padding: 24px; font-family: var(--mono); font-size: .88rem; line-height: 1.75; min-height: 340px; white-space: pre-wrap; color: #cbd5e1; }
.tok-k { color: #c084fc; } .tok-f { color: var(--cyan); } .tok-s { color: #86efac; } .tok-c { color: #64748b; font-style: italic; } .tok-n { color: #fbbf24; } .tok-p { color: #f472b6; }
.code-cursor { display: inline-block; width: 8px; height: 1.1em; background: var(--cyan); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }

.floating-card {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: rgba(15, 20, 40, .85); border: 1px solid var(--border); border-radius: 14px;
  backdrop-filter: blur(16px); box-shadow: 0 20px 40px -15px rgba(0,0,0,.6);
  animation: bob 5s ease-in-out infinite;
}
.floating-card strong { display: block; font-family: var(--display); font-size: 1rem; }
.floating-card span { font-size: .78rem; color: var(--muted); }
.floating-card__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-size: 1.1rem; }
.floating-card--1 { top: -24px; right: -20px; }
.floating-card--2 { bottom: -28px; left: -30px; animation-delay: -2.5s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.scroll-indicator { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2; }
.scroll-indicator__mouse { display: block; width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.3); border-radius: 14px; position: relative; }
.scroll-indicator__mouse span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; background: var(--cyan); border-radius: 2px; animation: scrollWheel 1.8s infinite; }
@keyframes scrollWheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--border); background: var(--bg-2); padding: 22px 0; overflow: hidden; position: relative; z-index: 1; }
.marquee__track { display: flex; gap: 40px; width: max-content; animation: marquee 30s linear infinite; font-family: var(--display); font-size: 1.4rem; font-weight: 600; white-space: nowrap; }
.marquee__track span:nth-child(even) { color: var(--violet); }
.marquee__track span:nth-child(odd) { color: rgba(232, 236, 245, .5); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: 120px 0; z-index: 1; }
.section--alt { background: var(--bg-2); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 64px; }
.eyebrow { display: inline-block; font-family: var(--mono); font-size: .88rem; color: var(--cyan); margin-bottom: 14px; }
.section__title { font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.section__desc { color: var(--muted); font-size: 1.08rem; margin-top: 18px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  position: relative; padding: 36px 30px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: border-color .4s, background .4s, transform .2s ease-out;
  transform-style: preserve-3d;
}
.service-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, .15), transparent 40%);
}
.service-card:hover { border-color: rgba(139, 92, 246, .4); }
.service-card:hover::before { opacity: 1; }
.service-card > * { position: relative; }
.service-card__icon {
  width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(34,211,238,.15), rgba(139,92,246,.15)); border: 1px solid rgba(139,92,246,.25); color: var(--cyan);
  transition: transform .5s var(--ease);
}
.service-card__icon svg { width: 28px; height: 28px; }
.service-card:hover .service-card__icon { transform: rotate(-8deg) scale(1.1); }
.service-card h3 { font-family: var(--display); font-size: 1.35rem; margin-bottom: 12px; }
.service-card p { color: var(--muted); font-size: .96rem; }
.service-card__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.service-card__list li { font-size: .78rem; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: #c4cbe0; border: 1px solid var(--border); }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.timeline__line { position: absolute; top: 32px; left: 32px; right: 32px; height: 2px; background: var(--border); }
.timeline__progress { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 20px var(--violet); transition: width .1s linear; }
.step { position: relative; }
.step__num {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 26px;
  background: var(--bg-2); border: 2px solid var(--border); font-family: var(--mono); font-weight: 500; font-size: 1.05rem;
  position: relative; z-index: 1; transition: border-color .5s, box-shadow .5s, color .5s;
}
.step.is-active .step__num { border-color: var(--violet); color: var(--cyan); box-shadow: 0 0 0 6px rgba(139,92,246,.12), 0 0 30px rgba(139,92,246,.4); }
.step h3 { font-family: var(--display); font-size: 1.25rem; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: .95rem; }

/* ---------- Projects ---------- */
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 48px; }
.filter { padding: 10px 22px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9rem; transition: all .3s var(--ease); }
.filter:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.filter.is-active { background: var(--grad); color: #fff; border-color: transparent; }
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.project { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: opacity .5s var(--ease), transform .5s var(--ease), border-color .4s; }
.project:hover { border-color: rgba(34, 211, 238, .35); }
.project.is-hidden { display: none; }
.project__media { height: 230px; position: relative; overflow: hidden; display: grid; place-items: center; }
.project__media--1 { background: linear-gradient(135deg, #7c3aed, #22d3ee); }
.project__media--2 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.project__media--3 { background: linear-gradient(135deg, #0ea5e9, #10b981); }
.project__media--4 { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.project__media--5 { background: linear-gradient(135deg, #10b981, #6366f1); }
.project__media--6 { background: linear-gradient(135deg, #6366f1, #22d3ee); }
.mock { width: 72%; height: 70%; background: rgba(255,255,255,.92); border-radius: 10px; padding: 12px; box-shadow: 0 20px 40px -10px rgba(0,0,0,.4); transition: transform .7s var(--ease); display: flex; gap: 5px; flex-wrap: wrap; align-content: flex-start; }
.mock > span { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.mock__lines { width: 100%; margin-top: 14px; display: grid; gap: 8px; }
.mock__lines i { display: block; height: 10px; border-radius: 5px; background: #e5e7eb; }
.mock__lines i:first-child { width: 60%; height: 16px; background: #c7d2fe; }
.mock__lines i:nth-child(2) { width: 90%; }
.mock__lines i:nth-child(3) { width: 75%; }
.mock--phone { width: 36%; height: 84%; border-radius: 18px; }
.mock--dash { align-items: flex-end; }
.bars { width: 100%; height: 100%; display: flex; align-items: flex-end; gap: 8px; }
.bars i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(to top, #8b5cf6, #22d3ee); height: 30%; transition: height .8s var(--ease); }
.bars i:nth-child(2) { height: 55%; } .bars i:nth-child(3) { height: 40%; } .bars i:nth-child(4) { height: 75%; } .bars i:nth-child(5) { height: 60%; }
.project:hover .mock { transform: translateY(-8px) scale(1.04) rotate(-1.5deg); }
.project:hover .bars i:nth-child(1) { height: 50%; } .project:hover .bars i:nth-child(2) { height: 35%; } .project:hover .bars i:nth-child(3) { height: 85%; } .project:hover .bars i:nth-child(4) { height: 60%; } .project:hover .bars i:nth-child(5) { height: 95%; }
.project__media--shot { background: #0b1020; place-items: stretch; }
.project__media--shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .8s var(--ease); }
.project__media--shot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6,9,19,.45), transparent 45%); pointer-events: none; }
.project:hover .project__media--shot img { transform: scale(1.06); }
.project__info { padding: 24px 26px 28px; }
.project__stack { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.project__stack li { font-family: var(--mono); font-size: .72rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: #c4cbe0; }
.project__tag { font-family: var(--mono); font-size: .76rem; color: var(--cyan); }
.project__info h3 { font-family: var(--display); font-size: 1.3rem; margin: 8px 0; }
.project__info p { color: var(--muted); font-size: .93rem; }

/* ---------- Tech ---------- */
.tech-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.tech {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 12px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  font-size: .9rem; font-weight: 500; color: var(--muted);
  transition: transform .4s var(--ease), border-color .4s, color .4s, opacity .9s var(--ease);
}
.tech__logo { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); transition: box-shadow .4s; }
.tech.is-visible:hover { transform: translateY(-8px); border-color: rgba(255,255,255,.2); color: var(--text); }
.tech:hover .tech__logo { box-shadow: 0 0 30px -4px var(--c); }

/* ---------- Testimonials ---------- */
.slider { max-width: 820px; margin: 0 auto; overflow: hidden; }
.slider__track { display: flex; transition: transform .8s var(--ease); }
.testimonial { flex: 0 0 100%; padding: 48px; text-align: center; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stars { color: #fbbf24; letter-spacing: 4px; font-size: 1.1rem; margin-bottom: 22px; }
.testimonial blockquote { font-family: var(--display); font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.5; font-weight: 500; }
.testimonial figcaption { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; text-align: left; }
.testimonial figcaption strong { display: block; }
.testimonial figcaption span { font-size: .88rem; color: var(--muted); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff !important; font-weight: 600; font-size: .95rem !important; }
.slider__dots { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.slider__dots button { width: 10px; height: 10px; border-radius: 999px; background: var(--border); transition: width .4s var(--ease), background .4s; }
.slider__dots button.is-active { width: 34px; background: var(--grad); }

/* ---------- CTA ---------- */
.cta { padding: 40px 0; position: relative; z-index: 1; }
.cta__box {
  position: relative; overflow: hidden; text-align: center; padding: 80px 40px; border-radius: 28px;
  background: linear-gradient(135deg, rgba(34,211,238,.1), rgba(139,92,246,.15)); border: 1px solid rgba(139,92,246,.3);
}
.cta__glow { position: absolute; width: 600px; height: 600px; left: 50%; top: 50%; transform: translate(-50%, -50%); background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--pink), var(--cyan)); filter: blur(120px); opacity: .25; animation: spin 12s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.cta__box > *:not(.cta__glow) { position: relative; }
.cta h2 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; max-width: 760px; margin: 0 auto; }
.cta p { color: var(--muted); margin: 18px 0 34px; font-size: 1.08rem; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 70px; align-items: start; }
.contact .section__title, .contact .section__desc { text-align: left; }
.contact__list { list-style: none; margin-top: 40px; display: grid; gap: 22px; }
.contact__list li { display: flex; align-items: center; gap: 16px; }
.contact__icon { width: 50px; height: 50px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--cyan); font-size: 1.2rem; }
.contact__list small { display: block; color: var(--muted); font-size: .8rem; }
.contact__list a:hover { color: var(--cyan); }
.form { padding: 40px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 20px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { position: relative; }
.field input, .field textarea, .field select {
  width: 100%; padding: 22px 18px 10px; border-radius: 12px; font: inherit; color: var(--text);
  background: rgba(0,0,0,.25); border: 1px solid var(--border); outline: none; resize: vertical;
  transition: border-color .3s, box-shadow .3s; appearance: none;
}
.field select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95ab' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; }
.field select option { background: var(--bg-2); color: var(--text); }
.field label { position: absolute; left: 18px; top: 17px; color: var(--muted); pointer-events: none; transition: all .25s var(--ease); font-size: .95rem; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139,92,246,.15); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field select:focus + label, .field select:valid + label { top: 7px; font-size: .72rem; color: var(--cyan); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #f43f5e; }
.form__status { font-size: .92rem; text-align: center; min-height: 1.4em; }
.form__status.is-success { color: #4ade80; }
.form__status.is-error { color: #fb7185; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 70px 0 30px; background: var(--bg-2); }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer__brand p { color: var(--muted); margin-top: 18px; max-width: 320px; font-size: .94rem; }
.footer__col h4 { font-family: var(--display); margin-bottom: 18px; font-size: 1rem; }
.footer__col a { display: block; color: var(--muted); font-size: .92rem; margin-bottom: 10px; transition: color .3s, transform .3s; }
.footer__col a:hover { color: var(--text); transform: translateX(4px); }
.socials { display: flex; gap: 12px; }
.socials a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin: 0; }
.socials a:hover { background: var(--grad); color: #fff; transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 50px; padding-top: 26px; border-top: 1px solid var(--border); color: var(--muted); font-size: .86rem; }

.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 1.2rem; font-weight: 700;
  box-shadow: 0 10px 30px -8px rgba(139,92,246,.7);
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: all .4s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }

/* ---------- Motion (js/motion-fx.js) ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
  box-shadow: 0 0 12px rgba(139, 92, 246, .7); pointer-events: none;
}
.word-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.word { display: inline-block; will-change: transform; }

/* ---------- Responsive ---------- */
.txt-short { display: none; }
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 80px; }
  .hero__visual { max-width: 560px; margin: 0 auto; width: 100%; }
  .services, .projects { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(4, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); row-gap: 50px; }
  .timeline__line { display: none; }
  .contact { grid-template-columns: 1fr; gap: 50px; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .logo { position: relative; z-index: 110; }
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 28px;
    background: rgba(6, 9, 19, .97); backdrop-filter: blur(20px);
    clip-path: circle(0 at calc(100% - 40px) 40px); transition: clip-path .7s var(--ease);
  }
  .nav.is-open { clip-path: circle(150% at calc(100% - 40px) 40px); }
  .nav__link { font-size: 1.5rem; font-family: var(--display); color: var(--text); }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .section { padding: 72px 0; }
  .section__head { margin-bottom: 40px; }
  .section__desc { font-size: 1rem; margin-top: 14px; }
  .services, .projects, .form__row { grid-template-columns: 1fr; }

  /* Header */
  .header { padding: 14px 0; }
  .header.is-scrolled { padding: 10px 0; }
  .logo { font-size: 1.2rem; }
  .logo__mark { width: 34px; height: 34px; }

  /* Hero */
  .hero { min-height: auto; padding: 108px 0 64px; }
  .hero__inner { gap: 56px; }
  .badge { font-size: .76rem; padding: 6px 12px; gap: 8px; }
  .hero__title { font-size: clamp(2.05rem, 9.6vw, 2.6rem); margin: 20px 0 16px; min-height: 4.4em; }
  .hero__subtitle { font-size: 1rem; }
  .hero__actions { margin-top: 28px; gap: 10px; }
  .hero__actions .btn { flex: 1 1 auto; padding: 14px 16px; font-size: .92rem; white-space: nowrap; }
  .hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 40px; }
  .stat__num, .stat__plus { font-size: 1.7rem; }
  .stat__label { font-size: .76rem; line-height: 1.35; }
  .code-window__bar { padding: 12px 14px; }
  .code-window__body { font-size: .72rem; line-height: 1.7; padding: 16px; min-height: 230px; }
  .floating-card { padding: 10px 12px; gap: 10px; border-radius: 12px; }
  .floating-card__icon { width: 30px; height: 30px; font-size: .95rem; }
  .floating-card strong { font-size: .88rem; }
  .floating-card--1 { top: -20px; right: -4px; }
  .floating-card--2 { bottom: -22px; left: -4px; }
  .scroll-indicator { display: none; }
  .marquee { padding: 16px 0; }
  .marquee__track { font-size: 1.1rem; gap: 28px; }

  /* Servicios */
  .service-card { padding: 28px 22px; }
  .service-card__icon { width: 50px; height: 50px; margin-bottom: 18px; }

  /* Proceso: línea de tiempo vertical */
  .timeline { grid-template-columns: 1fr; row-gap: 0; }
  .step { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding-bottom: 30px; }
  .step::before { content: ''; position: absolute; left: 25px; top: 52px; bottom: 0; width: 2px; background: var(--border); }
  .step:last-child { padding-bottom: 0; }
  .step:last-child::before { display: none; }
  .step__num { width: 52px; height: 52px; margin-bottom: 0; font-size: .95rem; }
  .step h3 { font-size: 1.12rem; margin: 12px 0 6px; }

  /* Portafolio: filtros deslizables */
  .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -16px 32px; padding: 2px 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex-shrink: 0; padding: 9px 18px; }
  .project__media { height: 190px; }
  .project__info { padding: 20px 20px 24px; }

  /* Tecnologías */
  .tech-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .tech { padding: 18px 6px; gap: 10px; font-size: .8rem; }
  .tech__logo { width: 44px; height: 44px; font-size: 1.1rem; border-radius: 12px; }

  /* Testimonios */
  .testimonial { padding: 30px 20px; }
  .testimonial blockquote { font-size: 1.08rem; }
  .testimonial figcaption { margin-top: 22px; }

  /* CTA y contacto */
  .cta__box { padding: 52px 20px; border-radius: 22px; }
  .cta p { margin: 14px 0 26px; font-size: 1rem; }
  .cta .btn--lg { width: 100%; padding: 16px 20px; }
  .contact { gap: 36px; }
  .contact__list { margin-top: 28px; }
  .contact__list a, .contact__list span { word-break: break-word; }
  .form { padding: 22px 16px; border-radius: 20px; gap: 16px; }

  /* Footer en dos columnas */
  .footer { padding: 56px 0 26px; }
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .footer__brand, .footer__col:last-child { grid-column: 1 / -1; }
  .footer__bottom { flex-direction: column; align-items: center; text-align: center; margin-top: 36px; }

  /* Botón volver arriba */
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* ---------- Celular: menos texto, más aire ---------- */
@media (max-width: 640px) {
  .txt-long { display: none; }
  .txt-short { display: inline; }
  .hero__subtitle { font-size: 1.05rem; max-width: 30ch; }

  /* La ventana de código no aporta en pantallas pequeñas */
  .hero__visual { display: none; }
  .hero__inner { gap: 0; }
  .hero { padding-bottom: 48px; }
  .hero__stats { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }

  /* Encabezados de sección: solo título (excepto contacto) */
  #servicios .section__desc, #proceso .section__desc { display: none; }
  .section__head { margin-bottom: 32px; }
  .section__title { font-size: 1.85rem; }
  .eyebrow { font-size: .8rem; margin-bottom: 10px; }

  /* Servicios como lista compacta: ícono + título + una línea */
  .services { gap: 12px; }
  .service-card { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-items: start; padding: 18px; }
  .service-card__icon { width: 48px; height: 48px; margin: 0; grid-row: span 2; border-radius: 12px; }
  .service-card__icon svg { width: 24px; height: 24px; }
  .service-card h3 { font-size: 1.08rem; margin: 2px 0 4px; }
  .service-card p { font-size: .92rem; line-height: 1.5; }
  .service-card__list { display: none; }

  /* Proceso: descripciones más cortas */
  .step p { font-size: .9rem; }
  .step { padding-bottom: 22px; }

  /* Proyectos: imagen + nombre + 2 líneas */
  .projects { gap: 16px; }
  .project__media { height: 180px; }
  .project__info h3 { font-size: 1.15rem; margin: 6px 0 4px; }
  .project__info p { font-size: .9rem; }
  .project__stack { display: none; }

  /* Tecnologías: 4 por fila, más compactas */
  .tech-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .tech { padding: 14px 4px; gap: 8px; font-size: .72rem; border-radius: 14px; }
  .tech__logo { width: 38px; height: 38px; font-size: 1rem; border-radius: 10px; }

  /* Testimonios y CTA */
  .testimonial blockquote { font-size: 1rem; line-height: 1.55; }
  .stars { margin-bottom: 14px; font-size: 1rem; }
  .cta h2 { font-size: 1.6rem; }

  /* Footer: sin columna de servicios repetida */
  .footer__col:nth-child(2) { display: none; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__col:last-child { grid-column: auto; }
}

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