/* === Catppuccin Theme Variables === */

:root,
[data-theme="latte"] {
  --ctp-base: #eff1f5;
  --ctp-mantle: #e6e9ef;
  --ctp-text: #4c4f69;
  --ctp-subtext1: #5c5f77;
  --ctp-subtext0: #6c6f85;
  --ctp-surface0: #ccd0da;
  --ctp-surface1: #bcc0cc;
  --ctp-overlay0: #9ca0b0;
  --ctp-blue: #1e66f5;
  --ctp-green: #40a02b;
  --ctp-peach: #fe640b;
  --ctp-lavender: #7287fd;
}

[data-theme="mocha"] {
  --ctp-base: #1e1e2e;
  --ctp-mantle: #181825;
  --ctp-text: #cdd6f4;
  --ctp-subtext1: #bac2de;
  --ctp-subtext0: #a6adc8;
  --ctp-surface0: #313244;
  --ctp-surface1: #45475a;
  --ctp-overlay0: #6c7086;
  --ctp-blue: #89b4fa;
  --ctp-green: #a6e3a1;
  --ctp-peach: #fab387;
  --ctp-lavender: #b4befe;
}

/* === Reset & Base === */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--ctp-base);
  color: var(--ctp-text);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Layout === */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 2.5rem 0;
}

section + section {
  border-top: 1px solid var(--ctp-surface0);
}


/* === Site Nav === */

.site-nav {
  padding: 1rem 0;
  border-bottom: 1px solid var(--ctp-surface0);
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--ctp-base);
  transition: background-color 0.3s ease;
}

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

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ctp-text);
  letter-spacing: -0.01em;
}

.nav-brand:hover {
  color: var(--ctp-lavender);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ctp-subtext1);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ctp-lavender);
}

/* === Typography === */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--ctp-text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin-bottom: 2rem;
  color: var(--ctp-lavender);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--ctp-subtext1);
}

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

a:hover {
  color: var(--ctp-lavender);
}

code {
  font-family: "JetBrains Mono", monospace;
  background-color: var(--ctp-surface0);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

/* === Theme Toggle (inside nav) === */

.theme-toggle {
  background: var(--ctp-surface0);
  border: 1px solid var(--ctp-surface1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  color: var(--ctp-text);
}

.theme-toggle:hover {
  background: var(--ctp-surface1);
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="mocha"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="mocha"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="latte"] .theme-toggle .icon-moon {
  display: block;
}

/* === Hero Section === */

.hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  padding: 4rem 0 2.5rem;
}

.hero-content {
  max-width: 700px;
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--ctp-subtext0);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero .role {
  font-size: 1.25rem;
  color: var(--ctp-lavender);
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-family: "JetBrains Mono", monospace;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--ctp-surface0);
  color: var(--ctp-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  border: 1px solid var(--ctp-surface1);
}

.hero-links a:hover {
  background: var(--ctp-surface1);
  color: var(--ctp-lavender);
  transform: translateY(-1px);
}

.hero-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* === Stats (compact inline badges) === */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.stat-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--ctp-surface0);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--ctp-subtext1);
  font-family: "JetBrains Mono", monospace;
}

.stat-badge strong {
  color: var(--ctp-lavender);
  font-weight: 700;
}

/* === Skills Section === */

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

.skill-category {
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface0);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.skill-category:hover {
  border-color: var(--ctp-surface1);
}

.skill-category h3 {
  color: var(--ctp-lavender);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--ctp-surface0);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--ctp-subtext1);
  font-family: "JetBrains Mono", monospace;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.skill-tag:hover {
  background: var(--ctp-surface1);
  color: var(--ctp-text);
}

/* === Experience Timeline === */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ctp-surface0);
}

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

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ctp-lavender);
  transform: translateX(-4px);
  border: 2px solid var(--ctp-base);
}

.timeline-item .period {
  font-size: 0.8rem;
  color: var(--ctp-overlay0);
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 0.25rem;
}

.timeline-item h3 {
  color: var(--ctp-text);
  margin-bottom: 0.15rem;
}

.timeline-item .company {
  color: var(--ctp-blue);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-item ul {
  list-style: none;
  padding: 0;
}

.timeline-item li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--ctp-subtext1);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.timeline-item li::before {
  content: "->";
  position: absolute;
  left: 0;
  color: var(--ctp-lavender);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

/* === GitHub Activity === */

.contributions-wrapper {
  overflow-x: auto;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
  background: var(--ctp-surface0);
  border: 1px solid var(--ctp-surface0);
  border-radius: 8px;
}

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

/* === Open Source Contributions === */

.oss-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.oss-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface0);
  transition: border-color 0.2s ease;
}

