:root {
    /* Light Theme (Default) */
    --bg-color: #ffffff;
    --text-color: #111111;
    --accent-color: #0071e3;
    --secondary-bg: #f5f5f7;
    --surface-color: #ffffff;
    --border-color: #e5e5e7;
    --muted-text: #6e6e73;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --card-shadow: 0 8px 24px rgba(0,0,0,0.04);
    --nav-height: 70px;
}

body.dark-theme {
    --bg-color: #0b0b0b;
    --text-color: #f5f5f7;
    --accent-color: #2997ff;
    --secondary-bg: #1c1c1e;
    --surface-color: #161617;
    --border-color: #2c2c2e;
    --muted-text: #a1a1a6;
    --glass-bg: rgba(11, 11, 11, 0.7);
    --card-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

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

html {
    scroll-behavior: smooth;
    font-size: 15px; /* Slightly smaller base font size */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
    max-width: 1000px; /* Reduced from 1100px */
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.logo {
    font-weight: 800;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.25rem;
    letter-spacing: -0.05em;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted-text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s;
}

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

.theme-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.theme-btn:hover {
    background: var(--secondary-bg);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* Sections */
.content-section {
    padding: 100px 0; /* Reduced from 120px */
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-ghost {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40vw;
    font-weight: 900;
    color: var(--text-color);
    opacity: 0.025;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    letter-spacing: -0.05em;
}

.dark-theme .hero-ghost {
    opacity: 0.025; /* Slightly lower for dark theme to keep it subtle */
}

.hero-centered {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

#hero h1 {
    font-size: clamp(2.8rem, 8vw, 5rem); /* Reduced from clamp(3.5rem, 10vw, 7rem) */
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--text-color);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: var(--text-color);
    animation: none;
}

#hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--muted-text);
    margin: 0 auto 48px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 600px;
    letter-spacing: -0.02em;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.btn.primary:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,113,227,0.3);
}

.btn.secondary {
    border: 1px solid var(--border-color);
    color: var(--text-color);
    background: var(--surface-color);
}

.btn.secondary:hover {
    background-color: var(--secondary-bg);
    transform: translateY(-2px);
}

/* Section Labels */
.section-label {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent-color);
    margin-bottom: 80px;
    font-weight: 700;
}

.section-label::before {
    content: "";
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(to right, transparent, var(--border-color));
}

.section-label::after {
    content: "";
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(to left, transparent, var(--border-color));
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

.skill-card {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 32px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.skill-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.skill-card p {
    color: var(--muted-text);
    font-size: 1rem;
    line-height: 1.5;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Project Filters */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--muted-text);
    padding: 10px 24px;
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-color);
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.project-card {
    background: var(--surface-color);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease, transform 0.4s ease;
    position: relative;
}

.project-card.hidden {
    display: none;
}

.project-content {
    padding: 40px;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: var(--card-shadow);
}

.project-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-color);
    display: block;
    margin-bottom: 15px;
    opacity: 0.6;
}

.project-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.project-card p {
    color: var(--muted-text);
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-link {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: fit-content;
}

.project-link.blog-link {
    color: var(--text-color);
    opacity: 0.8;
}

.project-link:hover {
    transform: translateX(5px);
    opacity: 1;
}

.private-tag {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--muted-text);
}

/* --- CV SECTION REDESIGN --- */
.cv-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

.cv-cat-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted-text);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.cv-cat-title::after {
    content: "";
    height: 1px;
    flex-grow: 1;
    background: var(--border-color);
}

.cv-timeline {
    position: relative;
    padding-left: 30px;
}

/* The vertical timeline thread */
.cv-timeline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent-color), var(--border-color) 40%, transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
}

/* The timeline dot */
.timeline-item::before {
    content: "";
    position: absolute;
    left: -34.5px; /* Centers dot on the line */
    top: 6px;
    width: 9px;
    height: 9px;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item:hover::before {
    background: var(--accent-color);
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--accent-color);
}

.year {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
    opacity: 0.8;
}

.work-info h4 {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 6px;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.location {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted-text);
    margin-bottom: 20px;
}

.work-info p, .cv-list li {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--muted-text);
}

.cv-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.cv-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.cv-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    opacity: 0.5;
}

.cv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 25px;
}

