:root {
  --bg: #030612;
  --bg-soft: #07111f;
  --card: rgba(255, 255, 255, 0.075);
  --card-strong: rgba(255, 255, 255, 0.11);
  --stroke: rgba(255, 255, 255, 0.15);
  --text: #eef5ff;
  --muted: #9fb0c9;
  --blue: #50a7ff;
  --purple: #8f5cff;
  --cyan: #58ffd6;
  --green: #4dff9d;
  --shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(80, 167, 255, .22), transparent 32%),
    radial-gradient(circle at 90% 8%, rgba(143, 92, 255, .22), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(88, 255, 214, .10), transparent 35%),
    linear-gradient(135deg, #02040b, #050814 42%, #08111f);
  color: var(--text);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(80, 167, 255, .35); }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 82%);
  pointer-events: none;
  z-index: 0;
}

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

.cursor-glow {
  position: fixed;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80,167,255,.20), transparent 68%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  background: rgba(5, 8, 20, .72);
  backdrop-filter: blur(18px);
  border-radius: 22px;
  z-index: 20;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -.03em; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 0 30px rgba(80,167,255,.35);
}
.nav-menu { display: flex; align-items: center; gap: 8px; }
.nav-menu a {
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 800;
  font-size: .92rem;
  border-radius: 14px;
  transition: .25s;
}
.nav-menu a:hover, .nav-cta { color: white !important; background: rgba(255,255,255,.09); }
.menu-btn { display: none; background: transparent; color: white; border: 0; font-size: 1.5rem; cursor: pointer; }

.section {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 110px 0;
}
.hero { padding-top: 155px; min-height: 100vh; display: flex; align-items: center; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 42px; align-items: center; }
.eyebrow, .tag {
  display: inline-flex; align-items: center; gap: 10px;
  color: #cce5ff;
  font-weight: 900;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow span { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 22px var(--cyan); }
h1 {
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: .95;
  letter-spacing: -.075em;
  margin: 22px 0;
  background: linear-gradient(180deg, #fff, #b4c9e8 74%);
  -webkit-background-clip: text;
  color: transparent;
}
h2 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1; letter-spacing: -.055em; margin-top: 12px; }
.hero-text, .glass-card p, .project-card p, .timeline-item p, .contact-card p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.05rem;
}
.hero-actions, .contact-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 16px;
  padding: 14px 20px;
  font-weight: 950;
  border: 1px solid var(--stroke);
  transition: .25s;
}
.btn:hover { transform: translateY(-3px); }
.primary { background: linear-gradient(135deg, var(--blue), var(--purple)); color: white; box-shadow: 0 18px 55px rgba(80,167,255,.25); }
.ghost { background: rgba(255,255,255,.07); }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 38px; }
.hero-stats div, .glass-card, .project-card, .skill-panel, .timeline-item, .contact-card {
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.045));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.hero-stats div { padding: 18px; border-radius: 20px; }
.hero-stats strong { display: block; font-size: 2rem; }
.hero-stats span { color: var(--muted); font-weight: 800; font-size: .85rem; }

