@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  /* Light Theme Variables */
  --bg-primary: #fafafa;
  --bg-secondary: #f4f4f5;
  --bg-card: #ffffff;
  --border-color: #e4e4e7;
  --border-focus: #a1a1aa;
  
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  
  --accent-primary: #4f46e5; /* Indigo */
  --accent-hover: #4338ca;
  
  /* Syntax Highlighting (Light) */
  --code-bg: #f4f4f5;
  --token-comment: #71717a;
  --token-punctuation: #71717a;
  --token-property: #ea580c;
  --token-selector: #16a34a;
  --token-operator: #0891b2;
  --token-keyword: #7c3aed;
  --token-function: #2563eb;
  --token-variable: #ca8a04;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --max-width: 800px;
  --header-height: 70px;
  --transition-smooth: all 0.2s ease-in-out;
}

html[data-theme="dark"] {
  /* Dark Theme Variables */
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: #1e293b;
  --border-color: #334155;
  --border-focus: #475569;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --accent-primary: #818cf8; /* Indigo 400 */
  --accent-hover: #a5b4fc;
  
  /* Syntax Highlighting (Dark) */
  --code-bg: #0f172a;
  --token-comment: #64748b;
  --token-punctuation: #94a3b8;
  --token-property: #f43f5e;
  --token-selector: #10b981;
  --token-operator: #38bdf8;
  --token-keyword: #a855f7;
  --token-function: #6366f1;
  --token-variable: #fbbf24;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

a {
	text-decoration: none;
        color: var(--text-primary);
        transition: var(--transition-smooth);
}

a.highlighted {
  text-decoration: underline;
  text-decoration-color: var(--accent-primary);
  text-decoration-thickness: 3px;
}

a.highlighted:hover {
  text-decoration-thickness: 3px;
  text-decoration-color: var(--accent-hover);
  color: var(--accent-hover);
}

a.decorless {
  text-decoration: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-focus);
}

/* Header & Navigation */
header.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  opacity: 0.98;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
}

.logo {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  color: var(--accent-primary);
}

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

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent-primary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  color: var(--accent-primary);
  border-color: var(--border-focus);
  background-color: var(--bg-secondary);
}

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

html[data-theme="light"] .sun-icon,
html:not([data-theme]) .sun-icon {
  display: none;
}

/* Container */
main.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem 1.5rem;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background-color: var(--bg-secondary);
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

footer.site-footer a {
  color: var(--text-secondary);
  border-bottom: 1px solid transparent;
}

footer.site-footer a:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Hero Section */
.hero {
  padding: 1rem 0 1.5rem 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.hero-content {
  flex: 1;
}

.hero-image {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hero h1 {
  font-family: var(--font-title);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
}

/* Blog List */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.75rem;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.post-card:hover {
  border-color: var(--border-focus);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-date {
  color: var(--text-muted);
  font-weight: 400;
}

.post-card h2 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.post-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-family: var(--font-title);
}

.post-card:hover .read-more {
  color: var(--accent-hover);
}

.read-more svg {
  transition: var(--transition-smooth);
}

.post-card:hover .read-more svg {
  transform: translateX(2px);
}

/* Post Detail styling */
.post-header {
  text-align: left;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.post-header .post-meta {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.post-header h1 {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

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

.tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

/* Markdown typography rendering */
.post-body {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  padding-bottom: 0.25rem;
}

.post-body h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.post-body ul, .post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
}

.post-body li {
  margin-bottom: 0.4rem;
}

.post-body hr {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 2.5rem 0;
}

.post-body blockquote {
  border-left: 3px solid var(--accent-primary);
  background: var(--bg-secondary);
  padding: 0.75rem 1.25rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: var(--text-secondary);
}

.post-body blockquote p {
  margin-bottom: 0;
}

/* Tables styling */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.post-body th, .post-body td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.post-body th {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* Inline code and code blocks */
code:not([class*="language-"]) {
  background: var(--bg-secondary);
  color: #c026d3;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: var(--font-mono);
}

pre[class*="language-"] {
  background: var(--code-bg) !important;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem !important;
  margin-bottom: 1.5rem !important;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* Syntax Highlighting overrides for PrismJS inside pre tags (Using variables) */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--token-comment);
}

.token.punctuation {
  color: var(--token-punctuation);
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--token-property);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: var(--token-selector);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: var(--token-operator);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: var(--token-keyword);
}

.token.function,
.token.class-name {
  color: var(--token-function);
}

.token.regex,
.token.important,
.token.variable {
  color: var(--token-variable);
}

/* Mermaid Diagrams styling */
.mermaid {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--accent-primary);
}

.back-link svg {
  transition: var(--transition-smooth);
}

.back-link:hover svg {
  transform: translateX(-2px);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.4rem;
  margin-left: 0.5rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.menu-toggle:hover {
  background-color: var(--bg-secondary);
}

/* CV Page Styling */
.cv-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 3.5rem 4.5rem;
  max-width: 900px;
  margin: 2rem auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.cv-container h1 {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--accent-primary);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.cv-container h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.cv-container h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}

.cv-container h3 em {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 1rem;
}

.cv-container p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.cv-container ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.cv-container li {
  margin-bottom: 0.4rem;
}

.cv-container hr {
  display: none; /* Hide markdown HRs in favor of H2 borders */
}

.cv-container strong {
  color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
  }
  
  .hero-image {
    width: 180px;
    height: 180px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }
  
  .post-header h1 {
    font-size: 2rem;
  }
  
  .post-card {
    padding: 1.25rem;
  }
  
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-links-wrapper nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  .nav-links-wrapper nav.nav-open {
    display: block;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }

  .cv-container {
    padding: 1.5rem;
    margin: 1rem auto;
    border-radius: 8px;
  }
  
  .cv-container h1 {
    font-size: 2.2rem;
  }
  
  .links-container {
    padding: 1.5rem;
    margin: 1rem auto;
  }
}

/* Links Page Styling */
.links-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2.5rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.links-container h1 {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.links-container > p:first-of-type {
  color: var(--text-secondary);
  font-size: 1.15rem;
  text-align: center;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.links-container h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.links-container ul {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.links-container li {
  padding: 1.25rem 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: var(--transition-smooth);
  color: var(--text-secondary);
  line-height: 1.5;
}

.links-container li:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
}

.links-container li a {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--accent-primary);
  display: block; /* Make the link sit on its own line if desired, or inline-block */
  margin-bottom: 0.4rem;
}

.links-container li a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.links-container hr {
  display: none;
}
