:root {
  --bg: #05070e;
  --bg-alt: #0a0f1c;
  --panel: #0d1322;
  --text: #eef1fb;
  --muted: #98a2bd;
  --line: rgba(255,255,255,0.09);
  --primary: #3f63ff;
  --primary-2: #5b8cff;
  --accent: #35e08b;
  --accent-text: #04140c;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --fs-h1: clamp(2.3rem, 5.2vw, 4.1rem);
  --fs-h2: clamp(1.8rem, 3.6vw, 2.7rem);
  --fs-h3: clamp(1.15rem, 2vw, 1.4rem);
  --fs-body: clamp(1rem, 1.1vw, 1.1rem);

  --radius: 12px;
  --header-h: 64px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: clip; max-width: 100vw; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
html.lenis-smooth { scroll-behavior: auto !important; }
html.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: clamp(20px, 5vw, 48px); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10000; background: var(--accent); color: var(--accent-text); padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: 0.85rem; transition: top 0.2s var(--ease); }
.skip-link:focus { top: 12px; }

.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: var(--accent); z-index: 9998; transition: width 0.1s linear; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  padding: 14px 28px; border-radius: 100px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  line-height: 1; text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 10px 30px -12px rgba(53,224,139,0.55); }
.btn-primary:hover { background: #4bf09d; transform: translateY(-2px); box-shadow: 0 16px 38px -14px rgba(53,224,139,0.7); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text); border-color: var(--line); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); transform: translateY(-2px); }
.btn-sm { padding: 11px 20px; font-size: 0.85rem; }
.btn-lg { padding: 17px 34px; font-size: 1.02rem; }

.eyebrow { font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--accent); display: inline-block; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(28px, 4vw, 64px); position: relative; z-index: 1; background: var(--bg); }
.section-head { max-width: 780px; margin-bottom: clamp(28px, 4vw, 52px); }
.section-title { font-size: var(--fs-h2); margin-top: 14px; color: var(--text); }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 15; height: var(--header-h); margin: 18px auto 0; max-width: calc(var(--maxw) + 40px); padding-inline: clamp(12px, 4vw, 24px); overflow: visible; }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; background: rgba(10,15,28,0.72); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 40px; padding: 0 12px 0 22px; box-shadow: 0 10px 34px -18px rgba(0,0,0,0.7); }
.brand img { height: 40px; width: auto; display: block; }
.nav { display: flex; gap: 28px; font-family: var(--font-display); font-size: 0.92rem; font-weight: 500; }
.nav a { position: relative; color: var(--text); padding: 4px 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav a:hover::after { transform: scaleX(1); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0 0 0 auto; width: 78%; max-width: 340px; z-index: 40; background: var(--bg-alt); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform 0.38s var(--ease); padding: calc(var(--header-h) + 44px) 32px 40px; box-shadow: -20px 0 50px -30px rgba(0,0,0,0.8); }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu nav a { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.mobile-menu nav a.btn { border: none; margin-top: 20px; justify-content: center; }

/* ---------- Hero (túnel 1000vh) ---------- */
.hero { position: relative; z-index: 0; min-height: 1000vh; margin-top: -102px; }
.hero-bg { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 0; pointer-events: none; background: var(--bg); }
.hero-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(5,7,14,0.22), rgba(5,7,14,0.22)),
    radial-gradient(130% 95% at 50% 48%, rgba(5,7,14,0.5) 0%, rgba(5,7,14,0.2) 46%, rgba(5,7,14,0) 80%);
}
.hero-stage { position: relative; z-index: 2; }
.hero-beat { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 0 clamp(20px, 6vw, 60px); will-change: transform, opacity, filter; }
.beat-main { text-align: left; align-items: stretch; padding: 0; }
.beat-main-inner { width: 100%; flex: 1; max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 120px clamp(20px, 5vw, 48px) 70px; }

.hero-eyebrow { margin-bottom: 20px; }
.hero-title { font-size: var(--fs-h1); max-width: 16ch; color: var(--text); }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: clamp(1.08rem, 1.4vw, 1.25rem); color: var(--muted); max-width: 44ch; margin-top: 22px; line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-cue { display: inline-flex; align-items: center; gap: 12px; margin-top: 56px; font-family: var(--font-display); font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hero-cue span { position: relative; width: 22px; height: 34px; border: 1.5px solid var(--muted); border-radius: 12px; flex: none; }
.hero-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 6px; border-radius: 3px; background: var(--accent); transform: translateX(-50%); animation: cue 1.6s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 12px); } 100% { opacity: 0; } }

