/* =====================================================================
   Landing motion layer — 2026-10
   ---------------------------------------------------------------------
   Loaded only by index.html, after styles.css. Scope: body[data-page="landing"].
   Adds: ambient aurora background, scroll progress, cursor glow, SVG icon
   motion graphics (hero orbit, stats, services, process, integration,
   marquee), word-by-word headline and text-positioning fixes.
   Rules: animations use transform/opacity only (no per-frame filter),
   everything honours prefers-reduced-motion, body.landing-motion-limited
   and body.hero-motion-paused (see initLandingMotionConsistency in site.js).
   ===================================================================== */

body[data-page="landing"] {
  --lm-lime: #cffe25;
  --lm-lime-soft: rgba(207, 254, 37, 0.12);
  --lm-lime-line: rgba(207, 254, 37, 0.3);
  --lm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Shared SVG icon contract ----------------------------------------- */
body[data-page="landing"] .xd-ico {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* Stroke "draw-on" once the owning .reveal block becomes visible. */
@keyframes xdDraw {
  to {
    stroke-dashoffset: 0;
  }
}

body[data-page="landing"] .reveal.visible .xd-draw use {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: xdDraw 1.1s var(--lm-ease) var(--draw-delay, 420ms) forwards;
}

/* --- 1. Ambient background: aurora blobs + grid + beam ---------------- */
body[data-page="landing"] .xd-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

body[data-page="landing"] .xd-aurora-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

body[data-page="landing"] .xd-aurora-a {
  width: 74vmax;
  height: 74vmax;
  left: -24vmax;
  top: -32vmax;
  background: radial-gradient(circle, rgba(120, 150, 30, 0.08) 0%, rgba(120, 150, 30, 0.03) 32%, transparent 62%);
  animation: xdAuroraA 26s ease-in-out infinite alternate;
}

body[data-page="landing"] .xd-aurora-b {
  width: 66vmax;
  height: 66vmax;
  right: -28vmax;
  top: 8vmax;
  background: radial-gradient(circle, rgba(30, 52, 86, 0.16) 0%, rgba(30, 52, 86, 0.06) 36%, transparent 64%);
  animation: xdAuroraB 32s ease-in-out infinite alternate;
}

body[data-page="landing"] .xd-aurora-c {
  width: 58vmax;
  height: 58vmax;
  left: 16vmax;
  bottom: -36vmax;
  background: radial-gradient(circle, rgba(40, 90, 70, 0.1) 0%, rgba(40, 90, 70, 0.04) 38%, transparent 64%);
  animation: xdAuroraC 38s ease-in-out infinite alternate;
}

@keyframes xdAuroraA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(14vmax, 10vmax, 0) scale(1.18); }
}

@keyframes xdAuroraB {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(-12vmax, 14vmax, 0) scale(0.92); }
}

@keyframes xdAuroraC {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(16vmax, -12vmax, 0) scale(1.12); }
}

body[data-page="landing"] .xd-aurora-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 10%, transparent 78%);
}

/* The sweeping beam was removed on 2026-10-11 (Luis: too bright); the
   element stays in the markup but renders nothing. */
body[data-page="landing"] .xd-aurora-beam {
  display: none;
}

/* Hero keeps a dark, near-opaque base; the aurora only tints its edges. */
body[data-page="landing"] .hero-v1 {
  background:
    radial-gradient(124% 92% at 50% -14%, rgba(150, 190, 60, 0.05), transparent 58%),
    radial-gradient(84% 70% at 52% 50%, rgba(40, 70, 110, 0.1), transparent 72%),
    linear-gradient(180deg, rgba(3, 7, 12, 0.96) 0%, rgba(2, 5, 11, 0.97) 56%, rgba(1, 3, 8, 0.98) 100%);
}

/* --- 2. Scroll progress line ------------------------------------------ */
body[data-page="landing"] .xd-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 10000;
  pointer-events: none;
  background: linear-gradient(90deg, var(--lm-lime), #8cecb6);
  box-shadow: 0 0 12px rgba(207, 254, 37, 0.45);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity 240ms ease;
  will-change: transform;
}

