/* Box-sizing reset — required for Tailwind/UnoCSS width utilities to work correctly */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Body line-height: WCAG 1.4.12 requires at least 1.5 for body text */
body {
  line-height: 1.6;
  margin: 0;
}

/* Focus-visible styles for keyboard accessibility */
*:focus-visible {
  outline: 2px solid var(--color-ring, var(--color-primary));
  outline-offset: 2px;
}

/* Skip-to-content link (visually hidden until focused) */
.skip-to-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-to-content:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: 9999;
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
  border-radius: var(--radius, 0.75rem);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  outline: 2px solid var(--color-ring, var(--color-primary));
  outline-offset: 2px;
}

/* Scroll-triggered reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 {
  transition-delay: 0.1s;
}
.reveal-delay-2 {
  transition-delay: 0.2s;
}
.reveal-delay-3 {
  transition-delay: 0.3s;
}
.reveal-delay-4 {
  transition-delay: 0.4s;
}
.reveal-delay-5 {
  transition-delay: 0.5s;
}

/* Hero gradient animation */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.animated-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

/* Floating glow orbs */
@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

.float-slow {
  animation: float 6s ease-in-out infinite;
}
.float-medium {
  animation: float 4s ease-in-out infinite;
}
.float-fast {
  animation: float 3s ease-in-out infinite;
}

