/* ═══════════════════════════════════════════════
   RAHUL NAIK PORTFOLIO — SHARED THEME
   Dark / Light toggle via [data-theme="light"]
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=JetBrains+Mono:wght@300;400;500&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── DARK THEME (default) ── */
:root {
  --bg:       #04060c;
  --bg1:      #070b14;
  --bg2:      #0b1120;
  --surface:  #0e1526;
  --s2:       #111d30;
  --border:   #162035;
  --b2:       #1e2e4a;

  --cyan:     #00d4ff;
  --green:    #00ff88;
  --yellow:   #ffb700;
  --pink:     #ff6b9d;
  --purple:   #bf5af2;
  --orange:   #ff9f43;
  --emerald:  #0be881;
  --blue:     #4da6ff;
  --gold:     #ffd166;
  --red:      #ff5f5f;

  --text:     #e8edf5;
  --text2:    #a8b8d0;
  --muted:    #4a6080;
  --dim:      #2a3a55;

  --nav-bg:   rgba(4,6,12,0.92);
  --card-bg:  #0e1526;
  --glow-opacity: 0.15;

  --font-display: 'Syne', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-body:    'Outfit', sans-serif;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg:       #f0f4f8;
  --bg1:      #e8eef5;
  --bg2:      #dde6f0;
  --surface:  #ffffff;
  --s2:       #f5f8fc;
  --border:   #ccd8e8;
  --b2:       #b8cce0;

  --cyan:     #0097b8;
  --green:    #00a85a;
  --yellow:   #d4960a;
  --pink:     #cc3070;
  --purple:   #8836c8;
  --orange:   #d4730a;
  --emerald:  #059660;
  --blue:     #2070c8;
  --gold:     #b8940a;
  --red:      #cc3030;

  --text:     #1a2535;
  --text2:    #3a5070;
  --muted:    #6080a0;
  --dim:      #c0d0e0;

  --nav-bg:   rgba(240,244,248,0.95);
  --card-bg:  #ffffff;
  --glow-opacity: 0.08;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ── HEX GRID BACKGROUND ── */
.hexgrid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 0 L56 16 L56 50 L28 66 L0 50 L0 16Z' fill='none' stroke='%23122040' stroke-width='0.5'/%3E%3C/svg%3E");
  opacity: 0.35;
  transition: opacity 0.35s;
}
[data-theme="light"] .hexgrid { opacity: 0.08; }

/* ── GLOW OVERLAY ── */
.glow-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  transition: opacity 0.35s;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── SHARED NAV ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
  display: flex; align-items: center; gap: 0.5rem;
}

.nav-logo .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  flex-shrink: 0;
}

.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0,212,255,0.06);
}

.nav-right {
  display: flex; align-items: center; gap: 0.75rem;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--b2);
  border-radius: 20px;
  padding: 0.3rem 0.7rem;
  transition: all 0.2s;
  user-select: none;
}

.theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.toggle-track {
  width: 28px; height: 14px;
  background: var(--b2);
  border-radius: 7px;
  position: relative;
  transition: background 0.2s;
}

.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 10px; height: 10px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

[data-theme="light"] .toggle-track { background: rgba(0,212,255,0.3); }
[data-theme="light"] .toggle-thumb { transform: translateX(14px); background: var(--cyan); }

/* ── SHARED FOOTER ── */
.site-footer {
  position: relative; z-index: 10;
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.site-footer a { color: var(--cyan); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── UTILITY ── */
.tag {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--b2);
  color: var(--muted);
  display: inline-block;
}

[data-theme="light"] .tag {
  background: rgba(0,0,0,0.04);
}

.gradient-text {
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── MOBILE NAV ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 200;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.2s;
  transform-origin: center;
}

/* Animated X on open */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .site-nav {
    padding: 0 1rem;
  }

  .hamburger {
    display: flex;
    order: 3;
  }

  /* Hide theme toggle label text on mobile to save space */
  .theme-label { display: none; }

  .nav-right {
    order: 2;
    margin-left: auto;
    margin-right: 0.25rem;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 150;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 1rem;
    background: var(--bg1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.9rem 1.5rem;
    font-size: 0.7rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(0,212,255,0.06);
    border-color: var(--border);
  }
}

/* ── GLOBAL MOBILE RESPONSIVE ── */
@media (max-width: 600px) {
  .site-nav { padding: 0 0.75rem; }

  /* Ensure nav-links take full width items */
  .nav-links a {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  /* Stats bar scrollable on mobile */
  .stats-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .stat-item {
    min-width: 110px;
    flex-shrink: 0;
  }

  /* Section headers */
  .section-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Projects section */
  .projects-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* About section */
  .about-section { padding: 3rem 1rem; }

  /* Contact section */
  .contact-section { padding: 3rem 1rem; }
  .contact-links { flex-direction: column; align-items: center; }
  .contact-links .btn { width: 100%; max-width: 280px; text-align: center; }

  /* Footer */
  .site-footer { padding: 2rem 1rem; }

  /* Card body padding */
  .card-body { padding: 1.4rem 1.2rem 1.1rem; }

  /* Card metrics wrap tighter */
  .card-metrics { gap: 0.75rem; }

  /* Evolution section */
  .evolution-section { padding: 2rem 1rem; }
}
