:root {
  --bg:       #0A0F1E;
  --bg2:      #0F1628;
  --bg3:      #141C35;
  --accent:   #6C63FF;
  --accent2:  #A78BFA;
  --text:     #E8EAFF;
  --muted:    #8892B0;
  --border:   rgba(108, 99, 255, 0.18);
  --card-bg:  rgba(20, 28, 53, 0.85);
  --radius:   12px;
  --nav-h:    64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

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

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent2);
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent2);
  transition: background 0.2s, color 0.2s;
}

.nav-cta:hover {
  background: var(--accent);
  color: #fff;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 99;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

/* SECTIONS */
section {
  padding: clamp(4rem, 10vw, 7rem) clamp(1.25rem, 5vw, 3rem);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  margin-bottom: 2.5rem;
}

/* HERO */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + 2rem);
  background: radial-gradient(ellipse 70% 60% at 60% 40%, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.hero-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent2);
  border: 1px solid rgba(108, 99, 255, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
}

.hero-name {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-name .first {
  color: var(--text);
}

.hero-name .last {
  color: var(--accent2);
}

.hero-role {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 540px;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

.btn-outline {
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: border-color 0.2s, transform 0.15s;
}

.btn-outline:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}

.hero-avatar {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 70px rgba(108, 99, 255, 0.35);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  padding: 4px;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.hero-avatar::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(108, 99, 255, 0.4);
  animation: spin 18s linear infinite;
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  border-left: 2px solid var(--accent);
  padding-left: 0.75rem;
}

.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ABOUT */
#about {
  background: var(--bg2);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-text p strong {
  color: var(--text);
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.highlight-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(108, 99, 255, 0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.highlight-card p {
  font-size: 0.83rem;
  color: var(--muted);
}

/* WORK EXPERIENCE & EDUCATION */
#experience {
  background: var(--bg);
}

#education {
  background: var(--bg2);
}

.exp-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.exp-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.exp-card:hover {
  border-color: var(--accent);
}

.exp-card.current::before {
  content: 'Current';
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 99px;
}

.exp-header {
  margin-bottom: 1rem;
}

.exp-date {
  font-size: 0.78rem;
  color: var(--accent2);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.exp-role {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.exp-org {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.exp-bullets li {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
  padding-left: 1.1rem;
  position: relative;
}

.exp-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.05rem;
}

.exp-bullets li strong {
  color: var(--text);
}

/* SKILLS */
#skills {
  background: var(--bg);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.skill-group {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  backdrop-filter: blur(6px);
}

.skill-group-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  background: rgba(108, 99, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 99px;
}

/* PROJECTS */
#projects {
  background: var(--bg2);
}

.projects-filter {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.project-card.hidden {
  display: none;
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  gap: 0.5rem;
}

.project-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.badge-flagship {
  background: rgba(167, 139, 250, 0.18);
  color: var(--accent2);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge-fullstack {
  background: rgba(99, 202, 183, 0.12);
  color: #63cab7;
  border: 1px solid rgba(99, 202, 183, 0.25);
}

.badge-ml {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-backend {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-data {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-tested {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.project-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-link {
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}

.project-link:hover {
  color: var(--accent2);
  border-color: var(--accent2);
}

.project-link-live {
  border-color: rgba(52, 211, 153, 0.4);
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
}

.project-link-live:hover {
  border-color: #34d399;
  color: #ffffff;
  background: rgba(52, 211, 153, 0.2);
}

.project-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.1rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.stack-tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.22rem 0.6rem;
  background: rgba(10, 15, 30, 0.6);
  color: var(--muted);
  border: 1px solid rgba(136, 146, 176, 0.2);
  border-radius: 4px;
}

.btn-details {
  width: 100%;
  padding: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(108, 99, 255, 0.08);
  color: var(--accent2);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-details:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* MODAL SYSTEM */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 18, 0.82);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  margin: auto;
}

.project-modal {
  display: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.2s ease-out;
}

.project-modal.active {
  display: block;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  background: rgba(20, 28, 53, 0.5);
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.modal-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 2rem;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.modal-section h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2);
  margin-bottom: 0.75rem;
}

.modal-section p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 0.5rem;
}

.modal-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-section li {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  padding-left: 1.25rem;
  position: relative;
}

.modal-section li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  top: 0;
}

.modal-section li strong {
  color: var(--text);
}

.arch-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--accent2);
  line-height: 1.5;
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
}

.modal-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* CONTACT */
#contact {
  background: var(--bg);
  text-align: center;
}

.contact-inner {
  max-width: 600px;
  margin: 0 auto;
}

.contact-intro {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.75;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.contact-link:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
  transform: translateY(-2px);
}

.contact-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-cta {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-avatar {
    display: block;
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
  }
  .hero-btns {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .modal-overlay {
    padding: 0.75rem;
  }
  .modal-header {
    padding: 1.25rem;
  }
  .modal-body {
    padding: 1.25rem;
  }
  .contact-links {
    flex-direction: column;
    align-items: center;
  }
  .contact-link {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}