/* Minimalist Classy Blog Theme - Sidpal Quant Edition */

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

/* --- VARIABLES --- */
:root {
  --font-main: "Inter", -apple-system, system-ui, sans-serif;
  --font-header: "Libre Baskerville", Georgia, serif;
  
  --background-color: #fafaf8;
  --accent-color: #e8e8e8;
  --text-color: #1a1a1a;
  --text-secondary: #666;
  --link-color: #1a1a1a;
  --hover-color: #4a90e2;
}

[data-theme="dark"] {
  --background-color: #1a1a1a;      
  --accent-color: #2d2d2d;          
  --text-color: #e8e8e8;            
  --text-secondary: #9b9b9b;        
  --link-color: #e8e8e8;
  --hover-color: #6fa3ef;           
}

/* --- BASE STYLES --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0; padding: 100px 20px 60px;
  max-width: 680px; margin-left: auto; margin-right: auto;
  font-family: var(--font-main); font-size: 17px; font-weight: 400;
  line-height: 1.65; color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- HEADER --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--background-color);
  border-bottom: 1px solid var(--accent-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-content {
  max-width: 680px; margin: 0 auto; padding: 20px;
  display: flex; justify-content: space-between; align-items: center;
}

/* Glassmorphism Effect */
.site-header.scrolled {
  background: rgba(250, 250, 248, 0.65);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(232, 232, 232, 0.6);
}
[data-theme="dark"] .site-header.scrolled {
  background: rgba(26, 26, 26, 0.65);
  border-bottom: 1px solid rgba(45, 45, 45, 0.6);
}

/* Title */
.title h1 {
  font-family: var(--font-header); font-size: 28px; font-weight: 400;
  margin: 0; letter-spacing: 0.5px; white-space: nowrap;
}
.title-link {
  position: relative; display: inline-flex; align-items: center;
  text-decoration: none; color: var(--text-color); transition: opacity 0.2s ease;
}
.title-link:hover { opacity: 0.6; }

.verified-badge {
  width: 18px; height: 18px; margin-left: 6px;
  vertical-align: middle; display: inline-block; flex-shrink: 0;
}

/* Navigation Container */
.header-right { display: flex; align-items: center; gap: 20px; }
.main-nav { display: flex; gap: 28px; font-family: var(--font-main); font-size: 15px; }

/* --- GLOBAL LINK ANIMATION (Bold + Blue Wipe) --- */
.nav-link {
  color: var(--text-secondary); text-decoration: none;
  transition: color 0.2s ease; 
  position: relative;
}

/* Hover: Turn Blue and Bold */
.nav-link:hover { 
  color: var(--hover-color); 
  font-weight: 700; 
}

/* The Blue Underline Wipe */
.nav-link::after {
  content: ''; 
  position: absolute; bottom: -3px; left: 0; width: 0; height: 1px;
  background-color: var(--hover-color); transition: width 0.2s ease;
}

.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--text-color); font-weight: 500; }
.nav-link.active::after { width: 100%; }

/* Toggle */
.theme-toggle {
  background: none; border: none; cursor: pointer; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-color); transition: all 0.3s ease;
  border-radius: 50%; width: 36px; height: 36px;
}
.theme-toggle:hover { background: var(--accent-color); transform: rotate(20deg); }
.theme-toggle svg { width: 20px; height: 20px; }

/* --- CONTENT --- */
h1, h2, h3 { font-family: var(--font-header); font-weight: 700; line-height: 1.3; margin-top: 1em; }
p { margin: 1.2em 0; }
a { color: var(--text-color); text-decoration: underline; text-decoration-color: var(--accent-color); text-underline-offset: 3px; }
a:hover { color: var(--hover-color); text-decoration-color: var(--hover-color); }

/* --- HOMEPAGE LAYOUT --- */
.bottom-nav-grid {
    display: flex;
    justify-content: space-between;
    margin-top: 80px;
    font-family: var(--font-header);
    font-size: 1.2rem;
}
/* Note: The homepage links inherit the .nav-link styles above automatically */

/* Footer */
footer { margin-top: 120px; padding-top: 40px; border-top: 1px solid var(--accent-color); font-size: 14px; color: var(--text-secondary); text-align: center; }

/* MathJax */
.MathJax_Display { overflow-x: auto; overflow-y: hidden; }

/* Mobile */
@media (max-width: 600px) {
  body { padding: 130px 16px 40px; }
  .header-content { flex-wrap: wrap; padding: 15px 16px; }
  .main-nav { order: 3; width: 100%; margin-top: 15px; }
  .bottom-nav-grid { flex-direction: column; gap: 20px; text-align: center; }
}