/**
 * NineJoe Formal Studio 2.0 - Unified Design System & UX/UI Overhaul
 * Performance-first, fully responsive across mobile, tablet, foldable, and desktop screens.
 */

:root {
  --nj-bg-deep: #03060a;
  --nj-bg-surface: #070a10;
  --nj-bg-card: rgba(12, 16, 25, 0.72);
  --nj-bg-card-hover: rgba(18, 24, 38, 0.88);
  --nj-border: rgba(255, 255, 255, 0.08);
  --nj-border-hover: rgba(255, 23, 68, 0.45);
  --nj-border-glow: rgba(255, 23, 68, 0.25);
  --nj-brand: #ff1744;
  --nj-brand-glow: rgba(255, 23, 68, 0.35);
  --nj-brand-light: #ff4569;
  --nj-text-primary: #f8fafc;
  --nj-text-secondary: #94a3b8;
  --nj-text-muted: #64748b;
  --nj-font-heading: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --nj-font-body: "Inter", system-ui, -apple-system, sans-serif;
  --nj-radius-sm: 8px;
  --nj-radius-md: 14px;
  --nj-radius-lg: 20px;
  --nj-radius-xl: 26px;
  --nj-transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --nj-transition-smooth: 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Global Reset & Smooth Scrolling */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--nj-bg-deep) !important;
  color: var(--nj-text-primary) !important;
  font-family: var(--nj-font-body);
  overflow-x: hidden;
  selection-background-color: var(--nj-brand);
}

::selection {
  background: rgba(255, 23, 68, 0.85);
  color: #ffffff;
}

/* 2. Sleek Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #04060a;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 999px;
  border: 2px solid #04060a;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--nj-brand);
}

/* 3. Performance & GPU Acceleration */
.nj-accelerate {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

/* Content Visibility for below-the-fold elements */
.content-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 420px;
}

/* 4. Glassmorphism Card System */
.nj-glass-card {
  background: var(--nj-bg-card) !important;
  backdrop-filter: blur(18px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
  border: 1px solid var(--nj-border) !important;
  border-radius: var(--nj-radius-lg) !important;
  transition: transform var(--nj-transition-smooth), border-color var(--nj-transition-smooth), box-shadow var(--nj-transition-smooth) !important;
  position: relative;
  overflow: hidden;
}

.nj-glass-card:hover {
  transform: translateY(-5px) !important;
  border-color: var(--nj-border-hover) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45), 0 0 24px var(--nj-brand-glow) !important;
}

/* 5. Formal Studio Badges */
.nj-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 23, 68, 0.1);
  border: 1px solid rgba(255, 23, 68, 0.28);
  color: var(--nj-brand-light);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--nj-font-heading);
}

.nj-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--nj-brand);
  box-shadow: 0 0 8px var(--nj-brand);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* 6. Active State Indicator for Navigation */
.nj-nav-active {
  color: var(--nj-brand) !important;
  position: relative;
}

.nj-nav-active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--nj-brand);
  box-shadow: 0 0 10px var(--nj-brand);
  border-radius: 999px;
}

/* 7. Formal Profile Card (About Section) */
.nj-profile-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: center;
  padding: 32px 36px;
  border-radius: var(--nj-radius-xl);
  background: linear-gradient(135deg, rgba(16, 22, 35, 0.85), rgba(7, 10, 16, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1024px) {
  .nj-profile-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .nj-profile-stats {
    grid-column: span 2;
    margin-top: 16px;
  }
}

@media (max-width: 680px) {
  .nj-profile-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px 20px;
    gap: 20px;
  }
  .nj-profile-avatar-wrap {
    margin: 0 auto;
  }
  .nj-profile-stats {
    grid-column: span 1;
  }
}

/* 8. Responsive Touch Target Fixes (Mobile Accessibility) */
@media (max-width: 768px) {
  button, a.btn, a.card, [role="button"] {
    min-height: 44px;
  }
  
  /* Responsive Heading Scaling */
  h1, .hero-title {
    font-size: clamp(32px, 8vw, 64px) !important;
    line-height: 1.08 !important;
  }
  
  h2, .section-title {
    font-size: clamp(24px, 5.5vw, 40px) !important;
    line-height: 1.15 !important;
  }

  .section-padding {
    padding: 42px 18px !important;
  }
}

/* 9. High-contrast Formal Typography */
.font-formal {
  font-family: var(--nj-font-heading) !important;
  letter-spacing: -0.02em;
}

.text-formal-lead {
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.68;
  color: var(--nj-text-secondary);
}
