/* ═══════════════════════════════════════════
   VOID Studio — Custom Styles
   Open-source stack: Tailwind + custom CSS
   Mobile-first optimized
   ═══════════════════════════════════════════ */

/* ── Base Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: auto !important; /* Lenis handles smooth scroll */
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  cursor: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

/* ── Mobile: restore cursor, disable custom cursor ── */
@media (max-width: 768px) {
  body { cursor: auto; }
  #cursor, #cursor-dot { display: none !important; }
}

/* ── Touch-friendly: ensure min tap targets ── */
@media (pointer: coarse) {
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ── Selection ── */
::selection {
  background: rgba(167, 139, 250, 0.3);
  color: white;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #0a0a0b; }
::-webkit-scrollbar-thumb { background: #3f3f42; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

@media (max-width: 768px) {
  ::-webkit-scrollbar { width: 2px; }
}

/* ── Nav background on scroll ── */
#main-nav.scrolled {
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ── Hero Splitting.js chars ── */
#hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(80px) rotateX(-40deg);
  transform-origin: bottom;
}

@media (max-width: 768px) {
  #hero-title .char {
    transform: translateY(40px) rotateX(-20deg);
  }
}

/* ── Reveal-up animation base ── */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
}

@media (max-width: 768px) {
  .reveal-up {
    transform: translateY(24px);
  }
}

/* ── Stat card shimmer ── */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.05), transparent);
  transition: left 0.6s ease;
}
.stat-card:hover::before { left: 100%; }

/* ── Project card ── */
.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (max-width: 768px) {
  .project-card {
    border-radius: 0.75rem;
  }
}

.project-card:hover {
  border-color: rgba(167,139,250,0.3);
  transform: translateY(-4px);
}

@media (max-width: 768px) {
  .project-card:hover {
    transform: translateY(-2px);
  }
}

.project-card .card-glow {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.project-card:hover .card-glow { opacity: 1; }

.project-card .card-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── Mobile project card: compact padding ── */
@media (max-width: 640px) {
  .project-card .p-8 {
    padding: 1.25rem !important;
  }
  .project-card .mb-8 {
    margin-bottom: 1rem !important;
  }
  .project-card .mb-6 {
    margin-bottom: 0.75rem !important;
  }
  .project-card .w-12 {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }
  .project-card .text-xl {
    font-size: 1rem !important;
  }
  .project-card .mt-6 {
    margin-top: 1rem !important;
  }
}

/* ── Stack item ── */
.stack-item {
  padding: 1.25rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 0.75rem;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
}

@media (min-width: 769px) {
  .stack-item {
    padding: 1.5rem 1rem;
    border-radius: 1rem;
  }
}

.stack-item:hover {
  border-color: rgba(167,139,250,0.3);
  transform: translateY(-4px);
  background: rgba(255,255,255,0.04);
}

@media (max-width: 768px) {
  .stack-item:hover {
    transform: translateY(-2px);
  }
}

.stack-item .stack-icon {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  transition: transform 0.4s ease;
}

@media (min-width: 769px) {
  .stack-item .stack-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }
}

.stack-item:hover .stack-icon { transform: scale(1.2); }

/* ── Mobile stack item text ── */
@media (max-width: 640px) {
  .stack-item p.font-display {
    font-size: 0.7rem !important;
  }
  .stack-item p.font-mono {
    font-size: 7px !important;
    line-height: 1.3;
  }
}

/* ── Scroll line animation ── */
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ── Marquee ── */
#marquee {
  animation: marqueeScroll 20s linear infinite;
}
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  #marquee {
    animation-duration: 12s;
  }
}

/* ── Magnetic button effect ── */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Noise texture overlay ── */
#app-root::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

@media (max-width: 768px) {
  #app-root::before {
    opacity: 0.02;
  }
}

/* ── Loading screen ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #0a0a0b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
}
#loader .loader-bar {
  width: 100px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 1px;
  overflow: hidden;
}

@media (min-width: 769px) {
  #loader .loader-bar {
    width: 120px;
  }
}

#loader .loader-bar-inner {
  height: 100%;
  background: #a78bfa;
  border-radius: 1px;
  width: 0%;
  animation: loaderProgress 1.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
@keyframes loaderProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ── Gradient text helper ── */
.gradient-text {
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Mobile: reduce motion for performance ── */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Safe area insets for notched phones ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  }
  #main-nav {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
  }
}