body[data-page="landing"].is-scrolled .xd-progress {
  opacity: 1;
}

/* --- 3. Hero: cursor glow + parallax backdrop ------------------------- */
body[data-page="landing"] .xd-hero-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 760px;
  height: 760px;
  margin: -380px 0 0 -380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(207, 254, 37, 0.14) 0%, rgba(207, 254, 37, 0.05) 30%, transparent 62%);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 600ms ease;
  will-change: transform;
}

body[data-page="landing"] .hero-v1.has-pointer .xd-hero-glow {
  opacity: 1;
}

body[data-page="landing"] .hero-tech-backdrop {
  will-change: transform;
}

/* --- 4. Hero headline: 4 balanced lines + word-by-word entrance ------- */
body[data-page="landing"] .hero-v1 h1.text-center {
  font-size: clamp(2.75rem, 5.5vw, 5.1rem);
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 24ch;
  text-wrap: balance;
}

body[data-page="landing"] .hero-v1 h1.is-split {
  opacity: 1;
  transform: none;
  transition: none;
}

/* No overflow clipping here: a masked rise cut the descenders of p/y/g
   (reported 2026-10-11), so words simply rise and fade in. */
body[data-page="landing"] .hero-v1 h1 .hw {
  display: inline-block;
}

body[data-page="landing"] .hero-v1 h1 .hw-i {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.45em, 0);
  will-change: transform, opacity;
}

@keyframes xdWordUp {
  from {
    opacity: 0;
    transform: translate3d(0, 0.45em, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body[data-page="landing"] .hero-text-wrap.reveal.visible h1.is-split .hw-i {
  animation: xdWordUp 760ms var(--lm-ease) both;
  animation-delay: calc(140ms + var(--wi, 0) * 58ms);
}

/* JS reveal observer never took over (html.js missing): mirror xdRevealSafety. */
html:not(.js) body[data-page="landing"] .hero-v1 h1.is-split .hw-i {
  animation: xdWordUp 520ms var(--lm-ease) 2200ms both;
}

html.reveal-static body[data-page="landing"] .hero-v1 h1.is-split .hw-i {
  animation: none;
  opacity: 1;
  transform: none;
}

body[data-page="landing"] .hero-v1 .hero-subtitle {
  text-wrap: pretty;
}

/* --- 5. Hero stats: icon badge + count-up ----------------------------- */
body[data-page="landing"] .hero-v1 .hero-stat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  border-radius: 12px;
  border: 1px solid var(--lm-lime-line);
  background: var(--lm-lime-soft);
  color: var(--lm-lime);
  font-size: 20px;
  box-shadow: inset 0 0 14px rgba(207, 254, 37, 0.08);
  transition: transform 320ms var(--lm-ease), box-shadow 320ms ease;
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="landing"] .hero-v1 .hero-stats article:hover .hero-stat-ico {
    transform: translateY(-2px) rotate(-6deg);
    box-shadow: 0 0 0 4px rgba(207, 254, 37, 0.08), inset 0 0 14px rgba(207, 254, 37, 0.14);
  }
}

body[data-page="landing"] .hero-v1 .hero-stats h2 {
  font-variant-numeric: tabular-nums;
}

/* --- 6. Hero orbit tags: SVG icons, no blur, visible constellation ----- */
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.36rem 0.66rem 0.36rem 0.5rem;
  border: 1px solid var(--lm-lime-line);
  background: rgba(6, 9, 13, 0.66);
  color: rgba(236, 242, 238, 0.92);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  filter: none;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(207, 254, 37, 0.05),
    inset 0 0 18px rgba(207, 254, 37, 0.06);
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.6);
  animation:
    xdTagIn 900ms var(--lm-ease) var(--tag-in, 700ms) forwards,
    xdTagFloat var(--tag-duration, 11s) ease-in-out calc(var(--tag-in, 700ms) + 900ms) infinite alternate;
  will-change: transform, opacity;
}

body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag .orbit-ico {
  width: 15px;
  height: 15px;
  color: var(--lm-lime);
  filter: drop-shadow(0 0 6px rgba(207, 254, 37, 0.55));
}

