/* ================================================================
   KDT Accounting — Custom Styles
   Dark premium theme with animated effects
   Used alongside Tailwind CSS v4 CDN
   ================================================================ */

/* ── CSS Custom Properties ── */
:root {
  --accent: #3b82f6;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --glow-blue: rgba(59, 130, 246, 0.5);
  --glow-violet: rgba(139, 92, 246, 0.4);
  --glow-cyan: rgba(6, 182, 212, 0.4);
  --surface: #18181b;
  --surface-hover: #27272a;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ── Animated Mesh Gradient Hero Background ── */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --hue-1 {
  syntax: "<number>";
  initial-value: 220;
  inherits: false;
}

@property --hue-2 {
  syntax: "<number>";
  initial-value: 270;
  inherits: false;
}

.mesh-gradient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  --angle: 0deg;
  --hue-1: 220;
  --hue-2: 270;
  background:
    radial-gradient(ellipse 80% 60% at 20% 60%, hsla(var(--hue-1), 80%, 55%, 0.25), transparent),
    radial-gradient(ellipse 60% 80% at 80% 30%, hsla(var(--hue-2), 70%, 50%, 0.2), transparent),
    radial-gradient(ellipse 50% 50% at 50% 80%, hsla(185, 70%, 45%, 0.15), transparent);
  animation: meshShift 12s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0%   { --hue-1: 220; --hue-2: 270; }
  33%  { --hue-1: 235; --hue-2: 290; }
  66%  { --hue-1: 210; --hue-2: 260; }
  100% { --hue-1: 230; --hue-2: 280; }
}

/* Fallback for browsers without @property */
@supports not (background: hsla(var(--hue-1, 220), 80%, 55%, 0.25)) {
  .mesh-gradient {
    background:
      radial-gradient(ellipse 80% 60% at 20% 60%, rgba(59, 130, 246, 0.2), transparent),
      radial-gradient(ellipse 60% 80% at 80% 30%, rgba(139, 92, 246, 0.18), transparent),
      radial-gradient(ellipse 50% 50% at 50% 80%, rgba(6, 182, 212, 0.12), transparent);
    animation: meshFallback 10s ease-in-out infinite alternate;
  }
}

@keyframes meshFallback {
  0%   { opacity: 0.8; transform: scale(1); }
  50%  { opacity: 1;   transform: scale(1.05); }
  100% { opacity: 0.85; transform: scale(0.98); }
}

/* ── Dot Grid Pattern ── */
.dot-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Noise Texture Overlay ── */
.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #3b82f6 45%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: linear-gradient(135deg, #ffffff 0%, #f59e0b 50%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-cyan {
  background: linear-gradient(135deg, #ffffff 0%, #06b6d4 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-subtle {
  background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient Line ── */
.gradient-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), var(--accent-3), transparent);
}

.gradient-line-top {
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

/* ── Glass Card ── */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-hover {
  transition: all 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glass-hover:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

/* ── Card Border Glow ── */
.glow-blue {
  transition: all 400ms ease;
}
.glow-blue:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.12), 0 20px 40px rgba(0, 0, 0, 0.25);
}

.glow-violet {
  transition: all 400ms ease;
}
.glow-violet:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.12), 0 20px 40px rgba(0, 0, 0, 0.25);
}

.glow-cyan {
  transition: all 400ms ease;
}
.glow-cyan:hover {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.12), 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* ── Card Light Sweep on Hover ── */
.light-sweep {
  position: relative;
  overflow: hidden;
}

.light-sweep::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transition: left 600ms ease;
  pointer-events: none;
}

.light-sweep:hover::after {
  left: 120%;
}

/* ── Accent Top Border for Cards ── */
.border-top-accent {
  position: relative;
}

.border-top-accent::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px 999px 0 0;
  opacity: 0;
  transition: opacity 400ms ease;
}

.border-top-accent:hover::before {
  opacity: 1;
}

.border-top-accent.accent-blue::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.border-top-accent.accent-violet::before {
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
}

.border-top-accent.accent-cyan::before {
  background: linear-gradient(90deg, var(--accent-3), var(--accent));
}

/* ── Button Glow ── */
.btn-glow {
  position: relative;
  transition: all 300ms ease;
}

.btn-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 300ms ease;
}

.btn-glow:hover {
  transform: translateY(-2px);
}

.btn-glow:hover::before {
  opacity: 0.6;
}

/* ── Brand Shimmer ── */
@keyframes brandShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.brand-shimmer {
  background: linear-gradient(
    90deg,
    #fafafa 0%,
    #3b82f6 25%,
    #fafafa 50%,
    #8b5cf6 75%,
    #fafafa 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: brandShimmer 4s linear 1;
}

/* ── Nav Underline Hover ── */
.nav-underline {
  position: relative;
}

.nav-underline::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 300ms ease;
  border-radius: 999px;
}

.nav-underline:hover::after,
.nav-underline.active::after {
  width: 100%;
}

/* ── Scroll Reveal Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 300ms; }
.delay-4 { transition-delay: 400ms; }
.delay-5 { transition-delay: 500ms; }

/* ── Timeline Connector ── */
.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.timeline-line.visible {
  transform: scaleX(1);
}

/* ── Step Number Style ── */
.step-number {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: 5rem;
  line-height: 1;
  opacity: 0.08;
  position: absolute;
  top: -0.5rem;
  right: 1rem;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.glass-hover:hover .step-number {
  opacity: 0.15;
}

/* ── Shimmer Header Bar ── */
@keyframes shimmerBar {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.shimmer-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  background-size: 300% 100%;
  animation: shimmerBar 6s ease infinite;
}

/* ── Mobile Nav ── */
.mobile-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, opacity 300ms ease;
  opacity: 0;
}

.mobile-nav.open {
  max-height: 300px;
  opacity: 1;
}

/* ── Floating Stat Cards Overlap ── */
@media (min-width: 768px) {
  .stat-overlap {
    margin-top: -4rem;
    position: relative;
    z-index: 5;
  }
}

/* ── Map Dark Style ── */
.map-frame {
  border: 0;
  border-radius: 16px;
  filter: brightness(0.8) contrast(1.1) saturate(0.8);
  transition: filter 400ms ease;
}

.map-frame:hover {
  filter: brightness(0.9) contrast(1.05) saturate(0.9);
}

/* ── Checkmark Animation ── */
@keyframes checkDraw {
  0% { stroke-dashoffset: 48; }
  100% { stroke-dashoffset: 0; }
}

.check-animated path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkDraw 500ms ease 200ms forwards;
}

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

  .reveal, .reveal-left, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }

  .timeline-line {
    transform: scaleX(1) !important;
  }
}
