:root {
  --navy-950: #050d1a;
  --navy-900: #0a1628;
  --navy-800: #0f2040;
  --navy-700: #162a54;
  --navy-600: #1e3a6e;
  --accent: #3b82f6;
  --accent-bright: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --cyan: #06b6d4;
  --green: #10b981;
  --text-primary: #f0f6ff;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --border: rgba(59, 130, 246, 0.15);
  --border-hover: rgba(59, 130, 246, 0.4);
  --card-bg: rgba(15, 32, 64, 0.6);
  --theme-toggle-bg: rgba(15, 32, 64, 0.8);
}

/* ── LIGHT THEME ── */
body.theme-light {
  --navy-950: #f0f4ff;
  --navy-900: #e8eeff;
  --navy-800: #dce6ff;
  --navy-700: #ccd9ff;
  --navy-600: #b8caff;
  --accent: #2563eb;
  --accent-bright: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.12);
  --cyan: #0891b2;
  --green: #059669;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: rgba(37, 99, 235, 0.2);
  --border-hover: rgba(37, 99, 235, 0.5);
  --card-bg: rgba(220, 230, 255, 0.6);
  --theme-toggle-bg: rgba(220, 230, 255, 0.8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--navy-950);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--theme-toggle-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: scale(1.1);
}

/* ── BACKGROUND ── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.bg-glow-1 {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  top: -200px; right: -100px;
  pointer-events: none; z-index: 0;
}

.bg-glow-2 {
  position: fixed;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.06) 0%, transparent 70%);
  bottom: 10%; left: -100px;
  pointer-events: none; z-index: 0;
}

/* ── NAV ── */
.navbar-custom {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(5, 13, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  transition: background 0.3s ease;
}

body.theme-light .navbar-custom {
  background: rgba(240, 244, 255, 0.9);
}

.nav-brand {
  font-family: 'Fira Code', 'Consolas', 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-bright) !important;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1.3;
}

.brand-line {
  color: #6a9955;
  font-size: 0.9rem;
  white-space: nowrap;
}

.brand-line:first-child {
  font-weight: 600;
  color: #569cd6;
}

.nav-link-custom {
  color: var(--text-secondary) !important;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link-custom:hover {
  color: var(--text-primary) !important;
  background: var(--accent-glow);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.nav-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px; height: 1px;
  background: var(--accent);
}

.hero-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.35s forwards;
}

.hero-name .highlight {
  color: var(--accent-bright);
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  color: var(--text-secondary);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.45s forwards;
}

.hero-desc {
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.55s forwards;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.65s forwards;
}

.btn-primary-custom {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-custom:hover {
  background: var(--accent-bright);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.35);
}

.btn-outline-custom {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-custom:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--accent-glow);
}

/* ── TERMINAL CARD ── */
.terminal-card {
  background: var(--navy-900);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.5s forwards;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.terminal-header {
  background: var(--navy-800);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 8px;
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 24px;
  font-size: 0.78rem;
  line-height: 2;
}

.t-comment { color: var(--text-muted); }
.t-cmd { color: var(--accent-bright); }
.t-key { color: var(--cyan); }
.t-val { color: var(--text-secondary); }
.t-ok { color: var(--green); }
.t-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--accent-bright);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── STATS ROW ── */
.stats-row {
  position: relative; z-index: 1;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item { text-align: center; }

.stat-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--accent-bright);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

.stat-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* ── SECTIONS ── */
section {
  position: relative; z-index: 1;
  padding: 80px 0;
}

.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 48px;
}

/* ── SKILL CARDS ── */
.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  height: 100%;
  transition: all 0.3s;
  backdrop-filter: blur(8px);
}

.skill-card:hover {
  border-color: var(--border-hover);
  background: rgba(22, 42, 84, 0.8);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(59,130,246,0.12);
}

body.theme-light .skill-card:hover {
  background: rgba(200, 220, 255, 0.85);
}

.skill-icon {
  font-size: 1.5rem;
  margin-bottom: 14px;
  display: block;
}

.skill-name {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.skill-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(59,130,246,0.1);
  color: var(--accent-bright);
  border: 1px solid rgba(59,130,246,0.2);
  letter-spacing: 0.05em;
}

/* ── EXPERIENCE ── */
.exp-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.exp-item:last-child { border-bottom: none; }

.exp-period {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-top: 4px;
  line-height: 1.8;
}

.exp-period .current {
  color: var(--green);
  font-size: 0.65rem;
}

.exp-role {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.exp-company {
  font-size: 0.78rem;
  color: var(--accent-bright);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}

.exp-list {
  list-style: none;
  padding: 0;
}

.exp-list li {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.exp-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── STACK GRID ── */
.stack-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
}

.stack-item:hover {
  border-color: var(--border-hover);
  background: rgba(22, 42, 84, 0.8);
  transform: translateY(-2px);
}

body.theme-light .stack-item:hover {
  background: rgba(200, 220, 255, 0.85);
}

.stack-icon { font-size: 1.3rem; flex-shrink: 0; }

.stack-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.stack-level {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--accent-bright);
  letter-spacing: 0.05em;
}

/* ── CONTACT ── */
.contact-card {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.contact-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.contact-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(10, 22, 40, 0.3);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.78rem;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.contact-link:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--accent-glow);
}

/* ── FOOTER ── */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .exp-item { grid-template-columns: 1fr; gap: 8px; }
  .exp-period { padding-top: 0; }
  .contact-card { padding: 32px 24px; }

  .brand-line:last-child {
    display: none;
  }

  .nav-brand {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .brand-line {
    font-size: 0.8rem;
  }

  .nav-badge {
    display: none;
  }
}
