/**
 * ========================================================================
 * finly — Corporate & Financial Services HTML Template
 * Version : 1.0.0
 * Author  : WebStudio
 * License : Commercial (ThemeForest / TemplateMonster)
 * ========================================================================
 */

/* ══════════════════════════════════════════════════════
   GLOBAL STYLES & CSS VARIABLES
   Provides core color palette and global resets
   ══════════════════════════════════════════════════════ */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}

:root {
  /* ── Core Palette ── */
  --lp-primary: #0000ff;
  --lp-primary-dark: #1e40af;
  --lp-primary-glow: rgba(26, 86, 219, 0.35);
  --lp-accent: #0b0f19;
  --lp-bg: #f9fafb;
  --lp-surface: #ffffff;
  --lp-muted: #ececec;
  --lp-border: #e5e7eb;
  --border-subtle: #e5e7eb; /* Used in HTML border styles */

  /* ── Clean Light Mode ── */
  --ds-bg: #f9fafb;
  --ds-surface: #ffffff;
  --ds-border: #e5e7eb;
  --ds-text: #0b0f19;
  --ds-text-muted: #6b7280;
  --ds-glass: rgba(0, 0, 0, 0.03);
  --ds-glass-border: rgba(0, 0, 0, 0.08);

  /* ── Functional ── */
  --lp-success: #10b981;
  --lp-danger: #ef4444;
}

/* ══════════════════════════════════════════════════════
   LEDGER-CUT SHAPES
   Signature asymmetric clip-path system for bottom-right corners
   ══════════════════════════════════════════════════════ */

/* Standard: 15px bottom-right chamfer */
.ledger-cut {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    0 100%
  );
}

/* Large: 30px bottom-right chamfer (used in hero, featured sections) */
.ledger-cut-lg {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 30px),
    calc(100% - 30px) 100%,
    0 100%
  );
}

/* Circle mask: Used for decorative globe/earth imagery */
.lp-circle-mask {
  clip-path: circle(50% at 50% 50%);
}

/* ══════════════════════════════════════════════════════
   NAVIGATION
   Glassmorphic sticky header
   ══════════════════════════════════════════════════════ */
.lp-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--ds-glass-border);
  transition: all 0.3s ease;
}

@media (min-width: 1024px) {
  .lp-nav.desktop-transparent {
    background-color: transparent;
    border-bottom-color: transparent;
    box-shadow: none !important;
  }
}

/* Added dynamically via JS when scrolling */
.lp-nav.scrolled {
  box-shadow: 0 2px 40px rgba(0, 0, 0, 0.08);
}

/* ── Active-Page Indicator ──
   2px animated bottom border on the active nav item */
.lp-nav-link {
  position: relative;
}

.lp-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--lp-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.lp-nav-link.lp-nav-active::after {
  transform: scaleX(1);
}

/* ── Hover Underline Slide-In ──
   Inactive items get a subtle left-to-right underline on hover */
.lp-nav-link:not(.lp-nav-active):hover::after {
  transform: scaleX(1);
  background: var(--lp-primary);
  opacity: 0.4;
}

/* ── Desktop Dropdown & Mega-menu Entrance ──
   Smooth scale + fade for a polished feel */
.lp-dropdown-panel {
  transform-origin: top center;
}

/* ── Mega-menu Column Headers ── */
.lp-mega-heading {
  font-family: "Clash Display", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-primary);
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--lp-border);
  margin-bottom: 0.25rem;
}

/* ── Mobile Drawer Section Label ── */
.lp-mobile-section-label {
  font-family: "Clash Display", sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lp-primary);
  padding: 0.625rem 1rem 0.25rem;
  border-bottom: 1px solid var(--lp-border);
  margin-bottom: 0.125rem;
}

/* ══════════════════════════════════════════════════════
   CLIENT LOGOS (MARQUEE)
   Infinite horizontal scrolling container for partner logos
   ══════════════════════════════════════════════════════ */
.lp-marquee-track {
  animation: marqueeScroll 60s linear infinite;
}

@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ══════════════════════════════════════════════════════
   STATUS DOT
   Pulsing dot animation for status indicators
   ══════════════════════════════════════════════════════ */

@keyframes statusPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

.lp-status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lp-accent);
  animation: statusPulse 0.8s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════
   SERVICES GRID
   Interactive hover effects
   ══════════════════════════════════════════════════════ */
.lp-service-item:hover {
  cursor: pointer;
}

.lp-service-item:hover img {
  transform: scale(0.8);
}

.lp-service-item:hover h3 {
  color: var(--lp-primary) !important;
}

/* ══════════════════════════════════════════════════════
   FUTURE OF FINANCE
   Interactive hover states for "How it works" sections
   ══════════════════════════════════════════════════════ */
.lp-future {
  position: relative;
  overflow: hidden;
}

.lp-future::before {
  content: "";
  position: absolute;
  inset: 0;
  background: black;
  transform: translateY(100%);
  transition: transform 0.6s ease;
  z-index: 0;
}

.lp-future:hover::before {
  transform: translateY(0);
}

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

.lp-future:hover h3 {
  color: white;
}

.lp-future:hover p {
  color: rgb(206, 206, 206);
}

/* ══════════════════════════════════════════════════════
   BACKGROUND IMAGE CASE STUDIES
   ══════════════════════════════════════════════════════ */
