@font-face {
    font-family: 'Noto Sans';
    src: url('fonts/NotoSans-Regular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('fonts/NotoSans-Light.ttf') format('truetype');
    font-weight: 300;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('fonts/NotoSans-Bold.ttf') format('truetype');
    font-weight: bold;
}

:root {
    /* Gruvbox color palette */
    --bg: #282828;
    --bg0: #282828;
    --bg1: #3c3836;
    --bg2: #504945;
    --fg: #ebdbb2;
    --red: #cc241d;
    --green: #98971a;
    --yellow: #d79921;
    --blue: #458588;
    --purple: #b16286;
    --aqua: #689d6a;
    --gray: #a89984;
    
    /* Semantic color assignments */
    --background-color: var(--bg);
    --primary-color: var(--bg1);
    --secondary-color: var(--bg2);
    --accent-color: var(--red);
    --text-color: var(--fg);
    --text-muted: var(--gray);
    --highlight: var(--green);
    --link-hover: var(--gray);
    --button-hover: var(--aqua);
    --border-accent: var(--purple);
}

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

body {
    font-family: 'Noto Sans', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Flowing Background */
#coding-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

#coding-canvas {
    width: 100%;
    height: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(91vh - 91px);
    position: relative;
    z-index: 1;
}

/* Navigation */
.nav-container {
    background-color: var(--primary-color);
    padding: 1rem 0;
    position: relative;
    z-index: 100;
}

.nav-links {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--link-hover);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-family: 'Noto Sans', sans-serif;
    font-weight: normal;
    font-size: 4rem;
    margin: 2rem 0;
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 4px var(--bg2);
}

.titles {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
    text-shadow: 2px 2px 4px var(--bg2);
}

/* About Section */
.about-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* About preview section */
.about-preview {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem;
}

.about-content-preview {
    flex: 1;
    text-align: left;
}

.about-preview .pixel-frame {
    width: 100%; /* Make image responsive */
    max-width: 250px; /* Smaller image size */
    aspect-ratio: 1/1.2; /* Maintain a consistent aspect ratio */
    justify-self: end; /* Align image to the right of its container */
    /* Removed aspect-ratio:  Let the image determine the aspect ratio */
}

.about-preview .pixel-frame::after {
    border: none; /* Remove the border for the about preview section */
}

.about-preview .pixel-frame img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Ensure the entire image is visible */
}

/* Base pixel frame container */
.pixel-frame {
    position: relative;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.pixel-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
    transition: border-color 0.2s ease;
    border: 3px solid var(--accent-color);
}

.pixel-frame img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.about-preview .pixel-frame {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1/1.2;
}

.preview-image {
    filter: grayscale(100%);
}

/* Sites Section */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.site-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    gap: 1.5rem;
}

.site-info {
    width: 100%;
}

.site-info h3 {
    color: var(--fg);
    font-size: 1.4rem;
    font-weight: 300;
    margin: 0 0 0.8rem 0;
}

.site-info p {
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
}

.site-preview {
    display: flex;
    justify-content: center;
}

.site-link {
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.site-link:hover {
    transform: translateY(-3px);
}

.site-preview .pixel-frame {
    width: 240px;
    aspect-ratio: 16/9;
}

.site-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(50%);
    transition: filter 0.3s ease;
}

.site-link:hover .site-preview-image {
    filter: grayscale(0%);
}

/* Buttons */
.pixel-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: transparent;
    color: var(--text-color);
    text-decoration: none;
    margin: 1rem 0;
    border: 3px solid var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.pixel-button:hover {
    background-color: rgba(235, 219, 178, 0.2);
    border-color: var(--fg);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    margin-top: 4rem;
    position: relative;
    z-index: 2;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* Utilities */
.text-center {
    text-align: center;
    margin-top: 2rem;
}

.divider {
    border: none;
    height: 2px;
    background-color: var(--bg2);
    margin: 2rem auto;
    width: 60%;
}

.section-border {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--fg);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

/* Typewriter effect */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--text-color);
    margin-left: 1px;
    animation: blink-caret 1.2s step-end infinite;
    vertical-align: bottom;
}

.cursor.typing {
    animation: none;
}

@keyframes blink-caret {
    from, to { background-color: transparent; }
    50% { background-color: var(--text-color); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .about-preview {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .about-preview .pixel-frame {
        max-width: 250px;
        margin: 0 auto;
    }

    .titles {
        flex-direction: column;
        gap: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .sites-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .site-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }

    .site-preview .pixel-frame {
        width: 150px;
        height: 150px;
    }

    .site-info {
        align-items: center;
    }

    .social-links {
        gap: 1.5rem;
    }

    footer {
        padding: 1rem;
    }
}
