/**
 * Personal Portfolio — Main Stylesheet
 * 
 * Design System: Dark mode, minimal, inspired by onur.dev
 * Typography: Archivo (headings) + Space Grotesk (body)
 * Palette: Monochrome + Blue accent (#3B82F6)
 */

/* ═══════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Typography */
    --font-heading: 'Archivo', system-ui, -apple-system, sans-serif;
    --font-body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Layout */
    --sidebar-width: 240px;
    --content-max-width: 720px;
    
    /* Transitions */
    --transition: 200ms ease;
}

/* ── Dark Theme (default) ─────────────────────────────────── */
[data-theme="dark"] {
    --bg-primary: #0A0A0B;
    --bg-secondary: #111113;
    --bg-surface: #141416;
    --bg-surface-hover: #1C1C1F;
    --bg-elevated: #1E1E21;
    --border-color: #27272A;
    --border-hover: #3F3F46;
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --accent-soft: rgba(59, 130, 246, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

/* ── Light Theme ──────────────────────────────────────────── */
[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-surface: #F1F3F5;
    --bg-surface-hover: #E9ECEF;
    --bg-elevated: #DEE2E6;
    --border-color: #DEE2E6;
    --border-hover: #CED4DA;
    --text-primary: #1A1A2E;
    --text-secondary: #495057;
    --text-muted: #868E96;
    --accent: #2563EB;
    --accent-hover: #1D4ED8;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --overlay-bg: rgba(0, 0, 0, 0.3);
}


/* ═══════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
}

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

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

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

::selection {
    background: var(--accent);
    color: white;
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* ═══════════════════════════════════════════════════════════
   LAYOUT: SIDEBAR + MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-lg);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
}


/* ═══════════════════════════════════════════════════════════
   SIDEBAR COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* Profile with Avatar */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-avatar {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: border-color var(--transition);
}

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

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-profile-info {
    flex: 1;
    min-width: 0;
}

.sidebar-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.3;
}

.sidebar-name:hover {
    color: var(--accent);
}

.sidebar-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
    margin-top: 2px;
}

/* Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--space-xl);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

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

.nav-link.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 500;
}

.nav-link .icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.nav-link:hover .icon,
.nav-link.active .icon {
    opacity: 1;
}

.nav-shortcut {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    background: var(--bg-primary);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    opacity: 0;
    transition: opacity var(--transition);
}

.nav-link:hover .nav-shortcut {
    opacity: 1;
}

/* Sidebar sections */
.sidebar-section {
    margin-bottom: var(--space-lg);
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding: 0 12px;
}

/* Social links */
.sidebar-social {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
}

.social-link:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.social-link .icon:last-child {
    margin-left: auto;
    opacity: 0;
    transition: opacity var(--transition);
}

.social-link:hover .icon:last-child {
    opacity: 0.5;
}

/* Bottom controls: Language toggle + Theme toggle */
.sidebar-bottom-controls {
    margin-top: auto;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.lang-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.lang-option {
    font-weight: 400;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.lang-option.active {
    opacity: 1;
    font-weight: 600;
    color: var(--accent);
}

.lang-divider {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Show sun icon in dark mode, moon icon in light mode */
[data-theme="dark"] .theme-icon-sun { display: flex; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: flex; }

.theme-icon-sun, .theme-icon-moon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}


/* ═══════════════════════════════════════════════════════════
   MOBILE HEADER & RESPONSIVE SIDEBAR
   ═══════════════════════════════════════════════════════════ */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 200;
}

.mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--space-md);
}

.mobile-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg-surface-hover);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    z-index: 99;
}


/* ═══════════════════════════════════════════════════════════
   PAGE SECTIONS
   ═══════════════════════════════════════════════════════════ */

.hero {
    margin-bottom: var(--space-3xl);
}

.hero-greeting p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.hero-greeting strong {
    color: var(--text-primary);
}

.section {
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.page-section {
    padding-bottom: var(--space-2xl);
}

.page-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
}

.see-all-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: var(--space-lg);
    cursor: pointer;
    transition: color var(--transition);
}

.see-all-link:hover {
    color: var(--accent);
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: var(--space-xl) 0;
}


/* ═══════════════════════════════════════════════════════════
   POST TABLE (Blog listing — onur.dev style)
   ═══════════════════════════════════════════════════════════ */

.post-table {
    display: flex;
    flex-direction: column;
}

