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

:root {
  --bg:      #09090f;
  --bg2:     #0f0f1a;
  --bg3:     #141424;
  --accent:  #7c3aed;
  --accent2: #a78bfa;
  --accent3: #c4b5fd;
  --text:    #f1f5f9;
  --muted:   #94a3b8;
  --border:  rgba(167, 139, 250, 0.15);
  --glow:    rgba(124, 58, 237, 0.12);
  --radius:  12px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:      #faf9ff;
    --bg2:     #f2f0ff;
    --bg3:     #e8e4ff;
    --accent:  #6d28d9;
    --accent2: #7c3aed;
    --accent3: #5b21b6;
    --text:    #180f30;
    --muted:   #5a548a;
    --border:  rgba(109, 40, 217, 0.18);
    --glow:    rgba(109, 40, 217, 0.07);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg:      #faf9ff;
  --bg2:     #f2f0ff;
  --bg3:     #e8e4ff;
  --accent:  #6d28d9;
  --accent2: #7c3aed;
  --accent3: #5b21b6;
  --text:    #180f30;
  --muted:   #5a548a;
  --border:  rgba(109, 40, 217, 0.18);
  --glow:    rgba(109, 40, 217, 0.07);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg:      #09090f;
  --bg2:     #0f0f1a;
  --bg3:     #141424;
  --accent:  #7c3aed;
  --accent2: #a78bfa;
  --accent3: #c4b5fd;
  --text:    #f1f5f9;
  --muted:   #94a3b8;
  --border:  rgba(167, 139, 250, 0.15);
  --glow:    rgba(124, 58, 237, 0.12);
  color-scheme: dark;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: break-word;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent3); }
strong { color: var(--text); }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
}

section { padding: 90px 0; }

h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 40px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 28px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== NAV ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: all 0.3s;
}

#navbar.scrolled {
  background: rgba(9, 9, 15, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) #navbar.scrolled { background: rgba(250, 249, 255, 0.92); }
}
:root[data-theme="light"] #navbar.scrolled { background: rgba(250, 249, 255, 0.92); }

.nav-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent2);
  letter-spacing: 0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 2px;
  background: var(--accent2);
  border-radius: 1px;
  transition: width 0.2s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; }

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

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 110px 28px 80px;
  max-width: 880px;
  margin: 0 auto;
  position: relative;
}

#hero::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hero-roles span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent2);
  border: 1.5px solid rgba(167,139,250,0.35);
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(124,58,237,0.08);
  letter-spacing: 0.02em;
}

.hero-bio {
  color: var(--muted);
  font-size: 0.975rem;
  margin-bottom: 32px;
  max-width: 560px;
  line-height: 1.8;
}

.hero-links {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.btn {
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  letter-spacing: 0.01em;
}
.btn:hover {
  background: #6d28d9;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.35);
}
.btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }

.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(167,139,250,0.4);
  color: var(--accent2);
}
.btn-ghost:hover {
  background: var(--glow);
  border-color: var(--accent2);
  color: var(--accent3);
  box-shadow: none;
}

.hero-socials {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-socials a {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
  word-break: break-all;
}
.hero-socials a:hover {
  color: var(--accent2);
  border-color: var(--accent2);
  background: var(--glow);
}

/* ===== ABOUT ===== */
#about {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

#about > .container > p {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 40px;
  max-width: 680px;
  line-height: 1.85;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.skill-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color 0.2s, transform 0.2s;
}

.skill-box:hover {
  border-color: rgba(167,139,250,0.35);
  transform: translateY(-2px);
}

.skill-box h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.skill-box p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}

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

.project-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  background: var(--bg2);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.project-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.25s;
}

