/* CSS Variables - Light Theme (Default) */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #6c757d;
    --accent-color: #e74c3c;
    --accent-hover: #c0392b;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --card-border: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition-speed: 0.3s;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d0;
    --text-muted: #8888a8;
    --accent-color: #e74c3c;
    --accent-hover: #ff6b5b;
    --border-color: #2a2a4e;
    --card-bg: #16213e;
    --card-border: #2a2a4e;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-padding-top: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 1000;
    background-color: var(--bg-primary);
    transition: background-color var(--transition-speed);
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}

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

.nav-link {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-speed);
}

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

.nav-link.active::after {
    width: 100%;
    background-color: var(--accent-color);
}

.nav-link.active {
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.toggle-track {
    display: flex;
    align-items: center;
    width: 44px;
    height: 24px;
    background-color: var(--bg-tertiary);
    border-radius: 12px;
    position: relative;
    transition: background-color var(--transition-speed);
}

.toggle-thumb {
    position: absolute;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
}

[data-theme="dark"] .toggle-thumb {
    transform: translateX(20px);
}

/* Social Sidebar */
.social-sidebar {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    z-index: 100;
}

.social-line {
    width: 1px;
    height: 40px;
    background-color: var(--text-muted);
    opacity: 0.3;
}

.social-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-muted);
    transition: color 0.3s ease;
    overflow: hidden;
}

.social-icon svg {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon .icon-fill {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.3s ease;
    z-index: 1;
}

.social-icon:hover {
    color: var(--bg-primary);
}

.social-icon:hover svg {
    transform: scale(1.1);
}

.social-icon:hover .icon-fill {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Section Indicator */
.section-indicator {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.indicator-line {
    width: 24px;
    height: 2px;
    background-color: var(--border-color);
    transition: background-color var(--transition-speed), width var(--transition-speed);
}

.indicator-line.active {
    background-color: var(--text-primary);
    width: 32px;
}

/* Sections */
.section {
    min-height: 100vh;
    padding: 8rem 6rem 4rem;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Profile Section */
.profile-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.name-highlight {
    color: var(--text-primary);
}

.profile-text .subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.profile-text .description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.resume-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

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

/* Profile Image */
.profile-image {
    position: relative;
    display: flex;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    display: flex;
    justify-content: flex-start;
}

.image-container {
    width: 320px;
    height: 420px;
    background-color: var(--bg-secondary);
    overflow: hidden;
    position: relative;
    z-index: 3;
}

.placeholder-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.placeholder-avatar svg {
    width: 60%;
    height: 60%;
}

.decoration-block {
    position: absolute;
    background-color: var(--bg-tertiary);
}

.decoration-right {
    top: 80px;
    right: -60px;
    width: 100px;
    height: 320px;
    z-index: 2;
}

.decoration-bottom {
    bottom: -40px;
    right: -60px;
    width: 240px;
    height: 100px;
    z-index: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    left: 2rem;
    bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    transform: translateY(50px);
    pointer-events: none;
}

.scroll-indicator span {
    writing-mode: vertical-rl;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--text-primary), transparent);
    animation: scrollDown 1.5s ease-in-out infinite;
}

@keyframes scrollDown {
    0% {
        top: -100%;
    }
    100% {
        top: 100%;
    }
}

/* Fixed Bottom Section Indicator */
.bottom-section-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.bottom-section-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.bottom-section-indicator span {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    transition: opacity 0.3s ease;
}

.indicator-line-bottom {
    width: 1px;
    height: 30px;
    background-color: var(--text-muted);
}

/* Blog Section */
.blog-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
}

.blog-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
}

.blog-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 2.5rem;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.life-blog .blog-card-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.tech-blog .blog-card-bg {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #2d2d2d 100%);
}

.blog-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    z-index: 2;
    transition: opacity 0.4s ease;
}

.blog-card-content {
    position: relative;
    z-index: 3;
    color: white;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.blog-card-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    max-width: 90%;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.blog-card-arrow {
    position: absolute;
    top: 2.5rem;
    right: 2.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.3s ease;
    z-index: 3;
}

/* Blog Card Hover Effects */
.blog-card:hover {
    transform: scale(1.02);
}

.blog-card:hover .blog-card-bg {
    transform: scale(1.1);
}

.blog-card:hover .blog-card-content {
    transform: translateY(0);
}

.blog-card:hover .blog-card-content p {
    opacity: 1;
    transform: translateY(0);
}

.blog-card:hover .blog-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.blog-card:hover .blog-card-arrow:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Blog Card Focus State */
.blog-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    z-index: 4;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.blog-card:hover::before {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Projects Section */
.projects-section {
    background-color: var(--bg-primary);
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.projects-intro h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.projects-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* GitHub Profile Card */
.github-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

.github-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.github-avatar svg {
    width: 70%;
    height: 70%;
}

.github-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.github-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.25rem;
    transition: box-shadow var(--transition-speed), transform 0.2s;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.repo-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.project-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4a9eff;
}

.project-name:hover {
    text-decoration: underline;
}

.project-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.language {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.lang-dot.python {
    background-color: #3572A5;
}

.lang-dot.javascript {
    background-color: #f1e05a;
}

.lang-dot.typescript {
    background-color: #3178c6;
}

.lang-dot.go {
    background-color: #00ADD8;
}

.stars::before {
    content: '\2605 ';
}

.forks::before {
    content: '\2442 ';
}

/* Contact Section */
.contact-section {
    display: flex;
    align-items: flex-start;
    padding-top: 12rem;
}

.contact-content {
    max-width: 500px;
}

.contact-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-content > p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.email-link {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-bottom: 1.5rem;
}

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

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
}

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

.social-links svg {
    width: 100%;
    height: 100%;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem;
    background-color: var(--bg-primary);
    scroll-snap-align: end;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .section {
        padding: 8rem 4rem 4rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .profile-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .profile-text {
        order: 2;
    }

    .profile-image {
        order: 1;
    }

    .image-container {
        width: 280px;
        height: 350px;
    }

    .blog-container {
        gap: 1.5rem;
    }

    .blog-card-content h2 {
        font-size: 1.75rem;
    }

    .social-sidebar,
    .section-indicator {
        display: none;
    }

    .scroll-indicator {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    html {
        scroll-snap-type: y proximity;
    }

    .navbar {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.8rem;
    }

    .section {
        padding: 6rem 1.5rem 3rem;
    }

    .profile-text h1 {
        font-size: 2rem;
    }

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

    .blog-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        gap: 1rem;
    }

    .blog-card {
        min-height: 250px;
    }

    .blog-card-content h2 {
        font-size: 1.5rem;
    }

    .blog-card-content p {
        font-size: 0.85rem;
    }

    .blog-card-arrow {
        width: 40px;
        height: 40px;
        top: 1.5rem;
        right: 1.5rem;
    }

    .projects-header {
        flex-direction: column;
    }

    .github-profile {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 0.95rem;
    }

    .nav-links {
        gap: 0.75rem;
    }

    .nav-link {
        font-size: 0.75rem;
    }

    .profile-text h1 {
        font-size: 1.75rem;
    }

    .image-container {
        width: 240px;
        height: 300px;
    }
}

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

.profile-text,
.profile-image,
.section-header,
.showcase-card,
.project-card,
.contact-content {
    animation: fadeInUp 0.6s ease forwards;
}

/* Smooth scroll offset for fixed navbar */
section[id] {
    scroll-margin-top: 80px;
}
