:root {
  --bg: #0a0e1a;
  --bg-alt: #0e1424;
  --card: #131a2d;
  --text: #e6ecff;
  --muted: #9aa6c9;
  --accent: #6c5ce7;
  --accent-2: #22d3ee;
  --accent-3: #f43f5e;
  --grad: linear-gradient(135deg, #6c5ce7, #22d3ee);
  --shadow: 0 20px 60px -20px rgba(108, 92, 231, .5);
  --radius: 18px;
  --font-head: 'Sora', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
}

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

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Background canvas + noise */
#bg { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; }
.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cursor glow */
#cursor {
  position: fixed; width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad); mix-blend-mode: screen;
  transform: translate(-50%, -50%); pointer-events: none; z-index: 9999;
  transition: transform .1s ease, width .2s, height .2s;
}
#cursor.big { width: 50px; height: 50px; opacity: .5; }
@media (hover: none) { #cursor { display: none; } body { cursor: auto; } a, button { cursor: pointer; } }

/* Loader */
#loader {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s, visibility .6s;
}
#loader.hide { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-ring {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.1); border-top-color: var(--accent-2);
  animation: spin 1s linear infinite;
}
.loader-inner p { font-family: var(--font-head); font-size: 1.3rem; letter-spacing: 2px; }
.loader-inner span, .logo span { color: var(--accent-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Nav */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 0; transition: background .3s, backdrop-filter .3s, box-shadow .3s;
}
#navbar.scrolled {
  background: rgba(10,14,26,.7); backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0,0,0,.3);
}
nav {
  width: min(1100px, 92%); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; letter-spacing: 1px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  position: relative; color: var(--muted); font-size: .95rem;
  transition: color .3s; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--grad); transition: width .3s; border-radius: 2px;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

#burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; width: 30px; padding: 6px; }
#burger span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: .3s; }

/* Hero */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 20px 60px; position: relative;
}
.name {
  font-family: var(--font-head); font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 800; line-height: 1.05;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: floaty 6s ease-in-out infinite;
}
.kicker { color: var(--accent-2); letter-spacing: 4px; text-transform: uppercase; font-size: .85rem; margin-bottom: 18px; }
.type-wrap { font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 600; color: var(--text); min-height: 2.4rem; margin: 22px 0 18px; font-family: var(--font-head); }
.caret { display: inline-block; width: 3px; height: 1.1em; background: var(--accent-2); margin-left: 3px; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tagline { color: var(--muted); max-width: 640px; margin: 0 auto 34px; font-size: 1.05rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }

.btn {
  position: relative; padding: 14px 30px; border-radius: 50px; font-family: var(--font-head);
  font-weight: 600; font-size: .95rem; transition: transform .2s, box-shadow .2s; letter-spacing: .5px;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { border: 1.5px solid var(--muted); color: var(--text); }
.btn:hover { transform: translateY(-3px); }
.btn-primary:hover { box-shadow: 0 24px 60px -16px rgba(34,211,238,.55); }
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }

.hero-socials { display: flex; gap: 14px; justify-content: center; }
.hero-socials a {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid rgba(255,255,255,.08); transition: .3s;
}
.hero-socials svg { width: 20px; height: 20px; }
.hero-socials a:hover { background: var(--grad); transform: translateY(-4px) rotate(6deg); }

.scroll-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  color: var(--muted); font-size: .75rem; letter-spacing: 2px; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-hint span {
  display: block; width: 1.5px; height: 40px; background: linear-gradient(var(--accent-2), transparent);
  animation: scrollDot 2s ease-in-out infinite;
}
@keyframes scrollDot { 0%{transform:scaleY(0);transform-origin:top} 100%{transform:scaleY(1);transform-origin:top} }

/* Sections */
.section { padding: 100px 20px; }
.section.alt { background: var(--bg-alt); }
.container { width: min(1100px, 100%); margin: 0 auto; }
.section-title {
  font-family: var(--font-head); font-size: clamp(2rem, 5vw, 3rem); font-weight: 800;
  text-align: center; margin-bottom: 60px;
}
.section-title span { color: var(--accent-2); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: stretch; }
.about-card {
  background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow);
}
.about-card h3 { font-family: var(--font-head); margin-bottom: 18px; color: var(--accent-2); }
.about-card p { color: var(--muted); line-height: 1.8; margin-bottom: 16px; }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat {
  background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius);
  padding: 30px 12px; text-align: center; display: flex; flex-direction: column; justify-content: center;
  transition: transform .3s;
}
.stat:hover { transform: translateY(-6px); }
.stat-num { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: 8px; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.skill-head { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text); font-family: var(--font-head); }
.pct { color: var(--accent-2); }
.bar { height: 10px; background: rgba(255,255,255,.08); border-radius: 10px; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 10px; background: var(--grad); transition: width 1.4s cubic-bezier(.4,0,.2,1); }

