:root {
    --navy: #2b4162;
    --navy-dark: #1c2b42;
    --ink: #131c2b;
    --accent: #b83200;
    --link: #124f8c;
    --surface: rgba(248, 249, 250, 0.95);
    --surface-solid: #f8f9fa;
    --surface-soft: #eef1f4;
    --border: rgba(43, 65, 98, 0.55);
    --shadow: 0 1rem 2.5rem rgba(12, 24, 40, 0.22);
    --radius: 0.75rem;
    --content-width: 72rem;
    --reading-width: 72ch;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Arial Narrow", "Franklin Gothic Medium", "Segoe UI", Arial, sans-serif;
}

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 20rem;
    min-height: 100vh;
    color: var(--ink);
    background: var(--surface-soft);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
}

#HomepageBackground {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background-color: #eef2f6;
    background-image: linear-gradient(180deg, #f8fafc 0%, #e8eef4 100%);
}

#HomepageBackground::before {
    position: fixed;
    inset: 0;
    z-index: 1;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(19, 28, 43, 0.08)),
        radial-gradient(circle at 50% 10%, transparent 0%, rgba(43, 65, 98, 0.055) 100%);
}

.homepage-rain-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #f7f8fa;
    pointer-events: none;
    filter: saturate(0.92) contrast(0.98);
}

#HomepageBackground .site-shell {
    position: relative;
    z-index: 2;
}

#HomepageBackground .page-title-panel,
#HomepageBackground .site-nav,
#HomepageBackground .about-card {
    background: rgba(248, 249, 250, 0.93);
    -webkit-backdrop-filter: blur(12px) saturate(112%);
    backdrop-filter: blur(12px) saturate(112%);
}

#ResearchBackground {
    background-color: var(--navy);
    background-image:
        linear-gradient(rgba(19, 28, 43, 0.34), rgba(19, 28, 43, 0.58)),
        url("./Haleakala-2400.jpg");
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
}

