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

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --border: rgba(255,255,255,0.07);
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --accent3: #38bdf8;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --glow: rgba(108,99,255,0.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Noise overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  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='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: .4;
}

/* ── Animated gradient orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 12s ease-in-out infinite;
}
.orb1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(108,99,255,.18) 0%, transparent 70%); top: -200px; left: -200px; animation-delay: 0s; }
.orb2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(56,189,248,.14) 0%, transparent 70%); bottom: 10%; right: -150px; animation-delay: -4s; }
.orb3 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(167,139,250,.12) 0%, transparent 70%); top: 50%; left: 40%; animation-delay: -8s; }

@keyframes orbFloat {
  0%,100% { transform: translateY(0) scale(1); }
  33% { transform: translateY(-40px) scale(1.05); }
  66% { transform: translateY(20px) scale(0.97); }
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,15,.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all .3s;
}
.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #6c63ff, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.02em;
}
.nav-right { display: flex; align-items: center; gap: 32px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 100%;
  height: 1.5px;
  background: var(--accent);
  transition: right .25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { right: 0; }

/* ── Lang switcher ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
}
.lang-btn {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  letter-spacing: .04em;
  transition: all .2s;
}
.lang-btn.active {
  background: var(--accent);
  color: #fff;
}
.lang-btn:not(.active):hover { color: var(--text-dim); }

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(108,99,255,.12);
  border: 1px solid rgba(108,99,255,.3);
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: fadeInUp .8s ease both;
}
.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--accent2);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.5; transform:scale(.8); } }

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.04em;
  margin-bottom: 24px;
  animation: fadeInUp .8s ease .1s both;
}
.hero h1 .line1 { display: block; color: var(--text); }
.hero h1 .line2 {
  display: block;
  background: linear-gradient(135deg, #6c63ff 0%, #a78bfa 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  max-width: 560px;
  font-size: 1.1rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 48px;
  animation: fadeInUp .8s ease .2s both;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-bottom: 48px;
  animation: fadeInUp .8s ease .3s both;
}
.stat { text-align: center; }
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #6c63ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 4px; letter-spacing: .04em; }

.hero-cta {
  display: flex;
  gap: 16px;
  animation: fadeInUp .8s ease .4s both;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .25s;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, #6c63ff, #a78bfa);
  color: #fff;
  box-shadow: 0 0 30px rgba(108,99,255,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 45px rgba(108,99,255,.55); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scroll indicator ── */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  animation: fadeInUp 1s ease .8s both;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 1.6s ease-in-out infinite;
}
@keyframes scrollLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ── Tech stack strip ── */
.tech-strip {
  position: relative;
  z-index: 1;
  padding: 48px 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tech-strip-inner {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 25s linear infinite;
}
.tech-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.tech-chip .icon { font-size: 1rem; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Section ── */
section {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 48px;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-label::before {
  content: '';
  width: 20px; height: 1.5px;
  background: var(--accent);
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 12px;
  line-height: 1.15;
}
.section-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 500px;
  margin-bottom: 56px;
}

/* ── Filter tabs ── */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.tab {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  user-select: none;
}
.tab:hover { color: var(--text-dim); border-color: rgba(255,255,255,.15); }
.tab.active {
  background: linear-gradient(135deg, #6c63ff, #a78bfa);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(108,99,255,.4);
}

/* ── Project grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all .3s cubic-bezier(.25,.46,.45,.94);
  cursor: pointer;
  animation: cardIn .5s ease both;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(108,99,255,.35);
  box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 0 40px rgba(108,99,255,.12);
}
@keyframes cardIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.card-preview {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--surface2);
  cursor: zoom-in;
}
.card-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.project-card:hover .card-preview img { transform: scale(1.06); }

.card-preview-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--surface2), rgba(108,99,255,.08));
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,.85) 0%, transparent 60%);
}
.card-category-badge {
  position: absolute;
  top: 14px; left: 14px;
  padding: 4px 12px;
  background: rgba(10,10,15,.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent2);
}

.card-body { padding: 22px 24px 24px; }
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
  color: var(--text);
}
.card-desc {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tag {
  padding: 4px 11px;
  background: rgba(108,99,255,.1);
  border: 1px solid rgba(108,99,255,.2);
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent2);
}
.tag.react { background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.2); color: #38bdf8; }
.tag.vue { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.2); color: #4ade80; }
.tag.rn { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.2); color: #fbbf24; }
.tag.electron { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.2); color: #a78bfa; }
.tag.node { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.2); color: #34d399; }
.tag.next { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #e2e8f0; }
.tag.tailwind { background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.2); color: #38bdf8; }

/* ── Featured card (wide) ── */
.project-card.featured { grid-column: span 2; }
.project-card.featured .card-preview { height: 280px; }
@media (max-width: 900px) { .project-card.featured { grid-column: span 1; } }

/* ── About section ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }

.about-text p {
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: .95rem;
}
.about-text p strong { color: var(--text); font-weight: 600; }

.skills-list { display: flex; flex-direction: column; gap: 16px; }
.skill-row { display: flex; flex-direction: column; gap: 6px; }
.skill-meta { display: flex; justify-content: space-between; align-items: center; }
.skill-name { font-size: .84rem; font-weight: 600; color: var(--text-dim); }
.skill-pct { font-size: .78rem; color: var(--text-muted); }
.skill-bar { height: 5px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.skill-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #6c63ff, #a78bfa);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(.25,.46,.45,.94);
}
.skill-fill.react { background: linear-gradient(90deg, #38bdf8, #60a5fa); }
.skill-fill.vue   { background: linear-gradient(90deg, #4ade80, #22d3ee); }
.skill-fill.node  { background: linear-gradient(90deg, #34d399, #4ade80); }

/* ── Contact ── */
.contact-box {
  background: linear-gradient(135deg, rgba(108,99,255,.08) 0%, rgba(56,189,248,.05) 100%);
  border: 1px solid rgba(108,99,255,.2);
  border-radius: 24px;
  padding: 64px;
  text-align: center;
}
.contact-box h2 { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 16px; }
.contact-box p { color: var(--text-dim); font-size: 1rem; margin-bottom: 40px; }
.contact-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 48px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
}

/* ── Hidden class for filter ── */
.project-card.hidden { display: none; }

/* ── Intersection observer fade ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Lightbox ── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
#lightbox.open { opacity: 1; pointer-events: all; }
#lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,5,10,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
#lightbox-box {
  position: relative;
  z-index: 1;
  max-width: min(1100px, 95vw);
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 60px rgba(108,99,255,.15);
  transform: scale(.88) translateY(24px);
  transition: transform .4s cubic-bezier(.25,.46,.45,.94);
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
#lightbox.open #lightbox-box { transform: scale(1) translateY(0); }
#lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 80px);
  object-fit: contain;
  width: 100%;
}
#lightbox-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#lightbox-title { font-size: .9rem; font-weight: 600; color: var(--text); }
#lightbox-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
#lightbox-close:hover { background: rgba(255,255,255,.15); color: var(--text); }

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  user-select: none;
}
.lb-arrow:hover { background: rgba(108,99,255,.3); color: #fff; border-color: rgba(108,99,255,.5); }
#lb-prev { left: -56px; }
#lb-next { right: -56px; }
@media (max-width: 800px) {
  #lb-prev { left: 8px; }
  #lb-next { right: 8px; }
}
