@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Playfair Display";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/playfair-display-latin-wght-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Playfair Display";
    font-style: italic;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/playfair-display-latin-wght-italic.woff2") format("woff2");
}

:root {
    --sidebar-w: 18rem;
    --gutter: clamp(1.25rem, 5vw, 3.5rem);

    --navy: #0C1A2A;
    --gold: #C6A15B;
    --gold-hover: #D4B270;
    --gold-text: #86672A;
    --gold-soft: rgba(198, 161, 91, 0.14);
    --gold-line: rgba(198, 161, 91, 0.4);

    --bg: #FBFAF7;
    --bg-alt: #F4F0E7;
    --surface: #FFFFFF;
    --surface-2: #F4F1EA;
    --ink: #0C1A2A;
    --text: #3D4B57;
    --muted: #5F6B76;
    --line: #E6E0D3;
    --line-strong: #CFC6B2;
    --fab-bg: #0C1A2A;

    --shadow-sm: 0 1px 2px rgba(12, 26, 42, 0.05), 0 4px 14px rgba(12, 26, 42, 0.06);
    --shadow-md: 0 12px 32px rgba(12, 26, 42, 0.12);

    --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

    color-scheme: light;
}

html[data-theme="dark"] {
    --gold: #D2AF6D;
    --gold-hover: #DEBD7C;
    --gold-text: #D9B876;
    --gold-soft: rgba(210, 175, 109, 0.12);
    --gold-line: rgba(210, 175, 109, 0.35);

    --bg: #0B141E;
    --bg-alt: #0E1925;
    --surface: #13202E;
    --surface-2: #1B2A3A;
    --ink: #EEF2F6;
    --text: #C3CDD7;
    --muted: #8FA0B0;
    --line: #22344A;
    --line-strong: #34495F;
    --fab-bg: #1B2A3A;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);

    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 1rem/1.65 var(--font-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
picture,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
    -webkit-user-drag: none;
    user-select: none;
}

a {
    color: var(--gold-text);
    text-decoration: none;
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.15;
}

p,
ul,
ol,
dl,
dd,
figure,
blockquote {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
}

code {
    font-family: ui-monospace, "Cascadia Code", Consolas, "DejaVu Sans Mono", monospace;
    font-size: 0.9em;
}

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

.sidebar :focus-visible,
.hero :focus-visible {
    outline-color: var(--gold);
}

::selection {
    background: var(--gold);
    color: var(--navy);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    transform: translateY(-200%);
    transition: transform 0.2s;
}

.skip-link:focus {
    transform: none;
    text-decoration: none;
}

.icon {
    flex: none;
    width: 1em;
    height: 1em;
}

.container {
    width: min(100% - 2 * var(--gutter), 72rem);
    margin-inline: auto;
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--gold-text);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.lead {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0 1.6rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background-color 0.25s, border-color 0.25s, color 0.25s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.btn .icon {
    font-size: 1.1em;
}

.btn-primary {
    background: var(--gold);
    color: var(--navy);
    box-shadow: 0 10px 24px rgba(198, 161, 91, 0.28);
}

.btn-primary:hover {
    background: var(--gold-hover);
    box-shadow: 0 14px 30px rgba(198, 161, 91, 0.36);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    border-color: var(--gold);
    background: var(--gold-soft);
}

.btn-on-dark {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.btn-on-dark:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-small {
    min-height: 2.5rem;
    padding: 0 1.1rem;
    font-size: 0.75rem;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.icon-button:hover {
    border-color: var(--gold);
    background: var(--gold-soft);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-w);
    max-width: 100%;
    overflow-y: auto;
    background: linear-gradient(180deg, #0D1C2E 0%, #0A1521 100%);
    color: #C8D2DC;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s, visibility 0s 0.35s;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    padding: 3.5rem 1.5rem 2rem;
    text-align: center;
}

.sidebar-portrait img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(198, 161, 91, 0.55);
    box-shadow: 0 0 0 7px rgba(198, 161, 91, 0.12);
}

.sidebar-name {
    margin-top: 1.25rem;
    color: #fff;
    font: 600 1.375rem/1.2 var(--font-display);
    letter-spacing: 0.01em;
}

.sidebar-role {
    margin-top: 0.45rem;
    color: #8E9DAD;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-nav {
    width: 100%;
    margin-top: 2.25rem;
}

.site-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.site-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.9rem 0.6rem 2.4rem;
    border-radius: 0.6rem;
    color: #9AAABB;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: left;
    transition: color 0.2s, background-color 0.2s;
}

.site-nav a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0.75rem;
    width: 2px;
    height: 0;
    background: var(--gold);
    transform: translateY(-50%);
    transition: height 0.3s var(--ease-out);
}

.site-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.site-nav a.is-active {
    color: #fff;
}

.site-nav a.is-active::before {
    height: 1.1em;
}

.nav-index {
    color: #5E6F80;
    font: italic 500 0.85rem/1 var(--font-display);
    transition: color 0.2s;
}

.site-nav a:hover .nav-index,
.site-nav a.is-active .nav-index {
    color: var(--gold);
}

.sidebar-social {
    display: flex;
    gap: 0.6rem;
    margin-top: 2rem;
}

.sidebar-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #C8D2DC;
    font-size: 1rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.sidebar-social a:hover {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--navy);
}

