/* ============================================================
   APLOMO · nelsongranja.com — V2 "en movimiento"
   Motion-forward layer (Amie-style) over styles.css + site.css.
   The plumb is a pendulum; scroll finds the vertical.
   ============================================================ */

:root {
  --ease-spring: cubic-bezier(.16, 1, .3, 1);
  --ease-smooth: cubic-bezier(.22, .61, .36, 1);
}

html { scroll-behavior: smooth; }

/* ============================================================
   REVEAL — richer, with stagger
   ============================================================ */
.r-up { opacity: 0; transform: translateY(36px); }
.r-up.in {
  opacity: 1; transform: none;
  transition: opacity 0.9s var(--ease-smooth), transform 1s var(--ease-spring);
}
.r-up.d1.in { transition-delay: 0.08s; }
.r-up.d2.in { transition-delay: 0.16s; }
.r-up.d3.in { transition-delay: 0.24s; }
.r-up.d4.in { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .r-up { opacity: 1; transform: none; transition: none; }
}

/* hero line clip-reveal */
.line-mask { overflow: hidden; display: block; }
.line-mask > span {
  display: block;
  transform: translateY(112%);
  transition: transform 1.05s var(--ease-spring);
}
.hero-v2.lit .line-mask > span { transform: none; }
.hero-v2.lit .line-mask:nth-child(2) > span { transition-delay: 0.09s; }
.hero-v2.lit .line-mask:nth-child(3) > span { transition-delay: 0.18s; }
.hero-v2.lit .line-mask:nth-child(4) > span { transition-delay: 0.27s; }

/* ============================================================
   SIDE PLUMB — scroll progress rail
   ============================================================ */
.scroll-plumb {
  position: fixed; left: clamp(14px, 2.4vw, 40px);
  top: 16vh; bottom: 16vh; width: 2px; z-index: 40;
  pointer-events: none;
}
.scroll-plumb .sp-track {
  position: absolute; inset: 0; width: 1px; left: 50%;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--sage) 38%, transparent);
}
.scroll-plumb .sp-fill {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 0%;
  background: linear-gradient(var(--sage), var(--sage-300));
}
.scroll-plumb .sp-bob {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--sage) 16%, transparent);
}
@media (max-width: 1100px) { .scroll-plumb { display: none; } }

/* ============================================================
   PENDULUM LOGO (nav + footer)
   the plumb-l swings like a pendulum, then settles
   ============================================================ */
.wm .pl { transform-origin: 50% 8%; }
.lockup .wm .pl { animation: penLogo 4.2s var(--ease-smooth) 0.3s both; }
@keyframes penLogo {
  0%   { transform: translateY(0.20em) rotate(13deg); }
  20%  { transform: translateY(0.20em) rotate(-9deg); }
  40%  { transform: translateY(0.20em) rotate(5.5deg); }
  60%  { transform: translateY(0.20em) rotate(-3deg); }
  80%  { transform: translateY(0.20em) rotate(1.4deg); }
  100% { transform: translateY(0.20em) rotate(0deg); }
}
.lockup:hover .wm .pl { animation: penLogo 3.4s var(--ease-smooth) both; }
@media (prefers-reduced-motion: reduce) {
  .lockup .wm .pl, .lockup:hover .wm .pl { animation: none; }
}

/* ============================================================
   HERO V2 — navy, dramatic, ambient
   ============================================================ */
.hero-v2 {
  background: var(--navy-800); color: var(--cream);
  position: relative; overflow: hidden;
}
.hero-v2 .glow {
  position: absolute; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--sage) 30%, transparent), transparent 62%);
  filter: blur(20px); opacity: 0.55;
  top: -18%; right: -12%;
  will-change: transform;
}
.hero-v2 .hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(36px, 5vw, 84px); align-items: center;
  padding-block: clamp(64px, 9vw, 132px);
  min-height: min(92vh, 900px);
}
.hero-v2 .eyebrow { color: var(--sage-300); margin-bottom: 28px; display: flex; align-items: center; gap: 12px; }
.hero-v2 .eyebrow .tick { width: 22px; height: 1px; background: var(--sage); }
.hero-v2 h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.3rem, 5.2vw, 4.2rem);
  line-height: 1.02; letter-spacing: -0.024em; color: var(--cream);
}
.hero-v2 h1 .accent { color: var(--sage-300); }
.hero-v2 .hero-sub { color: var(--mist); max-width: 42ch; margin-top: 30px; }
.hero-v2 .hero-sub strong { color: var(--cream); font-weight: 600; }
.hero-v2 .hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

