:root {
  --white: #ffffff;
  --off-white: #fafafa;
  --light-bg: #f8f8f9;
  --black: #0a0a0a;
  --dark: #1a1a1a;
  --charcoal: #2d2d2d;
  --slate: #474755;
  --gray: #5a5a68;
  --light-gray: #9090a0;
  --violet: #7c3aed;
  --violet-dark: #6d28d9;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --gradient-mixed: linear-gradient(135deg, var(--violet) 0%, var(--orange) 100%);
  --gradient-primary: linear-gradient(135deg, var(--violet) 0%, var(--violet-dark) 100%);
  --gradient-accent: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.05);
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.15);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.2);
  --radius-lg: 24px;
}

body {
  background-color: #F4F4F5;
  color: #0a0a0a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: auto;
}

#preloader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
  /* Disable blocking preloader for faster first paint */
  display: none;
}

#preloader.loaded {
  transform: translateY(-100%);
}

/* Fallback to hide preloader if JS is blocked */
body:not(.js-enabled) #preloader {
  animation: preloader-fallback 0.8s ease 1 1.6s forwards;
}

@keyframes preloader-fallback {
  to {
    transform: translateY(-100%);
  }
}

.nav-pill {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
  transition: all 0.4s ease;
}

.nav-pill.scrolled {
  background: rgba(10, 10, 10, 0.85);
  color: white;
  border-color: rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
}

.mobile-menu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  border-width: 0;
  border-color: transparent;
  transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}

.mobile-menu.open {
  max-height: 320px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  border-width: 1px;
  border-color: rgba(0, 0, 0, 0.08);
}

.mobile-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  transition: var(--transition);
}

.mobile-nav-link:hover {
  background: rgba(124, 58, 237, 0.1);
  color: var(--violet);
}

.nav-pill.scrolled .mobile-menu {
  background: rgba(10, 10, 10, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-pill.scrolled .mobile-nav-link {
  color: #e5e7eb;
}

.nav-pill.scrolled .mobile-nav-link:hover {
  background: rgba(249, 115, 22, 0.12);
  color: var(--orange);
}

.hover-bloom {
  position: relative;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.45s ease, border-color 0.45s ease, background-color 0.45s ease;
  will-change: transform, box-shadow;
}

.hover-bloom::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 rgba(124, 58, 237, 0);
  opacity: 0;
  transition: opacity 0.45s ease, box-shadow 0.45s ease;
  pointer-events: none;
}

.hover-bloom:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.15);
}

.hover-bloom:hover::after {
  opacity: 1;
  box-shadow: 0 0 55px rgba(124, 58, 237, 0.2);
}

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

.nav-underline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--violet), var(--orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  opacity: 0.9;
}

.nav-underline:hover::after,
.nav-pill.scrolled .nav-underline:hover::after,
.mobile-nav-link.nav-underline:hover::after {
  transform: scaleX(1);
}

.mobile-nav-link.nav-underline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-underline-kids::after {
  background: #0ea5e9;
}

@media (prefers-reduced-motion: reduce) {

  .hover-bloom,
  .hover-bloom:hover,
  .hover-bloom:active {
    transform: none;
  }
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  background-image: url('glove.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

body.custom-cursor-enabled #cursor {
  opacity: 1;
  visibility: visible;
}

#cursor.hovered {
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%) rotate(-15deg);
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 2s ease-in-out, transform 8s ease-out;
  transform: scale(1.1);
  z-index: 0;
}

.hero-frame {
  border-top-color: rgba(124, 58, 237, 0.22);
  border-right-color: rgba(124, 58, 237, 0.22);
  border-bottom-color: rgba(255, 255, 255, 0.9);
  border-left-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 28px 70px rgba(12, 10, 24, 0.28),
    0 20px 60px rgba(124, 58, 237, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.hero-frame::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background:
    linear-gradient(115deg, rgba(124, 58, 237, 0.3), rgba(124, 58, 237, 0.08) 38%, transparent 60%),
    radial-gradient(85% 85% at 100% 0%, rgba(124, 58, 237, 0.25), transparent 55%);
  filter: blur(12px);
  opacity: 0.85;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 5;
}

.hero-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(124, 58, 237, 0.5), transparent 75%) top/100% 3px no-repeat,
    linear-gradient(180deg, rgba(124, 58, 237, 0.5), transparent 75%) right/3px 100% no-repeat;
  opacity: 0.6;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 6;
}

