/* Refined header, editable footer layout, and a single-screen home page. */
body.milankov-site {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.header-shell {
    min-height: 8.5rem;
    transition: min-height 220ms ease;
}

.brand-name {
    color: #dfcfaa;
    font-weight: 400;
    letter-spacing: 0.01em;
    transition: font-size 220ms ease, letter-spacing 220ms ease;
}

.brand-name:hover,
.brand-name:focus-visible { color: var(--gold-bright); }

@media (min-width: 701px) {
    .brand-name { font-size: clamp(1.45rem, 2.45vw, 2rem); }
}

.site-header.is-compact {
    background: rgba(14, 11, 9, 0.96);
    border-bottom-color: rgba(214, 179, 108, 0.68);
    box-shadow: 0 0.6rem 1.4rem rgba(0, 0, 0, 0.28);
}

.site-header.is-compact .header-shell {
    min-height: 4.25rem;
}

.site-header.is-compact .brand-name {
    font-size: 1.18rem;
    letter-spacing: 0.018em;
}

.site-header.is-compact .site-branding p {
    display: none;
}

.site-footer {
    margin-top: auto;
}

.site-footer .moduletable {
    width: min(calc(100% - 4rem), var(--content));
    margin: 0 auto;
    padding: 1.55rem 0;
}

.site-footer .moduletable > * {
    margin-top: 0;
    margin-bottom: 0;
}

.site-footer .moduletable > * + * {
    margin-top: 0.35rem;
}

.site-footer p {
    color: var(--muted);
    font-size: 0.86rem;
}

.back-to-top {
    position: fixed;
    right: clamp(1rem, 2.5vw, 2rem);
    bottom: clamp(1rem, 2.5vw, 2rem);
    z-index: 25;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid rgba(214, 179, 108, 0.7);
    border-radius: 50%;
    background: rgba(20, 16, 13, 0.88);
    color: var(--gold);
    font-family: var(--serif);
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.65rem);
    transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover, .back-to-top:focus-visible { background: rgba(83, 65, 35, 0.96); outline: none; }

.is-home {
    height: 100dvh;
    overflow: hidden;
}

.is-home .site-content {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.is-home .home-hero {
    flex: 1 1 auto;
    min-height: 0;
    align-items: center;
    padding-bottom: clamp(2rem, 6vw, 6rem);
}

@media (max-width: 700px) {
    .site-footer .moduletable {
        width: calc(100% - 2rem);
        padding: 1rem 0;
    }

    .header-shell,
    .site-header.is-compact .header-shell {
        min-height: 5.25rem;
    }

    .site-header.is-compact .brand-name {
        font-size: 1.1rem;
    }

    .brand-name {
        font-size: clamp(1.08rem, 4.6vw, 1.35rem);
        line-height: 1.15;
    }

    .site-content h1 {
        max-width: 100%;
        overflow-wrap: anywhere;
        font-size: clamp(1.65rem, 8.5vw, 2.25rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .header-shell,
    .brand-name {
        transition: none;
    }
}
