/* ============================================
   SlowNotes Marketing Site — Custom Styles
   ============================================ */

/* --- Scroll Animation System --- */
[data-animate] {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

[data-animate="fade-up"] { transform: translateY(30px); }
[data-animate="fade-in"] { /* opacity only */ }
[data-animate="scale-in"] { transform: scale(0.95); }

/* Stagger delays */
[data-animate][data-delay="1"] { transition-delay: 100ms; }
[data-animate][data-delay="2"] { transition-delay: 200ms; }
[data-animate][data-delay="3"] { transition-delay: 300ms; }
[data-animate][data-delay="4"] { transition-delay: 400ms; }
[data-animate][data-delay="5"] { transition-delay: 500ms; }
[data-animate][data-delay="6"] { transition-delay: 600ms; }

/* Slow variant for philosophy section */
[data-animate-slow] {
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate-slow].is-visible {
  opacity: 1;
  transform: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  [data-animate],
  [data-animate-slow] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-animate {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* --- Hero Entrance Animations --- */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroScaleIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-animate {
  opacity: 0;
  animation-fill-mode: both;
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-animate-1 { animation-name: heroFadeUp; animation-delay: 0ms; }
.hero-animate-2 { animation-name: heroFadeUp; animation-delay: 100ms; }
.hero-animate-3 { animation-name: heroFadeUp; animation-delay: 200ms; }
.hero-animate-4 { animation-name: heroFadeUp; animation-delay: 300ms; }
.hero-animate-5 { animation-name: heroScaleIn; animation-delay: 400ms; }

/* --- Hero Mockup --- */
.hero-mockup {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
  .hero-mockup:hover {
    transform: rotateY(-2deg) rotateX(1deg) scale(1.02);
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.1),
      0 2px 4px rgba(0,0,0,0.2),
      0 12px 30px -8px rgba(0,0,0,0.4),
      0 40px 80px -20px rgba(0,0,0,0.5),
      0 0 120px -20px rgba(84,158,242,0.15) !important;
  }
}

/* --- Grain Texture --- */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  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)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* --- Nav Link Underline --- */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

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

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.03);
}

/* --- Nav scroll states --- */
.nav-scrolled {
  background: rgba(15, 15, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.nav-scrolled .nav-cta {
  background: rgba(250, 250, 249, 0.1);
  border-color: rgba(250, 250, 249, 0.3);
}

/* --- CTA Button Hover Glow --- */
.cta-btn {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-btn:hover {
  box-shadow: 0 0 20px rgba(250, 250, 249, 0.1);
  background: rgba(250, 250, 249, 0.1);
}

/* --- Handwriting panel lines --- */
.notebook-lines {
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    rgba(0, 0, 0, 0.06) 31px,
    rgba(0, 0, 0, 0.06) 32px
  );
}

/* --- Pricing toggle --- */
.pricing-toggle-active {
  background: rgba(250, 250, 249, 0.15);
}

/* --- Price transition --- */
.price-value {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* --- Mobile menu body lock --- */
body.menu-open {
  overflow: hidden;
}

/* --- Hover only on pointer devices --- */
@media (hover: hover) {
  .glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.03);
  }
}

@media (hover: none) {
  /*.glass-card:hover {*/
  /*  border-color: rgba(255, 255, 255, 0.08);*/
  /*  box-shadow: none;*/
  /*}*/
}

/* --- Testimonial horizontal scroll on mobile --- */
.testimonial-scroll {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.testimonial-scroll > * {
  scroll-snap-align: start;
}

/* --- Text balance for headlines --- */
.text-balance {
  text-wrap: balance;
}

/* --- Backdrop filter fallback --- */
@supports not (backdrop-filter: blur(12px)) {
  .glass-card {
    background: rgba(15, 23, 42, 0.9);
  }
  .nav-scrolled {
    background: rgba(15, 23, 42, 0.95);
  }
  #mobile-menu {
    background: rgba(10, 15, 26, 0.98);
  }
}

/* --- Focus indicators --- */
a:focus-visible,
button:focus-visible,
[role="switch"]:focus-visible {
  outline: 2px solid rgba(84, 158, 242, 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Pricing toggle rounded focus --- */
#pricing-toggle:focus-visible {
  border-radius: 9999px;
}

/* --- Will-change hint for animated elements --- */
[data-animate]:not(.is-visible),
[data-animate-slow]:not(.is-visible) {
  will-change: opacity, transform;
}

/* --- Use-case card hover desktop-only --- */
@media (hover: hover) {
  .group:hover .group-hover\:text-paper-50 {
    color: rgba(250, 250, 249, 1);
  }
}

/* --- Subscribe Modal --- */
#subscribe-modal input:focus,
#subscribe-modal textarea:focus {
  box-shadow: 0 0 0 1px rgba(84, 158, 242, 0.3);
}

#subscribe-modal input.border-accent-rose\/50,
#subscribe-modal textarea.border-accent-rose\/50 {
  border-color: rgba(237, 107, 133, 0.5);
  box-shadow: 0 0 0 1px rgba(237, 107, 133, 0.2);
}

/* --- Smooth font rendering for dark bg --- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
