/* ════════════════════════════════════════════════════════════════
   ARQ Digital — Motion layer
   Refinements on top of site.css. Loaded after.
   ════════════════════════════════════════════════════════════════ */

/* ───── Lenis baseline ───── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

/* ───── Reveal base ───── */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.js [data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.js [data-reveal-delay="1"] { transition-delay: 80ms; }
.js [data-reveal-delay="2"] { transition-delay: 160ms; }
.js [data-reveal-delay="3"] { transition-delay: 240ms; }
.js [data-reveal-delay="4"] { transition-delay: 320ms; }

/* Stagger child reveals — index applied by JS */
.js [data-reveal-children] > * {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--reveal-index, 0) * 70ms);
  will-change: opacity, transform;
}
.js [data-reveal-children].is-revealed > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ───── Hero word reveal ───── */
.h-hero .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
  padding: 0.38em 0.12em 0.46em 0.12em;
  margin: -0.38em -0.12em -0.46em -0.12em;
  line-height: inherit;
}
.h-hero .word-inner {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 950ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 55ms + 200ms);
  will-change: transform;
}
.h-hero.is-revealed .word-inner { transform: translateY(0); }

/* Hero supporting elements — sequenced fade-up */
.js .hero-left .eyebrow,
.js .hero-sub,
.js .hero-actions,
.js .hero-image figcaption {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
.js .hero-left .eyebrow   { transition-delay: 100ms; }
.js .hero-sub             { transition-delay: 750ms; }
.js .hero-actions         { transition-delay: 900ms; }
.js .hero-image figcaption{ transition-delay: 1000ms; }

.js.is-hero-revealed .hero-left .eyebrow,
.js.is-hero-revealed .hero-sub,
.js.is-hero-revealed .hero-actions,
.js.is-hero-revealed .hero-image figcaption {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Hero image clip-path reveal */
.js .hero-image image-slot {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.35s cubic-bezier(0.16, 1, 0.3, 1) 0.45s;
  will-change: clip-path;
}
.js.is-hero-revealed .hero-image image-slot {
  clip-path: inset(0 0 0 0);
}

/* ───── Custom cursor ───── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid transparent;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-100px, -100px, 0);
  mix-blend-mode: difference;
  transition:
    width 320ms cubic-bezier(0.16, 1, 0.3, 1),
    height 320ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 200ms ease,
    border-color 200ms ease,
    border-radius 200ms ease,
    opacity 200ms ease;
  will-change: transform;
}
.cursor.is-hover {
  width: 42px; height: 42px;
  background: transparent;
  border-color: #FFFFFF;
}
.cursor.is-text {
  width: 2px; height: 24px;
  border-radius: 1px;
}
.cursor.is-hidden { opacity: 0; }

.has-custom-cursor,
.has-custom-cursor body,
.has-custom-cursor a,
.has-custom-cursor button,
.has-custom-cursor .case,
.has-custom-cursor .recurso,
.has-custom-cursor .tool,
.has-custom-cursor .svc-item,
.has-custom-cursor input,
.has-custom-cursor textarea { cursor: none; }

@media (hover: none) {
  .cursor { display: none; }
}

/* ───── Magnetic buttons ───── */
.btn, .btn-ghost {
  will-change: transform;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1),
              background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.btn .arrow, .btn-ghost .arrow,
.btn-text .arrow, .case-link .arrow {
  display: inline-block;
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.btn:hover .arrow,
.btn-ghost:hover .arrow,
.btn-text:hover .arrow,
.case-link:hover .arrow {
  transform: translateX(5px);
}

/* ───── Nav scroll progress bar ───── */
.nav { overflow: visible; }
.nav-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 120ms linear;
  pointer-events: none;
  z-index: 1;
}

/* ───── Chapter number hairline ───── */
.js .eyebrow .chapter {
  position: relative;
}

/* ───── Process — sticky scrolly scene ───── */
.process-scroller {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 5rem;
  margin-top: 3.5rem;
  /* no align-items: start — let .process-media stretch to match .process-steps */
}
.process-media { position: relative; }
.process-stage {
  position: sticky;
  top: calc(var(--nav-h) + 4rem);
  aspect-ratio: 4 / 5;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--bg-soft);
}
.stage-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 1400ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.stage-frame.is-active {
  opacity: 1;
  transform: scale(1);
}
.stage-frame image-slot {
  display: block;
  width: 100%;
  height: 100%;
}

/* Stage footer: label + dots inside the stage */
.stage-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border-top: 1px solid var(--ink);
  z-index: 4;
  pointer-events: none;
}
.stage-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.7rem;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.stage-label-num {
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 0.62rem;
  text-transform: uppercase;
}
.stage-label-sep { color: var(--mute); }
.stage-label-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-dots {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}
.stage-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.stage-dot.is-active {
  background: var(--ink);
  transform: scale(1.4);
}

.process-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.process-steps .step {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  position: relative;
}
.process-steps .step:first-child { padding-top: 0; }
.process-steps .step:last-child { min-height: 50vh; }
.process-steps .step .step-image { display: none; }
.process-steps .step .step-body {
  opacity: 0.25;
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 44ch;
}
.process-steps .step.is-active .step-body { opacity: 1; }
.process-steps .step .step-title {
  font-size: 2.4rem;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-top: 0.5rem;
  margin-bottom: 1.1rem;
}
.process-steps .step .step-desc {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}
.process-steps .step .step-meta { margin-bottom: 0.85rem; }

/* Stage dots — legacy old positioning removed; new dots live inside .stage-footer */

@media (max-width: 880px) {
  .process-scroller {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .process-media { display: none; }
  .process-steps { gap: 4rem; }
  .process-steps .step {
    min-height: 0;
    padding: 0;
  }
  .process-steps .step .step-image { display: block; }
  .process-steps .step .step-body { opacity: 1; max-width: none; }
  .stage-dots { display: none; }
}

/* ───── Counters ───── */
.stat-num { font-variant-numeric: tabular-nums; }

/* ───── Parallax on .moment full-bleed ───── */
.moment {
  overflow: hidden;
  position: relative;
}
.js .moment {
  clip-path: inset(9% 0 9% 0);
  opacity: 0.72;
  transform: translate3d(0, 24px, 0);
  transition:
    clip-path 1100ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 1100ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: clip-path, opacity, transform;
}
.js .moment.is-revealed {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.moment image-slot {
  display: block;
  width: 100%;
  transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1.16);
  transform-origin: center;
  will-change: transform;
  backface-visibility: hidden;
}

@media (max-width: 620px) {
  .js .moment {
    clip-path: inset(6% 0 6% 0);
    transform: translate3d(0, 16px, 0);
  }
  .moment image-slot {
    transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1.1);
  }
}

/* ───── Service item subtle hover refinement ───── */
.svc-item {
  transition:
    background-color var(--dur-base) var(--ease),
    color var(--dur-base) var(--ease);
}

/* ───── Reduce motion ───── */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js [data-reveal-children] > *,
  .h-hero .word-inner,
  .js .hero-image image-slot,
  .js .hero-left .eyebrow,
  .js .hero-sub,
  .js .hero-actions,
  .js .hero-image figcaption,
  .stage-frame,
  .js .moment,
  .moment image-slot {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  .stage-frame { opacity: 0 !important; }
  .stage-frame.is-active { opacity: 1 !important; }
  .cursor { display: none !important; }
  .btn, .btn-ghost { transform: none !important; }
}
