/* =====================================================
   THE GROWTH WAY — MOTION LAYER
   -----------------------------------------------------
   Ye file saare pages pe same animation behaviour deti hai.

   Problem jo solve hua:
   Pehle har page apna alag reveal class use kar raha tha —
   index -> .is-visible, about/services -> .show,
   contact/portfolio -> .visible
   Isliye kuch pages pe animation chalti thi, kuch pe elements
   permanently invisible reh jaate the.

   Ab teeno class names support hain, aur js/site.js teeno
   lagata hai. Purani CSS ko chhua nahi gaya — ye uske upar
   layer ki tarah kaam karti hai.
===================================================== */

/* -----------------------------------------------------
   1. MOTION TOKENS
----------------------------------------------------- */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 220ms;
  --dur-base: 600ms;
  --dur-slow: 900ms;
  --accent: #a6ff3f;
}

/* -----------------------------------------------------
   2. PAGE LOAD
   Ek hi orchestrated entry — har section pe alag-alag
   effect nahi, warna page busy lagta hai.
----------------------------------------------------- */

body {
  opacity: 0;
  animation: tgw-page-in 500ms var(--ease-out) forwards;
}

@keyframes tgw-page-in {
  to {
    opacity: 1;
  }
}

/* Header ko neeche se slide karke laata hai, ek baar */
.tgw-nav {
  animation: tgw-header-in 700ms var(--ease-out) both;
}

@keyframes tgw-header-in {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* Hero content ka staggered entry (sirf hero, baaki sections
   scroll pe reveal hote hain) */
.hero-content > *,
.hero-container > * > *,
.hero .container > * {
  animation: tgw-hero-in var(--dur-slow) var(--ease-out) both;
}

.hero-content > *:nth-child(1) { animation-delay: 120ms; }
.hero-content > *:nth-child(2) { animation-delay: 220ms; }
.hero-content > *:nth-child(3) { animation-delay: 320ms; }
.hero-content > *:nth-child(4) { animation-delay: 420ms; }
.hero-content > *:nth-child(5) { animation-delay: 520ms; }

@keyframes tgw-hero-in {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* -----------------------------------------------------
   3. SCROLL REVEAL — teeno class naming conventions
----------------------------------------------------- */

.reveal,
.animate-on-scroll,
[data-aos] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
  will-change: opacity, transform;
}

.reveal.show,
.reveal.visible,
.reveal.is-visible,
.animate-on-scroll.show,
.animate-on-scroll.visible,
.animate-on-scroll.is-visible,
[data-aos].show,
[data-aos].visible,
[data-aos].is-visible {
  opacity: 1;
  transform: none;
}

/* Directional variants */
.reveal-left {
  opacity: 0;
  transform: translateX(-34px);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.reveal-right {
  opacity: 0;
  transform: translateX(34px);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.reveal-left.show,
.reveal-left.visible,
.reveal-left.is-visible,
.reveal-right.show,
.reveal-right.visible,
.reveal-right.is-visible,
.reveal-scale.show,
.reveal-scale.visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

/* -----------------------------------------------------
   4. SCROLL PROGRESS BAR (site.js inject karta hai)
----------------------------------------------------- */

.tgw-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 2000;
  background: transparent;
  pointer-events: none;
}

.tgw-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #6fe0ff);
  transition: width 90ms linear;
}

/* -----------------------------------------------------
   5. BACK TO TOP (site.js inject karta hai)
----------------------------------------------------- */

.tgw-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1500;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(12px);
  color: var(--accent);
  font-size: 17px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease-out);
}

.tgw-top.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.tgw-top:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.tgw-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* -----------------------------------------------------
   6. INTERACTION MOTION
   User ke action ka response — ye "generic decoration"
   nahi hai, ye batata hai ki kya clickable/active hai.
----------------------------------------------------- */

a,
button,
.btn,
.primary-btn,
.submit-btn {
  transition:
    color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft),
    border-color var(--dur-fast) var(--ease-soft),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.btn:hover,
.primary-btn:hover,
.submit-btn:hover {
  transform: translateY(-2px);
}

.btn:active,
.primary-btn:active,
.submit-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Arrow glyph nudge — sirf un links pe jinme arrow hai */
.btn span,
.text-link span,
.primary-btn span,
.submit-btn span {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn:hover span,
.text-link:hover span,
.primary-btn:hover span,
.submit-btn:hover span {
  transform: translate(3px, -3px);
}

/* Card lift — shadow ki jagah border glow (palette ke saath
   consistent, grey drop-shadow generic lagti hai) */
.service-card,
.work-card,
.project-card,
.mission,
.feature,
.info-card,
.highlight-card,
.mission-card,
.feature-card,
.process-step {
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft);
}

.service-card:hover,
.work-card:hover,
.project-card:hover,
.mission:hover,
.feature:hover,
.info-card:hover,
.highlight-card:hover,
.mission-card:hover,
.feature-card:hover,
.process-step:hover {
  transform: translateY(-4px);
  border-color: rgba(166, 255, 63, 0.38);
}

/* Keyboard focus — accessibility floor */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Form fields */
input,
select,
textarea {
  transition:
    border-color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft);
}

/* -----------------------------------------------------
   7. FORM FEEDBACK STATES
   Error apologize nahi karta, seedha batata hai.
----------------------------------------------------- */

.form-note.is-sending {
  color: #9aa4b4;
}

.form-note.is-ok {
  color: var(--accent);
}

.form-note.is-error {
  color: #ff8f8f;
}

.submit-btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.submit-btn.is-busy span {
  animation: tgw-spin 800ms linear infinite;
}

@keyframes tgw-spin {
  to {
    transform: rotate(360deg);
  }
}

/* -----------------------------------------------------
   FOOTER LEGAL LINKS
   Privacy/Terms — pehle plain text thi, ab clickable hai
   sab pages pe. Yahan rakha hai kyunki motion.css hi
   consistently sab 6 pages pe load hoti hai.
----------------------------------------------------- */

.legal-links {
  display: inline-flex;
  gap: 18px;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms var(--ease-soft);
}

.legal-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* -----------------------------------------------------
   8. REDUCED MOTION
   Jo log motion off rakhte hain unke liye sab kuch
   turant visible — kuch bhi hidden nahi rehna chahiye.
----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  body {
    opacity: 1;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .animate-on-scroll,
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* -----------------------------------------------------
   11. HONEYPOT (spam-guard field on the contact form)
   -----------------------------------------------------
   display:none wale fields kuch bots skip kar dete hain
   (wo check karte hain ki field visible hai ya nahi), isliye
   off-screen position + zero size use kiya hai - dikhta
   "technically present" hai bot ko, real user ko bilkul nahi.
----------------------------------------------------- */

.tgw-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Fallback: agar JavaScript hi off ho to content chhupa
   na reh jaaye. site.js turant <html> pe .js class lagata hai. */
html:not(.js) .reveal,
html:not(.js) .reveal-left,
html:not(.js) .reveal-right,
html:not(.js) .reveal-scale,
html:not(.js) .animate-on-scroll,
html:not(.js) [data-aos] {
  opacity: 1;
  transform: none;
}

html:not(.js) body {
  opacity: 1;
  animation: none;
}
