/* ==========================================================================
   coreybmoore.com
   Outfit is self-hosted (copied from the Fxplorer build) so the site renders
   without a round trip to Google Fonts.
   ========================================================================== */

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
        U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
        U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
        U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
        U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------- tokens -- */

:root {
    --bg: #fbfcfd;
    --bg-alt: #f2f5f7;
    --surface: #ffffff;
    --surface-2: #f7f9fa;
    --border: #dde5ea;
    --border-strong: #c3d0d8;

    --text: #101820;
    --text-muted: #566875;
    --text-faint: #7d8d99;

    --accent: #0e7490;
    --accent-hover: #0a5a71;
    --accent-soft: #e2f2f6;
    --accent-line: #9fd2dd;

    --shadow-sm: 0 1px 2px rgba(16, 24, 32, .06), 0 1px 3px rgba(16, 24, 32, .04);
    --shadow-md: 0 4px 12px rgba(16, 24, 32, .07), 0 2px 4px rgba(16, 24, 32, .04);
    --shadow-lg: 0 18px 40px rgba(16, 24, 32, .10), 0 4px 12px rgba(16, 24, 32, .05);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    --maxw: 1120px;
    --maxw-prose: 68ch;
    --gutter: 20px;

    --font: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* The explicit [data-theme] rules let the toggle override the OS preference
   in both directions; the media query alone cannot do that. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1116;
        --bg-alt: #0f171d;
        --surface: #131c23;
        --surface-2: #18232b;
        --border: #24333d;
        --border-strong: #354855;

        --text: #e9eff3;
        --text-muted: #9cafbc;
        --text-faint: #7b8d9a;

        --accent: #3fb9c9;
        --accent-hover: #6fd0dd;
        --accent-soft: #102a31;
        --accent-line: #235d6a;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
        --shadow-lg: 0 18px 40px rgba(0, 0, 0, .55);
    }
}

:root[data-theme="dark"] {
    --bg: #0b1116;
    --bg-alt: #0f171d;
    --surface: #131c23;
    --surface-2: #18232b;
    --border: #24333d;
    --border-strong: #354855;

    --text: #e9eff3;
    --text-muted: #9cafbc;
    --text-faint: #7b8d9a;

    --accent: #3fb9c9;
    --accent-hover: #6fd0dd;
    --accent-soft: #102a31;
    --accent-line: #235d6a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, .55);
}

/* ----------------------------------------------------------------- base -- */

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

html {
    scroll-behavior: smooth;
    /* Clears the sticky header when jumping to an anchor. */
    scroll-padding-top: 88px;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 .5em;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -.02em;
}

p {
    margin: 0 0 1.1em;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--accent);
    color: #fff;
    padding: .7rem 1.1rem;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

/* --------------------------------------------------------------- header -- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.site-header.is-stuck {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 68px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: .55rem;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    color: var(--text);
    text-decoration: none;
    margin-right: auto;
}

.brand:hover {
    color: var(--text);
}

.brand .brand-post {
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
}

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

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .93rem;
    font-weight: 500;
    padding: .45rem .7rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.site-nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}

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

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent-line);
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
}

.theme-toggle .icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
        display: block;
    }

    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
        display: none;
    }
}

/* ----------------------------------------------------------------- hero -- */

