/* ==========================================================================
   Design Tokens & CSS Custom Properties
   ========================================================================== */
:root {
  /* Light Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-accent-subtle: #eff6ff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #ffffff;
  --accent-glow: rgba(37, 99, 235, 0.15);
  
  --tag-bg: #f1f5f9;
  --tag-text: #334155;
  --tag-border: #e2e8f0;
  
  --success-color: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --header-bg: rgba(248, 250, 252, 0.85);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --container-max-width: 1040px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #151d2f;
  --bg-card-hover: #1b253b;
  --bg-accent-subtle: rgba(59, 130, 246, 0.12);
  --border-color: #1f293d;
  --border-hover: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --accent-color: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-text: #ffffff;
  --accent-glow: rgba(59, 130, 246, 0.25);
  
  --tag-bg: #1a2337;
  --tag-text: #cbd5e1;
  --tag-border: #243048;
  
  --success-color: #34d399;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.25);
  
  --header-bg: rgba(11, 15, 25, 0.85);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Navigation Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

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

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 6px 2px;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-color);
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--accent-text);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 56px 0 40px;
}

.hero-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 44px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color), #8b5cf6, #38bdf8);
}

.avatar-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
  border: 4px solid var(--bg-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.avatar-halo {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
  z-index: -1;
  opacity: 0.8;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-color);
  font-size: 0.82rem;
  font-weight: 600;
  width: fit-content;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-color);
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-bio {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

/* ==========================================================================
   Section Common
   ========================================================================== */
.section {
  padding: 48px 0;
}

.section-header {
  margin-bottom: 28px;
}

.section-tag {
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ==========================================================================
   Strategic Pillars & Core Skills Matrix
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.skill-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.skill-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-accent-subtle);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.skill-card-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

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

.skill-tag {
  background-color: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.skill-tag.highlight {
  background: var(--bg-accent-subtle);
  border-color: var(--accent-color);
  color: var(--accent-color);
  font-weight: 600;
}

/* ==========================================================================
   Work Experience Timeline
   ========================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.timeline-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.timeline-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

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

.company-badge-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.company-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  padding: 6px;
}

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

.company-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-color);
}

.job-meta {
  text-align: right;
  flex-shrink: 0;
}

.job-period {
  display: inline-block;
  padding: 4px 12px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.job-location {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.job-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.job-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.job-bullets li::before {
  content: "▹";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-color);
  font-weight: bold;
}

.tech-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}

/* ==========================================================================
   Education & Academic Background
   ========================================================================== */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.education-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.education-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.edu-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-accent-subtle);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.edu-degree {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.edu-school {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-color);
}

.edu-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ==========================================================================
   Contact & Quick Actions
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.contact-card:hover {
  border-color: var(--accent-color);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-accent-subtle);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.contact-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 36px 0;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 860px) {
  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }
  
  .status-pill {
    margin: 0 auto;
  }
  
  .meta-tags {
    justify-content: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .job-meta {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .nav-links {
    display: none;
  }
  
  .hero-title {
    font-size: 1.85rem;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   High-Fidelity Print-to-PDF Stylesheet (@media print)
   ========================================================================== */
@media print {
  :root {
    --bg-primary: #ffffff !important;
    --bg-secondary: #ffffff !important;
    --bg-card: #ffffff !important;
    --text-primary: #000000 !important;
    --text-secondary: #222222 !important;
    --text-muted: #555555 !important;
    --border-color: #cccccc !important;
    --accent-color: #111111 !important;
    --tag-bg: #f5f5f5 !important;
    --tag-border: #dddddd !important;
    --tag-text: #222222 !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10.5pt !important;
    line-height: 1.4 !important;
  }

  .site-header,
  .hero-actions,
  .icon-btn,
  .toast,
  .status-pill,
  .site-footer,
  .contact-card:hover {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .hero-section {
    padding: 0 0 20px 0 !important;
  }

  .hero-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    grid-template-columns: 120px 1fr !important;
    gap: 20px !important;
  }

  .hero-card::before {
    display: none !important;
  }

  .avatar-wrapper {
    width: 110px !important;
    height: 110px !important;
  }

  .hero-title {
    font-size: 18pt !important;
    color: #000000 !important;
  }

  .hero-subtitle {
    font-size: 12pt !important;
    color: #333333 !important;
  }

  .section {
    padding: 16px 0 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .section-title {
    font-size: 13pt !important;
    border-bottom: 1.5pt solid #000000 !important;
    padding-bottom: 4px !important;
    margin-bottom: 12px !important;
  }

  .skill-card,
  .timeline-card,
  .education-card {
    box-shadow: none !important;
    border: 1px solid #e0e0e0 !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .job-bullets li {
    font-size: 10pt !important;
  }

  .skill-tags, .tech-stack-row {
    gap: 4px !important;
  }

  .skill-tag {
    font-size: 8.5pt !important;
    padding: 2px 6px !important;
  }
}