.hero-v2 .hero-visual { position: relative; }
.hero-v2 .hero-visual .img-ph { background: color-mix(in srgb, var(--navy-700) 70%, var(--paper)); border-color: var(--navy-700); }
.hero-v2 .hero-visual .img-ph .ph-eyebrow { color: var(--sage-300); }
.hero-v2 .hero-visual .img-ph .ph-note { color: var(--mist); }
.hero-v2 .hero-visual .img-ph .ph-meta { color: var(--mist-soft); }
.hero-v2 .hero-visual .img-ph .ph-meta .pipe { background: var(--navy-600); }
.hero-v2 .hero-visual .img-ph::before { background: linear-gradient(var(--navy-600), color-mix(in srgb, var(--sage) 50%, transparent)); }

/* magnetic button wrapper */
.mag { display: inline-flex; will-change: transform; }

/* ============================================================
   COUNT-UP STAT
   ============================================================ */
.stat-figure .count { font-variant-numeric: tabular-nums; }

/* ============================================================
   HORIZONTE V2 — pinned, scroll-scrubbed ladder (navy)
   ============================================================ */
.horizonte-v2 { background: var(--navy-800); color: var(--cream); position: relative; }
.pin-track { position: relative; height: 340vh; }
.pin-stage {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; overflow: hidden;
  /* clears the sticky nav (~73px) and keeps the block off both edges */
  padding-block: clamp(100px, 12vh, 132px) clamp(32px, 4.5vh, 60px);
}
.pin-stage .glow {
  position: absolute; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--sage) 24%, transparent), transparent 64%);
  filter: blur(16px); opacity: 0.5; left: -10%; bottom: -16%;
}
.pin-inner { position: relative; width: 100%; }
.pin-head { margin-bottom: clamp(14px, 2.4vh, 30px); }
.pin-head .big-statement { color: var(--cream); font-size: clamp(1.65rem, 3.5vw, 2.6rem); max-width: 18ch; }
.pin-head .ph-lead { color: var(--mist); max-width: 56ch; margin-top: clamp(12px, 1.8vh, 22px); }

.rungs-v2 { position: relative; display: grid; gap: clamp(6px, 1.2vh, 14px); padding-left: clamp(40px, 7vw, 110px); }
/* vertical scrub line + climbing bob */
.rungs-v2 .climb {
  position: absolute; left: clamp(14px, 3vw, 46px); top: 6px; bottom: 6px; width: 2px;
}
.rungs-v2 .climb .cl-track { position: absolute; inset: 0; left: 50%; transform: translateX(-50%); width: 1px; background: color-mix(in srgb, var(--cream) 16%, transparent); }
.rungs-v2 .climb .cl-fill { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1px; height: 0%; background: linear-gradient(var(--sage), var(--sage-300)); }
.rungs-v2 .climb .cl-bob { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); width: 11px; height: 11px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 6px color-mix(in srgb, var(--coral) 14%, transparent); }

.rung-v2 {
  display: grid; grid-template-columns: clamp(58px, 7vw, 108px) 1fr;
  gap: clamp(18px, 3vw, 44px); align-items: baseline;
  padding: clamp(5px, 0.9vh, 11px) 0;
  opacity: 0.22; transform: translateY(26px);
  transition: opacity 0.6s var(--ease-smooth), transform 0.7s var(--ease-spring);
  border-top: 1px solid color-mix(in srgb, var(--cream) 12%, transparent);
}
.rung-v2.show { opacity: 0.4; transform: none; }
.rung-v2.active { opacity: 1; transform: none; }
.rung-v2 .r-num {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 4rem); line-height: 0.9;
  letter-spacing: -0.03em; color: var(--sage-300);
  transition: color 0.5s var(--ease-smooth);
}
.rung-v2.active .r-num { color: var(--coral-300); }
.rung-v2 .r-body h3 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.08;
  letter-spacing: -0.018em; color: var(--cream); text-wrap: balance; max-width: 26ch;
}
.rung-v2 .r-body p { color: var(--mist); margin-top: 10px; max-width: 58ch; font-size: 1.02rem;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.6s var(--ease-smooth), opacity 0.5s var(--ease-smooth), margin 0.4s; }
.rung-v2.active .r-body p { max-height: 200px; opacity: 1; }
.rung-v2 .r-body strong { color: var(--cream); font-weight: 600; }

