/* ============================================
   Portfolio Shared Stylesheet
   Dark & Premium Design System
   ============================================ */

/* --- Design Tokens --- */
:root {
  --bg-primary: #0f172a;       /* slate-900 */
  --bg-surface: #1e293b;       /* slate-800 */
  --bg-elevated: #334155;      /* slate-700 */
  --accent: #7dd3fc;           /* sky-300 — Arctic */
  --accent-hover: #53c0f0;     /* sky-400ish — Arctic */
  --accent-light: #a5d8ff;     /* sky-200ish — Arctic */
  --text-primary: #f8fafc;     /* slate-50 */
  --text-secondary: #cbd5e1;   /* slate-300 */
  --text-muted: #94a3b8;       /* slate-400 */
  --border: rgba(51, 65, 85, 0.5); /* slate-700/50 */
  --border-light: rgba(148, 163, 184, 0.1);
}

/* --- Base --- */
body {
  font-family: 'Inter', sans-serif;
}

/* --- Screen Reader Only (Accessibility) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Skip to Content (Accessibility) --- */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 100;
  font-weight: 600;
}
.skip-to-content:focus {
  top: 0;
}

/* --- Focus Indicators (Accessibility) --- */
a:focus, button:focus, input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.focus-visible:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Grain / Noise Texture Overlay --- */
.grain {
  position: relative;
}
.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='0.5'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

/* --- Glassmorphism --- */
.glass {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
}
.glass-card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 1rem;
  transition: all 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(125, 211, 252, 0.3);
  box-shadow: 0 0 30px rgba(125, 211, 252, 0.08), 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* --- Shadow Glow --- */
.shadow-glow {
  box-shadow: 0 0 30px rgba(125, 211, 252, 0.1), 0 4px 20px rgba(0, 0, 0, 0.3);
}
.shadow-glow-sm {
  box-shadow: 0 0 15px rgba(125, 211, 252, 0.06), 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* --- Scroll Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* --- Enhanced Hover Effects --- */

/* Card hover - lift + glow */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 0 30px rgba(125, 211, 252, 0.1), 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Image hover - zoom with overflow hidden */
.img-hover {
  overflow: hidden;
  border-radius: 0.75rem;
}
.img-hover img {
  transition: transform 0.5s ease;
}
.img-hover:hover img {
  transform: scale(1.05);
}

/* Link hover - underline slide-in */
.link-hover {
  position: relative;
  text-decoration: none;
}
.link-hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.link-hover:hover::after {
  width: 100%;
}

/* Button glow on hover */
.btn-glow {
  transition: all 0.3s ease;
}
.btn-glow:hover {
  box-shadow: 0 0 20px rgba(125, 211, 252, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- Section Dividers --- */
.divider-gradient {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* --- Accent Line for Section Headers --- */
.accent-bar::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 1rem;
}
.accent-bar-center::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

/* --- Pull Quotes --- */
.pull-quote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  font-style: italic;
  font-size: 1.125rem;
  color: var(--text-secondary);
  background: rgba(30, 41, 59, 0.3);
  padding: 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* --- Counter Animation --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.count-up {
  animation: countUp 0.6s ease-out forwards;
}

/* --- Subtle Parallax --- */
.parallax-slow {
  will-change: transform;
}

/* --- Image Treatments --- */
.image-frame {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.image-frame:hover {
  border-color: rgba(125, 211, 252, 0.3);
  box-shadow: 0 0 24px rgba(125, 211, 252, 0.08);
}

/* Image glow behind featured images */
.image-glow {
  position: relative;
}
.image-glow::before {
  content: '';
  position: absolute;
  inset: 10%;
  background: radial-gradient(ellipse, rgba(125, 211, 252, 0.12) 0%, transparent 70%);
  z-index: -1;
  border-radius: 50%;
  filter: blur(40px);
}

/* --- Dark Header --- */
.header-dark {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* --- Feature Cards (Glass) --- */
.feature-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.feature-card:hover {
  border-color: rgba(125, 211, 252, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* --- Testimonial Cards --- */
.testimonial-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.testimonial-card:hover {
  border-color: rgba(125, 211, 252, 0.2);
}

/* --- Status Badges on Dark --- */
.badge-enterprise {
  background: rgba(125, 211, 252, 0.15);
  color: #7dd3fc;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-rc {
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
}
.badge-alpha {
  background: rgba(125, 211, 252, 0.15);
  color: #7dd3fc;
}
.badge-dev {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

/* --- Mobile Menu (Dark) --- */
.mobile-menu-dark {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}

/* --- Smooth Scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Selection Color --- */
::selection {
  background: rgba(125, 211, 252, 0.3);
  color: var(--text-primary);
}

/* --- Scrollbar (Dark) --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Reduced Motion (Accessibility) --- */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .glass-card,
  .feature-card,
  .testimonial-card,
  .card-hover,
  .btn-glow,
  .link-hover::after,
  .img-hover img,
  .image-frame {
    transition: none;
  }
  .glass-card:hover,
  .card-hover:hover,
  .feature-card:hover {
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
