:root {
  --bg: #0b0f1a;
  --bg-2: #0f172a;
  --text: #dbe6ff;
  --muted: #8ca3c6;
  --line: rgba(130, 150, 255, 0.18);
  --glass: rgba(19, 28, 49, 0.55);
  --accent: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  --shadow: 0 20px 80px rgba(23, 34, 82, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 10% 0%, #131a33 0%, var(--bg) 40%, #070b14 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(circle at 75% 15%, rgba(124, 58, 237, .16), transparent 45%),
    radial-gradient(circle at 20% 85%, rgba(59, 130, 246, .14), transparent 42%);
}

#loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1rem;
  background: #070b14;
  z-index: 2000;
  transition: opacity .5s ease, visibility .5s ease;
}
#loader.hide { opacity: 0; visibility: hidden; }
.loader-core {
  width: 76px;
  height: 76px;
  border: 3px solid rgba(124, 58, 237, .3);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 25px rgba(124, 58, 237, .6);
}
#loader p { color: var(--muted); letter-spacing: .08em; font-size: .84rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1500;
}

.cursor-glow {
  position: fixed;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(124, 58, 237, .24), transparent 65%);
  transform: translate(-50%, -50%);
  filter: blur(8px);
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.noise,
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise {
  z-index: 1;
  opacity: .05;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 3px 3px;
}

.scanline {
  z-index: 1;
  opacity: .08;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 2px,
    rgba(124, 58, 237, .25) 3px
  );
  mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}

.container { width: min(1120px, calc(100% - 2.4rem)); margin: 0 auto; }
.section { padding: clamp(4rem, 9vw, 7.2rem) 0; position: relative; }
.section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,.45), rgba(59,130,246,.38), transparent);
}
.section-title {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.08;
  display: inline-block;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  margin-top: .45rem;
  width: 70%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}
.section-subtitle { color: var(--muted); max-width: 760px; margin: 0 0 2rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(8, 12, 24, .72);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled {
  background: rgba(6, 10, 20, .92);
  border-color: rgba(124,58,237,.25);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.nav { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 1.3rem; }
.brand {
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
  background: var(--accent);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: .65rem;
  color: #dbe6ff;
  background: rgba(255,255,255,.03);
  padding: .45rem .72rem;
}
.nav-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: .55rem .72rem;
  border-radius: .55rem;
  font-size: .92rem;
  transition: .25s ease;
}
.nav-links a:hover { color: #fff; background: rgba(124, 58, 237, .16); }
.nav-links a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,58,237,.28), rgba(59,130,246,.2));
  box-shadow: 0 0 0 1px rgba(124,58,237,.4) inset;
}

.hero { min-height: calc(100vh - 70px); display: grid; place-items: center; overflow: hidden; }
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(66, 88, 156, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 88, 156, .12) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
}
.hero-content { text-align: center; position: relative; z-index: 2; }
.pill {
  display: inline-flex;
  border: 1px solid rgba(124,58,237,.4);
  border-radius: 999px;
  padding: .45rem .9rem;
  background: rgba(124,58,237,.14);
  color: #cdb7ff;
  margin-bottom: 1.2rem;
}
.hero h1 { margin: 0; font-size: clamp(2.2rem, 7vw, 5rem); }
.hero h1 {
  text-shadow: 0 0 22px rgba(124,58,237,.26), 0 0 42px rgba(59,130,246,.22);
  animation: titleGlow 3.2s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 22px rgba(124,58,237,.26), 0 0 42px rgba(59,130,246,.22); }
  50% { text-shadow: 0 0 30px rgba(124,58,237,.4), 0 0 50px rgba(59,130,246,.35); }
}
.hero p { max-width: 760px; margin: 1rem auto 0; color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.14rem); }
.typing-wrap {
  margin-top: 1.1rem;
  min-height: 1.7em;
  color: #c2d7ff;
  font-weight: 600;
  letter-spacing: .02em;
}