.post-table-header {
    display: grid;
    grid-template-columns: 60px 50px 1fr 70px;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.post-table-row {
    display: grid;
    grid-template-columns: 60px 50px 1fr 70px;
    gap: var(--space-md);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background var(--transition);
    cursor: pointer;
    text-decoration: none;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 6px;
    border-bottom: none;
}

.post-table-row:hover {
    background: var(--bg-surface-hover);
}

.col-year {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.col-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.col-title {
    font-weight: 400;
}

.col-views {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* Inline tags in post table */
.post-tags-inline {
    display: none;
}

.tag-inline {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}


/* ═══════════════════════════════════════════════════════════
   TAG FILTER
   ═══════════════════════════════════════════════════════════ */

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.tag-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
}

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

.tag-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.tag-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0 5px;
    border-radius: 10px;
}


/* ═══════════════════════════════════════════════════════════
   ARTICLE (Single post/project)
   ═══════════════════════════════════════════════════════════ */

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    cursor: pointer;
    transition: color var(--transition);
}

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

.article-header {
    margin-bottom: var(--space-xl);
}

.article-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.8rem;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-meta .icon {
    opacity: 0.6;
}

.article-meta-sep {
    color: var(--border-color);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
}

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

.article-cover {
    margin-bottom: var(--space-xl);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.article-cover img {
    width: 100%;
    object-fit: cover;
}

/* Single Article Layout & Wide Floating TOC */
.article-single-page {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

/* Allow parent container to accommodate wider article layout */
.main-content:has(.article-single-page) .content-wrapper {
    max-width: 1040px;
}

.article-body-wrap {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 40px;
    align-items: start;
}

.article-content.prose {
    width: 100%;
    min-width: 0;
}

.article-toc {
    position: sticky;
    top: 32px;
    background: var(--bg-surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
}

.article-toc h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 700;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

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

/* Hide Table of Contents completely on Mobile & Tablet (< 1024px) */
@media (max-width: 1024px) {
    .article-body-wrap {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .article-toc,
    #articleToc {
        display: none !important;
    }
}

/* Prose — article body content */
.prose {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.prose h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: var(--space-2xl) 0 var(--space-md);
}

.prose h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: var(--space-xl) 0 var(--space-sm);
}

.prose p {
    margin-bottom: var(--space-md);
}

.prose ul, .prose ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-xl);
}

.prose li {
    margin-bottom: var(--space-xs);
}

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.prose code {
    font-size: 0.88em;
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.prose pre {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--space-md);
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

.prose pre code {
    background: none;
    border: none;
    padding: 0;
}

.prose blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--space-md);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.prose img {
    border-radius: 8px;
    margin: var(--space-md) 0;
}

.prose strong {
    color: var(--text-primary);
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════════════ */

.projects-grid {
    display: grid;
    gap: var(--space-md);
}

.project-card {
    display: block;
    padding: var(--space-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.project-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.project-card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.project-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Full-width project cards (listing) */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.project-card-full {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.project-card-full:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

.project-card-content {
    flex: 1;
}

.project-card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    margin-left: var(--space-md);
    transition: all var(--transition);
}

.project-card-full:hover .project-card-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* Single project */
.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-lg);
}

.btn-github {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: var(--space-xl);
}

.btn-github:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}


/* ═══════════════════════════════════════════════════════════
   CV / TIMELINE
   ═══════════════════════════════════════════════════════════ */

.cv-section {
    margin-bottom: var(--space-2xl);
}

.cv-section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.timeline-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 400;
    padding-top: 2px;
}

.timeline-dash {
    margin: 0 2px;
}

.timeline-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-institution {
    font-size: 0.88rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.timeline-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════════════════════ */

.contact-intro {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.contact-link-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
}

.contact-link-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

.contact-link-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 8px;
    color: var(--text-secondary);
}

.contact-link-card:hover .contact-link-icon {
    color: var(--accent);
}

.contact-link-info {
    flex: 1;
}

.contact-link-platform {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.contact-link-url {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.contact-link-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: all var(--transition);
}

.contact-link-card:hover .contact-link-arrow {
    color: var(--accent);
    transform: translateX(2px);
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════ */

.about-content {
    max-width: var(--content-max-width);
}


/* ═══════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--space-xl);
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-link:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.pagination-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    cursor: default;
}

.pagination-dots {
    padding: 0 4px;
    color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════
   ERROR PAGE
   ═══════════════════════════════════════════════════════════ */

.error-page {
    text-align: center;
    padding: var(--space-3xl) 0;
}

.error-page h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.error-page p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}


/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

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

.hero,
.section,
.page-section,
.article {
    animation: fadeIn 0.4s ease-out;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .timeline-item {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .mobile-header {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        top: 56px;
        height: calc(100vh - 56px);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding-top: 56px; /* Mobile header height */
    }

    .content-wrapper {
        padding: var(--space-xl) var(--space-md);
    }

    .article-title {
        font-size: 1.4rem;
    }

    .post-table-header,
    .post-table-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .post-table-header .col-year,
    .post-table-header .col-date,
    .post-table-header .col-views,
    .post-table-row .col-year,
    .post-table-row .col-views {
        display: none;
    }

    .post-table-row .col-date {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    .post-table-row .col-title {
        font-size: 0.95rem;
    }

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

    .page-title {
        font-size: 1.25rem;
    }

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

/* Small mobile */
@media (max-width: 375px) {
    .content-wrapper {
        padding: var(--space-md) var(--space-sm);
    }
}

/* ═══════════════════════════════════════════════════════════
   INTERACTIVE EXTENSIONS & COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #10B981);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Hero Status Badge */
.hero-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10B981;
    box-shadow: 0 0 8px #10B981;
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 0.4; transform: scale(0.9); }
}

/* Typewriter Text */
.typewriter-text {
    color: var(--accent);
    font-weight: 600;
    border-right: 2px solid var(--accent);
    padding-right: 2px;
    animation: blinkCaret 0.75s step-end infinite;
}

@keyframes blinkCaret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent); }
}

