:root {
    color-scheme: dark;
    --ink: #080e16;
    --panel: #101b29;
    --line: #304458;
    --text: #f1f5fa;
    --muted: #b5c2d1;
    --cyan: #63d7ff;
    --header-height: 4.5rem;
    --content-width: 72rem;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: #000;
    color: var(--text);
}

a {
    color: var(--cyan);
    text-underline-offset: .22em;
}

a:hover {
    color: #b8eeff;
}

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

button, input, textarea {
    font: inherit;
}

.screen-reader-only,
.hero-mission {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.site-header {
    position: relative;
    z-index: 1;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-height);
    max-width: 96rem;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 3.5rem);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--text);
    font-size: .86rem;
    font-weight: 750;
    letter-spacing: .075em;
    text-decoration: none;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    flex: 0 0 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid #315d74;
    border-radius: .5rem;
    background: #102233;
    color: var(--cyan);
    font: 700 .88rem ui-monospace, monospace;
}

.brand-secondary {
    color: var(--muted);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.desktop-nav a,
.mobile-nav a {
    padding: .65rem .85rem;
    border: 1px solid transparent;
    border-radius: .45rem;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.site-header a[aria-current="page"] {
    background: #142436;
    color: var(--cyan);
}

.desktop-nav a[href="contact.php"],
.mobile-nav a[href="contact.php"] {
    border-color: #315d74;
    color: var(--cyan);
}

.mobile-menu {
    display: none;
}

.hero {
    display: grid;
    align-content: center;
    min-height: calc(100vh - var(--header-height) - 1px);
    min-height: calc(100dvh - var(--header-height) - 1px);
}

.hero img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--header-height) - 1px);
    max-height: calc(100dvh - var(--header-height) - 1px);
    object-fit: contain;
}

.home-page .hero {
    min-height: 0;
}

.home-page .hero img {
    max-height: min(74vh, 47rem);
}

.home-content {
    padding: 0 clamp(1rem, 5vw, 3rem);
    border-top: 1px solid var(--line);
    background: radial-gradient(ellipse at top, #14273b, var(--ink) 38rem);
}

.home-section {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4.5rem) 0;
    scroll-margin-top: 1rem;
}

.home-section h2 {
    margin: 0;
    font-size: clamp(1.85rem, 4.5vw, 2.7rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(.85rem, 2vw, 1.5rem);
    margin-top: 1.4rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-top-color: #477d99;
    border-radius: .85rem;
    background: var(--panel);
}

.project-image-link {
    width: 100%;
    margin-bottom: 1.25rem;
    border-radius: .55rem;
}

.project-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: var(--ink);
}

.project-image-link:hover .project-image {
    border-color: var(--cyan);
}

.project-banner {
    padding: clamp(.75rem, 2vw, 1.25rem);
}

.project-card h3 {
    margin: 0;
    font-size: clamp(1.2rem, 2.5vw, 1.55rem);
    line-height: 1.2;
}

.project-card p:not(.eyebrow),
.about-section div > p:not(.eyebrow) {
    max-width: 58ch;
    color: var(--muted);
    line-height: 1.65;
}

.project-card p:not(.eyebrow) {
    margin: .65rem 0 1.25rem;
}

.project-card .secondary-button {
    margin-top: auto;
}

.about-section {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 5vw, 4rem);
    border-top: 1px solid var(--line);
}

.about-portrait {
    display: block;
    width: clamp(9rem, 25vw, 15rem);
    height: auto;
    aspect-ratio: 1;
    border: .35rem solid var(--cyan);
    border-radius: 50%;
    object-fit: cover;
    object-position: 68% center;
}

.about-section div > p:not(.eyebrow) {
    margin: .75rem 0 1.15rem;
}

.about-address {
    margin: 0 0 1.15rem;
    color: var(--muted);
    font-style: normal;
    line-height: 1.6;
}

.about-address strong {
    color: var(--text);
}

.site-footer {
    padding: 0 clamp(1rem, 5vw, 3rem);
    border-top: 1px solid var(--line);
    background: #070c13;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .65rem 1.5rem;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 1.15rem 0;
    color: var(--muted);
    font-size: .85rem;
}

.footer-inner p {
    margin: 0;
}

.footer-inner nav {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1rem;
}

.footer-inner a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
}

.contact-open {
    overflow: hidden;
}

.contact-dialog {
    position: fixed;
    inset: 0;
    width: min(36rem, calc(100% - 2rem));
    max-width: none;
    max-height: calc(100% - 2rem);
    margin: auto;
    padding: 0;
    border: 1px solid #42647c;
    border-radius: 1rem;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 20px 70px #000b;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #47647d var(--panel);
}

.contact-dialog[open]:not(:modal) {
    z-index: 2;
    box-shadow: 0 0 0 100vmax #03080cbd;
}