.hero-bg-image.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.hero-section {
  min-height: 100vh;
}

.hero-frame {
  min-height: 360px;
}

@media (min-width: 768px) {
  .hero-frame {
    min-height: 450px;
  }
}

@media (min-width: 1024px) {
  .hero-frame {
    min-height: 520px;
  }
}

@media (min-width: 1280px) {
  .hero-frame {
    min-height: 570px;
  }
}

/* Fix for Safari border-radius clipping with transforms */
.hero-image-wrapper>div {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

@media (hover: hover) and (pointer: fine) {

  /* Hide the default system cursor on desktop only after custom cursor is enabled */
  body.custom-cursor-enabled,
  body.custom-cursor-enabled * {
    cursor: none !important;
  }

  body.custom-cursor-enabled a,
  body.custom-cursor-enabled button,
  body.custom-cursor-enabled input,
  body.custom-cursor-enabled textarea,
  body.custom-cursor-enabled select,
  body.custom-cursor-enabled label {
    cursor: auto !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  #cursor {
    display: none;
  }

  body,
  body * {
    cursor: auto !important;
  }
}

.highlight-card,
.stat-card,
.process-item,
.info-box,
.authority-item,
.step-card,
.plan-card,
.faq-item {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.highlight-card::before,
.plan-card::before,
.process-item::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.highlight-card::before,
.plan-card::before {
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--gradient-mixed);
}

.plan-card:nth-of-type(2)::before {
  background: var(--gradient-accent);
}

.highlight-card:hover {
  transform: translateY(-6px);
  border-color: var(--violet) !important;
  box-shadow: var(--shadow-md);
}

.highlight-card:hover::before,
.plan-card:hover::before {
  transform: scaleX(1);
  opacity: 1;
}

.stat-card::before {
  background: var(--gradient-mixed);
  opacity: 0;
  pointer-events: none;
  content: "";
  position: absolute;
  inset: 0;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--violet) !important;
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
  opacity: 0.05;
}

.process-item::before {
  width: 6px;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--gradient-mixed);
}

.info-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-mixed);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.process-item:hover {
  transform: translateX(10px);
  border-color: var(--violet) !important;
  box-shadow: var(--shadow-md);
}

.process-item:hover::before {
  opacity: 1;
}

.info-box:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--violet) !important;
}

.section-dark .info-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--light-gray);
}

.section-light .info-box {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--slate);
}

.info-box:hover::before {
  opacity: 1;
}

.authority-item:hover,
.faq-item:hover {
  transform: translateX(10px);
  border-color: var(--violet) !important;
  box-shadow: var(--shadow-md);
}

.faq-item:hover {
  border-color: var(--orange) !important;
}

.step-card:hover {
  transform: translateY(-6px);
  border-color: var(--violet) !important;
  box-shadow: var(--shadow-md);
}

.plan-card:hover {
  transform: translateY(-8px);
  border-color: var(--violet) !important;
  box-shadow: var(--shadow-lg);
}

.plan-card:nth-of-type(2):hover {
  border-color: var(--orange) !important;
}

/* Text readability enhancement for light backgrounds */
.text-shadow {
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.8),
    1px 1px 3px rgba(0, 0, 0, 0.6),
    -1px -1px 3px rgba(0, 0, 0, 0.6);
}

@keyframes pulse-violet {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7);
  }

  70% {
    box-shadow: 0 0 0 20px rgba(124, 58, 237, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

.highlight-pulse {
  background: var(--violet) !important;
  animation: pulse-violet 2s infinite;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .animate-marquee {
    animation: none !important;
  }

  #preloader,
  #preloader.loaded {
    transition: none;
    transform: translateY(-100%);
  }

  body:not(.js-enabled) #preloader {
    animation: none;
    transform: translateY(-100%);
  }

  #cursor {
    display: none;
  }

  body,
  body * {
    cursor: auto !important;
  }
}
