/* ============================================
   PORTAFOLIO — DESIGN SYSTEM v5
   "Neon Glass" — Dark Interactive Theme
   ============================================ */

:root {
  /* Dark backgrounds */
  --bg-primary: #06060b;
  --bg-secondary: #0c0c14;
  --bg-elevated: #12121e;
  --bg-surface: #1a1a2e;
  --bg-glass: rgba(18, 18, 30, 0.7);

  /* Accent palette — vivid neon */
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.12);
  --accent-glow: rgba(139, 92, 246, 0.4);
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --cyan-soft: rgba(6, 182, 212, 0.12);
  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-soft: rgba(16, 185, 129, 0.12);
  --rose: #f43f5e;
  --rose-light: #fb7185;
  --rose-soft: rgba(244, 63, 94, 0.12);
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.12);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #5a5a72;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(139, 92, 246, 0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
  --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.15);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.5rem;
  --text-display: clamp(3rem, 7vw, 5.5rem);

  /* Spacing */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.25rem; --s-6: 1.5rem; --s-8: 2rem; --s-10: 2.5rem;
  --s-12: 3rem; --s-16: 4rem; --s-20: 5rem; --s-24: 6rem; --s-32: 8rem;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-2xl: 32px; --r-full: 9999px;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 0.4s;

  /* Z layers */
  --z-base: 1; --z-nav: 50; --z-modal: 100; --z-overlay: 150; --z-toast: 200; --z-cursor: 9999;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  cursor: none;
}

/* Animated gradient noise background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 600px 500px at 80% 60%, rgba(6, 182, 212, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 50% 90%, rgba(244, 63, 94, 0.04) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* Grid noise overlay */
body::after {
  content: '';
  position: fixed;
  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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

a { color: inherit; text-decoration: none; cursor: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: none; border: none; outline: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; outline: none; cursor: none; }

/* === CUSTOM CURSOR === */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--accent-light);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: difference;
}

.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 40px; height: 40px;
  border: 2px solid rgba(139, 92, 246, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s;
}

body.cursor-hover .cursor-dot {
  width: 40px; height: 40px;
  background: rgba(139, 92, 246, 0.15);
}

body.cursor-hover .cursor-ring {
  width: 60px; height: 60px;
  border-color: var(--accent);
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-light), var(--cyan-light), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s-8);
}

.section {
  padding: var(--s-24) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--s-16);
}

.section-overline {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent-light);
  margin-bottom: var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-4);
  background: var(--accent-soft);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--r-full);
}

.section-title {
  font-size: var(--text-4xl);
  margin-bottom: var(--s-4);
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  max-width: 520px;
  margin: 0 auto;
  font-weight: 300;
}

/* === NAVIGATION — Glass morphism floating bar === */
.navbar {
  position: fixed;
  top: var(--s-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  padding: var(--s-2) var(--s-3);
  background: rgba(12, 12, 20, 0.75);
  backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transition: all var(--duration) var(--ease-out);
  width: auto;
  max-width: 90vw;
}

.navbar.scrolled {
  background: rgba(12, 12, 20, 0.9);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(139, 92, 246, 0.1);
  top: var(--s-3);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 0;
  width: 100%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  padding: 0 var(--s-3);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: all var(--duration) var(--ease-out);
}

.nav-logo-img:hover {
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav-link {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease-out);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.08);
}

.nav-link.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.nav-link.admin-link {
  background: var(--amber-soft);
  color: var(--amber-light);
  font-weight: 600;
  font-size: var(--text-xs);
}

.nav-link.admin-link:hover { background: rgba(245, 158, 11, 0.2); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--s-2);
  z-index: calc(var(--z-modal) + 10);
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--duration) var(--ease-out);
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-light); }

::selection { background: rgba(139, 92, 246, 0.3); color: var(--text-primary); }

.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;
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
  :root {
    --text-display: clamp(2.5rem, 10vw, 4rem);
    --text-4xl: 2rem;
  }
  .container { padding: 0 var(--s-5); }
  .section { padding: var(--s-16) 0; }
  .navbar {
    top: 0; left: 0; right: 0;
    transform: none; border-radius: 0;
    max-width: 100%;
    padding: var(--s-3) var(--s-4);
  }
  .nav-logo-img { height: 24px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 280px; height: 100vh;
    background: rgba(12, 12, 20, 0.98);
    backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem var(--s-8) var(--s-8);
    gap: var(--s-2);
    transition: right var(--duration) var(--ease-out);
    border-left: 1px solid var(--border);
    z-index: var(--z-modal);
    border-radius: 0;
  }
  .nav-links.open { right: 0; }
  .nav-link { width: 100%; font-size: var(--text-base); padding: var(--s-4); border-radius: var(--r-lg); }

  /* Hide custom cursor on mobile */
  .cursor-dot, .cursor-ring { display: none; }
  body, a, button, input, textarea, select { cursor: auto; }
}

@media (max-width: 480px) {
  :root {
    --text-display: clamp(2rem, 12vw, 3rem);
    --text-4xl: 1.75rem;
  }
}