.beat-lead { font-family: var(--font-display); font-weight: 600; font-size: clamp(0.78rem, 1.1vw, 0.92rem); letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); }
.beat-big { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1.12; letter-spacing: -0.015em; color: var(--text); max-width: 20ch; text-shadow: 0 2px 40px rgba(5,7,14,0.95), 0 1px 6px rgba(5,7,14,0.9); }
.beat-note { font-size: clamp(1rem, 1.3vw, 1.15rem); color: var(--muted); max-width: 46ch; text-shadow: 0 1px 20px rgba(5,7,14,0.9); }
.beat-link { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--accent); margin-top: 6px; border-bottom: 1.5px solid transparent; transition: border-color 0.25s var(--ease); }
.beat-link:hover { border-color: var(--accent); }
.beat-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; justify-content: center; }

/* Cards flotantes: capturas web (browser) y celu (phone) */
.beat-shot, .beat-phone { position: absolute; overflow: hidden; will-change: transform, opacity; }
.beat-shot { width: clamp(280px, 36vw, 580px); aspect-ratio: 16/10; border-radius: 14px; border: 1px solid rgba(255,255,255,0.16); box-shadow: 0 60px 130px -40px rgba(0,0,0,0.95), 0 0 80px -30px rgba(63,99,255,0.4); }
.beat-phone { width: clamp(100px, 12vw, 180px); aspect-ratio: 9/19; border-radius: 22px; border: 3px solid rgba(255,255,255,0.18); box-shadow: 0 40px 90px -28px rgba(0,0,0,0.95), 0 0 60px -24px rgba(53,224,139,0.35); }
.beat-shot img, .beat-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.beat-shot.beat-img-near { left: clamp(10px, 6vw, 100px); top: 12%; transform: perspective(1000px) rotateY(18deg) rotate(-4deg); }
.beat-phone.beat-img-far { right: clamp(14px, 7vw, 110px); bottom: 11%; transform: perspective(1000px) rotateY(-18deg) rotate(5deg); }

/* Beats de portfolio: 6 capturas GRANDES en pasillo 3D — esquinas + laterales como paredes */
.beat-quad .beat-shot { width: clamp(190px, 25vw, 460px); }
.beat-quad .beat-shot.pos-tl { left: clamp(4px, 4.5vw, 70px); top: 6%; right: auto; bottom: auto; transform: perspective(1000px) rotateY(20deg) rotate(-4deg); }
.beat-quad .beat-shot.pos-tr { right: clamp(4px, 4.5vw, 70px); top: 8%; left: auto; bottom: auto; transform: perspective(1000px) rotateY(-20deg) rotate(4deg); }
.beat-quad .beat-shot.pos-ml { left: clamp(2px, 1.8vw, 28px); top: 50%; right: auto; bottom: auto; transform: perspective(1000px) translateY(-50%) rotateY(28deg) rotate(2deg); width: clamp(160px, 19vw, 350px); }
.beat-quad .beat-shot.pos-mr { right: clamp(2px, 1.8vw, 28px); top: 50%; left: auto; bottom: auto; transform: perspective(1000px) translateY(-50%) rotateY(-28deg) rotate(-2deg); width: clamp(160px, 19vw, 350px); }
.beat-quad .beat-shot.pos-bl { left: clamp(4px, 4.5vw, 70px); bottom: 6%; right: auto; top: auto; transform: perspective(1000px) rotateY(20deg) rotate(3deg); }
.beat-quad .beat-shot.pos-br { right: clamp(4px, 4.5vw, 70px); bottom: 8%; left: auto; top: auto; transform: perspective(1000px) rotateY(-20deg) rotate(-3deg); }

/* Modo túnel: activo solo con JS+GSAP (clase hero--tunnel); sin JS los beats se apilan verticales */
.hero--tunnel .hero-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.hero--tunnel .hero-beat { position: absolute; inset: 0; min-height: 0; }
.hero--tunnel .hero-beat + .hero-beat { opacity: 0; visibility: hidden; }

/* ---------- Servicios ---------- */
.serv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.serv-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; display: flex; flex-direction: column; transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.serv-card:hover { transform: translateY(-5px); border-color: rgba(53,224,139,0.5); box-shadow: 0 24px 50px -30px rgba(0,0,0,0.9); }
.serv-icon { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 12px; background: rgba(63,99,255,0.14); color: var(--primary-2); margin-bottom: 20px; }
.serv-icon svg { width: 24px; height: 24px; }
.serv-card h3 { font-size: var(--fs-h3); margin-bottom: 8px; color: var(--text); }
.serv-card p { color: var(--muted); font-size: 0.98rem; line-height: 1.55; flex: 1; }
.serv-link { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--accent); margin-top: 18px; }
.serv-link:hover { text-decoration: underline; }