.hero-cta { margin-top: 1.8rem; display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; }
.btn {
  position: relative;
  overflow: hidden;
  border-radius: .9rem;
  text-decoration: none;
  font-weight: 600;
  padding: .84rem 1.2rem;
  border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.btn::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,.45);
  left: var(--x, 50%);
  top: var(--y, 50%);
}
.btn.ripple::after { animation: ripple .55s ease-out; }
@keyframes ripple { to { transform: scale(22); opacity: 0; } }
.btn-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 0 rgba(124,58,237,.45), 0 10px 35px rgba(59,130,246,.33);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 26px rgba(124,58,237,.6), 0 12px 35px rgba(59,130,246,.45); }
.btn-ghost { color: #dbe6ff; border-color: var(--line); background: rgba(255,255,255,.04); }
.btn-ghost:hover { transform: translateY(-2px); border-color: #7c3aed; box-shadow: 0 0 18px rgba(124,58,237,.38); }
.btn-light { color: #13203f; background: #fff; }
.btn:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

.split { display: grid; grid-template-columns: 1.08fr 1fr; gap: 1.4rem; align-items: center; }
.about-image { width: 100%; height: clamp(320px, 48vw, 530px); object-fit: cover; border-radius: 1.2rem; box-shadow: var(--shadow); }
.glass-card,
.stat-card,
.tilt-card,
.project-card,
.contact-card,
.timeline-item {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.glass-card::before,
.stat-card::before,
.tilt-card::before,
.project-card::before,
.contact-card::before,
.timeline-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(130deg, rgba(124,58,237,.2), rgba(59,130,246,.15));
  transition: opacity .25s ease;
}

.glass-card:hover::before,
.stat-card:hover::before,
.tilt-card:hover::before,
.project-card:hover::before,
.contact-card:hover::before,
.timeline-item:hover::after {
  opacity: 1;
}
.glass-card { border-radius: 1.2rem; padding: clamp(1.2rem, 3vw, 2rem); }
.glass-card h2 { margin-top: 0; }
.glass-card p { color: #c4d3ef; }

.stats-grid { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { border-radius: 1rem; padding: 1rem; text-align: center; transition: transform .2s ease; }
.stat-card:hover { transform: translateY(-4px); }
.stat-card h3 {
  margin: 0;
  background: var(--accent);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.35rem;
}
.stat-card p { margin: .45rem 0 0; color: var(--muted); }

.chip-wrap, .badge-grid, .floating-chips, .vuln-tags {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
}
.chip, .badge, .floating-chips span, .tags span, .vuln-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .52rem .86rem;
  background: rgba(255,255,255,.04);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chip:hover, .badge:hover, .floating-chips span:hover {
  box-shadow: 0 0 20px rgba(124,58,237,.4);
  border-color: rgba(124,58,237,.55);
}
.pulse { animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.badge { text-align: center; }

.expertise-grid { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tilt-card { border-radius: 1rem; padding: 1rem; transform-style: preserve-3d; transition: transform .25s ease; }
.tilt-card h3 { margin-top: 0; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags span { color: #d4e3ff; }

.floating-chips span { animation: drift 5s ease-in-out infinite; }
.floating-chips span:nth-child(2n) { animation-delay: .9s; }
.floating-chips span:nth-child(3n) { animation-delay: 1.6s; }
@keyframes drift {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Journey / Experience Section */
.journey-section {
  margin-bottom: 3rem;
  clear: both;
  width: 100%;
}

.journey-title {
  color: #dbe6ff;
  font-size: 1.4rem;
  margin: 0 0 1.2rem 0;
  font-weight: 700;
  display: block;
}

.journey-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  width: 100%;
}

.journey-card {
  background: rgba(19, 28, 49, 0.55);
  border: 1px solid rgba(130, 150, 255, 0.18);
  border-radius: .95rem;
  padding: 1.2rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 80px rgba(23, 34, 82, 0.45);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display: block;
  position: relative;
}

.journey-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(124,58,237,.35), 0 20px 60px rgba(23, 34, 82, 0.45);
  border-color: rgba(124,58,237,.55);
}

.journey-year {
  display: inline-block;
  font-size: .85rem;
  color: #b2a7ff;
  background: rgba(124,58,237,.18);
  padding: .35rem .75rem;
  border-radius: 999px;
  margin-bottom: .7rem;
  font-weight: 600;
}

.journey-card h4 {
  margin: .5rem 0 .3rem 0;
  color: #e3edff;
  font-size: 1.1rem;
  font-weight: 600;
  display: block;
}

.journey-org {
  margin: .4rem 0 0 0;
  color: #a9c0ef;
  font-size: .9rem;
  display: block;
}

.timeline {
  position: relative;
  margin-left: .6rem;
  padding-left: 1.2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(#7c3aed, #3b82f6);
}
.timeline-item {
  position: relative;
  padding: 1rem 1rem 1rem 1.2rem;
  border-radius: .95rem;
  margin-bottom: .9rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.7rem;
  top: 1.25rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #7c3aed;
  box-shadow: 0 0 0 6px rgba(124,58,237,.22);
}
.timeline-item .year { font-size: .8rem; color: #b2a7ff; }
.timeline-item .school { margin: .35rem 0 .5rem; color: #a9c0ef; font-weight: 600; }

.projects-grid { display: grid; gap: 1rem; grid-template-columns: 1.2fr .8fr; }
.project-card { border-radius: 1rem; overflow: hidden; position: relative; }
.project-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  opacity: .65;
  transition: transform .35s ease, opacity .35s ease;
}
.project-card:hover img { transform: scale(1.05); opacity: .92; }
.project-body { padding: 1rem; }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.project-head span { color: #93a9d2; font-size: .9rem; }
.project-card p { color: #c3d2ee; }
.placeholder-card {
  display: grid;
  place-content: center;
  text-align: center;
  min-height: 300px;
}
.dashed { border-style: dashed; }

.vuln-tags span {
  border-color: rgba(255, 115, 76, .5);
  color: #ffb09d;
  background: linear-gradient(180deg, rgba(255,82,82,.18), rgba(255,174,0,.11));
  box-shadow: 0 0 18px rgba(255, 87, 34, .22);
}

.contact-card {
  text-align: center;
  border-radius: 1.2rem;
  padding: clamp(1.2rem, 3vw, 2.5rem);
}
.contact-card h2 { margin-top: 0; }
.contact-card p { color: #c3d3f1; max-width: 700px; margin: 0 auto 1rem; }
.contact-card small { display: block; margin-top: 1rem; color: #a7bee8; }

.footer { border-top: 1px solid var(--line); background: rgba(6, 10, 20, .84); }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem 0;
  color: var(--muted);
}
.footer-inner strong { color: #e3edff; }
.footer-inner p { margin: .2rem 0 0; }
.footer-links { display: flex; gap: .75rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: #fff; }

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(.98);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.show { opacity: 1; transform: none; }

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(124,58,237,.45);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(124,58,237,.24), rgba(59,130,246,.2));
  color: #dbe6ff;
  box-shadow: 0 8px 25px rgba(59,130,246,.28);
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .25s ease;
  z-index: 1100;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  box-shadow: 0 0 22px rgba(124,58,237,.5), 0 10px 30px rgba(59,130,246,.35);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .container { width: min(1120px, calc(100% - 1.6rem)); }
  .split { grid-template-columns: 1fr; }
  .about-image { height: clamp(250px, 60vw, 430px); }
  .stats-grid, .expertise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects-grid { grid-template-columns: 1fr; }
  .project-head { flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 780px) {
  .section { padding: clamp(3rem, 9vw, 4.5rem) 0; }
  .hero { min-height: calc(92vh - 70px); }
  .hero-content { text-align: left; }
  .hero p { margin-inline: 0; }
  .hero-cta { justify-content: flex-start; }
  .hero-cta .btn { width: 100%; text-align: center; }

  .menu-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + .55rem);
    border-radius: .9rem;
    background: rgba(10, 15, 29, .96);
    border: 1px solid var(--line);
    padding: .4rem;
    flex-direction: column;
    transform: scale(.96);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
    max-height: min(70vh, 420px);
    overflow: auto;
  }
  .nav-links.open { opacity: 1; pointer-events: all; transform: scale(1); }
  .nav-links a {
    display: block;
    width: 100%;
    padding: .78rem .9rem;
    font-size: .98rem;
  }

  .stats-grid, .expertise-grid, .journey-grid { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card img { height: 200px; }
  .timeline { margin-left: .3rem; padding-left: .95rem; }
  .timeline-item::before { left: -1.45rem; }
  .cursor-glow { display: none; }
  .noise,
  .scanline { opacity: .03; }
}

@media (max-width: 420px) {
  .container { width: min(1120px, calc(100% - 1.15rem)); }
  .badge-grid { grid-template-columns: 1fr; }
  .pill { font-size: .78rem; }
  .typing-wrap { font-size: .94rem; }
  .back-to-top {
    right: .75rem;
    bottom: .75rem;
  }
}
