/* Variables */
:root {
  --bg: #040815;
  --surface: #0b1224;
  --text: #e8ecf8;
  --muted: #95a5c7;
  --primary: #8b5cf6;
  --secondary: #22d3ee;
  --border: rgba(255, 255, 255, 0.10);
  --shadow: rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] {
  --bg: #020510;
  --surface: #0a0f1e;
  --text: #f2f6ff;
  --muted: #9fb3d9;
  --primary: #a78bfa;
  --secondary: #38e1ff;
  --border: rgba(255, 255, 255, 0.14);
  --shadow: rgba(0, 0, 0, 0.6);
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1400px 900px at 15% 20%, rgba(139, 92, 246, 0.18), transparent),
    radial-gradient(1200px 800px at 85% 15%, rgba(34, 211, 238, 0.16), transparent),
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 50%);
  min-height: 100vh;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 90px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 90px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(900px 900px at 70% 80%, rgba(34, 211, 238, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}
img { max-width: 100%; display: block; }

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.section { padding: 64px 0; position: relative; z-index: 1; }
.section h2 {
  font-size: 32px;
  margin: 0 0 16px 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section h2::after {
  content: "";
  display: inline-block;
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
}

/* Header & Nav */
.site-header { position: static; z-index: 1; }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  backdrop-filter: blur(14px) saturate(1.4);
  background: linear-gradient(90deg, rgba(11, 18, 36, 0.9), rgba(11, 18, 36, 0.7));
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 30px var(--shadow);
}
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 700; text-decoration: none;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
}
.nav-links { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 600; letter-spacing: 0.01em; }
.nav-links a:hover { color: var(--secondary); }
.nav-toggle { display: none; font-size: 20px; background: none; border: none; color: var(--text); }
.theme-switch button { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); }

/* Hero */
.hero {
  display: grid;
  place-items: center;
  min-height: 64vh;
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.9), transparent);
}
.hero-content { text-align: center; padding: 40px 0; position: relative; }
.avatar {
  width: 128px; height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid color-mix(in oklab, var(--primary) 60%, var(--secondary));
  box-shadow: 0 16px 40px rgba(34, 211, 238, 0.3);
  margin: 24px auto;
}
.hero h1 { font-size: 44px; margin: 0 0 8px 0; background: linear-gradient(120deg, var(--primary), var(--secondary)); -webkit-background-clip: text; color: transparent; }
.tagline { font-size: 18px; color: var(--muted); margin: 0 0 16px 0; letter-spacing: 0.02em; }
.cta { display: inline-flex; gap: 12px; }
.btn { display: inline-block; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border); color: var(--text); text-decoration: none; background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)); box-shadow: 0 8px 22px var(--shadow); transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 12px 30px rgba(34, 211, 238, 0.35); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5); border-color: rgba(255,255,255,0.22); }

/* Cards */
.section .container { background: rgba(11, 18, 36, 0.72); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: 0 14px 36px var(--shadow); backdrop-filter: blur(10px); }

main { padding-top: 0; }

/* Education timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--border); }
.timeline li { position: relative; padding: 12px 16px 12px 20px; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 6px 14px rgba(34, 211, 238, 0.35); }
.timeline .title { font-weight: 700; }
.timeline .meta { color: var(--muted); margin-left: 8px; }

/* Skills */
.skill-groups { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.skill-group { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: linear-gradient(160deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); box-shadow: 0 10px 24px var(--shadow); position: relative; overflow: hidden; }
.skill-group::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(400px 240px at 20% 10%, rgba(34, 211, 238, 0.08), transparent); }
.skill-group h3 { margin: 0 0 10px 0; font-size: 18px; letter-spacing: 0.01em; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip-list li { padding: 8px 12px; border-radius: 999px; background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(34,211,238,0.12)); border: 1px solid rgba(255,255,255,0.12); color: var(--text); font-weight: 600; box-shadow: 0 6px 14px rgba(0,0,0,0.35); display: inline-flex; align-items: center; gap: 6px; }
.chip-icon { font-family: "JetBrains Mono", monospace; font-size: 14px; }

/* Projects */
.project-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.project-block h3 { margin: 0 0 10px 0; font-size: 20px; }
.project-grid { display: grid; gap: 12px; }
.project-card { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); box-shadow: 0 10px 24px var(--shadow); position: relative; overflow: hidden; }
.project-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(320px 200px at 80% 10%, rgba(34, 211, 238, 0.12), transparent); pointer-events: none; }
.project-card:hover { border-color: rgba(255,255,255,0.2); box-shadow: 0 16px 32px rgba(0,0,0,0.6); }
.project-card h4 { margin: 0 0 6px 0; font-size: 18px; }
.project-card p { margin: 0; color: var(--muted); }
.project-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.stack-chip { padding: 6px 10px; border-radius: 10px; background: linear-gradient(135deg, rgba(34,211,238,0.12), rgba(139,92,246,0.12)); border: 1px solid rgba(255,255,255,0.12); color: var(--text); font-weight: 600; font-size: 13px; box-shadow: 0 6px 14px rgba(0,0,0,0.35); display: inline-flex; align-items: center; gap: 6px; }

/* Hobbies */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.list li { padding: 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(34,211,238,0.12), rgba(139,92,246,0.10)); border: 1px solid var(--border); box-shadow: 0 8px 18px var(--shadow); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.contact-card { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(34,211,238,0.12)); box-shadow: 0 10px 22px var(--shadow); }
.contact-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--shadow); }
.contact-card .icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.contact-card small { color: var(--muted); }

/* Footer */
.site-footer { padding: 24px 0 64px 0; color: var(--muted); }
.site-footer .container { background: transparent; border: none; box-shadow: none; text-align: center; }

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: rgba(11,18,36,0.95); border-bottom: 1px solid var(--border); padding: 12px 16px; box-shadow: 0 14px 28px var(--shadow); }
  .nav-links.open { display: flex; flex-direction: column; gap: 12px; }
}
