@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* --bg: #F2F3ED; */
    --bg: #F9F6EE;
    --ink: #1B1F1D;
    --primary: #3D5A47;
    --primary-light: #4F7259;
    --gold: #B8912F;
    --muted: #6E7568;
    --line: #D8DAD1;
    --surface: #FFFFFF;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.65;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header, main, footer {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

header {
    padding-top: 28px;
    padding-bottom: 20px;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 20px 0;
}

nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--primary);
}

nav a.logo {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    font-size: 1.1rem;
    margin-right: auto;
}

.nav-links {
    display: flex;
    gap: 22px;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--ink);
    cursor: pointer;
    transition: color 0.2s ease;
}

.menu-toggle:hover {
    color: var(--primary);
}

main {
    display: grid;
    grid-template-columns: 1fr 150px;
    grid-template-areas: 
        "heading photo"
        "intro intro" /* Changed from "intro photo" so it spans full width */
        "currently currently";
    column-gap: 40px; 
    row-gap: 30px; /* Adds space between the top row and the intro section */
    align-items: center; /* Aligns the heading vertically with the center of the photo */
    margin-top: 40px;
    flex: 1;
    width: 100%;
}

h1 {
    grid-area: heading;
    font-family: var(--font-display);
    color: var(--ink);
    font-size: clamp(2rem, 6vw, 2.5rem); 
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

main img {
    grid-area: photo;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 30px;
    border: 3px solid var(--line);
    max-width: 100%;
}

section {
    margin-bottom: 40px;
}

section p {
    margin-bottom: 16px;
    color: var(--ink);
}

main a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-light);
    transition: border-bottom 0.2s ease;
}

main a:hover {
    border-bottom: 2px solid var(--primary);
}

.intro {
    grid-area: intro;
}

.currently {
    grid-area: currently;
    border-top: 1px solid var(--line);
    padding-top: 24px;
    margin-top: 20px;
}

em {
    font-style: normal;
    font-family: var(--font-mono);
    color: var(--primary);
    background-color: var(--line);
    padding: 4px 10px; 
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
}

.page-header {
    margin-bottom: 50px;
}

.page-header h1 {
    margin-top: 0;
    margin-bottom: 12px;
}

.page-content {
    display: block;
    margin-top: 40px;
}

.page-intro {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 600px;
}

.link-group {
    margin-bottom: 40px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.group-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--ink);
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background-color: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.social-card i {
    font-size: 1.4rem;
    color: var(--muted);
    transition: color 0.2s ease;
}

.social-card .emoji-icon {
    font-size: 1.2rem;
}

.social-card:hover {
    border-color: var(--primary);
    background-color: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.social-card:hover i {
    color: var(--primary);
}

.blogs-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 60px;
}

.blog-card {
    display: block;
    text-decoration: none;
    background-color: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
    transition: all 0.2s ease;
}

.blog-card:hover {
    border-color: var(--primary);
    background-color: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-bottom: 12px;
}

.dot-separator {
    font-size: 0.8rem;
    color: var(--line);
}

.blog-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--ink);
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.3;
}

.blog-excerpt {
    color: var(--muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
    transition: all 0.2s ease;
}

.project-card:hover {
    border-color: var(--primary);
    background-color: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.project-icon {
    font-size: 2rem;
    color: var(--primary);
}

.project-links {
    display: flex;
    gap: 16px;
}

.project-links a {
    color: var(--muted);
    font-size: 1.25rem;
    border-bottom: none; 
    transition: color 0.2s ease;
}

.project-links a:hover {
    color: var(--primary);
    border-bottom: none;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--ink);
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.3;
    min-height: calc(1.4rem * 1.3 * 2);
}

.project-description {
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.6;
    flex-grow: 1;
}

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

.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    border-bottom: none;
}

.btn-read-more:hover {
    color: var(--ink);
    border-bottom: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 30px;
    border-bottom: none;
}

.back-link:hover {
    color: var(--primary);
    border-bottom: none;
}

.project-meta-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.detail-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    margin-top: 10px;
}

.github-out-link {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
}

.github-out-link:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.readme-content {
    line-height: 1.8;
    color: var(--ink);
    max-width: 100%;
    overflow-x: auto;
}

.readme-content h1:first-of-type {
    display: none;
}

.readme-content .anchor {
    display: none;
}

.readme-content h1 svg,
.readme-content h2 svg,
.readme-content h3 svg,
.readme-content h4 svg,
.readme-content h5 svg,
.readme-content h6 svg {
    display: none;
}

.readme-content h1, 
.readme-content h2, 
.readme-content h3 {
    font-family: var(--font-display);
    margin-top: 40px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.readme-content p, .readme-content ul {
    margin-bottom: 20px;
}

.readme-content ul {
    padding-left: 24px;
}

.readme-content pre {
    background-color: #f6f8fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid var(--line);
}

.readme-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.readme-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.about-section {
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--ink);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.about-text p {
    margin-bottom: 16px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 650px;
}

.timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 10px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 0;
    width: 2px;
    background-color: var(--line);
}

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

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid var(--bg);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 6px;
}

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 4px;
    line-height: 1.2;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 12px;
}

.timeline-content p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 600px;
}

.timeline-content ul {
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 600px;
}

.timeline-content li {
    margin-bottom: 8px;
}

footer {
    padding-top: 40px;
    padding-bottom: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--line);
}


@media (min-width: 650px) {
    main {
        display: grid;
        grid-template-columns: 1fr 220px; 
        grid-template-areas: 
            "heading photo"
            "intro intro"
            "currently currently";
        column-gap: 50px;
        row-gap: 40px;
        align-items: center;
    }

    h1 { 
        margin-top: 0; 
    }
    
    main img { 
        margin-bottom: 0;
        width: 100%; 
        height: auto;
    }
    
    .currently { 
        margin-top: 10px; 
        padding-top: 30px;
    }
}

@media (max-width: 480px) {
    header, main, footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    nav {
        justify-content: center; 
        gap: 15px;
        flex-wrap: wrap;
    }

    nav a.logo {
        margin-right: auto;
        margin-bottom: 0;
        width: auto;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 20px;
        gap: 16px;
        text-align: center;
        border-top: 1px solid var(--line);
        margin-top: 16px;
    }

    .nav-links.active {
        display: flex; 
    }

    main {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "photo"
            "heading"
            "intro"
            "currently";
        text-align: center;
    }

    main img {
        margin: 0 auto;
        width: 140px;
    }

    .currently p {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-bottom: 24px;
    }
}