/* ==========================================================================
   Motion layer — loaded last on every page.
   Principles: restrained, purposeful, transform/opacity only, one shared
   timing scale (tokens.css). The approved hero, globe, currency fans and
   RBI notice motion are intentionally NOT changed here.
   Reduced motion: base.css collapses every animation/transition, and
   motion.js never hides content, so everything simply appears.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scroll reveal (one-time). motion.js adds [data-reveal] only to elements
      that start below the fold, so nothing visible at load is ever hidden.
   -------------------------------------------------------------------------- */

[data-reveal]:not(.is-revealed) {
  opacity: 0;
  translate: 0 18px;
}

[data-reveal].is-revealed {
  animation: reveal-up var(--dur-reveal) var(--ease-out) var(--reveal-delay, 0ms) both;
}

@keyframes reveal-up {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}

@media print {
  [data-reveal] { opacity: 1 !important; translate: none !important; animation: none !important; }
}

/* --------------------------------------------------------------------------
   2. Navigation — active underline grows in rather than snapping
   -------------------------------------------------------------------------- */

.nav-list a::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-2) var(--ease-out);
}

.nav-list a.is-active::after {
  transform: scaleX(1);
}

@media (max-width: 1279.98px) {
  .js .nav-list a::after {
    right: auto;
    width: 18px;
    bottom: 8px;
  }
}

/* --------------------------------------------------------------------------
   3. Consistent hover timing for links and small controls
   -------------------------------------------------------------------------- */

.nav-list a,
.footer-links a,
.footer-legal a,
.kc-filter,
.ir-filter,
.ir-jump a,
.dest-options span,
.seg span,
.svc-close,
.nav-toggle {
  transition-duration: var(--dur-1);
}

/* Arrow icons inside CTAs nudge forward */
.btn svg:has(use[href="#i-arrow-right"]),
.xcard-cta .icon {
  transition: transform var(--dur-2) var(--ease-out);
}

.btn:hover svg:has(use[href="#i-arrow-right"]),
.btn:focus-visible svg:has(use[href="#i-arrow-right"]),
.xcard:hover .xcard-cta .icon,
.xcard:focus-visible .xcard-cta .icon {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   4. Explore Forex cards — gentle lift + a small, card-specific response
   -------------------------------------------------------------------------- */

.xcard {
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}

.xcard:hover {
  transform: translateY(-4px);
}

.xcard:active {
  transform: translateY(-1px);
  transition-duration: var(--dur-1);
}

/* Buy & Sell — fans open a few degrees */
.xbuy-note {
  transition: rotate var(--dur-3) var(--ease-out);
}
.xcard--buy:hover .xbuy-note--back { rotate: -9deg; }
.xcard--buy:hover .xbuy-note--front { rotate: 6deg; }

/* Explore Currencies — flags rise in a soft wave */
.xflag {
  transition: transform var(--dur-2) var(--ease-out);
}
.xcard--explore:hover .xflag { transform: translateY(-3px); }
.xcard--explore:hover .xflag:nth-child(2) { transition-delay: 30ms; }
.xcard--explore:hover .xflag:nth-child(3) { transition-delay: 60ms; }
.xcard--explore:hover .xflag:nth-child(4) { transition-delay: 90ms; }
.xcard--explore:hover .xflag:nth-child(5) { transition-delay: 120ms; }

/* Forex Cards — the card straightens slightly */
.fxcard {
  transition: transform var(--dur-3) var(--ease-out);
}
.xcard--cards:hover .fxcard--front { transform: rotate(-3deg) translateY(-3%); }
.xcard--cards:hover .fxcard--back { transform: translate(15%, -16%) rotate(12deg); }

/* Corporate Forex — the swap icon turns */
.xcorp-arrow {
  transition: rotate var(--dur-3) var(--ease-out);
}
.xcard--corp:hover .xcorp-arrow { rotate: 180deg; }

/* --------------------------------------------------------------------------
   5. Service dialog — same entrance language as the RBI notice;
      bottom sheet slides up on phones
   -------------------------------------------------------------------------- */

.svc-dialog[open] {
  animation: svc-in var(--dur-3) var(--ease-out) both;
}

.svc-dialog[open]::backdrop {
  animation: motion-fade-in var(--dur-2) ease both;
}

.svc-dialog.is-closing {
  animation: svc-out 200ms var(--ease-in) both;
}

.svc-dialog.is-closing::backdrop {
  animation: motion-fade-out 200ms var(--ease-in) both;
}

@media (max-width: 599.98px) {
  .svc-dialog[open] { animation-name: svc-sheet-in; }
  .svc-dialog.is-closing { animation-name: svc-sheet-out; }
}

@keyframes svc-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes svc-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(8px) scale(0.985); }
}
@keyframes svc-sheet-in {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
@keyframes svc-sheet-out {
  from { transform: none; }
  to   { transform: translateY(100%); }
}
@keyframes motion-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes motion-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Destination switch — detail panel content settles in */
.dest-detail.is-swapping > * {
  animation: motion-swap var(--dur-3) var(--ease-out) both;
}

/* Enquiry message preview updates softly */
.enq-preview.is-updating {
  animation: motion-swap var(--dur-2) var(--ease-out) both;
}

@keyframes motion-swap {
  from { opacity: 0; translate: 0 6px; }
  to   { opacity: 1; translate: 0 0; }
}

/* Enquiry option tick fills in */
.enq-tick {
  transition: border-color var(--dur-1) ease, background var(--dur-1) ease;
}

/* --------------------------------------------------------------------------
   6. Knowledge Centre — cards lift slightly; answers unfold
   -------------------------------------------------------------------------- */

.kc-card {
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}

.kc-card:hover {
  transform: translateY(-2px);
}

.kc-card[open] .kc-body {
  animation: motion-unfold var(--dur-3) var(--ease-out) both;
}

.kc-toggle {
  transition: background-color var(--dur-1) ease;
}

@keyframes motion-unfold {
  from { opacity: 0; translate: 0 -6px; }
  to   { opacity: 1; translate: 0 0; }
}

/* --------------------------------------------------------------------------
   7. Locations, Investors — quiet, colour/shadow-only feedback
   -------------------------------------------------------------------------- */

.loc-card,
.ir-disc {
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-3) var(--ease-out);
}

.loc-card:hover,
.loc-card:focus-within,
.ir-disc:hover {
  border-color: rgba(20, 20, 20, 0.18);
  box-shadow: 0 16px 36px -28px rgba(20, 20, 20, 0.4);
}

.ir-doc-title {
  transition: color var(--dur-1) ease;
}

.ir-doc:hover .ir-doc-title,
.ir-doc:focus-within .ir-doc-title {
  color: var(--c-red-700);
}
