/* =========================================================
   GEOCHEMICAL INFORMATICS
   Edit a palette here, then select it with:
   <html lang="en" class="theme-midnight">

   Available themes:
   theme-midnight | theme-ocean | theme-slate
   theme-forest   | theme-amber | theme-plum
   ========================================================= */

:root,
.theme-midnight {
    color-scheme: dark;
    --bg: #0b1422;
    --surface: #111f31;
    --surface-alt: #17283c;
    --text: #edf5fa;
    --muted: #afc1d0;
    --border: #2a4155;
    --accent: #70e0d2;
    --accent-strong: #a3f4e9;
    --accent-text: #092326;
    --glow: rgba(112, 224, 210, 0.15);
}

.theme-midnight2 {
    color-scheme: dark;
    --bg: #172638;
    --surface: #213449;
    --surface-alt: #2a4057;
    --text: #f2f7fb;
    --muted: #c1d0dc;
    --border: #4a6177;
    --accent: #78e2d5;
    --accent-strong: #aff2e9;
    --accent-text: #102a2b;
    --glow: rgba(120, 226, 213, 0.14);
}

.theme-ocean {
    color-scheme: light;
    --bg: #f3f8fb;
    --surface: #ffffff;
    --surface-alt: #e9f3f8;
    --text: #142c40;
    --muted: #4c6575;
    --border: #cadde7;
    --accent: #087f9f;
    --accent-strong: #065f78;
    --accent-text: #ffffff;
    --glow: rgba(8, 127, 159, 0.11);
}

.theme-slate {
    color-scheme: light;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-alt: #e9edf1;
    --text: #202b36;
    --muted: #586775;
    --border: #d4dce3;
    --accent: #315e89;
    --accent-strong: #254b70;
    --accent-text: #ffffff;
    --glow: rgba(49, 94, 137, 0.11);
}

.theme-forest {
    color-scheme: light;
    --bg: #f3f7f2;
    --surface: #ffffff;
    --surface-alt: #e9f1e9;
    --text: #20382d;
    --muted: #52685b;
    --border: #ccddce;
    --accent: #287552;
    --accent-strong: #205d42;
    --accent-text: #ffffff;
    --glow: rgba(40, 117, 82, 0.12);
}

.theme-amber {
    color-scheme: light;
    --bg: #fbf7f0;
    --surface: #ffffff;
    --surface-alt: #f7ecdc;
    --text: #352a23;
    --muted: #705e50;
    --border: #e7d6bf;
    --accent: #9b581e;
    --accent-strong: #794315;
    --accent-text: #ffffff;
    --glow: rgba(155, 88, 30, 0.12);
}

.theme-amber-2 {
    color-scheme: light;
    --bg: #fffaf0;
    --surface: #ffffff;
    --surface-alt: #fff0d3;
    --text: #352719;
    --muted: #685542;
    --border: #e8cfa4;
    --accent: #a85b0a;
    --accent-strong: #874600;
    --accent-text: #ffffff;
    --glow: rgba(245, 171, 53, 0.22);
}

.theme-plum {
    color-scheme: dark;
    --bg: #191523;
    --surface: #241e31;
    --surface-alt: #30283f;
    --text: #f6f1fa;
    --muted: #c7b9d1;
    --border: #493b58;
    --accent: #e8a8dc;
    --accent-strong: #f6c4ed;
    --accent-text: #301a30;
    --glow: rgba(232, 168, 220, 0.14);
}

/* Base */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
    line-height: 1.65;
}

a {
    color: var(--accent-strong);
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration-thickness: 2px;
}

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

::selection {
    background: var(--accent);
    color: var(--accent-text);
}

h1, h2, h3, p {
    margin-top: 0;
}

h1, h2, h3 {
    line-height: 1.18;
    letter-spacing: -0.035em;
}

h1 {
    font-size: clamp(2.7rem, 4vw, 3.5rem);
}

h2 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
}

h3 {
    font-size: 1.2rem;
}

p {
    max-width: 72ch;
}

.container {
    width: min(1120px, calc(100% - 2.5rem));
    margin-inline: auto;
}

.narrow {
    max-width: 760px;
}

.muted {
    color: var(--muted);
}

.skip-link {
    position: absolute;
    top: -5rem;
    left: 1rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--accent);
    color: var(--accent-text);
}

.skip-link:focus {
    top: 1rem;
}

