:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --color-background: #fff;
    --color-text: #000;
    --color-text-secondary: #666;
    --color-link: #0070f3;
    --color-hover: #0060df;
    --color-border: #eaeaea;
    --box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.2s ease;
    --max-width: 960px;
}

html.dark-mode {
    --color-background: #111;
    --color-text: #fff;
    --color-text-secondary: #999;
    --color-border: #333;
    --box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

html {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    padding: 0px 20px 60px;
    max-width: var(--max-width);
    margin: 0 auto;
    line-height: 1.6;
    font-size: 16px;
    transition: var(--transition);
    width: 90%;
}

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

    a:hover {
        opacity: 0.6;
    }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Header */
header {
    margin-bottom: 2rem;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

    .nav-links a {
        font-weight: 500;
        border-bottom: none;
    }

        .nav-links a:hover {
            opacity: 0.6;
        }

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

    .theme-toggle:hover {
        opacity: 0.6;
    }

/* Home page intro */
.intro {
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .intro {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
    }
}

.intro-content {
    flex: 1;
}

.intro-image {
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .intro-image {
        margin-bottom: 0;
    }
}

.intro-image img {
    border-radius: 50%;
    max-width: 100%;
    height: auto;
}

.intro h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.intro p {
    margin-top: 0.5rem;
    font-size: 1.125rem;
    color: var(--color-text-secondary);
}

.intro p a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wave-emoji {
    display: inline-block;
    animation: wave 2s infinite;
    transform-origin: 70% 70%;
    margin-left: 0.25rem;
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Section styles */
.section {
    margin-bottom: 3rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
}

    .section-heading:hover {
        color: var(--color-text);
        opacity: 1;
    }

    .section-heading:hover .view-all {
        opacity: 0.6;
    }

    .section-heading h2 {
        font-size: 1.5rem;
        margin: 0;
    }

    .section-heading .view-all {
        font-size: 0.8rem;
        color: var(--color-text-secondary);
        border: 1px solid var(--color-border);
        border-radius: 2rem;
        padding: 0.25rem 0.75rem;
        text-decoration: none;
    }

        .section-heading .view-all:hover {
            opacity: 0.6;
        }

/* Blog/Writing list */
.blog-list {
    display: flex;
    flex-direction: column;
}

a.blog-item {
    display: block;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--color-text);
    transition: background-color 0.15s ease;
}

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

    a.blog-item:hover {
        background-color: rgba(0, 0, 0, 0.05);
        opacity: 1;
    }

html.dark-mode a.blog-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

article.blog-item-row {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.blog-item-date {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
}

.blog-item-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.blog-item-views {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Projects list */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

    .projects-grid > a {
        min-width: 0;
        border: 1px solid var(--color-border);
        border-radius: 12px;
        padding: 1rem 1.25rem;
        transition: background-color 0.15s ease;
        text-decoration: none;
        color: var(--color-text);
    }

        .projects-grid > a:hover {
            background-color: rgba(0, 0, 0, 0.03);
            opacity: 1;
        }

html.dark-mode .projects-grid > a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

@media (min-width: 540px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.project-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    margin-top: auto;
}

.project-language {
    display: inline-block;
    padding: 0.25rem 0.25rem;
    background-color: var(--color-link);
    color: white;
    border-radius: 20px;
    font-weight: 500;
}

    .project-language.csharp {
        background-color: rgb(23, 134, 0);
    }

    .project-language.cplusplus {
        background-color: rgb(243, 75, 125);
    }

    .project-language.c {
        background-color: rgb(85, 85, 85);
    }

    .project-language.typescript {
        background-color: #3178c6;
    }

    .project-language.python {
        background-color: #3572A5;
    }

    .project-language.dockerfile {
        background-color: #384d54;
    }

    .project-language.java {
        background-color: #b07219;
    }

    .project-language.javascript {
        background-color: #f1e05a;
    }

.project-stars {
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

    .project-stars svg {
        vertical-align: middle;
    }

/* Projects portfolio page */
.projects-portfolio {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .projects-portfolio {
        grid-template-columns: repeat(2, 1fr);
    }
}

a.project-portfolio-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    transition: background-color 0.15s ease;
}

    a.project-portfolio-card:hover {
        background-color: rgba(0, 0, 0, 0.03);
        opacity: 1;
    }

html.dark-mode a.project-portfolio-card:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.project-portfolio-image {
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}

    .project-portfolio-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.project-portfolio-content {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .project-portfolio-content .project-title {
        margin-bottom: 0.25rem;
    }

    .project-portfolio-content .project-description {
        margin-bottom: 0.75rem;
    }

    .project-portfolio-content .project-meta {
        margin-top: auto;
    }

/* Footer */
footer {
    margin-top: 4rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}

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

    .social-links a {
        border-bottom: none;
        font-size: 1.25rem;
        color: var(--color-text-secondary);
    }

        .social-links a:hover {
            opacity: 0.6;
        }