/* ---------- Portfolio ---------- */
.portfolio { background: var(--bg-alt); }
.pf-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.pf-cat { font-family: var(--font-display); font-weight: 500; font-size: 0.88rem; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 100px; padding: 9px 18px; cursor: pointer; transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease); }
.pf-cat:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }
.pf-cat.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pf-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.pf-card:hover { transform: translateY(-6px); border-color: rgba(53,224,139,0.5); box-shadow: 0 26px 54px -30px rgba(0,0,0,0.9); }
.pf-card.pf-hidden { display: none; }
.pf-visuals { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #0a0e1a; }
.pf-web { width: 100%; height: 100%; }
.pf-web img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.5s var(--ease); }
.pf-card:hover .pf-web img { transform: scale(1.04); }
.pf-phone { position: absolute; right: 12px; bottom: -8px; width: 24%; aspect-ratio: 9/19; border-radius: 14px; border: 2px solid rgba(255,255,255,0.2); overflow: hidden; box-shadow: 0 14px 30px -10px rgba(0,0,0,0.8); }
.pf-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pf-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; }
.pf-info h4 { font-size: 1.02rem; color: var(--text); font-weight: 600; }
.pf-meta { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; font-family: var(--font-body); font-weight: 400; }
.pf-cta { font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: var(--accent); white-space: nowrap; }

/* ---------- Proceso ---------- */
.pasos { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.paso { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; display: flex; flex-direction: column; gap: 12px; }
.paso-num { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--accent); line-height: 1; }
.paso h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 6px; }
.paso p { color: var(--muted); font-size: 0.94rem; line-height: 1.55; }

/* ---------- CTA final ---------- */
.cta-final { position: relative; z-index: 1; background: linear-gradient(135deg, rgba(63,99,255,0.16) 0%, rgba(5,7,14,0) 45%, rgba(53,224,139,0.13) 100%), var(--bg-alt); border-block: 1px solid var(--line); padding-block: clamp(48px, 7vw, 96px); }
.cta-inner { text-align: center; max-width: 720px; }
.cta-inner h2 { font-size: var(--fs-h2); color: var(--text); }
.cta-inner p { color: var(--muted); margin-top: 14px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 30px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; background: #030509; color: var(--muted); padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand img { height: 42px; width: auto; }
.footer-brand p { color: var(--muted); margin-top: 16px; max-width: 36ch; font-size: 0.95rem; }
.footer-col h4 { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 14px; font-weight: 600; }
.footer-col a { display: block; color: var(--muted); padding: 5px 0; transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px clamp(20px, 5vw, 48px); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; max-width: var(--maxw); margin-inline: auto; font-size: 0.85rem; color: rgba(255,255,255,0.4); }
.footer-tag { font-style: italic; }

/* ---------- WhatsApp float ---------- */
.wsp-float { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px -8px rgba(37,211,102,0.55); opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.85); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s; }
.wsp-float.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.wsp-float svg { width: 30px; height: 30px; }
.wsp-float::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366; animation: pulse-ring 2.2s var(--ease) infinite; }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .serv-grid { grid-template-columns: 1fr; max-width: 480px; }
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .pasos { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .beat-main-inner { padding-top: 130px; }
  .hero-title { max-width: 100%; }
  /* Mobile: las <picture> sirven las previews de celu → formato vertical, más grandes */
  .beat-shot { aspect-ratio: 9/16; border-radius: 16px; }
  .beat-shot.beat-img-near { width: 44vw; top: 5%; left: 4%; }
  .beat-phone.beat-img-far { width: 26vw; bottom: 6%; right: 4%; }
  .beat-quad .beat-shot { width: 40vw; }
  .beat-quad .beat-shot.pos-tl { left: 2%; top: 2%; }
  .beat-quad .beat-shot.pos-tr { right: 2%; top: 2%; }
  .beat-quad .beat-shot.pos-ml { left: -11vw; top: 50%; width: 40vw; }
  .beat-quad .beat-shot.pos-mr { right: -11vw; top: 50%; width: 40vw; }
  .beat-quad .beat-shot.pos-bl { left: 2%; bottom: 2%; }
  .beat-quad .beat-shot.pos-br { right: 2%; bottom: 2%; }
  .pf-grid { grid-template-columns: 1fr; }
  .pasos { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .wsp-float { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .hero-cue span::after, .wsp-float::before { animation: none; }
  [data-animate] { opacity: 1 !important; transform: none !important; }
}
