/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds */
  --bg:          #0d1117;
  --bg-alt:      #161b27;
  --card-bg:     rgba(30,36,48,.85);
  --card-blur:   blur(16px);
  --card-border: rgba(255,255,255,.07);
  --navbar-bg:   rgba(13,17,23,.92);

  /* Brand */
  --primary:       #818cf8;
  --primary-light: rgba(129,140,248,.12);
  --primary-dark:  #6366f1;
  --accent:        #34d399;
  --gold:          #fbbf24;

  /* Text */
  --text:       #e6edf3;
  --text-muted: #8b949e;
  --text-light: #484f58;

  /* Structural */
  --border:     rgba(255,255,255,.08);
  --radius:     14px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 6px rgba(0,0,0,.35);
  --shadow:     0 4px 24px rgba(0,0,0,.45);
  --shadow-lg:  0 8px 48px rgba(0,0,0,.6);
  --transition: .25s ease;
  --font:       'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg:          #f7f8fc;
  --bg-alt:      #eef1f8;
  --card-bg:     #ffffff;
  --card-blur:   none;
  --card-border: #e2e6f0;
  --navbar-bg:   rgba(247,248,252,.90);

  --primary:       #4f46e5;
  --primary-light: #eef2ff;
  --primary-dark:  #3730a3;
  --accent:        #059669;
  --gold:          #d97706;

  --text:       #1a1d2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --border:    #e2e6f0;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow:    0 4px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

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

/* ── Progress Bar ── */
#progress-bar {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .1s linear;
}

/* ── Navbar ── */
#navbar {
  position: fixed; top: 3px; left: 0; right: 0; z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
#navbar.scrolled { box-shadow: var(--shadow); }

.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem; font-weight: 700;
  color: var(--primary);
  letter-spacing: -.3px;
  font-family: var(--font-mono);
}

.nav-links {
  display: flex; gap: 0; list-style: none;
}
.nav-links li a {
  padding: .5rem .9rem;
  font-size: .88rem; font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-links li a:hover,
.nav-links li a.active { color: var(--primary); background: var(--primary-light); }
.nav-links li a.nav-cta {
  background: var(--primary); color: #fff;
  padding: .45rem 1rem; margin-left: .5rem;
}
.nav-links li a.nav-cta:hover { background: var(--primary-dark); }

.nav-controls {
  display: flex; align-items: center; gap: .5rem;
}

.lang-toggle, .theme-toggle {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(129,140,248,.2);
  border-radius: var(--radius-sm);
  padding: .3rem .65rem;
  font-size: .78rem; font-weight: 700;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all var(--transition);
  line-height: 1;
}
.theme-toggle { font-size: .95rem; padding: .28rem .5rem; }
.lang-toggle:hover, .theme-toggle:hover {
  background: var(--primary); color: #fff;
}

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: var(--transition);
}

