/* ==========================================================================
   Valar Digital Commerce — Modern+ layer
   Builds on modern.css: page transitions, word-split heading reveals,
   3D tilt cards with cursor spotlight, hero mouse-parallax, aurora dark
   bands with wave dividers, per-section background morph, scroll hint,
   image zoom frames, animated footer links. No content changes.
   ========================================================================== */

/* ---------------- Page transition curtain ---------------- */
/* Pre-cover: a head script adds .curtain-pending before first paint, so the
   page is hidden until the JS-built curtain takes over (same colour, no flash). */
html.curtain-pending body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10011;
  background: linear-gradient(180deg, #0b2e5f 0%, #084da8 100%);
}

@media (prefers-reduced-motion: reduce) {
  html.curtain-pending body::before { display: none; }
}

.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 10010;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.page-curtain i {
  display: block;
  background: linear-gradient(180deg, #0b2e5f 0%, #084da8 100%);
  transform-origin: 50% 0%;
  transform: scaleY(1);
  transition: transform 0.5s var(--ease-out);
}

.page-curtain i:nth-child(2) { transition-delay: 0.03s; }
.page-curtain i:nth-child(3) { transition-delay: 0.06s; }
.page-curtain i:nth-child(4) { transition-delay: 0.09s; }
.page-curtain i:nth-child(5) { transition-delay: 0.12s; }

.ready .page-curtain {
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.65s;
}

.ready .page-curtain i {
  transform: scaleY(0);
}

/* Leaving: panels rise from the bottom, left to right. JS starts the
   navigation at 260ms, so keep this short (last panel completes at 0.38s);
   the next page commits under its own matching pre-cover. */
/* .ready already hid the curtain, and .ready stays on <body>, so without this
   the whole leaving animation plays invisibly: every internal link click
   looked like a 720ms dead freeze followed by a jump. Bring it straight back,
   with no visibility delay, so the cover is actually seen. */
.leaving .page-curtain {
  visibility: visible;
  transition: none;
}
.leaving .page-curtain i {
  transform-origin: 50% 100%;
  transform: scaleY(1);
  transition: transform 0.3s var(--ease-out);
}

.leaving .page-curtain i:nth-child(2) { transition-delay: 0.02s; }
.leaving .page-curtain i:nth-child(3) { transition-delay: 0.04s; }
.leaving .page-curtain i:nth-child(4) { transition-delay: 0.06s; }
.leaving .page-curtain i:nth-child(5) { transition-delay: 0.08s; }

.leaving {
  pointer-events: none;
}

.page-curtain .brand-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.35s var(--ease);
}

.page-curtain .brand-mark img {
  height: 56px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  animation: markPulse 1.4s ease-in-out infinite;
}

.ready .page-curtain .brand-mark {
  opacity: 0;
}

.leaving .page-curtain .brand-mark {
  opacity: 1;
  transition-delay: 0.15s;
}

@keyframes markPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* ---------------- Section headings: word-split rise ---------------- */
.split-words .sw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

/* Word wrappers must not pick up the italic "accent span" styling */
.split-words .sw,
.split-words .sw > span {
  font-style: inherit;
  font-weight: inherit;
  color: inherit;
}

.split-words .sw > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.split-words.is-visible .sw > span {
  transform: translateY(0);
}

/* ---------------- 3D tilt + spotlight cards ---------------- */
.tilt {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition: transform 0.25s ease-out, box-shadow 0.6s var(--ease-out), border-color 0.4s;
  position: relative;
  overflow: hidden;
}

.tilt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(8, 77, 168, 0.12), transparent 60%);
  transition: opacity 0.4s var(--ease);
}

.tilt.is-hover::before {
  opacity: 1;
}

.phase-card.tilt::before,
.cta-card.blue-card.tilt::before,
.cta-card.green-card.tilt::before {
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.22), transparent 60%);
}

.tilt > * {
  position: relative;
  z-index: 1;
}

