:root {
    --bg: #F8F7F4;
    --bg-alt: #f0efeb;
    --surface: #ffffff;
    --surface-hover: #f5f4f0;
    --border: #e0ded9;
    --text: #1a1a18;
    --text-secondary: #6b6a64;
    --text-muted: #9e9d97;
    --accent: #0F6E56;
    --accent-soft: #e8f5f0;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-full: 20px;
    --transition: 150ms ease;
    --max-width: 1080px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Cascadia Code', monospace;
    --logo-accent: #0F6E56;
    --logo-fill: #1a1a18;
    --logo-text: #1a1a18;
}

[data-theme="dark"] {
    --bg: #111110;
    --bg-alt: #1a1a18;
    --surface: #1a1a18;
    --surface-hover: #222220;
    --border: #2c2c2a;
    --text: #f0f0ee;
    --text-secondary: #b0b0a8;
    --text-muted: #8a8a82;
    --accent: #1D9E75;
    --accent-soft: #0d1f1a;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-full: 20px;
    --transition: 150ms ease;
    --max-width: 1080px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Cascadia Code', monospace;
    --logo-accent: #1D9E75;
    --logo-fill: #FFFFFF;
    --logo-text: #FFFFFF;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

a { color: inherit; text-decoration: none; }

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

.main {
    flex: 1;
    padding-top: 40px;
}

/* ============ NAV ============ */
.site-header {
    border-bottom: 0.5px solid var(--border);
    background: var(--bg);
    transition: background var(--transition);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.05em;
}

.site-logo:hover { opacity: 0.8; }

.site-logo__img {
    display: block;
    height: 24px;
    width: auto;
}

.nav-primary {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-list {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list a {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.nav-list a:hover,
.nav-list .current-menu-item a {
    color: var(--text);
}

.theme-toggle {
    background: none;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
    color: var(--text-secondary);
    margin-left: 16px;
    transition: all var(--transition);
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    margin: 5px 0;
    transition: all var(--transition);
}

/* ============ SECTIONS ============ */
.section {
    padding: 56px 0;
    border-bottom: 0.5px solid var(--border);
    scroll-margin-top: 60px;
}

.section:last-of-type { border-bottom: none; }

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.section-header { margin-bottom: 20px; }

.section-header h1 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 4px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 4px;
}

.section-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ============ HERO ============ */
.hero { padding: 56px 0 0; }

.hero-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 8px;
}

.hero-sub {
    font-size: 15px;
    color: var(--accent);
    font-weight: 500;
    margin: 0 0 8px;
}

.hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 24px;
    max-width: 340px;
}

.btn-row {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
    text-decoration: none;
}

.btn--outline {
    background: transparent;
    border: 0.5px solid var(--border);
    color: var(--text);
}

.btn--outline:hover {
    border-color: var(--text-muted);
}

.btn--primary {
    background: var(--accent);
    border: 0.5px solid var(--accent);
    color: var(--bg);
    font-weight: 500;
}

.btn--primary:hover {
    opacity: 0.9;
}

/* Terminal */
.terminal {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.term-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
    align-items: center;
}

.term-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.term-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
    font-family: var(--font);
}

.term-line {
    color: var(--text-muted);
    line-height: 1.8;
}

.term-line .cmd { color: var(--text); }

.term-line .prompt { color: var(--accent); }

.term-line .muted { color: var(--text-muted); }

.term-line + .term-line { margin-top: 0; }

/* ============ SKILLS STRIP ============ */
.skills-strip {
    padding: 32px 0 56px;
}

.skills-strip__inner {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 0.5px solid var(--border);
}

.skill-tag {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-full);
}

/* ============ PROJECTS ============ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.project-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.project-card__image {
    display: block;
    height: 200px;
    background: var(--bg-alt);
    overflow: hidden;
}

.project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

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

.project-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card__placeholder-inner {
    width: 48px;
    height: 48px;
    border: 1px dashed var(--border);
    border-radius: 6px;
}

.project-card__body {
    padding: 20px;
}

.project-card__type {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.project-card__title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 10px;
    line-height: 1.3;
}

.project-card__title a { color: var(--text); }
.project-card__title a:hover { color: var(--accent); }

.project-card__excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 12px;
}

.project-card__stack {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.project-card__tag {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border: 0.5px solid var(--border);
    border-radius: 4px;
}

.project-card__actions { display: none; }

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.view-all {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.view-all:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* ============ ABOUT ============ */
.about-section {
    background: var(--bg-alt);
    padding: 64px 0;
}

.about-layout {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 32px;
    align-items: start;
    margin-top: 20px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 500;
    color: var(--accent);
}

.about-text h2 {
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 12px;
    line-height: 1.3;
}

.about-text p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 16px;
    max-width: 520px;
}

