/*
 * Shared page canvas.
 *
 * The background belongs exclusively to the root element. Keeping body
 * transparent prevents short pages from ending in a second, differently
 * blended background layer.
 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f2eb;
    --text: #2c2a26;
    --muted: #726c63;
    --link: #5f594f;
    --accent: #8a7252;
    --accent-hover: #735c40;
    --border: #d9d1c4;
}

html {
    min-height: 100%;
    background-color: var(--bg);
}

body {
    min-height: 100vh;
    background: transparent;
    color: var(--text);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 17px;
    line-height: 1.7;
}

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
}

.site-nav .name {
    display: inline-block;
    font-family: 'Mynerve', cursive;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -.02em;
    text-decoration: none;
    color: var(--text);
    transform: scale(1.65);
    transform-origin: left center;
    transition: color 0.42s ease;
}

.site-nav .name:hover {
    color: var(--accent-hover);
}

.site-nav .links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-nav .links a {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 16px;
    color: var(--link);
    text-decoration: none;
    letter-spacing: .04em;
    transition: color 0.42s ease, transform 0.32s ease;
}

.site-nav .links a:hover {
    color: var(--accent-hover);
    transform: translateY(-1px);
}

.site-nav .links a[aria-current="page"] {
    color: var(--accent);
}

.site-nav .links a:focus-visible {
    outline: 1px solid rgba(138, 114, 82, 0.45);
    outline-offset: 4px;
}

::selection {
    color: var(--text);
    background: rgba(181, 145, 94, .28);
}

::-moz-selection {
    color: var(--text);
    background: rgba(181, 145, 94, .28);
}

/*
 * Shared name glow. The anchor is placed before the rest of the page
 * content, so the animated light remains underneath every text/control
 * layer while staying centered on the name.
 */
.name-glow-anchor {
    position: relative;
    isolation: isolate;
}

.name-glow-anchor::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 50%;
    left: 50%;
    width: min(88vw, 920px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%) scale(.04);
    transform-origin: center;
    opacity: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(190, 149, 91, .25) 0,
        rgba(190, 149, 91, .11) 38%,
        rgba(190, 149, 91, 0) 72%
    );
    pointer-events: none;
    animation: name-glow-radiate .72s cubic-bezier(.16, .7, .2, 1) 0s both;
}

.name-glow-anchor > h1 {
    position: relative;
    z-index: 1;
}

@keyframes name-glow-radiate {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.04);
    }
    2% {
        opacity: .78;
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

body.inner-page > .site-nav,
body.inner-page > .page-content,
body.inner-page > .cv-page {
    position: relative;
    z-index: 1;
}

body.inner-page > .page-content,
body.inner-page > .cv-page {
    animation: inner-page-arrive .38s cubic-bezier(.22, .72, .28, 1);
}

@keyframes inner-page-arrive {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-nav .name,
    .site-nav .links a {
        transition: none;
    }

    .site-nav .links a:hover {
        transform: none;
    }

    .name-glow-anchor::before {
        animation: none;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    body.inner-page > .page-content,
    body.inner-page > .cv-page {
        animation: none;
    }
}

@media (max-width: 600px) {
    .site-nav {
        padding: 20px 24px;
    }

    .site-nav .name {
        transform: scale(1.4);
    }

    .site-nav .links {
        gap: 20px;
    }
}

@media (max-width: 420px) {
    .site-nav {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 18px 16px;
    }

    .site-nav .name {
        transform: scale(1.25);
        transform-origin: center;
    }

    .site-nav .links {
        width: 100%;
        justify-content: center;
        gap: clamp(12px, 4.5vw, 18px);
    }

    .site-nav .links a {
        font-size: 15px;
    }
}

@media print {
    .name-glow-anchor::before {
        display: none;
    }

    body.inner-page > .page-content,
    body.inner-page > .cv-page {
        animation: none;
    }
}
