@font-face {
    font-family: "Source Serif 4";
    src: url("../fonts/source-serif-4.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --fg: #1d2427;
    --muted: #5b6467;
    --accent: #1b8a6b;
    --line: #dde2e3;
    --panel: #ffffff;
    --scrim: rgb(29 36 39 / 55%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1d2427;
        --fg: #f4f4f2;
        --muted: #aab3b6;
        --accent: #5fd1af;
        --line: #3a4448;
        --panel: #263034;
        --scrim: rgb(0 0 0 / 60%);
    }
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font: 400 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
    color: inherit;
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--accent);
}

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

.brand {
    display: block;
    width: min(26rem, 100%);
}

.brand img {
    display: block;
    width: 100%;
    height: auto;
}

main {
    flex: 1;
    padding: 0 1rem;
}

main.home {
    display: flex;
    align-items: center;
    justify-content: center;
}

main.page {
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 2.5rem 1rem 3rem;
}

.header {
    padding: 1.5rem 1rem 0;
}

.header .brand {
    width: min(14rem, 100%);
    margin: 0 auto;
    max-width: 44rem;
}

h1,
h2 {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 650;
    line-height: 1.2;
}

h1 {
    font-size: 2.1rem;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 1.35rem;
    margin: 2.25rem 0 0.5rem;
}

p,
ul,
address {
    margin: 0 0 1rem;
    font-style: normal;
}

ul {
    padding-left: 1.25rem;
}

.notfound {
    text-align: center;
}

.footer {
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--muted);
}

.footer ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer a {
    display: inline-block;
    padding: 0.25rem 0;
    text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
    text-decoration: underline;
}

.dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--scrim);
}

.dialog:target {
    display: flex;
}

.dialog-box {
    position: relative;
    width: 100%;
    max-width: 30rem;
    max-height: 100%;
    overflow: auto;
    padding: 1.75rem 1.5rem 1.5rem;
    background: var(--panel);
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}

.dialog-box h2 {
    margin-top: 0;
}

.dialog-close {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--fg);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
}

.dialog-close:hover,
.dialog-close:focus-visible {
    background: var(--fg);
    color: var(--bg);
}

/* Home page intro: the lockup is wiped in from the left, a soft green glow drifts behind it.
   CSS only; nothing moves for visitors who ask for reduced motion. */
body:has(main.home) {
    position: relative;
    overflow: hidden;
}

body:has(main.home)::before,
body:has(main.home)::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgb(27 138 107 / 22%), transparent);
    pointer-events: none;
}

body:has(main.home)::before {
    top: -20vmax;
    left: -15vmax;
    animation: drift-a 24s ease-in-out infinite alternate;
}

body:has(main.home)::after {
    right: -20vmax;
    bottom: -25vmax;
    animation: drift-b 30s ease-in-out infinite alternate;
}

main.home .brand,
main.home + .footer {
    position: relative;
    z-index: 1;
}

main.home .brand img {
    animation: wipe-in 1.6s cubic-bezier(0.65, 0, 0.2, 1) 0.3s both;
}

main.home + .footer {
    animation: fade-in 1s ease 1.6s both;
}

@keyframes wipe-in {
    from {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
        transform: translateY(0.6rem);
        filter: blur(6px);
    }
    35% {
        opacity: 1;
    }
    to {
        clip-path: inset(0 0 0 0);
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes drift-a {
    to {
        transform: translate(25vmax, 15vmax) scale(1.2);
    }
}

@keyframes drift-b {
    to {
        transform: translate(-25vmax, -15vmax) scale(1.15);
    }
}

@media (prefers-reduced-motion: reduce) {
    body:has(main.home)::before,
    body:has(main.home)::after,
    main.home .brand img,
    main.home + .footer {
        animation: none;
    }
}
