:root {
  --paper: #ffffff;
  --ink: #0a1628;
  --mist: #f4f7fb;
  --cyan: #2ec4f1;
  --cyan-deep: #1e6fd9;
  --green: #3ddc84;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3 { font-family: var(--font-display); }

img { max-width: 100%; display: block; }

/* Runs in the left gutter (not page-center) so it never hides behind
   centered content/cards — reads as a connecting "rail" beside the page. */
#spine-svg {
  position: absolute;
  top: 0;
  left: clamp(16px, 4vw, 56px);
  width: 6px;
  height: 100%;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}
#spine-path { fill: none; stroke: url(#spine-gradient); stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(46,196,241,.5)); }

.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 24px 5%; }

.brand-link { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; }
.brand-text {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
}
.brand-text small { font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700; color: var(--cyan-deep); letter-spacing: 0.14em; }

.site-footer { position: relative; z-index: 1; text-align: center; padding: 60px 5%; color: #5a6b85; background: var(--mist); }
.site-footer a { color: var(--cyan-deep); }
.site-footer .brand-text-footer { display: block; margin: 8px 0; }
.site-footer .legal-links { font-size: 0.85rem; margin-top: 8px; }

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-body);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.btn-primary { background: var(--green); color: #06210f; box-shadow: 0 8px 24px rgba(61,220,132,.35); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--cyan-deep); }
.btn:hover { transform: translateY(-2px); }

.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 30;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
}
@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,.5); }
  50% { box-shadow: 0 4px 32px rgba(37,211,102,.9); }
}
.whatsapp-float { animation: whatsapp-pulse 2.4s ease-in-out infinite; }

.cta-final {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 100px 5%;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 32px;
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(46,196,241,.12) 0%, rgba(46,196,241,0) 60%),
    var(--mist);
}
.cta-final h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 16px; }
.cta-final p { color: #5a6b85; margin-bottom: 32px; }

.reveal { opacity: 0; transform: translateY(24px); }

@media (max-width: 640px) {
  .cta-final { padding: 60px 5%; border-radius: 0; }
  #spine-svg { display: none; }
}

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 5% 60px;
  overflow: hidden;
}

/* The source video has the real subject centered as a 720x720 square
   baked inside a 1280x720 frame, with solid black filling the ~280px
   pillars on each side. object-fit only sizes the whole frame — it can't
   skip the black inside it — so we crop it ourselves: the sharp video sits
   in a square box (object-fit: cover on a 1:1 box crops exactly the
   pillars, with zero stretching since it's a crop, not an upscale), and
   its own edges fade to transparent via a radial mask so the cut isn't a
   hard square line. A second, blurred+enlarged copy fills the space
   around it so the transition dissolves into a soft glow — same trick as
   Spotify/YouTube letterboxing. */
.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* zoomed in well past the source video's black margin (~22% each side)
     so the blurred backdrop only ever samples the lit subject/background,
     never the black padding — otherwise the "diffuse" edge is just a
     softened black vignette instead of a glow. */
  transform: scale(2.4);
  filter: blur(60px) saturate(1.3) brightness(1.1);
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-video-bg.is-visible { opacity: 0.9; }

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(74vmin, 640px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  mask-image: radial-gradient(closest-side, black 76%, transparent 100%);
  -webkit-mask-image: radial-gradient(closest-side, black 76%, transparent 100%);
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-video.is-visible { opacity: 1; }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(255,255,255,.82) 0%, rgba(255,255,255,.55) 45%, rgba(255,255,255,0) 75%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero-eyebrow { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.16em; color: var(--cyan-deep); margin-bottom: 12px; text-shadow: 0 1px 12px rgba(255,255,255,.9); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; margin: 12px 0 20px; }
.line-mask { display: block; overflow: hidden; }
.line-inner { display: block; transform: translateY(110%); }
.hero-sub { font-size: 1.2rem; color: #4a5b75; margin-bottom: 32px; text-shadow: 0 1px 12px rgba(255,255,255,.9); }

@media (max-width: 640px) {
  .hero { padding: 100px 5% 40px; }
}

/* ---------- Quiénes somos ---------- */
.nosotros {
  position: relative;
  z-index: 1;
  padding: 100px 5%;
  background:
    radial-gradient(ellipse 70% 60% at 85% 20%, rgba(46,196,241,.10) 0%, rgba(46,196,241,0) 60%),
    radial-gradient(ellipse 60% 60% at 10% 90%, rgba(61,220,132,.08) 0%, rgba(61,220,132,0) 60%),
    var(--mist);
}
.nosotros-inner { max-width: 720px; margin: 0 auto; padding-left: clamp(0px, 6vw, 64px); }
.nosotros-inner h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.25; margin: 14px 0 20px; }
.nosotros-body { font-size: 1.1rem; color: #4a5b75; line-height: 1.6; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--cyan-deep);
  text-transform: uppercase;
}

/* ---------- Lo que hacemos: tarjetas apiladas (sticky stack) ---------- */
.pilares {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 5% 40px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper) 70%, var(--mist) 100%);
}
.pilares > .section-label,
.pilares-heading { padding-left: clamp(0px, 6vw, 64px); }
.pilares-heading { font-size: clamp(1.7rem, 3.8vw, 2.5rem); margin: 14px 0 60px; max-width: 640px; }