/* Shimmer border on hover */
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--ang, 0deg), rgba(8, 77, 168, 0) 0%, rgba(8, 77, 168, 0.6) 20%, rgba(89, 143, 47, 0.6) 40%, rgba(8, 77, 168, 0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.tilt.is-hover::after {
  opacity: 1;
  animation: spinAng 2.4s linear infinite;
}

@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes spinAng {
  to { --ang: 360deg; }
}

/* Icons inside tilt cards float forward */
.tilt .icon {
  transform: translateZ(30px);
}

/* ---------------- Hero: full-height centred stance ---------------- */
@media (min-width: 992px) {
  .hero-section {
    min-height: clamp(560px, 84vh, 900px);
    display: flex;
    align-items: center;
    padding-top: 40px !important;
    padding-bottom: 80px !important;
  }

  .hero-section > .container {
    width: 100%;
  }

  .hero-section h1 {
    font-size: clamp(44px, 5.2vw, 76px) !important;
    margin-bottom: 1.4rem;
  }

  .hero-section p.lead {
    font-size: clamp(17px, 1.3vw, 20px) !important;
    max-width: 62ch;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-section .text-lg-start + p.lead,
  .hero-section .col-lg-6 p.lead {
    margin-left: 0;
  }

  .hero-section .cta-action {
    padding-top: 24px !important;
  }
}

/* ---------------- Hero: mouse parallax layers + orbit ring ---------------- */
.hero-section [data-depth] {
  will-change: transform;
}

.hero-orbit {
  position: absolute;
  z-index: -1;
  width: min(56vw, 640px);
  height: min(56vw, 640px);
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px dashed rgba(8, 77, 168, 0.22);
  pointer-events: none;
  animation: orbitSpin 60s linear infinite;
  will-change: transform;
  contain: paint layout;
}

.hero-orbit::before,
.hero-orbit::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--v-green);
  box-shadow: 0 0 0 8px rgba(89, 143, 47, 0.15);
  top: -7px;
  left: calc(50% - 7px);
}

.hero-orbit::after {
  background: var(--v-blue);
  box-shadow: 0 0 0 8px rgba(8, 77, 168, 0.15);
  top: auto;
  bottom: -7px;
}

.hero-section.text-center .hero-orbit,
.hero-section:not(:has(.col-lg-6, .col-md-6)) .hero-orbit {
  right: 50%;
  transform: translate(50%, -50%);
  width: min(70vw, 860px);
  height: min(70vw, 860px);
  opacity: 0.7;
}

@keyframes orbitSpin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.hero-section.text-center .hero-orbit,
.hero-section:not(:has(.col-lg-6, .col-md-6)) .hero-orbit {
  animation-name: orbitSpinCentered;
}

@keyframes orbitSpinCentered {
  from { transform: translate(50%, -50%) rotate(0deg); }
  to { transform: translate(50%, -50%) rotate(360deg); }
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--v-ink-45);
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.8s var(--ease) 1.6s;
  z-index: 2;
}

.scroll-hint::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--v-blue);
  animation: hintDrop 1.8s var(--ease) infinite;
}

.ready .scroll-hint {
  opacity: 0.8;
}

.navbar.is-scrolled ~ * .scroll-hint,
body.scrolled .scroll-hint {
  opacity: 0;
  transition-delay: 0s;
}

@keyframes hintDrop {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* Conic halo behind the ONDC hero card / photo frames */
.ondc-hero-card::before,
.hero-visual::after {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from 0deg, rgba(8, 77, 168, 0.0), rgba(8, 77, 168, 0.35), rgba(89, 143, 47, 0.35), rgba(8, 77, 168, 0.0));
  filter: blur(20px);
  opacity: 0.65;
  animation: haloSpin 16s linear infinite;
  will-change: transform;
  contain: paint layout;
  pointer-events: none;
}

.hero-visual {
  position: relative;
}

.hero-visual::after {
  inset: 8% 10%;
  border-radius: 40%;
}

@keyframes haloSpin {
  from { transform: translateZ(0) rotate(0deg); }
  to { transform: translateZ(0) rotate(360deg); }
}

/* ---------------- Aurora dark bands + wave dividers ---------------- */
.expand-business,
.expand-photo-section {
  overflow: hidden;
}

.expand-business::after,
.expand-photo-section::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 20% 30%, rgba(8, 77, 168, 0.55), transparent 70%),
    radial-gradient(35% 45% at 80% 70%, rgba(89, 143, 47, 0.35), transparent 70%),
    radial-gradient(30% 40% at 60% 20%, rgba(108, 79, 161, 0.35), transparent 70%);
  filter: blur(40px);
  animation: aurora 22s ease-in-out infinite alternate;
  pointer-events: none;
}

