/* ============================================
   nunchi labs. — Global Styles
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* ============================================
   Grain Texture
   ============================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' fill='white' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ============================================
   Sticky Nav w/ Blur
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.site-header.scrolled {
  background-color: rgba(0, 0, 0, 0.88) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============================================
   Page Load Animations
   ============================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.up {
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.up.d1 { animation-delay: 0.05s; }
.up.d2 { animation-delay: 0.18s; }
.up.d3 { animation-delay: 0.32s; }
.up.d4 { animation-delay: 0.48s; }
.up.d5 { animation-delay: 0.62s; }

/* ============================================
   Scroll Reveal
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Staggered grid children */
.stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger.on > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.00s; }
.stagger.on > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.10s; }
.stagger.on > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.20s; }
.stagger.on > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.30s; }

/* ============================================
   App Cards
   ============================================ */
.card-lift {
  will-change: transform;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 48px rgba(255, 255, 255, 0.07);
}

/* ============================================
   Feature Cards
   ============================================ */
.feat-card {
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.feat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.28);
}

/* ============================================
   Store Badges
   ============================================ */
.badge {
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.badge:hover {
  transform: translateY(-2px);
}

/* ============================================
   Animated Underline Link
   ============================================ */
.ilink {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: 1px;
}

.ilink:hover {
  background-size: 100% 1px;
}

/* ============================================
   Focus Styles
   ============================================ */
:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
  border-radius: 4px;
}
