/* ========================================
   NEXO Landing Page — Custom Styles
   ======================================== */

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* ---- Navigation ---- */
.nav-scrolled {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* ---- Phone Mockup Floating Animation ---- */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

.phone-mockup {
  animation: float 5s ease-in-out infinite;
}

/* Phone notch */
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 26px;
  background: #1a1a1a;
  border-radius: 0 0 16px 16px;
  z-index: 10;
}

/* ---- Scroll Animations ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Mobile Menu ---- */
.mobile-menu {
  transition: max-height 0.35s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.mobile-menu.open {
  max-height: 400px;
  opacity: 1;
}

/* ---- How It Works — Dashed Connector ---- */
.step-connector {
  position: relative;
}

.step-connector::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -2rem;
  width: 4rem;
  border-top: 2px dashed #d1d5db;
  transform: translateY(-50%);
}

@media (max-width: 767px) {
  .step-connector::after {
    display: none;
  }
}

/* ---- Feature Card Hover ---- */
.feature-card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.feature-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
  transform: translateY(-4px);
}

/* ---- Custom Focus Styles (Accessibility) ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove default outline for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Pricing Card Badge ---- */
.pricing-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ---- CTA Banner Gradient Overlay ---- */
.cta-banner {
  background: #232323;
}

/* ---- Hamburger Button Lines ---- */
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #232323;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---- Selection Color ---- */
::selection {
  background: rgba(35, 35, 35, 0.15);
  color: #232323;
}

/* ---- Dark Mode Transitions ---- */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode nav shadow */
.dark .nav-scrolled {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

/* Dark mode phone notch */
.dark .phone-notch {
  background: #0a0a0a;
}

/* Dark mode step connector */
.dark .step-connector::after {
  border-top-color: #2A2A2A;
}

/* Dark mode selection */
.dark ::selection {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Dark mode feature card hover */
.dark .feature-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Dark mode toggle button icon transition */
.dark-mode-toggle svg {
  transition: transform 0.3s ease;
}

.dark-mode-toggle:hover svg {
  transform: rotate(15deg);
}

/* Dark mode hamburger lines */
.dark .hamburger-line {
  background-color: #FFFFFF;
}

/* Dark mode CTA banner — override gradient */
.dark .cta-banner {
  background: #2A2A2A;
}

/* ---- Phone Screen Auto-Scroll ---- */
@keyframes phone-scroll {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(0);
  }
  70% {
    transform: translateY(calc(-100% + 650px));
  }
  100% {
    transform: translateY(calc(-100% + 650px));
  }
}

.phone-screen-scroll > * {
  /* Wrap all children so we can animate them together */
}

.phone-screen-scroll {
  position: relative;
}

.phone-screen-scroll-inner {
  animation: phone-scroll 12s ease-in-out infinite alternate;
}

/* ---- Feature Card Demo Animations ---- */
.feature-demo {
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Invoice: lines draw in + stamp appears */
.demo-line {
  transform-origin: left;
  animation: demo-line-draw 7s ease-in-out infinite;
}
.demo-line:nth-child(2) { animation-delay: 0.15s; }
.demo-line:nth-child(3) { animation-delay: 0.3s; }
.demo-line:nth-child(4) { animation-delay: 0.45s; }

@keyframes demo-line-draw {
  0%, 5% { transform: scaleX(0); }
  18%, 82% { transform: scaleX(1); }
  95%, 100% { transform: scaleX(0); }
}

.demo-stamp {
  animation: demo-stamp-in 7s ease-out infinite;
}
@keyframes demo-stamp-in {
  0%, 48% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(0); }
  56% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1.15); }
  62%, 82% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); }
  95%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(0); }
}

/* Customer: contact rows slide in */
.demo-contact {
  animation: demo-slide-in 6s ease-in-out infinite;
}
.demo-contact:nth-child(2) { animation-delay: 0.25s; }
.demo-contact:nth-child(3) { animation-delay: 0.5s; }

@keyframes demo-slide-in {
  0%, 5% { opacity: 0; transform: translateX(16px); }
  18%, 78% { opacity: 1; transform: translateX(0); }
  95%, 100% { opacity: 0; transform: translateX(-16px); }
}

/* Vehicle: scan line sweep */
.demo-scan-line {
  position: absolute;
  left: 15%;
  right: 15%;
  height: 2px;
  border-radius: 1px;
  animation: demo-scan 4s ease-in-out infinite;
}
@keyframes demo-scan {
  0% { top: 18%; opacity: 0; }
  8% { opacity: 1; }
  46% { top: 78%; opacity: 1; }
  54% { opacity: 0; }
  100% { top: 18%; opacity: 0; }
}

.demo-scan-data {
  animation: demo-scan-reveal 4s ease-out infinite;
}
@keyframes demo-scan-reveal {
  0%, 50% { opacity: 0; transform: translateY(4px); }
  65%, 85% { opacity: 1; transform: translateY(0); }
  95%, 100% { opacity: 0; transform: translateY(4px); }
}

/* Calendar: date pulse */
.demo-cal-active {
  animation: demo-cal-pulse 3s ease-in-out infinite;
}
@keyframes demo-cal-pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.6); opacity: 1; }
}

/* Accounting: bars grow */
.demo-bar {
  transform-origin: bottom;
  border-radius: 3px 3px 0 0;
  animation: demo-bar-grow 5s ease-in-out infinite;
}
.demo-bar:nth-child(2) { animation-delay: 0.15s; }
.demo-bar:nth-child(3) { animation-delay: 0.3s; }
.demo-bar:nth-child(4) { animation-delay: 0.45s; }
.demo-bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes demo-bar-grow {
  0%, 8% { transform: scaleY(0); }
  30%, 65% { transform: scaleY(1); }
  90%, 100% { transform: scaleY(0); }
}

/* Employees: avatars pop in */
.demo-avatar {
  animation: demo-pop 5s ease-out infinite;
}
.demo-avatar:nth-child(2) { animation-delay: 0.3s; }
.demo-avatar:nth-child(3) { animation-delay: 0.6s; }
.demo-avatar:nth-child(4) { animation-delay: 0.9s; }

@keyframes demo-pop {
  0%, 5% { opacity: 0; transform: scale(0); }
  18%, 78% { opacity: 1; transform: scale(1); }
  95%, 100% { opacity: 0; transform: scale(0); }
}

/* Offers: status badge cycle */
.demo-status-1 { animation: demo-st1 6s linear infinite; }
.demo-status-2 { animation: demo-st2 6s linear infinite; }
.demo-status-3 { animation: demo-st3 6s linear infinite; }

@keyframes demo-st1 {
  0%, 28% { opacity: 1; } 33%, 100% { opacity: 0; }
}
@keyframes demo-st2 {
  0%, 33% { opacity: 0; } 38%, 61% { opacity: 1; } 66%, 100% { opacity: 0; }
}
@keyframes demo-st3 {
  0%, 66% { opacity: 0; } 71%, 95% { opacity: 1; } 100% { opacity: 0; }
}

/* Work packages: checkmarks appear */
.demo-check {
  animation: demo-check-in 6s ease-out infinite;
}
.demo-check-row:nth-child(2) .demo-check { animation-delay: 0.8s; }
.demo-check-row:nth-child(3) .demo-check { animation-delay: 1.6s; }

@keyframes demo-check-in {
  0%, 12% { opacity: 0; transform: scale(0); }
  22%, 78% { opacity: 1; transform: scale(1); }
  92%, 100% { opacity: 0; transform: scale(0); }
}