/* Pulse ring for CTA */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 var(--color-primary);
  }
  70% {
    box-shadow: 0 0 0 12px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.pulse-glow {
  animation: pulse-ring 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Step connector line */
@keyframes draw-line {
  from {
    height: 0;
  }
  to {
    height: 100%;
  }
}

/* Number counter tick */
@keyframes count-in {
  from {
    opacity: 0;
    transform: scale(0.5) rotateX(90deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateX(0);
  }
}

.count-in {
  animation: count-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Pricing card hover lift */
.pricing-card {
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px -15px var(--color-primary), 0 0 20px rgba(124, 58, 237, 0.1);
}

/* Highlighted pricing card: only scale up on larger screens */
@media (min-width: 1024px) {
  .pricing-card-highlighted {
    transform: scale(1.03);
  }
  .pricing-card-highlighted:hover {
    transform: scale(1.03) translateY(-8px);
  }
}

/* Smooth scroll + prevent horizontal overflow on mobile */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* ── Mobile overrides (below sm: 640px) ── */
@media (max-width: 639px) {
  :root {
    --spacing-container: 1.25rem;
    --spacing-section: 5rem;
  }
}

/* Noise texture overlay — static PNG-based noise (no SVG filters) */
.noise::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUAAAAAAAAAAAAAAAAAAAAAAADgKxmiAAAABnRSTlMFBQUFBQUiMJRdAAAASklEQVQ4y2MYBaNg2AImKAMYGBj+//8PYTABGf8hDCYg4z+YgWISmIFiEoTBCGT8BzOYgIz/EAYT2CQIg4kByPgPYTANnzQDAFUyKTdyMYAqAAAAAElFTkSuQmCC");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 1;
}

/* Sections with floating orbs: contain overflow */
.section-overflow-hidden {
  overflow: hidden;
}

/* Performance: contain paint on sections (layout containment breaks Firefox) */
section {
  contain: paint;
}

/* Crane Logo styles */
.crane-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.crane-logo-circle {
  width: var(--crane-size, 200px);
  height: var(--crane-size, 200px);
  background: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(168, 85, 247, 0.4);
  animation: crane-logo-glow 4s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
}
.crane-logo-circle:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 30px rgba(168, 85, 247, 0.7),
    0 0 80px rgba(124, 58, 237, 0.3),
    0 0 120px rgba(124, 58, 237, 0.15) !important;
}
.crane-logo-circle svg {
  width: 62%;
  height: 62%;
}
.crane-logo-circle svg path {
  stroke: #c084fc;
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}
.crane-logo-circle.drawn svg path {
  animation: crane-logo-draw 2.5s ease forwards;
}
.crane-logo-circle.drawn svg path:nth-child(1) {
  animation-delay: 0.2s;
}
.crane-logo-circle.drawn svg path:nth-child(2) {
  animation-delay: 0.4s;
}
.crane-logo-circle.drawn svg path:nth-child(3) {
  animation-delay: 0.55s;
}
.crane-logo-circle.drawn svg path:nth-child(4) {
  animation-delay: 0.7s;
}
.crane-logo-circle.drawn svg path:nth-child(5) {
  animation-delay: 0.85s;
}
.crane-logo-circle.drawn svg path:nth-child(6) {
  animation-delay: 0.95s;
}
.crane-logo-circle.drawn svg path:nth-child(7) {
  animation-delay: 1.05s;
}
.crane-logo-circle.drawn svg path:nth-child(8) {
  animation-delay: 1.1s;
}
@keyframes crane-logo-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes crane-logo-glow {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(168, 85, 247, 0.4),
      0 0 40px rgba(168, 85, 247, 0.2),
      0 0 70px rgba(124, 58, 237, 0.1);
  }
  50% {
    box-shadow:
      0 0 25px rgba(192, 132, 252, 0.6),
      0 0 60px rgba(168, 85, 247, 0.3),
      0 0 100px rgba(124, 58, 237, 0.15);
  }
}

/* ── Glow system ── */
/* Uses #A78BFA (primary) for all glow effects */

/* USP card hover */
.usp-card {
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.usp-card:hover {
  transform: translateY(-4px);
  border-color: #A78BFA !important;
  box-shadow: 0 0 25px rgba(167, 139, 250, 0.25), 0 0 50px rgba(167, 139, 250, 0.1), 0 8px 30px rgba(0, 0, 0, 0.3) !important;
}

/* CTA button glow on hover — all buttons with primary bg */
a[style*="background-color:var(--color-primary)"]:hover,
.bg-primary:hover,
a[style*="background-color: var(--color-primary)"]:hover {
  box-shadow: 0 0 25px #A78BFA, 0 0 50px rgba(167, 139, 250, 0.4), 0 0 80px rgba(167, 139, 250, 0.15) !important;
}

/* CTA button glow — outline/ghost buttons */
a.border:hover,
a[style*="border"]:hover,
.border-border:hover {
  border-color: #A78BFA !important;
  text-shadow: 0 0 12px #A78BFA, 0 0 25px rgba(167, 139, 250, 0.4) !important;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.2), 0 0 40px rgba(167, 139, 250, 0.08) !important;
}

/* Nav link glow on hover */
nav a:hover {
  text-shadow: 0 0 12px #A78BFA, 0 0 25px rgba(167, 139, 250, 0.5) !important;
}

/* Pricing card title glow */
.pricing-card:hover h3 {
  text-shadow: 0 0 15px #A78BFA, 0 0 30px rgba(167, 139, 250, 0.4) !important;
}

/* Step card glow */
.pricing-card:hover span[style*="color:var(--color-primary)"] {
  text-shadow: 0 0 15px #A78BFA, 0 0 30px rgba(167, 139, 250, 0.5) !important;
}

/* Prefers-reduced-motion: disable all animations and transitions */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal.visible {
    opacity: 1;
    transform: none;
  }

  .reveal-delay-1,
  .reveal-delay-2,
  .reveal-delay-3,
  .reveal-delay-4,
  .reveal-delay-5 {
    transition-delay: 0s;
  }

  .animated-gradient {
    animation: none;
  }

  .float-slow,
  .float-medium,
  .float-fast {
    animation: none;
    will-change: auto;
  }

  .pulse-glow {
    animation: none;
  }

  .count-in {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .pricing-card {
    transition: none;
  }

  .pricing-card:hover {
    transform: none;
  }

  .usp-card {
    transition: none;
  }

  .usp-card:hover {
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }

  .crane-logo-circle {
    animation: none;
  }

  .crane-logo-circle svg path {
    stroke-dashoffset: 0;
    animation: none;
  }

  .crane-logo-circle.drawn svg path {
    animation: none;
    stroke-dashoffset: 0;
  }
}
