/* ===== Reset & Vars ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --bg-alt: #0d0d14;
  --surface: #13131c;
  --surface-2: #1a1a26;
  --border: rgba(255,255,255,0.08);
  --text: #f2f2f7;
  --text-muted: #9797a8;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #ff5c8a;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
  --ff-display: 'Space Grotesk', sans-serif;
  --ff-body: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--accent); color: #fff; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--text-muted); }

/* Cursor glow (desktop only) */
.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,0.12) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: opacity .3s;
  left: -9999px;
  top: -9999px;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background .3s, border-color .3s, padding .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10,10,15,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  padding: 12px 0;
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}
.logo .dot { color: var(--accent-2); }
.nav-links {
  display: flex;
  gap: 32px;
  margin-left: auto;
  margin-right: 24px;
}
.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  transition: color .2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gradient);
  transition: width .25s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }

.nav-cta { display: inline-flex; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 200;
}
.menu-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--gradient);
  color: #08080d;
}
.btn-primary:hover {
  box-shadow: 0 10px 30px rgba(124,92,255,0.35);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(124,92,255,0.08); }
.btn-small { padding: 9px 20px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 80px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: float 14s ease-in-out infinite;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -150px; left: -100px;
}
.blob-2 {
  width: 420px; height: 420px;
  background: var(--accent-2);
  bottom: -180px; right: -100px;
  animation-delay: -7s;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px,-30px) scale(1.08); }
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 40%, transparent 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 780px; }
.eyebrow {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 22px;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 44px;
}
.hero-socials {
  display: flex;
  gap: 20px;
  justify-content: center;
}
.hero-socials a {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all .2s;
}
.hero-socials a svg { width: 18px; height: 18px; }
.hero-socials a:hover {
  color: var(--bg);
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-3px);
}

.scroll-cue {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--border);
  border-radius: 20px;
  z-index: 1;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px;
  background: var(--accent-2);
  border-radius: 4px;
  animation: scrollDown 1.8s infinite;
}
@keyframes scrollDown {
  0% { opacity: 1; top: 8px; }
  100% { opacity: 0; top: 20px; }
}

/* ===== Sections ===== */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.section-tag {
  font-family: var(--ff-display);
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--ff-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 56px;
}

/* reveal on scroll */
.reveal, .reveal-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.reveal.in, .reveal-item.in { opacity: 1; transform: translateY(0); }
.hero .reveal:nth-child(1) { transition-delay: .05s; }
.hero .reveal:nth-child(2) { transition-delay: .15s; }
.hero .reveal:nth-child(3) { transition-delay: .25s; }
.hero .reveal:nth-child(4) { transition-delay: .35s; }
.hero .reveal:nth-child(5) { transition-delay: .45s; }

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-text p { color: var(--text-muted); margin-bottom: 18px; }
.about-stats {
  display: flex;
  gap: 40px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.stat-num {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-plus {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-2);
}
.stat-label { display: block; color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }

.about-card {
  position: relative;
  border-radius: var(--radius);
  padding: 1px;
}
.card-glow {
  position: absolute; inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), transparent 60%);
  opacity: 0.5;
}
.about-card-inner {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 30px;
  text-align: center;
}
.avatar {
  width: 84px; height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: #08080d;
}
.about-card-inner h3 { font-family: var(--ff-display); font-size: 1.3rem; margin-bottom: 4px; }
.about-list { margin: 22px 0 26px; text-align: left; display: inline-block; }
.about-list li { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 10px; display: flex; gap: 10px; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124,92,255,0.4);
  box-shadow: var(--shadow);
}
.skill-icon { font-size: 1.8rem; margin-bottom: 14px; }
.skill-card h3 { font-family: var(--ff-display); font-size: 1.05rem; margin-bottom: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ===== Timeline ===== */
.timeline { position: relative; max-width: 760px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  opacity: 0.4;
}
.timeline-item {
  position: relative;
  padding-left: 42px;
  margin-bottom: 44px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 0; top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.12);
}
.timeline-date {
  font-size: 0.82rem;
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.timeline-content h3 {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  margin: 6px 0 10px;
  font-weight: 600;
}
.timeline-content p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
  border-color: rgba(124,92,255,0.35);
}
.project-thumb {
  height: 180px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-thumb span {
  font-family: var(--ff-display);
  font-size: 3.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.18);
}
.thumb-1 { background: linear-gradient(135deg, #7c5cff33, #22d3ee22); }
.thumb-2 { background: linear-gradient(135deg, #ff5c8a33, #7c5cff22); }
.thumb-3 { background: linear-gradient(135deg, #22d3ee33, #ff5c8a22); }
.thumb-4 { background: linear-gradient(135deg, #7c5cff33, #ff5c8a22); }
.project-body { padding: 24px; }
.project-body h3 { font-family: var(--ff-display); font-size: 1.2rem; margin-bottom: 10px; }
.project-body p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 16px; }
.project-body .tags { margin-bottom: 18px; }
.project-links { display: flex; gap: 20px; }
.project-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-2);
  transition: opacity .2s;
}
.project-links a:hover { opacity: 0.7; }

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: start;
}
.contact-info p { color: var(--text-muted); margin-bottom: 24px; }
.contact-email {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 30px;
  position: relative;
}
.contact-email:hover { color: var(--accent-2); }
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.form-row input, .form-row textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color .2s;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-note { margin-top: 14px; font-size: 0.85rem; color: var(--accent-2); min-height: 1em; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.back-top {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color .2s;
}
.back-top:hover { color: var(--accent-2); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(280px, 75vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.2,.7,.3,1);
    margin: 0;
    z-index: 150;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-cta { display: none; }
  .menu-toggle { display: flex; }
  .hero { padding-top: 120px; }
  .skills-grid { grid-template-columns: 1fr; }
  .about-stats { gap: 24px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (hover: none) {
  .cursor-glow { display: none; }
}
