:root {
  --bg: linear-gradient(135deg, #0a0514 0%, #1a083a 100%);
  --surface: #130a24;
  --text: #e8dfff;
  --muted: #9d8ec4;
  --accent: #b25cff;
  --accent-2: #e024ff;
  --card: #1a0f30;
  --glow: 0 0 40px rgba(178, 92, 255, 0.35);
}


* { box-sizing: border-box; }
html, body { height: 100%; }
/* Removed scroll-behavior: smooth to avoid conflict with JS scrolling */
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
}

/* Enhanced ambient background */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% -10% -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(800px 500px at 85% -5%, rgba(224, 36, 255, 0.15), transparent 60%),
    radial-gradient(600px 400px at 10% 20%, rgba(178, 92, 255, 0.20), transparent 65%),
    conic-gradient(from 210deg at 70% 30%, rgba(138, 43, 226, 0.18), rgba(0,0,0,0) 35%, rgba(224, 36, 255, 0.18) 60%, rgba(0,0,0,0) 100%);
  filter: blur(40px) saturate(140%);
  opacity: .65;
  animation: bg-drift 48s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mix-blend-mode: overlay;
  opacity: 0.6;
}

@keyframes bg-drift {
  0% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  100% { transform: translate3d(2%, 1%, 0) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

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

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(10, 5, 20, 0.85), rgba(10, 5, 20, 0.35) 60%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: box-shadow .25s ease, background .25s ease, transform .25s ease;
  will-change: background, box-shadow;
}
.navbar.scrolled { box-shadow: 0 10px 30px rgba(0,0,0,.4); background: rgba(10, 5, 20, 0.95); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.logo { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .8px; font-size: 22px; text-transform: uppercase; }
nav { max-width: calc(100% - 100px); overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
.nav-links { list-style: none; display: flex; gap: 26px; padding: 0; margin: 0; white-space: nowrap; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; letter-spacing: .2px; position: relative; transition: color .25s ease, text-shadow .25s ease; }
.nav-link.active, .nav-link:hover { color: var(--accent-2); text-shadow: 0 0 12px rgba(224, 36, 255, 0.4); }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.theme-toggle { background: transparent; border: 1px solid rgba(255,255,255,.2); color: var(--text); border-radius: 8px; padding: 6px 8px; cursor: pointer; transition: background .2s ease, box-shadow .2s ease; }
.theme-toggle:hover { background: rgba(255,255,255,.1); box-shadow: var(--glow); }

/* Hero */
.hero { position: relative; min-height: 92vh; display: grid; align-items: center; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-bg .layer { position: absolute; inset: -10%; background: radial-gradient(900px 400px at 15% 30%, rgba(224, 36, 255, 0.15), transparent 60%); will-change: transform; }
.hero-bg .layer.dots { background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 24px 24px; mix-blend-mode: screen; }
.hero-bg .layer.glow { box-shadow: inset 0 0 160px rgba(178, 92, 255, 0.15); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; padding: 90px 0; }
.hero-content h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -1px; }
.hero-content .hi { color: var(--muted); font-weight: 300; }
.hero .subtitle { color: var(--accent); margin: 0 0 24px; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.cta { display: flex; gap: 12px; }
.btn { --b: 1px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; border: var(--b) solid rgba(255,255,255,.16); color: var(--text); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease; font-weight: 600; letter-spacing: .5px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #000; box-shadow: var(--glow); border-color: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn.small { padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.btn:active { transform: translateY(1px); }
.hero-visual { display: grid; place-items: center; }
.avatar-wrap { width: clamp(180px, 40vw, 320px); aspect-ratio: 1; border-radius: 24px; background: linear-gradient(135deg, rgba(106,162,255,.35), rgba(126,240,255,.2)); padding: 10px; box-shadow: var(--glow); transform-style: preserve-3d; }
.avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; display: block; }

/* Sections */
.section { padding: 90px 0; position: relative; }
.section-title { font-size: clamp(22px, 3vw, 32px); margin: 0 0 24px; }
.grid.two-cols { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }

/* About */
.about-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.about-stats li { background: rgba(26, 15, 48, 0.5); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 22px; text-align: center; transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.about-stats li:hover { transform: translateY(-4px); border-color: rgba(178, 92, 255, 0.4); box-shadow: 0 8px 24px rgba(178, 92, 255, 0.2); }
.about-stats .stat { display: block; font-size: 28px; font-weight: 800; letter-spacing: .6px; }
.about-stats .label { color: var(--muted); font-size: 13px; }
.about-visual { display: grid; place-items: center; }
.about-img { width: 100%; aspect-ratio: 16 / 9; max-height: 360px; border-radius: 16px; object-fit: cover; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--glow); }

/* Skills */
.skills-tags { display: flex; flex-wrap: wrap; gap: 14px; }
.skill-tag { display: flex; align-items: center; gap: 8px; background: rgba(26, 15, 48, 0.5); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 12px 24px; font-weight: 600; font-size: 15px; color: var(--text); transform-style: preserve-3d; transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease, color .3s ease; cursor: default; }
.skill-tag:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(178, 92, 255, 0.3); border-color: rgba(178, 92, 255, 0.5); color: var(--text); text-shadow: 0 0 10px rgba(224, 36, 255, 0.5); }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.projects-grid--second { margin-top: 18px; }
.project-card { background: rgba(26, 15, 48, 0.5); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.4); transform-style: preserve-3d; transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.project-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(178, 92, 255, 0.3); border-color: rgba(178, 92, 255, 0.4); }
.project-card img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.project-content { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-desc { color: var(--muted); font-size: 14px; line-height: 1.6; flex: 1; margin: 0; }
.project-card .actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.badge-wip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #f59e0b; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 999px; padding: 2px 10px; vertical-align: middle; margin-left: 6px; }

/* Organization section images: ensure full image visible and consistent sizing */
#organization .project-card img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: contain; padding: 24px; background: rgba(255,255,255,0.85); border-bottom: 1px solid rgba(255,255,255,.08); }
#organization .project-content h3 { margin: 0; }
#organization .project-content p { margin: 0; color: var(--muted); }



/* Contact */
.contact-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.contact-list a { color: var(--accent-2); text-decoration: none; }
.contact-form { background: var(--card); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 18px; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: #0b101a; color: var(--text); outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106,162,255,.15); }

/* Contact icons */
.icon-grid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); color: var(--text); background: rgba(255,255,255,.04); text-decoration: none; transition: background .2s ease, transform .12s ease, box-shadow .2s ease; }
.icon-btn:hover { background: rgba(255,255,255,.1); box-shadow: var(--glow); }
.icon-btn:active { transform: translateY(1px); }

@media (max-width: 640px) {
  .icon-grid { justify-content: center; }
}

/* Footer */
.footer { padding: 40px 0 60px; color: var(--muted); text-align: center; }

/* Back to top */
.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(15,20,32,.6); color: var(--text); display: grid; place-items: center; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease, background .25s ease; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: rgba(15,20,32,.9); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px) scale(.98); filter: blur(2px); transition: opacity .6s ease, transform .6s ease, filter .6s ease; }
.reveal-visible { opacity: 1 !important; transform: translateY(0) scale(1) !important; filter: blur(0) !important; }

/* Utilities */
[data-tilt] { will-change: transform; }

/* Responsive */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; padding: 70px 0; }
  .grid.two-cols { grid-template-columns: 1fr; }
  .skills-grid, .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .skills-grid, .projects-grid { grid-template-columns: 1fr; }
  .project-card img { aspect-ratio: 16 / 9; height: auto; }
}


