/* Utilizing modern CSS layers for better organization */
@layer reset, theme, base, layout, modules, utilities;

@layer reset {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }
    
    body {
        margin: unset;
    }
    
    button,
    input,
    textarea,
    select {
        font: inherit;
    }
    
    img,
    picture,
    svg,
    canvas {
        display: block;
        max-inline-size: 100%;
        height: auto;
    }
    
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

@layer theme {
    :root {
        /* utilizing rosé pine for color scheme */
        --background-color: #232136;
        --text-color: #e0def4;
        --text-secondary: #908caa;
        --highlight-high: #56526e;
        --color-love-moon: #eb6f92;
        --color-love-dawn: #b4637a;
        --color-subtle-moon: #908caa;
        --color-subtle-dawn: #797593;
        --color-foam-moon: #9ccfd8;
        --color-foam-dawn: #56949f;
        accent-color: var(--color-love-dawn);
        --font-main: system-ui, Arial, sans-serif;
        --font-monospace: "Lucida Console", monospace;
        --column-size: 760px;
        --margin-y: 15px;
    }
}

@layer base {
    :root {
        font-size: clamp(1rem, 0.4rem + 0.8svw, 1.2rem);
    }
    
    body {
        font-family: var(--font-main);
        background-color: var(--background-color);
        color: var(--text-color);
    }
    
    a:any-link {
        color: var(--color-foam-moon);
        text-decoration: unset;
    }
    
    a:any-link:hover {
        color: var(--color-foam-dawn);
    }
    
    h1, h2, h3 {
        font-family: var(--font-monospace);
        text-transform: lowercase;
        margin: unset;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.65rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    @media (min-width: 768px) {
        h1 {
            font-size: 2.2rem;
        }
        
        h2 {
            font-size: 1.85rem;
        }
        
        h3 {
            font-size: 1.5rem;
        }
    }
    
    p {
        margin: var(--margin-y) 0;
    }
    
    ul {
        margin: var(--margin-y) 0;
        padding-inline-start: 20px;
    }
    
    li + li {
        margin-block-start: 0.5em;
    }
    
    @media (min-width: 768px) {
        li + li {
            margin-block-start: 0.3em;
        }
    }
}

@layer layout {
    body .container {
        margin: 10px 10px 0;
    }
    
    @media (min-width: 768px) {
        body .container {
            max-width: var(--column-size);
            margin: 15px auto 0;
        }
    }
}

@layer modules {
    .project-grid {
        display: grid;
        gap: 2rem;
        margin-block-start: 2rem;
    }
    
    .project-card {
        border: 1px solid var(--color-subtle-moon);
        border-radius: 0.5rem;
        padding: 1.5rem;
        background: var(--highlight-high);
        transition: border-color 0.2s ease;
    }
    
    .project-card:hover {
        border-color: var(--color-foam-moon);
    }
    
    .project-title {
        color: var(--color-love-moon);
        margin-block-end: 0.5rem;
    }
    
    .project-description {
        color: var(--text-secondary);
        margin-block-end: 1rem;
    }
    
    .project-tech {
        font-size: 0.875rem;
        color: var(--color-subtle-moon);
    }
    
    .ai-badge {
        display: inline-block;
        background: var(--color-love-moon);
        color: var(--background-color);
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        font-size: 0.75rem;
        font-weight: bold;
        margin-inline-start: 0.5rem;
    }
    
    .intro-text {
        font-size: 1.1rem;
        line-height: 1.6;
        color: var(--text-secondary);
        margin-block-end: 2rem;
    }
    
    .header-section {
        margin-block-end: 3rem;
    }
}

@layer utilities {
    .flex {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }
    
    .flex-to-row {
        flex-direction: column;
    }
    
    @media (min-width: 768px) {
        .flex-to-row {
            flex-direction: row;
        }
    }
}