.project-item:hover {
  border-color: rgba(167,139,250,0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.project-item:hover::after { opacity: 1; }

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.project-top h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
}

.project-url {
  font-size: 0.8rem;
  color: var(--accent2);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.project-url:hover { border-color: var(--accent2); background: var(--glow); }

.project-date {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 14px;
  font-style: italic;
  line-height: 1.6;
}

.project-item ul {
  list-style: none;
  margin-bottom: 18px;
}

.project-item ul li {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 3px 0 3px 16px;
  position: relative;
  line-height: 1.6;
  min-width: 0;
}

.project-item ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent2);
  font-size: 0.7rem;
  top: 6px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  font-size: 0.73rem;
  background: rgba(124,58,237,0.1);
  color: var(--accent3);
  border: 1px solid rgba(167,139,250,0.2);
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===== EXPERIENCE ===== */
#experience {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--border);
  padding-left: 28px;
  margin-left: 8px;
}

.exp-item {
  position: relative;
  padding-bottom: 36px;
}

.exp-item:last-child { padding-bottom: 0; }

.exp-item::before {
  content: '';
  position: absolute;
  left: -35px;
  top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg2);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 3px;
}

.exp-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.exp-header span {
  font-size: 0.78rem;
  color: var(--accent2);
  background: rgba(124,58,237,0.1);
  padding: 2px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.exp-item h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent2);
  margin-bottom: 12px;
}

.exp-item ul { list-style: none; }

.exp-item ul li {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 3px 0 3px 16px;
  position: relative;
  line-height: 1.65;
}

.exp-item ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Education & Certs (inside experience section) */
.edu-section { margin-top: 64px; }
.edu-section h2 { margin-bottom: 24px; }

.edu-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 32px;
}

.edu-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.edu-card h4 { font-size: 0.875rem; color: var(--accent2); font-weight: 500; margin-bottom: 8px; }
.edu-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.edu-card ul { list-style: none; margin-top: 10px; }
.edu-card ul li {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 3px 0 3px 16px;
  position: relative;
  line-height: 1.65;
}
.edu-card ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.cert-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
}

.cert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  font-size: 0.875rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
  transition: background 0.2s;
}

.cert-item:last-child { border-bottom: none; }
.cert-item:hover { background: rgba(124,58,237,0.05); }

.cert-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cert-date {
  font-size: 0.78rem;
  color: var(--accent2);
  background: rgba(124,58,237,0.1);
  padding: 2px 10px;
  border-radius: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cert-dl {
  font-size: 0.75rem;
  color: var(--accent2);
  border: 1px solid rgba(167,139,250,0.3);
  padding: 2px 10px;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}
.cert-dl:hover {
  background: var(--glow);
  border-color: var(--accent2);
  color: var(--accent3);
}

/* ===== CONTACT ===== */
#contact { background: var(--bg); }

.contact-intro {
  color: var(--muted);
  margin-bottom: 36px;
  font-size: 1rem;
  line-height: 1.8;
  max-width: 560px;
}

.contact-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-links a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 20px 22px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all 0.2s;
}

.contact-links a:hover {
  border-color: rgba(167,139,250,0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  color: var(--text);
  background: var(--bg3);
}

.contact-links a strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2);
}

.contact-links a span {
  font-size: 0.9rem;
  color: var(--muted);
  word-break: break-word;
  user-select: all;
}

/* CV download card */
.cv-download-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 20px 24px;
  background: var(--bg2);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: var(--radius);
  color: var(--text);
  transition: all 0.2s;
  text-decoration: none;
  grid-column: 1 / -1;
}

.cv-download-card:hover {
  border-color: var(--accent2);
  background: var(--bg3);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124,58,237,0.2);
  color: var(--text);
}

.cv-download-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.cv-download-card div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cv-download-card strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent2);
}

.cv-download-card span {
  font-size: 0.85rem;
  color: var(--muted);
  user-select: auto;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--bg2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  section { padding: 70px 0; }
  #hero { padding: 100px 20px 60px; }

  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 70px 24px 32px;
    flex-direction: column;
    gap: 0;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .skills-grid { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: 1fr; }
  .project-top { flex-direction: column; align-items: flex-start; }
  .exp-header { flex-direction: column; }
  .hero-links { flex-direction: column; }
  .cv-download-card { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
