/* Shared portfolio layout: adjust these values for every portfolio page. */
:root {
    color-scheme: dark;
    --page-bg: #050505;
    --panel-bg: #202020;
    --heading-text: #e8e8e8;
    --body-text: #c8c8c8;
    --muted-text: #a0a0a0;
    --border-color: #383838;
    --border-subtle: #292929;
    --surface: #2a2a2a;
    --surface-hover: #3a3a3a;
    --strong-text: #c6c6c6;
    --accent: #8ab4e8;
    --link-color: #a8b8c8;
    --site-content-width: 820px;
    --site-top-space: 118px;
}

/* Reserve scrollbar space so navigation does not shift between pages. */
html {
    scrollbar-gutter: stable;
}

body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    background-color: var(--page-bg);
    color: var(--body-text);
    font-family: 'Lato', sans-serif;
    
    box-sizing: border-box;
    width: 100%;
    max-width: calc(var(--site-content-width) + 40px);
    margin: 0 auto;
    padding: 0px 20px 0 20px;
}

body > header {
    padding-top: var(--site-top-space);
}

body > header,
body > main,
body > footer {
    min-width: 0;
}

.site-title {
    margin: 0 0 16px;
    font-size: 2.375rem;
    font-weight: 700;
    text-align: left;
}

header .site-title a {
    color: var(--heading-text);
}

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

body .content a,
.sdr-article > p a {
    text-decoration: none;
    color: var(--link-color);
}

body .content a:hover,
.sdr-article > p a:hover {
    color: var(--heading-text);
    text-decoration: underline;
}

body a:hover,
.nav a:hover {
    text-decoration: underline;
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
    text-align: left;
    margin-top: 0;
}

.nav a {
    color: var(--muted-text);
    text-decoration: none;
    font-size: 1.25rem;
}

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

.nav a[aria-current],
.mobile-menu a[aria-current] {
    color: var(--heading-text);
}


.menu-button {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding-left: 5px;
    background: transparent;
    border: 0;
}

.line {
    display: block;
    background-color: #ffffff;
    height: 2px;
    border-radius: 20px;
    margin: 5px;
}

.mobile {
    display: none;
}

.mobile-menu {
    display: none;
    font-size: 1.3125rem;
    flex-direction: column;
    min-height: 40vh;
    padding-top: 3vh;
    text-align: center;
    justify-content: space-between;
}

.mobile-menu:not([hidden]) {
    display: flex;
}

[hidden] {
    display: none !important;
}

:is(a, button, input, label):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted-text);
    padding: 24px 0;
}

@media (max-width: 768px) {
    :root {
        --site-top-space: 72px;
    }

    footer {
        margin-top: 0;
    }

    .site-title {
        font-size: 2.1875rem;
        text-align: center;
    }
    .desktop {
        display: none;
    }
    .mobile {
        display: block;
    }

    .nav {
        display: flex;
        justify-content: flex-end;
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin-top: 0;
    }

    .nav .menu-button {
        display: flex;
        margin-left: auto;
        margin-right: 0;
        padding: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        position: relative;
        border-radius: 8px;
    }

    .nav .menu-button .line {
        margin: 0;
        height: 2px;
        flex-shrink: 0;
        position: absolute;
        transition: transform 160ms ease;
    }

    .nav .menu-button .line:first-child {
        transform: translateY(-4px);
    }

    .nav .menu-button .line:last-child {
        transform: translateY(4px);
    }

    .nav .menu-button[aria-expanded="true"] .line:first-child {
        transform: rotate(45deg);
    }

    .nav .menu-button[aria-expanded="true"] .line:last-child {
        width: 26px !important;
        transform: rotate(-45deg);
    }

    .nav .menu-button:hover,
    .nav .menu-button[aria-expanded="true"] {
        background: #222;
    }

    .mobile-menu {
        min-height: 0;
        justify-content: flex-start;
        align-items: center;
        gap: 20px;
        margin-top: 10px;
        padding: 3vh 0 32px;
        text-align: center;
        font-size: 1.3125rem;
    }

    .mobile-menu a {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        min-width: 140px;
        padding: 10px 20px;
        color: var(--body-text);
    }

    .mobile-menu a:hover {
        color: #fff;
    }

}

@media (prefers-reduced-motion: reduce) {
    .nav .menu-button .line {
        transition: none;
    }
}