.sidebar-clock {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 2rem;
    color: #7E8C9A;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.sidebar-clock .icon {
    color: var(--gold);
}

.sidebar-clock-value {
    color: #C8D2DC;
    font-variant-numeric: tabular-nums;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(6, 12, 20, 0.55);
    backdrop-filter: blur(2px);
}

.nav-toggle {
    position: fixed;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--gold-line);
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.nav-toggle-close,
html.nav-open .nav-toggle-open {
    display: none;
}

html.nav-open .nav-toggle-close {
    display: block;
}

html.nav-open {
    overflow: hidden;
}

html.nav-open .sidebar {
    transform: none;
    visibility: visible;
    box-shadow: var(--shadow-md);
    transition-delay: 0s;
}

.site-main {
    flex: 1 0 auto;
    min-width: 0;
}

.site-footer {
    padding: 2rem var(--gutter);
    background: var(--navy);
    color: #7E8C9A;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
}

@media (min-width: 64em) {
    .nav-toggle,
    .sidebar-backdrop {
        display: none;
    }

    .sidebar {
        transform: none;
        visibility: visible;
    }

    .site-main,
    .site-footer {
        margin-left: var(--sidebar-w);
    }
}

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 6rem var(--gutter);
    overflow: hidden;
    background: var(--navy);
    color: #fff;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.06);
    animation: hero-drift 32s ease-in-out infinite alternate;
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12, 26, 42, 0.4) 0%, rgba(12, 26, 42, 0.55) 55%, rgba(12, 26, 42, 0.9) 100%);
}

@keyframes hero-drift {
    from {
        transform: scale(1.06) translate3d(0, 0, 0);
    }

    to {
        transform: scale(1.12) translate3d(-1%, -1.5%, 0);
    }
}

.hero-content {
    max-width: 52rem;
    animation: hero-in 1.1s var(--ease-out) both;
}

@keyframes hero-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

.hero-content::before {
    content: "";
    display: block;
    width: 3.5rem;
    height: 2px;
    margin: 0 auto 1.75rem;
    background: var(--gold);
}

.hero h1 {
    color: #fff;
    font: 600 clamp(2.5rem, 4.6vw, 4.75rem)/1.05 var(--font-display);
    letter-spacing: 0.005em;
    text-wrap: balance;
    text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
}

@media (min-width: 64em) {
    .hero h1 {
        white-space: nowrap;
    }
}

.hero-role {
    min-height: 1.6em;
    margin-top: 1.4rem;
    color: var(--gold);
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.typewriter::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 0.2em;
    vertical-align: -0.12em;
    background: currentColor;
}

.typewriter.is-typing::after {
    animation: caret 1s steps(1, end) infinite;
}

@keyframes caret {
    50% {
        opacity: 0;
    }
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.875rem;
    margin-top: 2.5rem;
}

.hero-hint {
    margin-top: 2.25rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
}

.hero-hint kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 0.05em 0.45em;
    border: 1px solid var(--gold-line);
    border-radius: 0.3em;
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold);
    font: 600 0.95em var(--font-text);
}

.hero-scroll {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    transform: translateX(-50%);
    animation: nudge 2.4s ease-in-out infinite;
    transition: color 0.2s, border-color 0.2s;
}

.hero-scroll:hover {
    color: #fff;
    border-color: #fff;
    text-decoration: none;
}

@keyframes nudge {
    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, 6px);
    }
}

.section {
    padding-block: clamp(4.5rem, 9vw, 7.5rem);
}

.section-alt {
    background: var(--bg-alt);
}