.about-link {
    font-size: 14px;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.about-link:hover { opacity: 0.8; }

.new-badge {
    font-size: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 0.5px solid var(--accent);
    padding: 2px 7px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ============ CTA ============ */
.cta-strip {
    background: var(--accent-soft);
    border-top: 0.5px solid var(--accent);
    border-bottom: 0.5px solid var(--accent);
    padding: 56px 32px;
    text-align: center;
}

.cta-strip .eyebrow {
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 12px;
}

.cta-strip h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px;
    line-height: 1.2;
}

.cta-strip p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 auto 24px;
    max-width: 440px;
    line-height: 1.6;
}

.cta-btn {
    display: inline-block;
    background: var(--accent);
    color: var(--bg);
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: opacity var(--transition);
}

.cta-btn:hover { opacity: 0.9; }

/* ============ FOOTER ============ */
.site-footer {
    padding: 16px 0;
    border-top: 0.5px solid var(--border);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

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

.footer-links a {
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-links a:hover { color: var(--text); }

/* ============ SINGLE PROJECT ============ */
.project-single {
    padding: 48px 0;
    max-width: 700px;
}

.project-single__header { margin-bottom: 28px; }

.project-single__title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    margin: 8px 0 12px;
}

.project-single__desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.project-single__image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
    background: var(--bg-alt);
}

.project-single__meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 36px;
}

.meta-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.meta-card__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.meta-card__value {
    font-size: 13px;
    color: var(--text);
}

.project-single__content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.project-single__content h2 {
    font-size: 18px;
    color: var(--text);
    margin: 28px 0 10px;
}

.project-single__content p { margin: 0 0 16px; }

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

/* ============ PAGE CONTENT ============ */
.page-content {
    max-width: 700px;
    padding: 48px 0;
}

.page-content__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px;
}

.page-content__body {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ============ SINGLE POST ============ */
.single-post {
    max-width: 700px;
    padding: 48px 0;
}

.single-post__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px;
}

.single-post__meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.single-post__image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--bg-alt);
}

.single-post__content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.single-post__content h2,
.single-post__content h3 {
    color: var(--text);
    margin-top: 28px;
    margin-bottom: 10px;
}

/* ============ POSTS GRID ============ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.post-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}

.post-card:hover { border-color: var(--text-muted); }

.post-card__image {
    display: block;
    aspect-ratio: 16/9;
    background: var(--bg-alt);
    overflow: hidden;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__body { padding: 12px; }

.post-card__date {
    font-size: 11px;
    color: var(--text-muted);
}

.post-card__title {
    font-size: 13px;
    font-weight: 500;
    margin: 4px 0;
}

.post-card__title a { color: var(--text); }
.post-card__title a:hover { color: var(--accent); }

.post-card__excerpt {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

.post-card__more {
    font-size: 12px;
    color: var(--accent);
    margin-top: 6px;
    display: inline-block;
}

/* ============ 404 ============ */
.error-page {
    text-align: center;
    padding: 80px 0;
}

.error-page__code {
    font-size: 48px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.error-page h1 {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px;
}

.error-page p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 24px;
}

/* ============ SEARCH ============ */
.search-result {
    padding: 16px 0;
    border-bottom: 0.5px solid var(--border);
}

.search-result h2 {
    font-size: 15px;
    margin: 0 0 4px;
}

.search-result p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.no-results {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 40px 0;
}

/* ============ PAGINATION ============ */
.pagination,
.posts-navigation {
    padding: 28px 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span,
.posts-navigation a {
    padding: 6px 12px;
    font-size: 13px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.pagination a:hover { border-color: var(--text-muted); }

/* ============ CONTACT FORM ============ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 20px;
}

.contact__info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 20px;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--text-muted);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
}

.form-status {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: none;
}

.form-status.success {
    display: block;
    background: var(--accent-soft);
    color: var(--accent);
    border: 0.5px solid var(--accent);
}

.form-status.error {
    display: block;
    background: #fef2f2;
    color: #b91c1c;
    border: 0.5px solid #fecaca;
}

[data-theme="dark"] .form-status.error {
    background: #2a0a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .projects-grid,
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-single__meta {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        position: relative;
        padding: 0 16px;
    }

    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 0.5px solid var(--border);
        padding: 8px 16px;
        gap: 8px;
        z-index: 10;
    }

    .nav-list.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .theme-toggle {
        margin-left: auto;
        margin-right: 8px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-desc {
        max-width: 100%;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .about-section {
        padding: 48px 0;
    }

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

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

    .main {
        padding-top: 24px;
    }

    .section {
        padding: 40px 0;
    }

    .hero {
        padding: 24px 0 0;
    }

    .skills-strip {
        padding: 24px 0 40px;
    }

    .cta-strip {
        padding: 40px 20px;
    }

    .cta-strip h2 {
        font-size: 20px;
    }

    .container {
        padding: 0 16px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .projects-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