.contact-dialog::backdrop {
    background: #03080cbd;
}

.contact-panel {
    position: relative;
    padding: clamp(1.15rem, 4vw, 2rem);
}

.close-button {
    position: absolute;
    top: .85rem;
    right: .85rem;
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #162438;
    color: var(--text);
}

.close-button:hover,
.secondary-button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.eyebrow {
    margin: 0 0 .55rem;
    color: var(--cyan);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.contact-panel .eyebrow {
    padding-right: 2rem;
}

.contact-panel h1,
.legal-content h1 {
    margin: 0;
    font-size: clamp(1.8rem, 6vw, 2.65rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.contact-panel h1:focus {
    outline: none;
}

.contact-intro,
.contact-alternative,
.legal-content p {
    color: var(--muted);
    line-height: 1.6;
}

.contact-intro {
    margin: .65rem 0 1.2rem;
}

.contact-form,
.field {
    display: grid;
    gap: .5rem;
}

.contact-form {
    gap: .95rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.field label {
    font-size: .88rem;
    font-weight: 650;
}

.field input,
.field textarea {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #466078;
    border-radius: .45rem;
    background: #080f19;
    color: var(--text);
}

.field textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.captcha {
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: .65rem;
    background: #0c1622;
}

.captcha-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.captcha-row img {
    display: block;
    border: 1px solid #41647d;
    border-radius: .4rem;
    background: #0a1a28;
}

.field .captcha-code {
    width: min(100%, 7rem);
    letter-spacing: .16em;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: fit-content;
    min-height: 2.75rem;
    padding: .55rem .85rem;
    border: 1px solid transparent;
    border-radius: .45rem;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    background: var(--cyan);
    color: #071522;
}

.primary-button:hover {
    background: #b8eeff;
    color: #071522;
}

.secondary-button {
    border-color: #426079;
    background: #162438;
    color: var(--text);
}

button:disabled {
    opacity: .6;
    cursor: wait;
}

.form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.form-footer a,
.contact-alternative,
.refresh-status {
    font-size: .85rem;
}

.contact-alternative {
    margin: 1rem 0 0;
}

.form-error {
    margin: 0 0 1rem;
    padding: .75rem;
    border: 1px solid #915566;
    border-radius: .45rem;
    background: #321e2a;
    color: #ffd8df;
}

.refresh-status {
    margin: .45rem 0 0;
    color: var(--muted);
}

.refresh-status:empty {
    margin: 0;
}

.legal-page {
    flex: 1;
    padding: clamp(2rem, 7vw, 5rem) 1rem;
    background: radial-gradient(ellipse at top, #14273b, var(--ink) 38rem);
}

.legal-content {
    max-width: 46rem;
    margin: 0 auto;
    padding: clamp(1.25rem, 5vw, 3rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
}

.legal-content .eyebrow {
    color: var(--cyan);
}

.legal-content .legal-summary {
    margin: .9rem 0 0;
    color: var(--text);
    font-size: 1.05rem;
}

.legal-content section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.legal-content h2 {
    margin: 0 0 .4rem;
    font-size: 1.15rem;
}

.legal-content section p {
    margin: 0;
}

@media (max-width: 56rem) {
    :root {
        --header-height: 4rem;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-menu {
        display: block;
        flex-shrink: 0;
    }

    .mobile-menu summary {
        display: flex;
        align-items: center;
        gap: .4rem;
        padding: .65rem;
        border: 1px solid var(--line);
        border-radius: .45rem;
        color: var(--text);
        font-size: .88rem;
        font-weight: 650;
        list-style: none;
        cursor: pointer;
    }

    .mobile-menu summary::-webkit-details-marker {
        display: none;
    }

    .mobile-menu[open] summary {
        color: var(--cyan);
    }

    .mobile-menu[open] .mobile-nav {
        position: absolute;
        top: calc(100% + .35rem);
        right: 1rem;
        left: 1rem;
        display: grid;
        gap: .35rem;
        padding: .6rem;
        border: 1px solid var(--line);
        border-radius: .65rem;
        background: var(--panel);
        box-shadow: 0 12px 30px #0009;
    }
}

@media (max-width: 36rem) {
    .site-brand {
        gap: .55rem;
        font-size: .75rem;
    }

    .hero-mission {
        position: static;
        width: auto;
        height: auto;
        max-width: 28rem;
        margin: .5rem auto 0;
        padding: 0 1.25rem 1rem;
        clip-path: none;
        color: var(--muted);
        font-size: .95rem;
        line-height: 1.6;
        text-align: center;
        white-space: normal;
    }

    .form-row,
    .project-grid,
    .about-section {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-portrait {
        justify-self: center;
    }
}