#PDEBackground {
    background-color: var(--navy);
    background-image: url("./bore.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#HeatBackground {
    background-color: var(--navy);
    background-image: url("./BackgroundImg3.JPG");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#WaveBackground {
    background-color: var(--navy);
    background-image: url("./BackgroundImg4.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

a {
    color: var(--link);
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.18em;
    overflow-wrap: anywhere;
}

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

a:focus,
button:focus {
    outline: 0.2rem solid #ffbf47;
    outline-offset: 0.2rem;
}

@supports selector(:focus-visible) {
    a:focus:not(:focus-visible),
    button:focus:not(:focus-visible) {
        outline: none;
    }

    a:focus-visible,
    button:focus-visible {
        outline: 0.2rem solid #ffbf47;
        outline-offset: 0.2rem;
    }
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    min-height: 2.75rem;
    border: 0.125rem solid var(--navy);
    border-radius: 0.45rem;
    padding: 0.55rem 0.9rem;
    color: #ffffff;
    background: var(--navy);
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

button:hover {
    background: var(--navy-dark);
}

[hidden] {
    display: none !important;
}

.site-shell {
    width: calc(100% - 2rem);
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 1.25rem 0 4rem;
}

.site-shell--wide {
    max-width: 78rem;
}

.site-header {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.site-nav {
    display: inline-flex;
    justify-self: start;
    width: auto;
    max-width: 100%;
    min-height: 2.75rem;
    overflow: hidden;
    border: 0.125rem solid var(--navy);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 0.45rem 1.2rem rgba(12, 24, 40, 0.16);
}

.site-nav__label {
    display: flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border-right: 0.0625rem solid var(--border);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.015em;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav li + li {
    border-left: 0.0625rem solid var(--border);
}

.site-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 1rem;
    color: var(--ink);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--accent);
    background: #ffffff;
}

.page-title-panel,
.section-title-panel,
.research-intro,
.about-card,
.publication-card,
.cv-document {
    border: 0.125rem solid var(--navy);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.page-title-panel,
.section-title-panel {
    padding: 0.8rem 1.25rem;
}

.page-title-panel--solid {
    background: var(--surface-solid);
}

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

h1,
h2,
h3 {
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.22;
}

h1 {
    margin-bottom: 0;
    font-size: 2.25rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
    text-align: center;
}

h2 {
    font-size: 1.65rem;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
}

h3 {
    font-size: 1.22rem;
    font-size: clamp(1.12rem, 1.7vw, 1.32rem);
}

p {
    margin-bottom: 1rem;
}

.prose > :last-child,
.abstract > :last-child,
.research-intro > :last-child,
.cv-section > :last-child {
    margin-bottom: 0;
}

.about-card {
    overflow: hidden;
}

.about-card > h2 {
    margin: 0;
    padding: 0.8rem 1.25rem;
    border-bottom: 0.125rem solid var(--navy);
    text-align: center;
}

.about-card__body {
    display: grid;
    grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    padding: 1.5rem;
}

.about-card__portrait {
    margin-bottom: 0;
}

.about-card__portrait img {
    width: 100%;
    border: 0.125rem solid var(--navy);
    border-radius: 0.55rem;
    background: #ffffff;
    box-shadow: 0 0.6rem 1.4rem rgba(12, 24, 40, 0.2);
}

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

.prose p:first-child {
    font-weight: 700;
}

.research-intro {
    padding: 1.4rem 1.5rem;
}

.research-intro h1 {
    margin-bottom: 1rem;
}

.research-intro > p {
    max-width: 92ch;
}

.collaborators {
    padding-top: 1rem;
    border-top: 0.0625rem solid var(--border);
}

.publications {
    margin-top: 1.25rem;
}

.section-title-panel {
    margin-bottom: 1rem;
}

.section-title-panel h2 {
    margin: 0;
    text-align: center;
}

.publication-list {
    display: grid;
    gap: 1rem;
}

.publication-card {
    padding: 1.2rem 1.3rem;
}

.publication-heading h3 {
    max-width: 90ch;
    margin-bottom: 0.35rem;
}

.publication-authors {
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.publication-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    font-weight: 700;
}

.abstract-toggle {
    display: none;
}

.js .abstract-toggle {
    display: inline-flex;
    align-items: center;
}

.abstract {
    max-width: 96ch;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 0.0625rem solid var(--border);
}

.js .abstract {
    display: none;
}

.js .abstract.is-open {
    display: block;
}

.cv-body {
    background:
        linear-gradient(180deg, #e9edf2 0, #f7f8fa 28rem, #f7f8fa 100%);
}

.cv-shell {
    max-width: 64rem;
}

.cv-document {
    overflow: hidden;
    background: #ffffff;
}

.cv-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.35rem;
    border-bottom: 0.0625rem solid var(--border);
    background: #f3f5f7;
}

.cv-toolbar p {
    margin: 0;
}

.cv-updated {
    font-size: 0.82rem;
}

.cv-download a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.45rem 0.9rem;
    border: 0.125rem solid var(--navy);
    border-radius: 0.45rem;
    color: #ffffff;
    background: var(--navy);
    font-weight: 700;
    text-decoration: none;
}

.cv-download a:hover,
.cv-download a:focus-visible {
    color: #ffffff;
    background: var(--navy-dark);
}

.cv-section {
    padding: 1.25rem 1.5rem;
}

.cv-section + .cv-section {
    border-top: 0.0625rem solid var(--border);
}

.cv-section h2 {
    margin-bottom: 0.85rem;
}

.cv-section p {
    max-width: 92ch;
}

.cv-list,
.cv-section ol,
.cv-section ul {
    padding-left: 1.45rem;
}

.cv-list {
    margin-top: -0.45rem;
    margin-bottom: 1.35rem;
}

.cv-list li,
.cv-section ol > li,
.cv-section ul > li {
    padding-left: 0.25rem;
}

.cv-list li::marker,
.cv-section ol > li::marker,
.cv-section ul > li::marker {
    color: var(--accent);
    font-weight: 800;
}

.cv-list p,
.cv-section li > p {
    margin-bottom: 0.35rem;
}

.cv-section ol {
    margin-bottom: 0;
}

.cv-numbered-item,
.cv-publication-item {
    margin-bottom: 0.9rem;
}

.cv-publication-item > p {
    font-weight: 700;
}

.cv-publication-item > ul {
    margin-top: 0.25rem;
}

@media (max-width: 44rem) {
    .site-shell {
        width: calc(100% - 1rem);
        padding-top: 0.5rem;
        padding-bottom: 2rem;
    }

    .site-nav {
        display: block;
        justify-self: stretch;
        width: 100%;
    }

    .site-nav__label {
        min-height: 2.75rem;
        border-right: 0;
        border-bottom: 0.0625rem solid var(--border);
    }

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

    .site-nav li + li {
        border-left: 0.0625rem solid var(--border);
    }

    .page-title-panel,
    .section-title-panel,
    .research-intro,
    .publication-card,
    .cv-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .about-card__body {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .about-card__portrait {
        width: 100%;
        max-width: 20rem;
        margin-right: auto;
        margin-left: auto;
    }

    .publication-controls {
        align-items: flex-start;
    }

    .cv-toolbar {
        align-items: flex-start;
    }
}

@media (max-width: 27rem) {
    .site-nav ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-nav li + li {
        border-top: 0;
        border-left: 0.0625rem solid var(--border);
    }

    .site-nav a {
        padding-right: 0.35rem;
        padding-left: 0.35rem;
        font-size: clamp(0.66rem, 3vw, 0.8rem);
        white-space: nowrap;
    }

    h1 {
        font-size: 1.8rem;
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (forced-colors: active) {
    .homepage-rain-canvas,
    #HomepageBackground::before {
        display: none;
    }
}

@media print {
    body,
    #HomepageBackground,
    #ResearchBackground {
        color: #000000;
        background: #ffffff;
    }

    .site-shell,
    .site-shell--wide,
    .cv-shell {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .homepage-rain-canvas,
    #HomepageBackground::before,
    .site-nav,
    .abstract-toggle {
        display: none !important;
    }

    .page-title-panel,
    .section-title-panel,
    .research-intro,
    .about-card,
    .publication-card,
    .cv-document {
        border-color: #777777;
        background: #ffffff;
        box-shadow: none;
    }

    .js .abstract {
        display: block;
    }

    a {
        color: #000000;
    }
}
