/* ===== CSS Variables - Dark Theme (Default) ===== */
:root {
    --primary-color: #3b82f6;
    --accent-color: #8b5cf6;
    --secondary-color: #ffffff;
    --text-color: #94a3b8;
    --text-light: #cbd5e1;
    --bg-color: #000000;
    --bg-secondary: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;
    --white: #ffffff;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    --transition-fast: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    --nav-height: 70px;
}

/* ===== Light Theme ===== */
[data-theme="light"] {
    --primary-color: #2563eb;
    --accent-color: #7c3aed;
    --secondary-color: #1e293b;
    --text-color: #475569;
    --text-light: #334155;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #f1f5f9;
    --bg-card-hover: #e2e8f0;
    --border-color: #e2e8f0;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--secondary-color);
    font-weight: 600;
    line-height: 1.2;
}

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

em {
    font-style: italic;
}

/* ===== Accessibility ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* Enhanced focus states for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

.project-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 8px;
}

/* ===== Scroll Progress Indicator ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    z-index: 1001;
    transition: width 0.1s ease-out;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--bg-color);
    z-index: 1000;
    transition: var(--transition);
}

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

.nav-logo a {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 600;
    letter-spacing: -0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.theme-toggle:hover {
    color: var(--secondary-color);
    background-color: var(--bg-card);
    transform: scale(1.05);
}

.theme-icon {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

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

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

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

/* ===== Container ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Hero Section ===== */
.hero {
    min-height: auto;
    padding: 0 0 1.5rem;
    margin-top: var(--nav-height);
    padding-top: 2.5rem;
    position: relative;
    overflow: visible;
}

.hero-intro {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

.detail-item svg {
    color: var(--text-color);
    flex-shrink: 0;
}

.hero-bio {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-light);
}

.hero-bio em {
    color: var(--text-color);
    font-style: italic;
}

/* ===== Section Styles ===== */
section {
    padding: 1.5rem 0;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* ===== Blog Section ===== */
.blog {
    background-color: var(--bg-color);
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blog-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.blog-link {
    flex: 1;
    max-width: 600px;
}

.blog-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 6px;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .blog-card {
    background: rgba(241, 245, 249, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.blog-card:hover {
    background: rgba(51, 65, 85, 0.7);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateX(4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .blog-card:hover {
    background: rgba(226, 232, 240, 0.9);
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.blog-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin: 0;
    flex: 1;
}

.blog-icon {
    color: var(--text-color);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.blog-date {
    font-size: 0.875rem;
    color: var(--text-color);
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== Projects Section ===== */
.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
}

.project-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0;
}

/* ===== Project Links ===== */
.project-link {
    display: block;
    text-decoration: none;
    flex: 1;
    max-width: 600px;
}

.project-link .project-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

[data-theme="light"] .project-link .project-card {
    background: rgba(241, 245, 249, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.project-link:hover .project-card {
    transform: translateY(-4px) scale(1.02);
    background: rgba(51, 65, 85, 0.7);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.2),
        0 0 40px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .project-link:hover .project-card {
    background: rgba(226, 232, 240, 0.9);
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.15),
        0 0 40px rgba(37, 99, 235, 0.1);
}

.project-link:hover .project-title {
    color: var(--primary-color);
}

/* ===== Footer ===== */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-color);
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    display: inline-block;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: var(--secondary-color);
}

.footer-link:hover::after {
    width: 100%;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    .nav-container {
        padding: 0 1.5rem;
    }

    .nav-logo a {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero {
        padding-top: 2rem;
        padding-bottom: 1.25rem;
    }

    section {
        padding: 1.25rem 0;
    }

    .blog-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .blog-link {
        max-width: 100%;
        width: 100%;
    }

    .blog-date {
        align-self: flex-end;
    }

    .project-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .project-item .blog-date {
        align-self: flex-end;
    }

    .footer-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-intro {
        font-size: 1rem;
    }

    .hero-bio {
        font-size: 0.95rem;
    }

    .blog-title {
        font-size: 0.95rem;
    }
}
