/* Custom extras beyond Tailwind: animations and details the utilities cannot express */

::selection {
  background: rgba(37, 42, 66, 0.15);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Hero title with an animated gradient */
.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #6366f1, #c084fc, #38bdf8);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradient-shift 8s ease-in-out infinite;
}

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

/* Floating aurora blobs */
.aurora {
  animation: aurora-drift 14s ease-in-out infinite;
}

.aurora-2 { animation-duration: 18s; animation-delay: -6s; }
.aurora-3 { animation-duration: 22s; animation-delay: -11s; }

@keyframes aurora-drift {
  0%, 100% { transform: translate(var(--tw-translate-x, 0), 0) scale(1); }
  33%      { transform: translate(calc(var(--tw-translate-x, 0px) + 2rem), -1.5rem) scale(1.08); }
  66%      { transform: translate(calc(var(--tw-translate-x, 0px) - 1.5rem), 1rem) scale(0.95); }
}

/* Floating icon/logo in the hero */
.float-slow {
  animation: floaty 5s ease-in-out infinite;
}

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

/* Hourly lines of the calendar grid (9:00-18:00 window):
   strong line on the full hour, light on the half hour, as in the original app */
.hour-lines {
  background-image:
    linear-gradient(to bottom, rgba(148, 163, 184, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
  background-size: 100% 11.115%, 100% 5.5575%;
}

/* Vacation/out-of-office block: diagonal stripes as in the real app */
.stripes {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(255, 255, 255, 0.3) 8px,
    rgba(255, 255, 255, 0.3) 9px
  );
}

/* Mockup calendar events: cascade into view */
.cal-event {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.visible .cal-event { opacity: 1; transform: none; }
.visible .cal-event:nth-child(2) { transition-delay: 0.15s; }
.visible .cal-event:nth-child(3) { transition-delay: 0.3s; }
.visible .cal-event:nth-child(4) { transition-delay: 0.45s; }

/* Service mockups: small looping animations, subtle and out of phase with each other.
   The per-element delay is set via --d. */
/* Chart bars stay still: they only light up in sequence,
   with the same light wave as the other mockups */
.mock-bar {
  opacity: 0.65;
  animation: mock-glow 3.6s ease-in-out infinite;
  animation-delay: calc(var(--d, 0s) * 2);
}

.mock-rise {
  opacity: 0.65;
  animation: mock-glow 3.6s ease-in-out infinite;
  animation-delay: calc(var(--d, 0s) * 2);
}

/* A wave of light sweeps through the elements in sequence */
@keyframes mock-glow {
  0%, 55%, 100% { opacity: 0.65; }
  25%           { opacity: 1; }
}

.mock-pop {
  animation: mock-pulse 3.6s ease-in-out infinite;
  animation-delay: calc(var(--d, 0s) * 2);
}

@keyframes mock-pulse {
  0%, 55%, 100% { transform: scale(1); }
  25%           { transform: scale(1.07); }
}

/* Pill navbar: more opaque and with a deeper shadow when scrolling */
#navbar.scrolled #navpill {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 32px rgba(37, 42, 66, 0.12);
}

/* Hamburger turns into an X when the menu is open */
#menu-btn.open .menu-line:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

#menu-btn.open .menu-line:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .cal-event,
  .mock-bar,
  .mock-rise,
  .mock-pop {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .aurora,
  .float-slow,
  .gradient-text {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