/* ── Sections ── */
.section { padding: 100px 0 80px; }
.section-alt { background: var(--bg-alt); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

.section-title {
  font-size: 2rem; font-weight: 700;
  margin-bottom: 3rem; letter-spacing: -.5px;
  position: relative; display: inline-block;
}
.section-title[data-number]::before {
  content: attr(data-number) ' /';
  display: block;
  font-family: var(--font-mono);
  font-size: .72rem; font-weight: 500;
  color: var(--primary);
  letter-spacing: .12em;
  margin-bottom: .4rem;
  opacity: .8;
}
.section-title::after {
  content: '';
  display: block; margin-top: 8px;
  width: 48px; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  padding: 100px 2rem 60px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  background: radial-gradient(ellipse at 70% 40%, rgba(99,102,241,.12) 0%, transparent 55%),
              radial-gradient(ellipse at 20% 80%, rgba(52,211,153,.07) 0%, transparent 45%),
              var(--bg);
  position: relative; overflow: hidden;
}
[data-theme="light"] .hero {
  background: linear-gradient(135deg, #f7f8fc 0%, #eef2ff 100%);
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(129,140,248,.06) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
[data-theme="light"] .hero::before { background-image: none; }

.hero-content {
  max-width: 1100px; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 4rem;
  position: relative; z-index: 1;
}

.hero-text { flex: 1; }

.hero-greeting {
  font-size: .88rem; font-weight: 600;
  color: var(--primary); letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: .6rem; font-family: var(--font-mono);
}

.hero-name {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800; letter-spacing: -1.5px;
  line-height: 1.08; margin-bottom: .5rem;
  color: var(--text);
}
.hero-nickname { color: var(--primary); }

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 500; color: var(--accent);
  margin-bottom: 1.5rem; height: 2rem;
}
.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

.hero-bio {
  font-size: .97rem; color: var(--text-muted);
  max-width: 520px; margin-bottom: 2rem; line-height: 1.8;
}

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

.btn {
  padding: .75rem 1.75rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .93rem; cursor: pointer;
  transition: all var(--transition); display: inline-block;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 18px rgba(99,102,241,.4);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 24px rgba(99,102,241,.55);
  transform: translateY(-2px);
}
.btn-outline {
  border: 1.5px solid var(--primary); color: var(--primary); background: transparent;
}
.btn-outline:hover { background: var(--primary-light); transform: translateY(-2px); }

.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }
.badge {
  font-size: .76rem; font-weight: 600;
  background: var(--primary-light); color: var(--primary);
  padding: .28rem .8rem; border-radius: 99px;
  border: 1px solid rgba(129,140,248,.25);
  font-family: var(--font-mono);
}

/* Stats */
.hero-stats {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; gap: .1rem; }
.stat-num {
  font-size: 2rem; font-weight: 800;
  color: var(--primary); font-family: var(--font-mono);
  line-height: 1;
}
.stat-num::after { content: '+'; font-size: 1.4rem; }
.stat-label {
  font-size: .75rem; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .07em;
}

/* Photo */
.hero-photo-wrap {
  flex-shrink: 0; position: relative;
  width: 320px; height: 320px;
}
.hero-photo-blob {
  position: absolute; inset: -20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
  animation: blobmorph 8s ease-in-out infinite;
  z-index: 0; opacity: .18;
  filter: blur(2px);
}
@keyframes blobmorph {
  0%,100% { border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
  33%      { border-radius: 44% 56% 60% 40% / 54% 38% 62% 46%; }
  66%      { border-radius: 56% 44% 38% 62% / 40% 60% 44% 56%; }
}
.hero-photo-ring {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  border: 4px solid rgba(129,140,248,.4);
  box-shadow: var(--shadow-lg), 0 0 0 8px rgba(129,140,248,.08);
}
[data-theme="light"] .hero-photo-ring {
  border-color: #fff;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; }

.hero-scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-light); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; font-family: var(--font-mono);
}
.scroll-arrow {
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, var(--primary), transparent);
  animation: scrollpulse 1.6s ease-in-out infinite;
}
@keyframes scrollpulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), rgba(129,140,248,.1));
  border-radius: 2px;
}

.timeline-item {
  position: relative; margin-bottom: 2.5rem;
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.timeline-item.visible { opacity: 1; transform: translateY(0); }

.timeline-dot {
  position: absolute; left: -2rem; top: 1.25rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary), 0 0 12px rgba(129,140,248,.4);
  z-index: 1;
  transition: box-shadow var(--transition);
}
[data-theme="light"] .timeline-dot { border-color: var(--bg); }
.timeline-item:hover .timeline-dot { box-shadow: 0 0 0 3px var(--primary), 0 0 20px rgba(129,140,248,.6); }

.timeline-date {
  font-size: .75rem; font-weight: 600; color: var(--primary);
  letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: .5rem; font-family: var(--font-mono);
}

.timeline-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.timeline-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: rgba(129,140,248,.3);
}

.timeline-header { margin-bottom: 1rem; }
.timeline-header h3 { font-size: 1.08rem; font-weight: 700; color: var(--text); }
.company-tag { font-size: .82rem; color: var(--text-muted); font-weight: 500; }

.timeline-bullets { list-style: none; margin-bottom: 1rem; }
.timeline-bullets li {
  font-size: .88rem; color: var(--text-muted);
  padding: .3rem 0 .3rem 1.2rem; position: relative;
}
.timeline-bullets li::before {
  content: '▸'; position: absolute; left: 0; color: var(--primary);
}
.timeline-bullets strong { color: var(--text); font-weight: 600; }

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .72rem; font-weight: 600;
  padding: .2rem .65rem; border-radius: 99px;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid rgba(129,140,248,.2);
  font-family: var(--font-mono);
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s ease, transform .4s ease, box-shadow var(--transition), border-color var(--transition);
}
.skill-card.visible { opacity: 1; transform: translateY(0); }
.skill-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: rgba(129,140,248,.3);
}

