:root {
    --bg: #10150f;
    --bg-soft: #1a2218;
    --panel: rgba(34, 43, 32, 0.92);
    --panel-strong: #2a3427;
    --text: #f4f7f1;
    --muted: #c7d0c0;
    --accent: #9fb38c;
    --accent-strong: #c8ddb1;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
    --radius: 20px;
    --content-width: 72rem;
}

body[data-theme="light"] {
    --bg: #f3f0e8;
    --bg-soft: #faf7f0;
    --panel: rgba(255, 252, 245, 0.92);
    --panel-strong: #ffffff;
    --text: #243024;
    --muted: #4f5f4d;
    --accent: #7d9868;
    --accent-strong: #587247;
    --border: rgba(36, 48, 36, 0.12);
    --shadow: 0 18px 40px rgba(64, 54, 34, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(159, 179, 140, 0.18), transparent 30%),
        linear-gradient(180deg, #0f140e 0%, #151d14 50%, #1d271b 100%);
    transition: background 0.45s ease, color 0.3s ease;
}

body.is-transitioning {
    opacity: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 1000;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    background: var(--accent-strong);
    color: #10150f;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

body[data-theme="light"] {
    background:
        radial-gradient(circle at top, rgba(125, 152, 104, 0.22), transparent 30%),
        linear-gradient(180deg, #f6f1e7 0%, #efe8db 55%, #e6ddcf 100%);
}

a {
    color: inherit;
    transition: color 0.25s ease;
}

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

.site-shell {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
    animation: page-enter 0.35s ease;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.language-switcher a,
.language-switcher button {
    min-width: 3rem;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}

.language-switcher a.is-active,
.language-switcher button.is-active {
    background-color: rgba(159, 179, 140, 0.18);
    color: var(--text);
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-brand {
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.25s ease;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background-color: rgba(159, 179, 140, 0.16);
}

.theme-toggle-icon {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.25s ease, color 0.25s ease;
}

.nav-toggle span {
    display: block;
    width: 1.2rem;
    height: 2px;
    margin: 0.16rem 0;
    background-color: currentColor;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(0.36rem) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-0.36rem) rotate(-45deg);
}

.layout {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.site-nav,
.content-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    transition:
        background-color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        color 0.25s ease;
}

.site-nav {
    position: sticky;
    top: 1.25rem;
    padding: 1.5rem;
}

.site-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.site-nav a {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
    color: var(--text);
    background-color: rgba(159, 179, 140, 0.16);
    transform: translateX(4px);
}

.content-panel {
    padding: clamp(1.5rem, 3vw, 3rem);
}

.hero {
    display: grid;
    gap: 1rem;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.3rem, 5vw, 4.25rem);
    line-height: 1.08;
    font-weight: 600;
}

h2 {
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    line-height: 1.2;
    font-weight: 600;
}

p {
    max-width: 65ch;
    color: var(--muted);
    font-size: 1.05rem;
    transition: color 0.25s ease;
}

.lead {
    font-size: 1.15rem;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
    color: var(--text);
    transition:
        transform 0.2s ease,
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
    background-color: rgba(159, 179, 140, 0.16);
    transform: translateY(-2px);
}

.inline-link {
    color: var(--accent-strong);
    font-weight: 600;
    text-decoration: none;
}

.inline-link:hover,
.inline-link:focus-visible {
    text-decoration: underline;
}

.social-icon {
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: filter 0.25s ease;
}

body[data-theme="light"] .social-icon {
    filter: none;
}

.section-stack {
    display: grid;
    gap: 1.25rem;
    margin-top: 2rem;
}

.info-card {
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    transition:
        background-color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.info-card p + p {
    margin-top: 0.8rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition:
        transform 0.22s ease,
        border-color 0.3s ease,
        background-color 0.3s ease,
        color 0.25s ease,
        box-shadow 0.3s ease;
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(200, 221, 177, 0.35);
    background-color: rgba(255, 255, 255, 0.05);
}

.project-card img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.project-info {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
}

.project-link-label {
    color: var(--accent-strong);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.25s ease;
}

.error-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.error-card {
    width: min(100%, 42rem);
    text-align: center;
}

.error-code {
    font-size: clamp(4rem, 14vw, 7rem);
    line-height: 1;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    padding: 0.9rem 1.25rem;
    border-radius: 999px;
    background: var(--accent);
    color: #10150f;
    font-weight: 600;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        filter 0.2s ease,
        background-color 0.25s ease,
        color 0.25s ease;
}

body[data-theme="light"] .button-link {
    color: #ffffff;
}

.button-link:hover,
.button-link:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .site-shell {
        width: min(calc(100% - 1rem), var(--content-width));
        padding-top: 1rem;
    }

    .site-header {
        margin-bottom: 1rem;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .theme-toggle-label {
        display: none;
    }

    .theme-toggle {
        min-width: 3rem;
        justify-content: center;
        padding-inline: 0.8rem;
    }

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

    .site-nav {
        position: static;
        display: none;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav a:hover,
    .site-nav a:focus-visible,
    .site-nav a[aria-current="page"] {
        transform: none;
    }
}

@media (max-width: 640px) {
    .content-panel,
    .site-nav {
        border-radius: 16px;
    }

    .content-panel {
        padding: 1.25rem;
    }

    p,
    .lead {
        font-size: 1rem;
    }

    .social-links a {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
