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

/* ===== THEME VARIABLES ===== */
:root {
  /* Colors - Dark (default) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --border-color: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-muted: rgba(59, 130, 246, 0.15);

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: 0.8rem;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --section-padding: 6rem 2rem;
  --container-max: 1200px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Focus (accessibility) */
  --focus-ring: 2px solid var(--accent);
  --focus-offset: 2px;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #ffffff;
  --border-color: #e0e0e0;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #888888;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-muted: rgba(37, 99, 235, 0.1);
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

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

a:hover {
  color: var(--accent-hover);
}

/* ===== UTILITIES ===== */

/* Layout */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--section-padding);
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* Text */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Spacing */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible (keyboard nav) */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== SKIP LINK (accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1001;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: white;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.9);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  min-height: 64px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.nav-menu {
  display: flex;
  gap: var(--space-8);
}

.nav-link {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  margin-right: var(--space-4);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-cta {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.nav-toggle:hover {
  color: var(--accent);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  padding-bottom: var(--space-10);
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: center;
}

.hero-content {
  animation: heroFadeInUp 0.8s ease-out;
}

.hero-greeting {
  font-size: var(--text-lg);
  color: var(--accent);
  margin-bottom: var(--space-2);
  font-weight: 500;
}

.hero-title {
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: var(--space-5);
  line-height: 1.3;
}

.hero-description {
  max-width: 32rem;
  margin-bottom: var(--space-6);
  font-size: var(--text-lg);
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-cta-primary,
.hero-cta-secondary {
  min-width: 140px;
  justify-content: center;
}

.hero-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.hero-cta-secondary:hover {
  transform: translateY(-2px);
}

.hero-image {
  position: relative;
  animation: heroFadeInUp 0.8s ease-out 0.15s backwards;
}

.hero-image img {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-image img:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-muted);
}

@keyframes heroFadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ABOUT ===== */
.about-bio {
  max-width: 800px;
  margin-bottom: 3rem;
}

.about-bio p {
  margin-bottom: 1rem;
}

.about-details {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.detail i {
  color: var(--accent);
}

.skills {
  margin-bottom: 3rem;
}

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

.tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

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

/* ===== CERTIFICATIONS ===== */
.certifications {
  margin-bottom: 3rem;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.cert-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.cert-placeholder {
  display: none;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.cert-placeholder.visible {
  display: block;
}

.cert-name {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.cert-verify {
  color: var(--accent);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cert-verify i {
  font-size: 0.75rem;
}

/* ===== SOCIAL LINKS ===== */
.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ===== EXPERIENCE TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-content {
  padding-left: 0.5rem;
}

.timeline-company {
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.timeline-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.timeline-bullets {
  margin-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.timeline-bullets li {
  margin-bottom: 0.5rem;
}

/* ===== PROJECTS ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.project-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.project-body {
  padding: 1.5rem;
}

.project-title {
  margin-bottom: 0.5rem;
}

.project-description {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-link {
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ===== CONTACT ===== */
.contact-intro {
  max-width: 500px;
  margin-bottom: 1rem;
}

.contact-email {
  font-size: 1.25rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 1.5rem;
}

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

.footer p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== FADE-IN ANIMATION ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  [data-theme="light"] .nav-menu {
    background: var(--bg-primary);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}