.bg-img {
  background-image:
    linear-gradient(#000000da, #000000d8), url("../img/CASE-STUDIES-bg.jpg");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ══════════════════════════════════════════════════════
   CASE STUDIES
   ══════════════════════════════════════════════════════ */

.case-study:hover {
  cursor: pointer;
}
.case-study:hover img {
  transform: scale(1.1);
  transition: all 0.5s ease-in-out;
}
.case-study:hover h3 {
  color: var(--lp-primary);
  transition: all 0.5s ease-in-out;
}

/* ══════════════════════════════════════════════════════
   BAR CHART 
   Interactive CSS stat bars with hover glow
   ══════════════════════════════════════════════════════ */
.lp-bar {
  transition: height 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lp-bar:hover {
  filter: brightness(1.3);
  box-shadow: 0 0 12px var(--lp-primary-glow);
}

/* ══════════════════════════════════════════════════════
   FOOTER UTILITIES
   Custom boundaries for footer links
   ══════════════════════════════════════════════════════ */
.border-b-footer {
  border-bottom: 1px solid rgba(65, 65, 65, 0.664);
}

.border-t-footer {
  border-top: 1px solid rgba(65, 65, 65, 0.664);
}

/* ══════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATION SYSTEM
   Data-attribute-driven entrance animations using
   hardware-accelerated CSS transitions (transform + opacity only).
   
   USAGE:
     .animate-on-scroll.fade-up    → fade in + slide up 25px
     .animate-on-scroll.fade-down  → fade in + slide down 25px
     .animate-on-scroll.fade-left  → fade in + slide from left 25px
     .animate-on-scroll.fade-right → fade in + slide from right 25px
     .animate-on-scroll.fade       → fade in (no movement)
     .animate-on-scroll.zoom-in    → fade in + scale from 0.95
   
     Use Tailwind delay classes (e.g. delay-100) → stagger timing
   
   The JS Intersection Observer adds `.is-visible` when
   the element enters the viewport. Elements animate once
   and are then unobserved.
   ══════════════════════════════════════════════════════ */

@layer utilities {
  /* ── Hidden State (before entering viewport) ── */
  .animate-on-scroll {
    opacity: 0;
    will-change: transform, opacity;
    transition:
      opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
      transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  /* ── Directional Starting Positions ── */
  .animate-on-scroll.fade-up {
    transform: translateY(25px);
  }
  .animate-on-scroll.fade-down {
    transform: translateY(-25px);
  }
  .animate-on-scroll.fade-left {
    transform: translateX(-25px);
  }
  .animate-on-scroll.fade-right {
    transform: translateX(25px);
  }
  .animate-on-scroll.fade {
    transform: none;
  }
  .animate-on-scroll.zoom-in {
    transform: scale(0.95);
  }

  /* ── Visible State (after entering viewport) ── */
  .animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
  }
}

/* ── Accessibility: Respect prefers-reduced-motion ──
   Instantly show all animated elements without any
   transition for users with motion sensitivity.        */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }
}

/* ══════════════════════════════════════════════════════
   CUSTOM SCROLLBAR
   Subtle styled scrollbar for supported browsers
   ══════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: var(--ds-bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(26, 86, 219, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--lp-primary);
}

/* ══════════════════════════════════════════════════════
   LOADING OVERLAY (PRELOADER)
   Premium branded preloader shown during page load.
   Injected via <lp-loader> Web Component (components/loader.js).
   Dismissed on window.onload.

   Components:
     .lp-loader-overlay      → full-screen backdrop (host element)
     .lp-loader-logo         → brand SVG icon
     .lp-loader-wordmark     → "FINLY" logotype
     .lp-loader-tagline      → sub-label
     .lp-loader-progress-rail → track for animated bar
     .lp-loader-progress-bar → indeterminate sliding fill
     .lp-loader-dots         → three-dot pulse status row
   ══════════════════════════════════════════════════════ */

/* ── Overlay Backdrop ── */
.lp-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Subtle crosshatch grid — feels technical, matches Finly aesthetic */
  background-color: var(--lp-bg, #f9fafb);
  background-size: 32px 32px;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

/* ── Fade-out state (added by JS) ── */
.lp-loader-overlay.lp-loader-hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes lpCardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Loader Container ── */
.lp-loader-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
}

/* ── Brand logo Material Icon wrapper ── */
.lp-loader-logo {
  position: relative;
  flex-shrink: 0;
  animation: lpLogoPulse 2.4s ease-in-out infinite;
  will-change: transform, opacity;
  z-index: 10;
}

@keyframes lpLogoPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.96);
  }
}

/* ── Circular Loader ── */
.lp-loader-spinner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--lp-border, #e5e7eb);
  border-top-color: var(--lp-primary, #0000ff);
  animation: lpSpin 1s linear infinite;
  will-change: transform;
}

@keyframes lpSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Accessibility: Respect prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .lp-loader-overlay {
    transition: none !important;
  }
  .lp-loader-logo {
    animation: none;
  }
  .lp-loader-spinner {
    animation-duration: 1.6s;
  }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   Adjust clip paths on smaller screens
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ledger-cut {
    clip-path: polygon(
      0 0,
      100% 0,
      100% calc(100% - 24px),
      calc(100% - 24px) 100%,
      0 100%
    );
  }
  .ledger-cut-lg {
    clip-path: polygon(
      0 0,
      100% 0,
      100% calc(100% - 40px),
      calc(100% - 40px) 100%,
      0 100%
    );
  }
}