.oss-row:hover {
  border-color: var(--ctp-surface1);
}

.oss-row .lang-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ctp-peach);
  flex-shrink: 0;
  margin-top: 2px;
}

.oss-row a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ctp-blue);
}

.oss-row a:hover {
  color: var(--ctp-lavender);
}

.oss-desc {
  font-size: 0.8rem;
  color: var(--ctp-subtext0);
  flex: 1;
  min-width: 0;
}

.oss-stars {
  font-size: 0.75rem;
  color: var(--ctp-overlay0);
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
}

.oss-heading {
  margin-top: 1.5rem;
  color: var(--ctp-subtext1);
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  color: var(--ctp-blue);
  font-size: 0.9rem;
  font-weight: 500;
}

.github-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
/* === Education & Certifications (compact) === */

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.edu-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface0);
}

.edu-degree {
  font-size: 0.85rem;
  color: var(--ctp-text);
  font-weight: 500;
}

.edu-school {
  font-size: 0.8rem;
  color: var(--ctp-blue);
}

.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cert-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--ctp-surface0);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--ctp-subtext1);
  font-family: "JetBrains Mono", monospace;
}

.cert-badge::before {
  content: "✓";
  color: var(--ctp-green);
  font-weight: 700;
}
/* === Publications === */

.publication-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.publication-item {
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface0);
  border-radius: 12px;
  padding: 1.25rem;
}

.publication-item h3 {
  font-size: 0.95rem;
}

.publication-item h3 a {
  color: var(--ctp-blue);
}

.publication-item .pub-venue {
  font-size: 0.85rem;
  color: var(--ctp-subtext0);
  margin-top: 0.25rem;
}

/* === Footer === */

footer {
  padding: 3rem 0;
  border-top: 1px solid var(--ctp-surface0);
  text-align: center;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

footer .footer-links a {
  color: var(--ctp-subtext0);
  transition: color 0.2s ease;
}

footer .footer-links a:hover {
  color: var(--ctp-lavender);
}

footer .footer-links svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

footer .footer-text {
  font-size: 0.8rem;
  color: var(--ctp-overlay0);
}

footer .footer-text a {
  color: var(--ctp-lavender);
}

/* === Responsive === */

@media (max-width: 640px) {
  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  section {
    padding: 2rem 0;
  }

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

  .oss-row {
    flex-wrap: wrap;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline::before {
    left: 0;
  }

  .timeline-item::before {
    left: -1.5rem;
  }

  .hero-links {
    flex-direction: column;
  }

  .hero-links a {
    justify-content: center;
  }
}

/* === Blog Listing === */

.blog-list h2 {
  margin-bottom: 1.5rem;
}

.blog-list-posts {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-post-item {
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface0);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

.blog-post-item:hover {
  border-color: var(--ctp-surface1);
}

.blog-post-item a {
  color: inherit;
  display: block;
}

.blog-post-item h3 {
  color: var(--ctp-blue);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.blog-post-item h3:hover {
  color: var(--ctp-lavender);
}

.blog-post-excerpt {
  font-size: 0.85rem;
  color: var(--ctp-subtext0);
  margin-bottom: 0;
}

/* === Blog Post === */

.blog-post {
  padding: 4rem 0 2rem;
}

.blog-post h1 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.blog-back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ctp-subtext0);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.blog-back-link:hover {
  color: var(--ctp-lavender);
}

.blog-post-meta {
  font-size: 0.8rem;
  color: var(--ctp-overlay0);
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 2rem;
}

.blog-content {
  line-height: 1.8;
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--ctp-text);
}

.blog-content h2 {
  color: var(--ctp-lavender);
}

.blog-content p {
  margin-bottom: 1rem;
}

.blog-content ul,
.blog-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--ctp-subtext1);
}

.blog-content li {
  margin-bottom: 0.35rem;
}

.blog-content blockquote {
  border-left: 3px solid var(--ctp-surface1);
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  color: var(--ctp-subtext0);
}

.blog-content pre {
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface0);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.blog-content pre code {
  background: none;
  padding: 0;
}

.blog-content img {
  max-width: 100%;
  border-radius: 8px;
}

.blog-content a {
  color: var(--ctp-blue);
}

.blog-content a:hover {
  color: var(--ctp-lavender);
}

/* === Utility: fade-in animation === */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* === Print === */

@media print {
  .theme-toggle {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