.hero {
    position: relative;
    padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -30% -10% auto -10%;
    height: 620px;
    background:
        radial-gradient(52% 58% at 22% 32%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 70%),
        radial-gradient(44% 52% at 82% 12%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.1rem;
}

.hero-eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.hero h1 {
    font-size: clamp(2.6rem, 7.5vw, 4.4rem);
    font-weight: 700;
    letter-spacing: -.035em;
    margin-bottom: .35rem;
}

.hero-creds {
    font-size: clamp(.8rem, 2.2vw, .95rem);
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1.5rem;
}

.hero-lede {
    font-size: clamp(1.08rem, 2.6vw, 1.32rem);
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 40ch;
    margin-bottom: 2rem;
}

.hero-lede strong {
    color: var(--text);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

/* Placeholder portrait — swap the inner <img> in when a headshot exists. */
.portrait {
    width: clamp(160px, 26vw, 250px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--surface-2), var(--accent-soft));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portrait .portrait-initials {
    font-size: clamp(2.6rem, 7vw, 4rem);
    font-weight: 300;
    letter-spacing: .02em;
    color: var(--accent);
    opacity: .5;
}

@media (max-width: 760px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .portrait {
        display: none;
    }
}

/* ---------------------------------------------------------------- stats -- */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1rem;
}

.stat {
    background: var(--surface);
    padding: 1.6rem 1.4rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: clamp(1.9rem, 5.2vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.05;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    display: block;
    margin-top: .4rem;
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-note {
    display: block;
    margin-top: .15rem;
    font-size: .73rem;
    color: var(--text-faint);
}

@media (max-width: 620px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .stat {
        padding: 1.15rem 1rem;
        display: flex;
        align-items: baseline;
        justify-content: flex-start;
        gap: .8rem;
        text-align: left;
    }

    .stat-value {
        font-size: 1.7rem;
        min-width: 4.2ch;
    }

    .stat-text {
        display: block;
    }
}

/* -------------------------------------------------------------- buttons -- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1.35rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease,
        color .18s ease, transform .18s ease, box-shadow .18s ease;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-md);
}

/* The dark-theme accent is a light cyan, so white text on it fails contrast.
   Flip the label to near-black instead. The SVG uses currentColor and follows. */
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover {
    color: #06222a;
}

@media (prefers-color-scheme: dark) {

    :root:not([data-theme="light"]) .btn-primary,
    :root:not([data-theme="light"]) .btn-primary:hover {
        color: #06222a;
    }
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface);
}

.btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

/* ------------------------------------------------------------- sections -- */

.section {
    padding: clamp(3rem, 7vw, 5rem) 0;
}

.section-alt {
    background: var(--bg-alt);
    border-block: 1px solid var(--border);
}

.section-head {
    max-width: var(--maxw-prose);
    margin-bottom: 2.4rem;
}

.section-eyebrow {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .6rem;
}

.section-head h2 {
    font-size: clamp(1.7rem, 4.2vw, 2.35rem);
    margin-bottom: .5rem;
}

.section-head p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 0;
}

.prose {
    max-width: var(--maxw-prose);
}

.prose p:last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------- timeline -- */

.timeline {
    display: grid;
    gap: 0;
    max-width: var(--maxw-prose);
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline li {
    position: relative;
    padding: 0 0 1.9rem 2rem;
    border-left: 2px solid var(--border);
}

.timeline li:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: .45rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent-line);
}

.timeline li.is-current::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-when {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .2rem;
    font-variant-numeric: tabular-nums;
}

.timeline-what {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: .15rem;
}

.timeline-where {
    display: block;
    color: var(--text-muted);
    font-size: .95rem;
}

/* --------------------------------------------------------- feature card -- */

.feature {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 4vw, 2.2rem);
    box-shadow: var(--shadow-md);
}

.feature h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: .7rem;
}

.feature p:last-child {
    margin-bottom: 0;
}

.feature-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: .25rem .6rem;
    border-radius: 999px;
    margin-bottom: .9rem;
}

/* --------------------------------------------------------------- cards -- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.15rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

a.card,
.card--link {
    text-decoration: none;
    color: inherit;
}

a.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-line);
    color: inherit;
}

.card-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.02em;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 1rem;
    flex: 0 0 auto;
}

.card h3 {
    font-size: 1.12rem;
    margin-bottom: .1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.card .card-domain {
    font-size: .82rem;
    color: var(--text-faint);
    margin-bottom: .7rem;
    word-break: break-word;
}

.card p {
    font-size: .93rem;
    color: var(--text-muted);
    margin-bottom: 0;
    flex: 1 1 auto;
}

.card-foot {
    margin-top: 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

a.card:hover .card-foot {
    gap: .55rem;
}

.card-foot svg {
    width: 14px;
    height: 14px;
    transition: transform .2s ease;
}

.badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .2rem .5rem;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--text-faint);
    border: 1px solid var(--border);
    vertical-align: middle;
}

.card--muted {
    background: var(--surface-2);
    border-style: dashed;
    box-shadow: none;
}

.card--muted .card-mark {
    background: var(--surface);
    color: var(--text-faint);
}

/* -------------------------------------------------------------- contact -- */

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.75rem, 5vw, 3rem);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.contact-email {
    display: inline-block;
    font-size: clamp(1.05rem, 3.2vw, 1.45rem);
    font-weight: 600;
    letter-spacing: -.01em;
    margin: .3rem 0 1.4rem;
    word-break: break-word;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: center;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
}

.link-chip:hover {
    color: var(--accent);
    border-color: var(--accent-line);
}

.link-chip[aria-disabled="true"] {
    opacity: .55;
    cursor: default;
    pointer-events: none;
}

/* --------------------------------------------------------------- footer -- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    padding: 2.5rem 0;
    font-size: .88rem;
    color: var(--text-faint);
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
}

/* ==========================================================================
   CV page
   ========================================================================== */

.cv-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: start;
    padding-block: clamp(2rem, 5vw, 3.5rem);
}