/* Prism Copy Code Button & Code Blocks */
pre, pre[class*="language-"] {
    position: relative;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: var(--space-md) var(--space-lg) !important;
    overflow-x: auto;
    margin: var(--space-lg) 0 !important;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace !important;
    font-size: 0.9rem;
    line-height: 1.6;
}

code, code[class*="language-"] {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace !important;
    text-shadow: none !important;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 5;
}

.copy-code-btn:hover {
    background: var(--accent);
    color: #ffffff !important;
    border-color: var(--accent);
}

/* LIGHT MODE SYNTAX HIGHLIGHTING & CODE BLOCK OVERRIDES */
[data-theme="light"] pre,
[data-theme="light"] pre[class*="language-"] {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .copy-code-btn {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] .copy-code-btn:hover {
    background: var(--accent);
    color: #ffffff !important;
    border-color: var(--accent);
}

[data-theme="light"] .token.comment,
[data-theme="light"] .token.prolog,
[data-theme="light"] .token.doctype,
[data-theme="light"] .token.cdata {
    color: #64748b !important;
    font-style: italic;
}

[data-theme="light"] .token.punctuation {
    color: #475569 !important;
}

[data-theme="light"] .token.property,
[data-theme="light"] .token.tag,
[data-theme="light"] .token.boolean,
[data-theme="light"] .token.number,
[data-theme="light"] .token.constant,
[data-theme="light"] .token.symbol,
[data-theme="light"] .token.deleted {
    color: #dc2626 !important;
}

[data-theme="light"] .token.selector,
[data-theme="light"] .token.attr-name,
[data-theme="light"] .token.string,
[data-theme="light"] .token.char,
[data-theme="light"] .token.builtin,
[data-theme="light"] .token.inserted {
    color: #059669 !important;
}

[data-theme="light"] .token.operator,
[data-theme="light"] .token.entity,
[data-theme="light"] .token.url,
[data-theme="light"] .language-css .token.string,
[data-theme="light"] .style .token.string {
    color: #0284c7 !important;
}

[data-theme="light"] .token.atrule,
[data-theme="light"] .token.attr-value,
[data-theme="light"] .token.keyword,
[data-theme="light"] .token.directive-hash,
[data-theme="light"] .token.directive,
[data-theme="light"] .token.macro {
    color: #d97706 !important;
    font-weight: 600;
}

[data-theme="light"] .token.function,
[data-theme="light"] .token.class-name {
    color: #2563eb !important;
    font-weight: 600;
}

[data-theme="light"] .token.regex,
[data-theme="light"] .token.important,
[data-theme="light"] .token.variable {
    color: #7c3aed !important;
}

/* LIGHT MODE UI SPECIFIC OVERRIDES */
[data-theme="light"] .tech-badge,
[data-theme="light"] .tag-badge {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
    font-weight: 500;
}

[data-theme="light"] .btn-github {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .btn-github:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
}

[data-theme="light"] .ee-lab-matrix h2,
[data-theme="light"] .cv-section-title,
[data-theme="light"] .obsidian-card h3,
[data-theme="light"] .hw-spec-card h3 {
    color: #0f172a !important;
}

[data-theme="light"] .ee-lab-matrix {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* Search Box Styling */
.search-input {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

/* Print PDF Styling for About / CV Page */
@media print {
    .sidebar, .reading-progress-bar, .btn-pdf-download, .sidebar-accent-picker, .lang-toggle, .theme-toggle-btn, .mobile-header, .site-footer {
        display: none !important;
    }
    body, .main-layout, .main-content {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
    }
    .timeline-item {
        page-break-inside: avoid;
    }
    .prose {
        color: #111 !important;
    }
}