/* TRANSLATE ONLY - same reason as blobDrift: this layer is a 40px-blurred
   radial gradient spanning inset:-40% -20% of a whole section. Scale/rotate
   here forces that blur to be recomputed every frame for the life of the page. */
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(-4%, 3%, 0); }
  100% { transform: translate3d(3%, -3%, 0); }
}

/* Wave divider inserted by JS before dark bands */
.wave-divider {
  display: block;
  width: 100%;
  height: 70px;
  margin-bottom: -1px;
  color: var(--v-ink);
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wave-divider path {
  fill: currentColor;
}

.wave-divider .w2 {
  opacity: 0.35;
  animation: waveShift 9s ease-in-out infinite alternate;
}

@keyframes waveShift {
  to { transform: translateX(-4%); }
}

/* Pointer light on the dark bands (modern-plus.js moves it with `translate`;
   a fixed-size soft gradient on its own layer, so moving it never repaints). */
.cursor-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 560px;
  height: 560px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 150, 255, 0.24) 0%, rgba(92, 150, 255, 0.08) 38%, transparent 68%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
  will-change: translate;
}

.glow-on > .cursor-glow {
  opacity: 1;
}

/* ---------------- Per-section background morph ---------------- */
body { transition: background-color 1.1s var(--ease); }

/* ---------------- Image zoom frames ---------------- */
.empower-video,
.benefits-section .benifits-cont,
.build-visual,
.about-section .about-image-container,
.founder-section .img-container {
  overflow: hidden;
  border-radius: var(--v-r-lg);
}

.empower-video img,
.benefits-section .benifits-cont img,
.build-visual img,
.about-section .about-image-container img {
  transition: transform 1.2s var(--ease-out), filter 0.6s var(--ease);
  will-change: transform;
}

.empower-video:hover img,
.benefits-section .benifits-cont:hover img,
.build-visual:hover img,
.about-section .about-image-container:hover img {
  transform: scale(1.05);
}

/* ---------------- Footer links: sliding underline ---------------- */
.footer .footer-menus ul li a,
.footer .footer-quick-links ul li a,
.footer-rights-policies .copyrights ul.policies a {
  position: relative;
  display: inline-block;
}

.footer .footer-menus ul li a::after,
.footer .footer-quick-links ul li a::after,
.footer-rights-policies .copyrights ul.policies a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.45s var(--ease-out);
}

.footer .footer-menus ul li a:hover::after,
.footer .footer-quick-links ul li a:hover::after,
.footer-rights-policies .copyrights ul.policies a:hover::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

/* ---------------- Accordion: rotating plus icon ---------------- */
.accordion-button::after {
  background-image: none !important;
  width: 1.1rem;
  height: 1.1rem;
  position: relative;
  flex-shrink: 0;
}

.accordion-button::before,
.accordion-button::after {
  transition: transform 0.45s var(--ease-out), background-color 0.3s;
}

.accordion-button::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--v-blue);
  transform: rotate(0deg);
}

.accordion-button:not(.collapsed)::after {
  transform: rotate(45deg);
}

/* ---------------- Idle off-screen decorations ----------------
   modern.js adds .is-idle to a host once it scrolls out of sight. This freezes
   the loops inside it so they stop costing frames on a page you have scrolled
   past. !important because the animation shorthand on each of these (and on
   the pseudo-elements the halo and the aurora live on) resets
   animation-play-state back to running and outranks a plain descendant
   selector. Transitions are untouched, so scroll reveals and the page curtain
   still play normally. */
.is-idle,
.is-idle *,
.is-idle::before,
.is-idle::after {
  animation-play-state: paused !important;
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .page-curtain { display: none; }
  .split-words .sw > span { transform: none !important; transition: none !important; }
  .tilt { transform: none !important; }
  .tilt::after, .hero-orbit, .scroll-hint, .ondc-hero-card::before, .hero-visual::after,
  .expand-business::after, .expand-photo-section::after { animation: none !important; }
  .wave-divider .w2 { animation: none; }
}

@media (max-width: 940px) {
  .hero-orbit { display: none; }
  .scroll-hint { display: none; }
}