.cv-toc {
    position: sticky;
    top: 88px;
    font-size: .9rem;
}

.cv-toc h2 {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: .8rem;
}

.cv-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border);
}

.cv-toc a {
    display: block;
    padding: .35rem 0 .35rem .9rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
}

.cv-toc a:hover {
    color: var(--text);
}

.cv-toc a.is-active {
    color: var(--accent);
    font-weight: 600;
    border-left-color: var(--accent);
}

@media (max-width: 900px) {
    .cv-layout {
        grid-template-columns: 1fr;
    }

    .cv-toc {
        position: static;
        display: none;
    }
}

.cv-header {
    padding-bottom: 1.8rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.cv-header h1 {
    font-size: clamp(2rem, 5.5vw, 3rem);
    margin-bottom: .2rem;
}

.cv-header .hero-creds {
    margin-bottom: 1.2rem;
}

.cv-section {
    margin-bottom: 3.2rem;
    scroll-margin-top: 88px;
}

.cv-section > h2 {
    font-size: 1.32rem;
    padding-bottom: .5rem;
    margin-bottom: 1.3rem;
    border-bottom: 2px solid var(--accent-line);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cv-section > h2 .h2-note {
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-faint);
}

/* Two-column "when / what" rows, used for roles and education. */
.cv-entry {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: .4rem 1.4rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border);
}

.cv-entry:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cv-when {
    font-size: .88rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    padding-top: .12rem;
}

.cv-what h3 {
    font-size: 1.06rem;
    margin-bottom: .1rem;
}

.cv-org {
    display: block;
    color: var(--text-muted);
    font-size: .93rem;
    margin-bottom: .6rem;
}

.cv-what ul {
    margin: 0;
    padding-left: 1.15rem;
    font-size: .95rem;
    color: var(--text-muted);
}

.cv-what li {
    margin-bottom: .35rem;
}

.cv-what li::marker {
    color: var(--accent-line);
}

@media (max-width: 640px) {
    .cv-entry {
        grid-template-columns: 1fr;
        gap: .15rem;
    }
}

/* ---------------------------------------------------------------- table -- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    min-width: 520px;
}

table.data th,
table.data td {
    text-align: left;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

table.data thead th {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
    background: var(--surface-2);
    white-space: nowrap;
}

table.data tbody tr:last-child td {
    border-bottom: 0;
}

table.data tfoot td {
    font-weight: 700;
    background: var(--surface-2);
    border-top: 2px solid var(--border-strong);
}

table.data .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --------------------------------------------------------- publications -- */

.pub-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    margin-bottom: 1.4rem;
}

.pub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: pub;
}

.pub {
    position: relative;
    padding: .95rem 0 .95rem 2.6rem;
    border-bottom: 1px solid var(--border);
    font-size: .95rem;
}

.pub:last-child {
    border-bottom: 0;
}

.pub::before {
    counter-increment: pub;
    content: counter(pub);
    position: absolute;
    left: 0;
    top: 1.05rem;
    width: 1.9rem;
    text-align: right;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-faint);
}

.pub-title {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .2rem;
    line-height: 1.4;
}

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

.pub-authors {
    display: block;
    color: var(--text-faint);
    font-size: .86rem;
    line-height: 1.5;
    margin-bottom: .3rem;
}

.pub-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.pub-venue {
    font-style: italic;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .74rem;
    font-weight: 600;
    padding: .13rem .5rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

.chip--cites {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.chip--flag {
    background: transparent;
    border-style: dashed;
}

.pub-note {
    margin: .5rem 0 0;
    padding: .6rem .8rem;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    font-size: .86rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* <details> blocks for the long appendix lists. */
.disclosure {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.disclosure + .disclosure {
    margin-top: .8rem;
}

.disclosure > summary {
    cursor: pointer;
    padding: .95rem 1.2rem;
    font-weight: 600;
    font-size: .98rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    list-style: none;
    user-select: none;
}

.disclosure > summary::-webkit-details-marker {
    display: none;
}

.disclosure > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-right: 2px solid var(--text-faint);
    border-bottom: 2px solid var(--text-faint);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .2s ease;
}

.disclosure[open] > summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}

.disclosure > summary:hover {
    background: var(--surface-2);
    color: var(--accent);
}

.disclosure-body {
    padding: 0 1.2rem 1.1rem;
    border-top: 1px solid var(--border);
}

.disclosure-body > ol,
.disclosure-body > ul {
    margin: 1rem 0 0;
    padding-left: 1.3rem;
    font-size: .91rem;
    color: var(--text-muted);
}

.disclosure-body li {
    margin-bottom: .55rem;
    line-height: 1.55;
}

.disclosure-body li::marker {
    color: var(--text-faint);
}

.summary-count {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-faint);
    margin-left: auto;
    margin-right: .5rem;
}

/* --------------------------------------------------------------- skills -- */

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.skill-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
}