.skill-icon { font-size: 1.8rem; margin-bottom: .75rem; }
.skill-card h4 { font-size: .92rem; font-weight: 700; margin-bottom: .75rem; color: var(--text); }
.skill-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.stag {
  font-size: .78rem; padding: .22rem .65rem;
  border-radius: 6px;
  background: rgba(129,140,248,.08);
  color: var(--text-muted); font-weight: 500;
  border: 1px solid var(--card-border);
}
[data-theme="light"] .stag {
  background: var(--bg-alt);
  border-color: var(--border);
}

/* ── Projects ── */
.project-filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 2rem;
}
.filter-btn {
  background: var(--primary-light);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  border-radius: 99px;
  padding: .35rem 1rem;
  font-size: .8rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-mono);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .75rem;
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s ease, transform .4s ease, box-shadow var(--transition), border-color var(--transition);
}
.project-card.visible { opacity: 1; transform: translateY(0); }
.project-card.hidden { display: none; }
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(129,140,248,.3);
}
.project-top { display: flex; align-items: center; gap: .75rem; }
.project-icon { font-size: 1.6rem; }
.project-card h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.project-card p { font-size: .88rem; color: var(--text-muted); line-height: 1.65; flex: 1; }

/* ── Education ── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.edu-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s ease, transform .4s ease, box-shadow var(--transition);
}
.edu-card.visible { opacity: 1; transform: translateY(0); }
.edu-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.edu-card--featured {
  border-left: 3px solid var(--primary);
  background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, rgba(30,36,48,.9) 100%);
}
[data-theme="light"] .edu-card--featured {
  background: linear-gradient(135deg, #fff 0%, #f0f4ff 100%);
}
.edu-year {
  font-size: .75rem; font-weight: 600; color: var(--primary);
  letter-spacing: .05em; font-family: var(--font-mono);
  margin-bottom: .6rem;
}
.edu-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; color: var(--text); }
.edu-school { font-size: .9rem; color: var(--text-muted); font-weight: 500; margin-bottom: .4rem; }
.edu-note { font-size: .82rem; color: var(--accent); font-weight: 500; margin-bottom: .4rem; }
.edu-courses { font-size: .82rem; color: var(--text-light); font-style: italic; }

/* ── Achievements ── */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}
.ach-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s ease, transform .4s ease, box-shadow var(--transition);
}
.ach-card.visible { opacity: 1; transform: translateY(0); }
.ach-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.ach-card--gold { border-top: 3px solid var(--gold); }
.ach-card--cert { border-top: 3px solid var(--primary); }
.ach-icon { font-size: 1.5rem; margin-bottom: .6rem; }
.ach-card h4 { font-size: .88rem; font-weight: 700; margin-bottom: .35rem; color: var(--text); }
.ach-card p { font-size: .8rem; color: var(--text-muted); line-height: 1.55; }

/* ── Contact ── */
.contact-sub {
  color: var(--text-muted); max-width: 500px;
  margin-bottom: 2.5rem; font-size: 1rem;
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}
.contact-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; flex-direction: column; gap: .3rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.contact-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: rgba(129,140,248,.35);
}
.contact-icon { font-size: 1.5rem; }
.contact-label {
  font-size: .72rem; font-weight: 600;
  color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase;
  font-family: var(--font-mono);
}
.contact-value { font-size: .88rem; font-weight: 600; color: var(--primary); }

/* ── Footer ── */
.footer {
  text-align: center; padding: 2rem;
  font-size: .82rem; color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

/* ── Star burst canvas ── */
.star-burst-canvas {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  display: block;
}

/* ── Back to Top ── */
#back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer; font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(99,102,241,.45);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  display: flex; align-items: center; justify-content: center;
}
#back-to-top.visible { opacity: 1; pointer-events: all; }
#back-to-top:hover { transform: translateY(-3px); box-shadow: 0 6px 22px rgba(99,102,241,.6); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-content { flex-direction: column-reverse; gap: 2.5rem; align-items: center; text-align: center; }
  .hero-bio { margin: 0 auto 2rem; }
  .hero-btns { justify-content: center; }
  .hero-badges { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-photo-wrap { width: 220px; height: 220px; }
}

@media (max-width: 640px) {
  .nav-links {
    display: none; position: absolute; top: 67px; left: 0; right: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 1rem 2rem; gap: .25rem;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .section { padding: 70px 0 50px; }
  .section-title { font-size: 1.6rem; }
  .hero-stats { gap: 1.5rem; }
  #back-to-top { bottom: 1.25rem; right: 1.25rem; }
}