.pin-foot { margin-top: clamp(20px, 3vh, 40px); color: var(--mist); max-width: 60ch; padding-left: clamp(40px, 7vw, 110px); opacity: 0; transition: opacity 0.6s var(--ease-smooth); }
.pin-foot.in { opacity: 1; }
.pin-foot strong { color: var(--sage-300); font-weight: 600; }

@media (max-width: 900px) {
  /* hero stacks: full copy, then the portrait below */
  .hero-v2 .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
    gap: clamp(28px, 6vw, 44px);
  }
  .hero-v2 .hero-visual { order: 2; max-width: 480px; }

  .pin-track { height: auto; }
  .pin-stage { position: static; height: auto; padding-block: clamp(72px, 12vw, 110px); }
  .rung-v2 { opacity: 1; transform: none; }
  .rung-v2 .r-body p { max-height: none; opacity: 1; }
  .pin-foot { opacity: 1; }
  .rungs-v2 { padding-left: 0; }
  .rungs-v2 .climb { display: none; }
}

/* short but wide viewports: un-pin the scrub so nothing clips off the fold.
   (the pinned scrub stays on taller screens, where it fits comfortably) */
@media (min-width: 901px) and (max-height: 899px) {
  .pin-track { height: auto; }
  .pin-stage { position: static; height: auto; padding-block: clamp(64px, 9vh, 100px); overflow: visible; }
  .rung-v2 { opacity: 1; transform: none; }
  .rung-v2 .r-body p { max-height: none; opacity: 1; }
  .pin-foot { opacity: 1; }
  .rungs-v2 .climb { display: none; }
}

/* ============================================================
   PÉNDULO personas ↔ tecnología (El modelo)
   ============================================================ */
.pendulum-scene {
  position: relative; margin: clamp(36px, 6vw, 72px) auto clamp(8px, 3vw, 32px);
  height: clamp(300px, 42vw, 480px); max-width: 760px;
  display: flex; justify-content: center;
}
.pendulum-scene .poles {
  position: absolute; inset: 0; pointer-events: none;
}
.pendulum-scene .pole {
  position: absolute; top: 30%;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.05rem, 2.4vw, 1.7rem); letter-spacing: -0.01em;
  color: var(--ink-mute); opacity: 0.45;
  transition: opacity 0.4s var(--ease-smooth), color 0.4s var(--ease-smooth), transform 0.4s var(--ease-spring);
}
.pendulum-scene .pole .tag { display: block; font-family: var(--body); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 4px; opacity: 0.7; }
.pendulum-scene .pole.left { left: 2%; text-align: left; }
.pendulum-scene .pole.right { right: 2%; text-align: right; }
.pendulum-scene .pole.lit { opacity: 1; color: var(--sage-700); transform: scale(1.04); }

.pendulum-scene .vertical {
  position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%);
  text-align: center; opacity: 0;
  transition: opacity 0.5s var(--ease-smooth), transform 0.6s var(--ease-spring);
}
.pendulum-scene .vertical.lit { opacity: 1; }
.pendulum-scene .vertical .v-word {
  font-family: var(--display); font-weight: 600; font-size: clamp(1.3rem, 3vw, 2.1rem);
  color: var(--coral-700); letter-spacing: -0.015em;
}
.pendulum-scene .vertical .v-tag { font-family: var(--body); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); display: block; margin-bottom: 4px; }

.pendulum-svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.pendulum-arm { transform-origin: 50% 7%; will-change: transform; }
.pendulum-scene .guide { stroke: var(--cream-2); stroke-width: 1; fill: none; opacity: 0.8; }

@media (max-width: 600px) {
  .pendulum-scene .pole { font-size: 1rem; top: 24%; }
}

/* ============================================================
   PARALLAX helpers
   ============================================================ */
[data-parallax] { will-change: transform; }
.lift { transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-smooth); }
.lift:hover { transform: translateY(-6px); }

/* bars grow on reveal */
.rg-bar { width: 0 !important; transition: width 1.2s var(--ease-spring); }
.rg-bar.grown.tech { width: 33.3% !important; }
.rg-bar.grown.people { width: 66.6% !important; }

/* ============================================================
   CLOSER V2
   ============================================================ */
.closer-v2 { position: relative; overflow: hidden; }
.closer-v2 .glow {
  position: absolute; width: 60vw; height: 60vw; max-width: 700px; max-height: 700px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--sage) 22%, transparent), transparent 64%);
  filter: blur(18px); opacity: 0.5; left: 50%; top: 0; transform: translateX(-50%);
}
.closer-v2 .closer-plumb { will-change: transform; }
