:root {
    --background: #f1f2f3;
    --sheet: #ffffff;
    --sheet-padding: 2rem;
    --text: #171717;
    --muted: #666666;
    --line: #dedede;
    --line-dark: #b8b8b8;
    --gold: #8a6716;
    --page-gutter: clamp(1rem, 3vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.55;
}

button, a { color: inherit; }
a { text-decoration: none; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

.document-sheet {
    width: min(210mm, calc(100% - var(--page-gutter) - var(--page-gutter)));
    margin: 1.5rem auto;
    padding: 0 var(--sheet-padding);
    background: var(--sheet);
    border: 1px solid #dedfe1;
    box-shadow: 0 2px 12px rgb(0 0 0 / 4%);
}

.site-header { border-bottom: 1px solid var(--line); }

.navigation,
main,
footer {
    width: 100%;
    margin: 0;
}

.navigation {
    position: relative;
    display: flex;
    min-height: 3.5rem;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.menu-button {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.65rem;
    border: 1px solid var(--line-dark);
    background: #ffffff;
    cursor: pointer;
    align-content: center;
    gap: 0.28rem;
}

.menu-button span:not(.visually-hidden) {
    display: block;
    height: 1px;
    background: var(--text);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-menu a {
    color: var(--muted);
    transition: color 140ms ease;
}

.nav-menu a:hover { color: var(--gold); }

.introduction {
    padding: 1.25rem 0;
}

.introduction h1 {
    margin: 0;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.5;
}

.introduction p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.section {
    padding: 1.25rem 0;
    border-top: 1px solid var(--line);
    scroll-margin-top: 1rem;
}

.section h2 {
    margin: 0 0 0.75rem;
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
}

.projects-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.project {
    padding: 0;
}

.project h3 {
    margin: 0 0 0.6rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.project-details { margin: 0 0 0.9rem; }

.project-details div {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    column-gap: 0.75rem;
    padding: 0.12rem 0;
}

.project-details dt { color: var(--muted); }
.project-details dd { margin: 0; }

.project-description {
    margin: 0;
}

.project-description p {
    margin: 0 0 1rem;
}

.project-description p:last-child {
    margin-bottom: 0;
}

.project-description .project-question {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.55;
}

.text-section p { margin: 0 0 0.75rem; }

.contact-links {
    display: flex;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    font-style: normal;
}

.contact-links a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: var(--line-dark);
    text-underline-offset: 0.25rem;
}

.contact-links a:hover { text-decoration-color: var(--gold); }

footer {
    padding: 0.75rem 0 1.25rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

footer p { margin: 0; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 800px) {
    .navigation {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        padding: 0.5rem 0;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .navigation.is-enhanced .menu-button { display: grid; }

    .navigation.is-enhanced .nav-menu {
        position: absolute;
        z-index: 10;
        top: 100%;
        right: 0;
        display: none;
        min-width: 12rem;
        border: 1px solid var(--line-dark);
        background: var(--sheet);
    }

    .navigation.is-enhanced .nav-menu.is-open { display: block; }

    .navigation.is-enhanced .nav-menu a {
        display: block;
        padding: 0.8rem 1rem;
        border-bottom: 1px solid var(--line);
    }

    .navigation.is-enhanced .nav-menu a:last-child { border-bottom: 0; }
}

@media (max-width: 520px) {
    :root {
        --page-gutter: 0.5rem;
        --sheet-padding: 1rem;
    }

    .document-sheet { margin: 0.5rem auto; }

    .project-details div {
        grid-template-columns: 7.25rem minmax(0, 1fr);
        column-gap: 0.5rem;
    }

    .contact-links a { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .nav-menu a { transition: none; }
}

@page {
    size: A4;
    margin: 18mm;
}

@media print {
    body {
        background: #ffffff;
        color: #000000;
        font-size: 11pt;
    }

    .document-sheet {
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .navigation .menu-button,
    .navigation .nav-menu { display: none !important; }

    .navigation {
        min-height: 0;
        padding: 0 0 0.75rem;
    }

    .projects-grid { display: block; }

    h1, h2, h3 {
        break-after: avoid;
        page-break-after: avoid;
    }

    .project-details,
    .project-details div {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    p {
        orphans: 3;
        widows: 3;
    }

    .contact-links a { color: inherit; }
}