.hero-visual { position: relative; min-height: 520px; perspective: 1000px; }
.hero-svg { position: absolute; inset: 30px 0 auto 0; width: 100%; filter: drop-shadow(0 35px 80px rgba(0,0,0,.35)); animation: cardTilt 7s ease-in-out infinite; }
.terminal-card {
  position: absolute; z-index: 3; right: 0; bottom: 20px;
  width: min(410px, 92%);
  border: 1px solid rgba(80,167,255,.24);
  background: rgba(5,9,20,.88);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.terminal-top { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: rgba(255,255,255,.07); color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: .78rem; }
.terminal-top span { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.terminal-top span:nth-child(2) { background: #ffbd2e; }
.terminal-top span:nth-child(3) { background: #28c840; }
.terminal-card pre { padding: 22px; white-space: pre-wrap; color: #c9e6ff; font-family: "JetBrains Mono", monospace; font-size: .88rem; line-height: 1.65; }
.floating-card { animation: float 5s ease-in-out infinite; }
.orbit { position: absolute; inset: 0; animation: spin 24s linear infinite; transform-origin: center; }
.planet { position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; background: rgba(255,255,255,.09); border: 1px solid var(--stroke); font-weight: 950; box-shadow: 0 20px 55px rgba(0,0,0,.35); }
.p1 { top: 20px; right: 90px; } .p2 { top: 165px; left: 8px; } .p3 { right: 12px; top: 270px; } .p4 { left: 125px; bottom: 20px; }

.section-heading { max-width: 760px; margin-bottom: 35px; }
.about-grid, .project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.glass-card { position: relative; padding: 28px; border-radius: 28px; overflow: hidden; }
.glass-card::after, .project-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.09), transparent);
  transform: translateX(-120%);
  transition: .65s;
  pointer-events: none;
}
.glass-card:hover::after, .project-card:hover::after { transform: translateX(120%); }
.glass-card h3, .project-card h3, .timeline-item h3 { font-size: 1.35rem; margin-bottom: 12px; }

.stack-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: center; }
.stack-cloud { display: flex; flex-wrap: wrap; gap: 14px; }
.stack-cloud span { padding: 16px 20px; border: 1px solid var(--stroke); border-radius: 999px; background: rgba(255,255,255,.065); font-weight: 950; color: #dcecff; transition: .25s; }
.stack-cloud span:hover { transform: translateY(-4px) scale(1.02); border-color: rgba(80,167,255,.45); background: rgba(80,167,255,.12); }
.skill-panel { padding: 28px; border-radius: 28px; }
.skill { margin: 18px 0; }
.skill span { display: block; margin-bottom: 10px; font-weight: 950; }
.skill div { height: 12px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.skill i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--purple), var(--cyan)); transition: width 1.2s ease; }
.skill-panel.visible .skill i, .skill-panel:has(.skill) .skill i { width: var(--w); }

.project-grid { grid-template-columns: repeat(2, 1fr); }
.project-card { position: relative; overflow: hidden; padding: 30px; border-radius: 30px; transition: .3s; min-height: 280px; }
.project-card::before { content: ""; position: absolute; inset: -1px; background: radial-gradient(circle at top right, rgba(80,167,255,.25), transparent 36%); opacity: .8; pointer-events: none; }
.project-card:hover { transform: translateY(-8px); border-color: rgba(80,167,255,.42); }
.project-card.featured { background: linear-gradient(135deg, rgba(80,167,255,.18), rgba(143,92,255,.14)); }
.project-top { display: flex; align-items: center; justify-content: space-between; color: #cde6ff; font-weight: 950; margin-bottom: 18px; }
.project-icon { font-size: 2rem; }
.project-card ul { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; list-style: none; }
.project-card li { padding: 9px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: #cfe2ff; font-weight: 850; font-size: .85rem; }

.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.timeline-item { padding: 25px; border-radius: 26px; }
.timeline-item b { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(135deg, var(--blue), var(--purple)); margin-bottom: 18px; }
.contact-card { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding: 36px; border-radius: 34px; background: linear-gradient(135deg, rgba(80,167,255,.16), rgba(143,92,255,.12), rgba(255,255,255,.06)); }
footer { position: relative; z-index: 2; text-align: center; color: var(--muted); padding: 35px; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .75s ease, transform .75s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .12s; } .delay-2 { transition-delay: .24s; } .delay-3 { transition-delay: .36s; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cardTilt { 0%, 100% { transform: rotateX(0) rotateY(0); } 50% { transform: rotateX(2deg) rotateY(-3deg); } }

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav-menu { position: absolute; top: 68px; right: 0; left: 0; display: none; flex-direction: column; padding: 16px; background: rgba(5,8,20,.96); border: 1px solid var(--stroke); border-radius: 20px; }
  .nav-menu.open { display: flex; }
  .hero-grid, .stack-layout, .contact-card { grid-template-columns: 1fr; }
  .hero { padding-top: 130px; }
  .hero-visual { min-height: 470px; }
  .about-grid, .project-grid, .timeline { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  h1 { font-size: 3.15rem; }
  .section { padding: 80px 0; }
  .contact-actions { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .site-header { top: 10px; width: calc(100% - 20px); }
  .section { width: calc(100% - 24px); }
  .hero-svg { opacity: .9; }
  .terminal-card { left: 0; right: 0; margin: auto; }
  .planet { width: 54px; height: 54px; border-radius: 18px; font-size: .85rem; }
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2.2rem; }
  .btn { width: 100%; }
}