.cv-tags span {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 10px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 100px; /* Pill shape for a more modern look */
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.timeline-item:hover .cv-tags span {
    opacity: 1;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

@media (max-width: 1024px) {
    .cv-layout {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.blog-post-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
    height: 100%;
}

.blog-post-card {
    background: var(--surface-color);
    padding: 32px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-post-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: var(--card-shadow);
}

.blog-post-card h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    text-decoration: none !important;
}

.blog-excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
    text-decoration: none !important;
}

/* --- BLOG VIEWER REDESIGN --- */
.blog-viewer-container {
    padding-top: 100px;
    min-height: 100vh;
    background-color: var(--bg-color);
}

.post-header-top {
    max-width: 700px;
    margin: 0 auto 40px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--muted-text);
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--text-color);
    transform: translateX(-4px);
}

.full-blog-post {
    max-width: 700px;
    margin: 0 auto;
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.full-blog-post::before {
    display: none;
}

.post-header {
    margin-bottom: 60px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 40px;
}

.post-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--muted-text);
}

.post-header .blog-date {
    background: none;
    padding: 0;
    margin: 0;
    color: var(--accent-color);
    font-weight: 700;
}

.post-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin: 0 0 20px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-color);
}

.blog-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.blog-tags span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted-text);
    background: var(--secondary-bg);
    padding: 4px 10px;
    border-radius: 4px;
}

.markdown-content {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-color);
    max-width: 100%;
}

/* Standout lead paragraph */
.markdown-content > p:first-of-type {
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 40px;
    opacity: 1;
}

.markdown-content h2 {
    font-size: 1.8rem;
    margin: 60px 0 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.markdown-content h2::before {
    display: none;
}

.markdown-content h3 {
    font-size: 1.4rem;
    margin: 40px 0 15px;
    font-weight: 700;
}

.markdown-content p {
    margin-bottom: 24px;
    opacity: 0.9;
}

.markdown-content img,
.markdown-content video {
    width: 100%;
    border-radius: 12px;
    margin: 40px 0 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.video-caption {
    text-align: left;
    font-size: 0.85rem;
    color: var(--muted-text);
    margin-top: 0;
    margin-bottom: 40px;
    font-style: normal;
    max-width: 100%;
}

.markdown-content blockquote {
    padding: 24px 32px;
    margin: 40px 0;
    background: var(--secondary-bg);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    font-style: normal;
    font-size: 1.1rem;
    color: var(--text-color);
}

.markdown-content blockquote p {
    margin-bottom: 0;
}

.markdown-content blockquote strong {
    color: var(--accent-color);
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
    font-size: 0.95rem;
}

.markdown-content th, 
.markdown-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.markdown-content th {
    background: var(--secondary-bg);
    font-weight: 700;
    color: var(--text-color);
}

.markdown-content tr:hover {
    background: rgba(var(--accent-color-rgb, 0, 113, 227), 0.03);
}

.markdown-content hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 50px 0;
}

.markdown-content ul, 
.markdown-content ol {
    margin: 24px 0;
    padding-left: 20px;
}

.markdown-content li {
    margin-bottom: 10px;
}

.markdown-content pre {
    background: #161617; /* Always dark for code */
    padding: 24px;
    border-radius: 12px;
    margin: 32px 0;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.1);
}

.markdown-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: var(--secondary-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #e5e5e7;
}

/* Footer Improvements */
footer {
    padding: 100px 0 60px;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.footer-content h2 {
    font-size: clamp(2rem, 8vw, 4rem);
    margin-bottom: 40px;
}

.social-links {
    gap: 40px;
    margin-bottom: 60px;
}

.social-btn {
    font-size: 1rem;
}

.copyright {
    color: var(--muted-text);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; gap: 60px; text-align: center; }
    .hero-text { order: 2; }
    .hero-visual { order: 1; }
    .cv-layout { grid-template-columns: 1fr; gap: 60px; }
    .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .container { padding: 0 24px; }
    .nav-links { display: none; }
    #hero h1 { font-size: 3.5rem; }
    .footer-content h2 { font-size: 3rem; }
    .social-links { flex-direction: column; gap: 30px; }
    .timeline-item { flex-direction: column; gap: 10px; }
    .year { min-width: auto; }
}