.skill-block h3 {
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: .6rem;
}

.skill-block p {
    margin: 0;
    font-size: .93rem;
    color: var(--text-muted);
}

/* ---------------------------------------------------------------- notes -- */

.callout {
    display: flex;
    gap: .8rem;
    padding: 1rem 1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .89rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.callout svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin-top: .18rem;
    color: var(--text-faint);
}

.callout p {
    margin: 0;
}

.callout p + p {
    margin-top: .5rem;
}

/* ---------------------------------------------------------------- print -- */

@media print {
    :root {
        --bg: #fff;
        --bg-alt: #fff;
        --surface: #fff;
        --surface-2: #fff;
        --text: #000;
        --text-muted: #333;
        --text-faint: #555;
        --accent: #0b5566;
        --border: #bbb;
    }

    .site-header,
    .site-footer,
    .cv-toc,
    .pub-controls,
    .theme-toggle,
    .skip-link,
    .hero::before,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 10.5pt;
        line-height: 1.4;
    }

    .cv-layout {
        grid-template-columns: 1fr;
        padding-block: 0;
    }

    .cv-section {
        margin-bottom: 1.4rem;
        break-inside: avoid;
    }

    .disclosure,
    .card,
    .table-wrap,
    .feature {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }

    /* Force every collapsed appendix open so a printed copy is complete. */
    .disclosure > summary::after {
        display: none;
    }

    .disclosure-body {
        display: block !important;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #555;
        word-break: break-all;
    }
}

/* ==========================================================================
   Landing page — site directory
   ========================================================================== */

.landing-intro {
    padding: clamp(1.25rem, 3.5vw, 2.25rem) 0 clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
}

/* The headshot is a square crop (tools/build-portrait.ps1), so the circle
   masks it without distortion. The 512px intrinsic size is there for 2x
   displays; the layout size is set here. */
.landing-portrait {
    display: block;
    width: clamp(112px, 20vw, 148px);
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
}

.landing-intro h1 {
    font-size: clamp(1.9rem, 5vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -.035em;
    margin-bottom: .25rem;
}

.landing-intro .hero-creds {
    margin-bottom: .8rem;
}

.landing-intro p {
    max-width: 56ch;
    margin-inline: auto;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: clamp(.98rem, 2.2vw, 1.08rem);
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(318px, 1fr));
    gap: 1.25rem;
    padding-bottom: clamp(2rem, 4.5vw, 3rem);
}

.site-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

a.site-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-line);
    color: inherit;
}

/* Each tile is pre-rendered at 1200x460 with its own brand background baked
   in, because the logos need opposite backgrounds: the Fxplorer wordmark is
   white, the Moore Foundation wordmark is black. A theme-reactive background
   would make one of them invisible. The aspect ratio must track the generated
   tile in tools/build-tiles.ps1, or object-fit: cover will crop the marks. */
.site-card-media {
    display: block;
    aspect-ratio: 1200 / 460;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.site-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

a.site-card:hover .site-card-media img {
    transform: scale(1.035);
}

.site-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: .95rem 1.15rem 1.1rem;
}

.site-card-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--text);
    margin-bottom: .1rem;
}

.site-card-title svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: var(--accent);
    opacity: 0;
    transform: translate(-3px, 3px);
    transition: opacity .2s ease, transform .2s ease;
}

a.site-card:hover .site-card-title svg {
    opacity: 1;
    transform: translate(0, 0);
}

.site-card-domain {
    display: block;
    font-size: .84rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: .5rem;
    word-break: break-word;
}

/* Archived products are rendered as div.site-card, not a.site-card, so the
   hover lift and the arrow glyph are already scoped away from them. This
   swaps the accent-coloured domain line for a neutral one, so that nothing
   on the card reads as something you can click. */
.site-card-era {
    display: block;
    font-size: .84rem;
    color: var(--text-faint);
    font-weight: 500;
    margin-bottom: .5rem;
}

/* A rule above the archive block: the two cards below it have no links, and
   the break plus its heading is what explains that before a visitor clicks. */
.landing-archive {
    border-top: 1px solid var(--border);
    padding-top: clamp(2rem, 5vw, 3rem);
}

.site-card-desc {
    display: block;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--text-muted);
    flex: 1 1 auto;
}

@media (max-width: 420px) {
    .site-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
}