.section-head {
    max-width: 46rem;
    margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.section-head h2 {
    font: 600 clamp(2rem, 3.6vw, 2.75rem)/1.1 var(--font-display);
    letter-spacing: -0.005em;
}

.section-head h2::after {
    content: "";
    display: block;
    width: 3.25rem;
    height: 2px;
    margin-top: 1.1rem;
    background: var(--gold);
}

.section-intro {
    margin-top: 1.4rem;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.about-grid {
    display: grid;
    gap: 2.5rem;
}

.about-portrait {
    max-width: 22rem;
}

.about-portrait img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

@media (min-width: 52em) {
    .about-grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
        gap: clamp(2.5rem, 5vw, 4.5rem);
        align-items: start;
    }

    .about-portrait {
        max-width: none;
    }
}

.about-title {
    font: 600 1.5rem/1.2 var(--font-display);
}

.about-role {
    margin-top: 0.75rem;
    color: var(--muted);
    font-style: italic;
}

.about-body .lead {
    margin-top: 1rem;
}

.about-body {
    scroll-margin-top: 8rem;
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.9rem 2rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.facts div {
    display: grid;
    gap: 0.1rem;
}

.facts dt {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.facts dd {
    color: var(--ink);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.facts + p {
    margin-top: 1.5rem;
}

.skill-groups {
    display: grid;
    gap: 1.75rem;
}

.skill-group {
    display: grid;
    gap: 0.9rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

@media (min-width: 48em) {
    .skill-group {
        grid-template-columns: 12rem minmax(0, 1fr);
        gap: 1rem 2rem;
        align-items: start;
    }
}

.skill-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.55rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.skill-group-title::before {
    content: "";
    width: 1.25rem;
    height: 1px;
    background: var(--gold);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.9rem 0.4rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}

.chip:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
}

/* A light tile keeps dark logos readable on the dark theme. */
.chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: #F4F1EA;
}

.chip-icon img {
    width: 1.25rem;
    height: 1.25rem;
}

.chip-years {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--gold-text);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.career-grid {
    display: grid;
    gap: 3.5rem;
}

@media (min-width: 60em) {
    .career-grid {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        gap: clamp(3rem, 6vw, 5rem);
        align-items: start;
    }
}

.career-column-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.career-column-title .icon {
    color: var(--gold);
    font-size: 1.1rem;
}

.timeline {
    margin-left: 0.35rem;
    padding-left: 1.75rem;
    border-left: 1px solid var(--line-strong);
}

.timeline-item {
    position: relative;
    padding-bottom: 2.25rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 0.45rem;
    left: calc(-1.75rem - 6px);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px var(--bg);
}

.timeline-period {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--gold-text);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

.timeline-title {
    margin-top: 0.7rem;
    font-size: 1.0625rem;
    line-height: 1.35;
}

.timeline-org {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.timeline-note {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
}

.timeline-bullets {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.85rem;
    padding-left: 1.1rem;
    list-style: disc;
    font-size: 0.9375rem;
}

.timeline-bullets li::marker {
    color: var(--gold);
}

.cv-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
    margin-bottom: clamp(3rem, 6vw, 4.5rem);
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.75rem);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cv-copy h3 {
    font: 600 1.375rem/1.2 var(--font-display);
}

.cv-copy p {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.cv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cv-dialog {
    width: min(72rem, calc(100vw - 2rem));
    height: min(56rem, calc(100vh - 2rem));
    height: min(56rem, calc(100dvh - 2rem));
    margin: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.cv-dialog[open] {
    display: flex;
    flex-direction: column;
}

.cv-dialog::backdrop {
    background: rgba(6, 12, 20, 0.62);
    backdrop-filter: blur(4px);
}

.cv-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem 0.9rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.cv-dialog-head h2 {
    font: 600 1.25rem/1.2 var(--font-display);
}

.cv-dialog-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cv-dialog-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: var(--surface-2);
}

body:has(.cv-dialog[open]) {
    overflow: hidden;
}

.fabs {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--gold-line);
    border-radius: 50%;
    background: var(--fab-bg);
    color: var(--gold);
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease-out), opacity 0.25s, visibility 0.25s;
}

.fab:hover {
    background: var(--gold);
    color: var(--navy);
    text-decoration: none;
}

#back-to-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
}

#back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

/* Gated on html.js so the content stays visible without scripting. */
html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.8s var(--ease-out);
}

html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

.stagger > .reveal:nth-child(2) {
    transition-delay: 60ms;
}

.stagger > .reveal:nth-child(3) {
    transition-delay: 120ms;
}

.stagger > .reveal:nth-child(n + 4) {
    transition-delay: 180ms;
}

.error-page h1 {
    font: 600 clamp(2.25rem, 5vw, 3.5rem)/1.05 var(--font-display);
}

.error-page .lead {
    max-width: 40rem;
    margin-top: 1.25rem;
}

.error-request {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.error-page .btn {
    margin-top: 2rem;
}

[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    html.js .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-bg img {
        transform: none !important;
    }
}

@media print {
    html,
    html[data-theme="dark"] {
        --bg: #fff;
        --bg-alt: #fff;
        --surface: #fff;
        --surface-2: #fff;
        --ink: #000;
        --text: #222;
        --muted: #555;
        --line: #ccc;
        --line-strong: #bbb;
        --gold: #7A5C22;
        --gold-text: #7A5C22;
        --shadow-sm: none;
        --shadow-md: none;
    }

    .sidebar,
    .sidebar-backdrop,
    .nav-toggle,
    .fabs,
    .hero-bg,
    .hero-scroll,
    .hero-hint,
    .hero-actions,
    .cv-actions,
    .cv-dialog,
    .skip-link {
        display: none;
    }

    .site-main,
    .site-footer {
        margin-left: 0;
    }

    .site-footer {
        background: none;
        color: #555;
    }

    .hero {
        min-height: 0;
        padding: 2rem 0;
        background: none;
        color: #000;
        text-align: left;
    }

    .hero h1 {
        color: #000;
        text-shadow: none;
    }

    .hero-content::before {
        margin-left: 0;
    }

    .typewriter::after {
        display: none;
    }

    .section {
        padding-block: 1.5rem;
    }

    .section-alt {
        background: none;
    }

    .about-portrait {
        max-width: 12rem;
    }

    .timeline-item,
    .skill-group,
    .cv-block {
        break-inside: avoid;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    html.js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