/* Header and navigation */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 5.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border: 1px solid var(--accent);
    border-radius: 0.7rem;
    background: var(--glow);
    color: var(--accent-strong);
    font-size: 0.83rem;
    letter-spacing: -0.05em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.site-nav a {
    padding: 0.5rem 0.7rem;
    border-radius: 0.45rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.94rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    background: var(--surface-alt);
    color: var(--text);
}

/* Page sections */

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(5rem, 10vw, 9rem) 0;
    background:
            radial-gradient(circle at 85% 30%, var(--glow), transparent 35%),
            var(--bg);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.75fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
}

.hero-photo {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    background: var(--surface);
    box-shadow: 0 24px 70px var(--glow);
}

.hero-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--surface);
}

.hero-photo figcaption {
    padding: 0.8rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.researcher-photo {
    width: min(100%, 300px);
    margin: 0;
}

.researcher-photo img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
}

.about-background-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 350px);
    align-items: start;
    gap: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

.about-portrait {
    margin: 0;
}

.about-portrait img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
}

@media (max-width: 750px) {
    .about-background-intro {
        grid-template-columns: 1fr;
    }

    .about-portrait {
        width: min(100%, 300px);
    }
}

.eyebrow {
    margin-bottom: 1rem;
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-lead,
.page-lead {
    color: var(--muted);
    font-size: clamp(1.12rem, 1.8vw, 1.35rem);
}

.hero h1,
.page-intro h1 {
    margin-bottom: 1.4rem;
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.7rem 1.15rem;
    border: 1px solid var(--accent);
    border-radius: 0.55rem;
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
}

.button:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

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

.diagram {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    background: var(--surface);
    box-shadow: 0 24px 70px var(--glow);
}

.diagram-label {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.diagram-step {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--surface-alt);
}

.diagram-step strong {
    display: block;
}

.diagram-step span {
    color: var(--muted);
    font-size: 0.9rem;
}

.diagram-arrow {
    color: var(--accent-strong);
    text-align: center;
    line-height: 1;
}

.section {
    padding: clamp(3.5rem, 7vw, 6rem) 0;
}

.research-project-section {
    padding-top: 1.5rem;
}

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

.section-heading {
    margin-bottom: 2rem;
}

.section-heading p {
    color: var(--muted);
}

.page-intro {
    padding: clamp(4rem, 8vw, 7rem) 0 3rem;
}

.page-intro h1 {
    max-width: 16ch;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    padding: 1.6rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--surface);
}

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

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

.card .eyebrow {
    font-size: 0.73rem;
}

.card-link {
    display: inline-block;
    margin-top: 0.6rem;
    font-weight: 700;
}

/* Existing image styling — leave this as it is */
.card-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: 1.25rem;
    border-radius: 0.55rem;
}

/* Placeholder when a project card has no thumbnail */
.grid.grid-two > .card:not(:has(> .card-thumbnail))::before {
    content: "";
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 1.25rem;
    border-radius: 0.55rem;
    background:
            radial-gradient(circle at 75% 25%, var(--glow), transparent 55%),
            linear-gradient(135deg, var(--surface-alt), var(--bg));
}

.callout {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0.8rem;
    background: var(--surface);
}

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

.prose > * + * {
    margin-top: 1.4rem;
}

.prose h2 {
    margin-top: 2.7rem;
}

.prose .content-figure {
    width: 100%;
    max-width: 100%;
    margin: 2rem auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--surface);
}

.prose .content-figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.prose .content-figure figcaption {
    padding: 0.8rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.meta {
    color: var(--muted);
    font-size: 0.94rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 3rem;
    padding: 0;
    list-style: none;
}

.tag-list li {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface-alt);
    font-size: 0.84rem;
}

.publication-list {
    padding-left: 1.4rem;
}

.publication-list li {
    margin-bottom: 1.4rem;
    padding-left: 0.35rem;
}

.publication-list li::marker {
    color: var(--accent-strong);
}

.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
}

.site-footer p {
    margin: 0;
}

.footer-copyright {
    flex-basis: 100%;
    max-width: none;
}

@media (max-width: 850px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 1rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .diagram {
        max-width: 550px;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .container {
        width: min(100% - 2rem, 1120px);
    }

    .site-nav {
        gap: 0.15rem;
    }

    .site-nav a {
        padding: 0.35rem 0.5rem;
        font-size: 0.88rem;
    }

    .grid,
    .grid-two {
        grid-template-columns: 1fr;
    }
}

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

/*The Field subpage*/
.field-intro .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

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

.funding-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin: 1.5rem 0;
}

.funding-logos img {
    display: block;
    max-width: 100%;
    height: auto;
}