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

:root {
    --color-bg: #fafaf9;
    --color-surface: #ffffff;
    --color-text: #1c1917;
    --color-text-muted: #57534e;
    --color-text-light: #a8a29e;
    --color-accent: #292524;
    --color-accent-hover: #44403c;
    --color-border: #e7e5e4;
    --color-border-light: #f5f5f4;
    --color-tag-bg: #f5f5f4;
    --color-tag-text: #57534e;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --max-width: 1100px;
    --header-height: 64px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* === Header === */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(250, 250, 249, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
}

.logo-role {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.site-nav {
    display: flex;
    gap: 2rem;
}

.site-nav a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.site-nav a:hover {
    color: var(--color-text);
}

/* === Hero Section === */
.hero-section {
    padding: calc(var(--header-height) + 6rem) 2rem 5rem;
    text-align: center;
}

.hero-inner {
    max-width: 680px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-cta {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--color-accent);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s, transform 0.15s;
}

.hero-cta:hover {
    background: var(--color-accent-hover);
    color: white;
    transform: translateY(-1px);
}

/* === Sections === */
.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
}

/* === Projects Section === */
.projects-section {
    padding: 4rem 0 5rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-color: #d6d3d1;
}

.project-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-border-light);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.03);
}

.project-info {
    padding: 1.25rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.project-summary {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 0.75rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--color-tag-bg);
    color: var(--color-tag-text);
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* === Categories Section === */
.categories-section {
    padding: 4rem 0 5rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.category-card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-color: #d6d3d1;
}

.category-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-border-light);
    border-radius: 10px;
}

.category-content {
    flex: 1;
    min-width: 0;
}

.category-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.category-desc {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.category-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Category Hero (list pages) === */
.category-hero {
    padding: calc(var(--header-height) + 4rem) 0 3rem;
}

.category-hero-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.category-hero-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-border-light);
    border-radius: 12px;
}

.category-hero-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.category-hero-desc {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-weight: 300;
    line-height: 1.6;
}

.category-intro-body {
    margin-top: 1.5rem;
    max-width: 720px;
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}

.category-intro-body p {
    margin-bottom: 1rem;
}

/* === About Section === */
.about-section {
    padding: 4rem 0 5rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.about-content {
    max-width: 640px;
}

.about-content p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.about-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.about-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    transition: background-color 0.2s, border-color 0.2s;
}

.about-link:hover {
    background: var(--color-border-light);
    border-color: #d6d3d1;
}

/* === Project Detail Page === */
.project-detail {
    padding: calc(var(--header-height) + 3rem) 0 5rem;
}

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-text);
}

.project-header h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.project-lead {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    font-weight: 300;
    margin-bottom: 1.25rem;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.project-github,
.project-live {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.project-github:hover,
.project-live:hover {
    background: var(--color-border-light);
}

.project-hero-image {
    margin-bottom: 2.5rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.project-body {
    max-width: 720px;
    font-size: 1rem;
    line-height: 1.8;
}

.project-body h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin: 2.5rem 0 0.75rem;
}

.project-body h3 {
    font-size: 1.15rem;
    margin: 2rem 0 0.5rem;
}

.project-body p {
    margin-bottom: 1.25rem;
    color: var(--color-text-muted);
}

.project-body ul, .project-body ol {
    margin: 0 0 1.25rem 1.5rem;
    color: var(--color-text-muted);
}

.project-body li {
    margin-bottom: 0.4rem;
}

.project-body code {
    font-size: 0.88em;
    background: var(--color-tag-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

.project-body pre {
    background: var(--color-accent);
    color: #e7e5e4;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.project-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

.project-body img {
    border-radius: 8px;
    border: 1px solid var(--color-border);
    margin: 1rem 0;
}

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.footer-inner a {
    color: var(--color-text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-section {
        padding-top: calc(var(--header-height) + 3rem);
        padding-bottom: 3rem;
    }

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

    .category-card {
        padding: 1.5rem;
    }

    .category-hero-header {
        flex-direction: column;
        gap: 1rem;
    }

    .category-hero-title {
        font-size: 1.75rem;
    }

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

    .project-header h1 {
        font-size: 1.75rem;
    }

    .site-nav {
        gap: 1.25rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .header-inner {
        padding: 0 1rem;
    }

    .section-inner {
        padding: 0 1rem;
    }
}