/* Projects */
.filters { display: flex; gap: 12px; justify-content: center; margin-bottom: 44px; flex-wrap: wrap; }
.filter {
  padding: 10px 22px; border-radius: 50px; border: 1.5px solid rgba(255,255,255,.12);
  background: transparent; color: var(--muted); font-family: var(--font-head); font-size: .9rem;
  transition: .3s; cursor: pointer;
}
.filter:hover { color: var(--text); border-color: var(--accent-2); }
.filter.active { background: var(--grad); border-color: transparent; color: #fff; }
.sync-note {
  text-align: center; color: var(--muted); font-size: .9rem; letter-spacing: .5px;
  margin: -36px 0 44px;
}
.sync-note::before { content: "↻ "; color: var(--accent-2); }
.projects-grid .sync-note { margin: 0; }
.projects-grid .sync-note::before { content: ""; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.project {
  background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius);
  padding: 30px; position: relative; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .3s, box-shadow .3s;
}
.project::before {
  content: ""; position: absolute; top: -40%; right: -40%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(108,92,231,.3), transparent 70%); opacity: 0; transition: .4s;
}
.project:hover::before { opacity: 1; }
.project:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.project-icon { font-size: 1.8rem; color: var(--accent-2); }
.project-top a { font-size: 1.3rem; color: var(--muted); transition: .3s; }
.project-top a:hover { color: var(--accent-2); transform: translate(2px,-2px); }
.project h3 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 12px; }
.project p { color: var(--muted); font-size: .95rem; line-height: 1.7; margin-bottom: 20px; flex-grow: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tags span {
  background: rgba(108,92,231,.15); color: var(--accent-2); padding: 5px 12px; border-radius: 20px;
  font-size: .75rem; letter-spacing: .5px;
}
.project-link { color: var(--accent-2); font-weight: 600; font-size: .9rem; }
.project-link:hover { text-decoration: underline; }

/* Contact */
.contact-intro { text-align: center; color: var(--muted); max-width: 520px; margin: 0 auto 36px; font-size: 1.05rem; line-height: 1.7; }
.contact-actions { display: flex; justify-content: center; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.contact-email { text-align: center; }
.contact-email a { color: var(--accent-2); font-size: 1.1rem; border-bottom: 1px dashed var(--accent-2); padding-bottom: 2px; }
.contact-loc { text-align: center; color: var(--muted); margin-top: 18px; }

/* Footer */
footer { background: var(--bg-alt); border-top: 1px solid rgba(255,255,255,.06); padding: 30px 20px; text-align: center; color: var(--muted); font-size: .9rem; }
footer span { color: var(--accent-2); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

/* Responsive */
@media (max-width: 768px) {
  #burger { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -100%; height: 100vh; width: 70%;
    background: rgba(10,14,26,.98); flex-direction: column; justify-content: center;
    align-items: center; gap: 34px; transition: right .4s; z-index: 99; box-shadow: -10px 0 40px rgba(0,0,0,.4);
  }
  .nav-links.open { right: 0; }
  #burger.open span:nth-child(1){ transform: rotate(45deg) translate(5px,5px); }
  #burger.open span:nth-child(2){ opacity: 0; }
  #burger.open span:nth-child(3){ transform: rotate(-45deg) translate(5px,-5px); }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}
