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

:root {
  --bg: #0b0d12;
  --bg-alt: #0f1117;
  --surface: #151820;
  --surface-hover: #1c2030;
  --border: #1e2535;
  --accent: #4f9cf9;
  --accent-dim: rgba(79, 156, 249, 0.15);
  --accent-glow: rgba(79, 156, 249, 0.3);
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --text-faint: #4a5568;
  --green: #34d399;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --radius: 12px;
  --transition: 0.25s ease;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
strong { color: var(--text); font-weight: 600; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== NAV ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}
#navbar.scrolled {
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.5px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links li a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition);
  font-weight: 500;
}
.nav-links li a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  transition: background var(--transition) !important;
}
.nav-cta:hover { background: var(--accent-dim) !important; }
.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-muted);
  border-radius: 2px;
  transition: var(--transition);
}
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(11, 13, 18, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  z-index: 99;
  padding: 1rem 2rem;
}
.mobile-menu.open { display: flex; }
.mobile-link {
  padding: 0.75rem 0;
  color: var(--text-muted);
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.mobile-link:last-child { border-bottom: none; }
.mobile-link:hover { color: var(--accent); }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 0 2rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 60% 40%, rgba(79,156,249,0.07) 0%, transparent 70%),
              radial-gradient(ellipse 50% 40% at 10% 80%, rgba(52,211,153,0.04) 0%, transparent 60%);
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}
.hero-content {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding-top: var(--nav-h);
  width: 100%;
}
.hero-greeting {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}
.hero-name {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--text);
  opacity: 0;
  animation: fadeUp 0.6s ease 0.35s forwards;
}
.hero-name .accent { color: var(--accent); }
.hero-typewriter {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  margin: 1rem 0 1.5rem;
  min-height: 1.8em;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.5s forwards;
}
.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-sub {
  max-width: 500px;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.65s forwards;
}
.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.8s forwards;
}
.hero-social {
  display: flex;
  gap: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.95s forwards;
}
.hero-social a {
  color: var(--text-faint);
  transition: color var(--transition), transform var(--transition);
  display: flex;
}
.hero-social a:hover { color: var(--accent); transform: translateY(-2px); }
.hero-social svg { width: 20px; height: 20px; }
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-faint);
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s ease 1.5s forwards;
}
.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--text-faint);
  animation: scrollPulse 2s ease infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; width: 40px; }
  50% { opacity: 1; width: 60px; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #0b0d12;
}
.btn-primary:hover {
  background: #6aadff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.btn-large { padding: 1rem 2.5rem; font-size: 1rem; }

/* ===== SECTION BASE ===== */
.section { padding: 6rem 2rem; }
.section-dark { background: var(--bg-alt); }
.container { max-width: 1100px; margin: 0 auto; }
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}
.section-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 300px;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 4rem;
  align-items: start;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1rem;
}
.about-text strong { color: var(--accent); }
.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.about-card { position: sticky; top: calc(var(--nav-h) + 2rem); }
.card-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.3rem;
  display: block;
}
.edu-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}
.edu-school {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.edu-degree {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.edu-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

/* ===== TIMELINE ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 2rem;
  align-items: start;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-alt);
  box-shadow: 0 0 0 3px var(--accent-dim);
  margin-top: 6px;
  position: relative;
  left: -4px;
}
.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition);
}
.timeline-content:hover { border-color: var(--accent); }
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.timeline-role {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.timeline-company {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.timeline-company span { color: var(--accent); }
.timeline-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
  padding-top: 3px;
}
.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.timeline-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.timeline-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.15em;
}
.timeline-list strong { color: var(--text); }
.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ===== TAGS ===== */
.tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

/* ===== FEATURED PROJECTS ===== */
.featured-projects { display: flex; flex-direction: column; gap: 4rem; margin-bottom: 4rem; }

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.featured-card-reverse { direction: rtl; }
.featured-card-reverse > * { direction: ltr; }

.featured-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.featured-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}
.featured-desc p {
  color: var(--text-muted);
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.featured-bullets {
  list-style: none;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.featured-bullets li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.featured-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--green);
  font-size: 0.75rem;
  top: 0.15em;
}
.featured-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.featured-links { display: flex; gap: 1rem; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}
.project-link:hover { color: var(--accent); }

/* Code Window */
.code-window {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #161b22;
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.window-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}
.code-block {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.8;
  overflow-x: auto;
  color: #abb2bf;
}
.kw { color: #c678dd; }
.fn { color: #61afef; }
.str { color: #98c379; }

/* Pipeline Visual */
.pipeline-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.pipeline-title {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  text-align: center;
}
.pipeline-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}
.pipe-step {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.accent-step {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.pipe-arrow { color: var(--text-faint); font-size: 0.875rem; }

/* ===== PROJECT GRID ===== */
.other-projects-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 500;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(79,156,249,0.08);
}
.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.folder-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  stroke: var(--accent);
}
.project-card-links {
  display: flex;
  gap: 0.75rem;
}
.project-card-links a {
  color: var(--text-faint);
  transition: color var(--transition);
}
.project-card-links a:hover { color: var(--accent); }
.project-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.project-award {
  font-size: 0.7rem;
  font-family: var(--mono);
  background: rgba(52,211,153,0.12);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}
.project-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  flex: 1;
  margin-bottom: 1.25rem;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.skill-group-title {
  font-size: 0.75rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 1rem;
}
.skill-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-pill {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.skill-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ===== FOOTER ===== */
.footer {
  padding: 6rem 2rem 2rem;
  border-top: 1px solid var(--border);
}
.footer-content {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 4rem;
}
.footer-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 1rem;
}
.footer-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}
.footer-sub strong { color: var(--accent); }
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-links span { color: var(--border); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  color: var(--text-faint);
  font-size: 0.8rem;
  font-family: var(--mono);
}
.back-to-top {
  color: var(--text-faint);
  transition: color var(--transition);
}
.back-to-top:hover { color: var(--accent); }

/* ===== ACCENT ===== */
.accent { color: var(--accent); }

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-card { position: static; }
  .featured-card, .featured-card-reverse { grid-template-columns: 1fr; direction: ltr; }
  .featured-card-reverse > * { direction: ltr; }
}
@media (max-width: 700px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-name { letter-spacing: -1px; }
  .section { padding: 4rem 1.25rem; }
  .timeline-item { grid-template-columns: 16px 1fr; gap: 1rem; }
  .timeline-header { flex-direction: column; }
  .timeline-date { padding-top: 0; }
  .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }
}
@media (max-width: 480px) {
  .hero-btns { flex-direction: column; }
  .btn { justify-content: center; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
}