@keyframes xdTagIn {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.6);
  }
  to {
    opacity: 0.92;
    transform: none;
  }
}

@keyframes xdTagFloat {
  from { transform: translate3d(calc(var(--tag-drift-x, 10px) * -1), calc(var(--tag-drift-y, 8px) * -1), 0); }
  to { transform: translate3d(var(--tag-drift-x, 10px), var(--tag-drift-y, 8px), 0); }
}

/* Eight tags, four per side, kept clear of the headline column. */
/* The core stretches to the hero content, so these percentages track the
   copy: 21% sits just under the fixed header, 64% stays above the stats. */
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-cloud { left: 4%; top: 22%; --tag-in: 700ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-code { left: 6%; top: 36%; --tag-in: 850ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-pc { left: 5%; top: 50%; --tag-in: 1000ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-auto { left: 8%; top: 64%; --tag-in: 1150ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-api { left: 86%; top: 21%; --tag-in: 780ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-web { left: 87%; top: 35%; --tag-in: 930ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-it { left: 85%; top: 49%; --tag-in: 1080ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-data { left: 88%; top: 63%; --tag-in: 1230ms; }
body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag.tag-ops { display: none; }

/* Rings: a touch more presence plus a comet travelling along ring one. */
body[data-page="landing"] .hero-tech-backdrop .tech-ring-one {
  opacity: 0.34;
  border-color: rgba(207, 254, 37, 0.3);
}

body[data-page="landing"] .hero-tech-backdrop .tech-ring-one::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, transparent 0 66%, rgba(207, 254, 37, 0.95) 92%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}

@media (max-width: 1024px) {
  body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag {
    display: none;
  }

  body[data-page="landing"] .hero-v1 h1.text-center {
    font-size: clamp(2.5rem, 7vw, 4.2rem);
    max-width: 18ch;
  }
}

@media (max-width: 640px) {
  body[data-page="landing"] .hero-v1 h1.text-center {
    font-size: clamp(2.1rem, 9.4vw, 2.9rem);
    line-height: 1.04;
    max-width: 14ch;
  }
}

/* Below 960px the stats stack; make them compact rows (icon left) instead of
   three cramped columns or three tall centred cards. */
@media (max-width: 960px) {
  body[data-page="landing"] .hero-v1 .hero-stats {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: 560px;
  }

  body[data-page="landing"] .hero-v1 .hero-stats article {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    text-align: left;
    padding: 11px 14px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body[data-page="landing"] .hero-v1 .hero-stats .hero-stat-ico {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    margin: 0;
  }

  body[data-page="landing"] .hero-v1 .hero-stats h2 {
    font-size: 1.12rem;
    line-height: 1.15;
  }

  body[data-page="landing"] .hero-v1 .hero-stats p {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-top: 1px;
  }
}

/* --- 7. Marquee: icon per keyword, pause on hover --------------------- */
body[data-page="landing"] .logo-marquee .marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body[data-page="landing"] .logo-marquee .mq-ico {
  width: 14px;
  height: 14px;
  color: var(--lm-lime);
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="landing"] .logo-marquee .marquee:hover .marquee-track {
    animation-play-state: paused;
  }
}

/* --- 8. Section eyebrow line draws in --------------------------------- */
body[data-page="landing"] .reveal .eyebrow::before {
  transform: scaleX(0);
  transform-origin: left center;
}

body[data-page="landing"] .reveal.visible .eyebrow::before {
  animation: xdLineGrow 700ms var(--lm-ease) 160ms forwards;
}

@keyframes xdLineGrow {
  to { transform: scaleX(1); }
}

html.reveal-static body[data-page="landing"] .reveal .eyebrow::before {
  transform: none;
  animation: none;
}

/* --- 9. Service / process cards: icon badge in the title row ---------- */
body[data-page="landing"] #services .service-card h3,
body[data-page="landing"] #process .process-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  text-wrap: balance;
}

body[data-page="landing"] .card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(207, 254, 37, 0.26);
  background: rgba(207, 254, 37, 0.09);
  color: var(--lm-lime);
  font-size: 18px;
  flex: 0 0 auto;
  transition: transform 320ms var(--lm-ease), background 320ms ease, box-shadow 320ms ease;
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="landing"] .premium-card:hover .card-ico {
    transform: translateY(-2px) rotate(-6deg);
    background: rgba(207, 254, 37, 0.18);
    box-shadow: 0 0 0 4px rgba(207, 254, 37, 0.07);
  }
}

body[data-page="landing"] :is(.service-card, .process-card, .xp-card, .testimonial-card, .founder-story-card, .faq) p,
body[data-page="landing"] .section-lead {
  text-wrap: pretty;
}

/* Real arrow in the card links (was an ASCII "->"). */
body[data-page="landing"] .service-card-link::after {
  content: none;
}

body[data-page="landing"] .service-card-link .xd-arrow {
  width: 14px;
  height: 14px;
  transition: transform 260ms var(--lm-ease);
}

body[data-page="landing"] .service-card-link:hover .xd-arrow,
body[data-page="landing"] .service-card-link:focus-visible .xd-arrow {
  transform: translateX(3px);
}

/* --- 10. Experience: integration nodes + support pill ----------------- */
body[data-page="landing"] .integration-node {
  min-width: 38px;
  height: 38px;
  padding: 0;
}

body[data-page="landing"] .integration-node .xd-ico {
  width: 16px;
  height: 16px;
}

/* Phones: the orbit is narrower than the node radii, so nodes were clipped
   by the card edge. Pull them in (cloud/pay are already hidden there). */
@media (max-width: 820px) {
  body[data-page="landing"] .integration-orbit {
    height: 264px;
  }

  body[data-page="landing"] .integration-node.node-api { --node-radius: 100px; }
  body[data-page="landing"] .integration-node.node-web { --node-radius: 84px; }
  body[data-page="landing"] .integration-node.node-db { --node-radius: 96px; }
  body[data-page="landing"] .integration-node.node-bot { --node-radius: 102px; }
}

body[data-page="landing"] .support-pill .xd-ico {
  width: 16px;
  height: 16px;
  color: var(--xd-coral, #ff8e74);
}

/* --- 11. Text positioning fixes --------------------------------------- */
@media (max-width: 820px) {
  body[data-page="landing"] #faq .section-head {
    margin-bottom: 20px;
  }
}

body[data-page="landing"] .site-footer .copyright-wrap p {
  font-variant-numeric: tabular-nums;
}

/* --- 12. Rendering budget: skip layout/paint of far-below-fold sections */
body[data-page="landing"] :is(#testimonials, #process, #story, #faq) {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

body[data-page="landing"] .site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 640px;
}

/* --- 13. Motion budget: paused / limited / reduced -------------------- */
body[data-page="landing"].hero-motion-paused .hero-tech-backdrop .tech-core .orbit-tag,
body[data-page="landing"].hero-motion-paused .hero-tech-backdrop .tech-ring-one::after {
  animation-play-state: paused;
}

body[data-page="landing"].landing-motion-limited .hero-tech-backdrop .tech-core .orbit-tag {
  display: none;
}

body[data-page="landing"].landing-motion-limited .xd-aurora-blob,
body[data-page="landing"].landing-motion-limited .xd-aurora-beam {
  animation: none;
}

body[data-page="landing"].landing-motion-limited .xd-hero-glow {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="landing"] .xd-aurora-blob,
  body[data-page="landing"] .xd-aurora-beam,
  body[data-page="landing"] .hero-tech-backdrop .tech-ring-one::after,
  body[data-page="landing"] .reveal .eyebrow::before {
    animation: none !important;
  }

  body[data-page="landing"] .reveal .eyebrow::before {
    transform: none;
  }

  body[data-page="landing"] .hero-tech-backdrop .tech-core .orbit-tag {
    animation: none !important;
    opacity: 0.85;
    transform: none;
  }

  body[data-page="landing"] .hero-v1 h1 .hw-i {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  body[data-page="landing"] .reveal.visible .xd-draw use {
    stroke-dasharray: none;
    animation: none !important;
  }

  body[data-page="landing"] .xd-hero-glow,
  body[data-page="landing"] .xd-progress {
    display: none;
  }
}
