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

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1100px;
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #22222f;
  --text-primary: #e8e8ed;
  --text-secondary: #9494a3;
  --text-muted: #5c5c6e;
  --accent: #e74c3c;
  --accent-glow: rgba(231, 76, 60, 0.15);
  --accent-secondary: #ff6b6b;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --tag-bg: rgba(231, 76, 60, 0.1);
  --tag-text: #ff6b6b;
  --timeline-line: rgba(231, 76, 60, 0.2);
  --code-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f5;
  --text-primary: #1a1a2e;
  --text-secondary: #555568;
  --text-muted: #8888a0;
  --accent: #cc3322;
  --accent-glow: rgba(204, 51, 34, 0.08);
  --accent-secondary: #e74c3c;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --tag-bg: rgba(204, 51, 34, 0.08);
  --tag-text: #cc3322;
  --timeline-line: rgba(204, 51, 34, 0.25);
  --code-bg: rgba(0, 0, 0, 0.04);
}

/* ========== BASE ========== */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-secondary); }

/* ========== NAV ========== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(20deg);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 6px 0;
  transition: all var(--transition);
  border-radius: 2px;
}

/* ========== SECTIONS ========== */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 24px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 48px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
}

.hero-content {
  width: 100%;
}

.hero-greeting {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}
.hero-title .typed-accent { color: var(--accent); }

.hero-bio {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.3s forwards;
}

.hero-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.4s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-secondary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-outline {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ========== ABOUT ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.85;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== SKILLS ========== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
}
.skill-category:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-category-icon {
  font-size: 1.6rem;
  margin-bottom: 16px;
  display: block;
}

.skill-category-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.skill-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-mono);
  transition: all var(--transition);
}
.skill-tag:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

/* ========== EXPERIENCE ========== */
.timeline {
  position: relative;
  padding-left: 40px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  z-index: 1;
  transition: all var(--transition);
}
.timeline-item:hover .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

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

.timeline-role {
  font-size: 1.2rem;
  font-weight: 600;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.timeline-company {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.timeline-company .location {
  color: var(--text-muted);
  margin-left: 8px;
}

.timeline-details {
  list-style: none;
}
.timeline-details li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.7;
}
.timeline-details li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ========== EDUCATION ========== */
.edu-grid {
  display: grid;
  gap: 24px;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
}
.edu-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.edu-degree {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.edu-school {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.edu-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.edu-highlights {
  list-style: none;
  margin-top: 12px;
}
.edu-highlights li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 3px 0 3px 20px;
  position: relative;
}
.edu-highlights li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ========== CERTIFICATIONS ========== */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
}
.cert-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.cert-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.cert-issuer {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.cert-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 12px;
}

/* ========== CONTACT ========== */
.contact-wrapper {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 36px;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all var(--transition);
}
.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.contact-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 20px;
  }
  .hamburger { display: block; }
  .hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }
  section { padding: 60px 20px; }
  .about-grid { grid-template-columns: 1fr; }
  .hero-name { font-size: 2.4rem; }
  .skills-grid { grid-template-columns: 1fr; }
}