.pilar-stack { position: relative; }

.pilar-card {
  position: sticky;
  top: calc(90px + var(--i) * 24px);
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 24px 0 60px;
}

.pilar-card-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  background: var(--paper);
  border: 1px solid rgba(10,22,40,.06);
  border-radius: 32px;
  padding: 48px;
  box-shadow: 0 30px 70px rgba(10,22,40,.14);
  transform-origin: center top;
}

.pilar-img { max-width: 320px; width: 100%; border-radius: 20px; flex-shrink: 0; box-shadow: 0 20px 40px rgba(10,22,40,.12); }

.pilar-text { max-width: 440px; }
.pilar-label { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; color: var(--cyan-deep); text-transform: uppercase; margin-bottom: 10px; }
.pilar-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-bottom: 16px; line-height: 1.2; }
.pilar-desc { color: #5a6b85; font-size: 1.05rem; line-height: 1.55; }

@media (max-width: 768px) {
  /* Keep the sticky-stack effect on mobile too — just a shorter offset
     stagger and a smaller minimum height so it doesn't overshoot the
     viewport on a short phone screen. */
  .pilar-card { top: calc(64px + var(--i) * 14px); min-height: 62vh; padding: 12px 0 40px; }
  .pilar-card-inner { flex-direction: column; text-align: center; gap: 20px; padding: 28px 20px; }
  .pilar-img { max-width: 220px; }
  .nosotros-inner, .pilares > .section-label, .pilares-heading { padding-left: 0; }
}

.formulario-contacto {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 100px 5%;
  max-width: 1200px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse 55% 50% at 12% 20%, rgba(61,220,132,.08) 0%, rgba(61,220,132,0) 60%),
    radial-gradient(ellipse 55% 50% at 88% 80%, rgba(46,196,241,.08) 0%, rgba(46,196,241,0) 60%);
}
.formulario-contacto h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 16px; }
.formulario-contacto p { color: #5a6b85; margin-bottom: 32px; }

.lead-form { max-width: 480px; margin: 0 auto; text-align: left; display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.9rem; color: #5a6b85; }
.form-row input, .form-row select {
  font-family: var(--font-body);
  background: var(--mist);
  border: 1px solid rgba(10,22,40,.12);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 1rem;
}
.form-row input:focus, .form-row select:focus { outline: 2px solid var(--cyan-deep); }
.form-error { color: #c0392b; font-size: 0.9rem; }
.lead-form .btn { align-self: center; margin-top: 8px; border: none; cursor: pointer; }

.lead-form-success { max-width: 480px; margin: 0 auto; padding: 40px; background: rgba(61,220,132,.08); border: 1px solid rgba(61,220,132,.4); border-radius: 16px; }
.lead-form-success p { color: var(--ink); font-size: 1.1rem; margin: 0; }

@media (max-width: 640px) {
  .formulario-contacto { padding: 60px 5%; }
}

.legal-page { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 140px 5% 100px; }
.legal-page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 16px; }
.legal-page > p.legal-intro { color: #5a6b85; margin-bottom: 40px; font-size: 1.05rem; }

.legal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.legal-card { background: var(--mist); border: 1px solid rgba(10,22,40,.08); border-radius: 16px; padding: 24px; }
.legal-card .legal-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #06210f; font-weight: 700; margin-bottom: 12px;
}
.legal-card h3 { margin-bottom: 8px; color: var(--cyan-deep); }
.legal-card p { color: #5a6b85; font-size: 0.95rem; line-height: 1.5; }

.legal-back { display: inline-block; margin-top: 40px; color: var(--cyan-deep); }

@media (max-width: 640px) {
  .legal-grid { grid-template-columns: 1fr; }
}
