/* Jim Boerkoel's homepage. One stylesheet, no frameworks.
   1. Tokens   2. Base   3. Layout & utilities (the small subset of Bootstrap class names the pages use)
   4. Components (buttons, cards, navbar, header, dialogs)   5. Page sections
   Colors and sizes come from the tokens below; heatlab.org uses the same names. */

/* ========================================================================== 1. Tokens */
:root {
    --gold: #fdb913;          /* HMC gold: buttons, accents */
    --gold-dark: #8a6400;     /* gold for text and links: 5:1 on white */
    --gold-hover: #d99c0d;
    --gold-tint: #fff7df;
    --ink: #212529;
    --muted: #595c5f;
    --soft: #495057;          /* body copy inside cards */
    --line: #e4e6ea;
    --band: #f8f9fa;          /* light section background */
    --card: #fff;
    --page: #fff;
    --dark: #212529;          /* navbar, footer */
    --p4p-navy: #003973;      /* plan4planet.org */
    --p4p-green: #3f8a46;
    --p4p-green-light: #7fc486;
    --teal: #0081a2;
    --on-gold: #212529;       /* text on gold and on white pills: stays dark in both modes */
    --chip: #f3f4f6;          /* quiet pill / chip background */
    --chip-line: #ced4da;
    --gray: #6c757d;          /* small labels, outline buttons */
    --p4p-text: #003973;      /* Plan4Planet navy when used as text */
    --tint-green: #eef7ec;
    color-scheme: light;
    --radius: 12px;
    --radius-sm: .375rem;
    --shadow: 0 2px 14px rgba(0, 0, 0, .07);
    --shadow-hover: 0 6px 18px rgba(0, 0, 0, .08);
    --font-body: 'Roboto Slab', Georgia, serif;
    --font-head: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ========================================================================== 2. Base */
*, *::before, *::after { box-sizing: border-box; }
/* No sideways wobble on phones: iOS ignores overflow-x on body alone, and "clip" doesn't create a scroll box */
html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
body { margin: 0; overflow-x: hidden; overflow-x: clip; font: 1rem/1.5 var(--font-body); color: var(--ink); background: var(--page);
    -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: var(--gold); }
h1, h2, h3, h4, h5, h6, .h5 { margin: 0 0 .5rem; font-family: var(--font-head); font-weight: 700; line-height: 1.2; text-transform: uppercase; }
h1 { font-size: calc(1.375rem + 1.5vw); } h2 { font-size: calc(1.325rem + .9vw); } h3 { font-size: calc(1.3rem + .6vw); }
h4 { font-size: calc(1.275rem + .3vw); } h5, .h5 { font-size: 1.25rem; } h6 { font-size: 1rem; }
@media (min-width: 1200px) { h1 { font-size: 2.5rem; } h2 { font-size: 2rem; } h3 { font-size: 1.75rem; } h4 { font-size: 1.5rem; } }
.h5 { font-weight: 500; }   /* the class keeps Bootstrap's medium weight even on an h3 */
hr { margin: 1rem 0; color: inherit; border: 0; border-top: 1px solid; opacity: .25; }
p { margin: 0 0 1rem; font-size: 14px; line-height: 1.75; }
ul, ol { margin: 0 0 1rem; padding-left: 2rem; }
ul ul, ol ol { margin-bottom: 0; }
b, strong { font-weight: bolder; }
small, .small { font-size: .875em; }
a { color: var(--gold-dark); transition: color .2s ease-in-out; }
a:hover, a:focus, a:active { color: var(--ink); }
img, svg { vertical-align: middle; }
button { font: inherit; border-radius: 0; }
button:not(:disabled), [type="button"]:not(:disabled) { cursor: pointer; }
input, button, textarea { margin: 0; }
iframe { border: 0; }
pre { display: block; margin: 0 0 1rem; overflow: auto; font-size: .875em; font-family: SFMono-Regular, Menlo, Consolas, monospace; }
summary { display: list-item; cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--gold); text-shadow: none; }
img::selection { background: transparent; }
.lead { font-size: 1.25rem; font-weight: 300; }
.display-3 { font-size: calc(1.525rem + 3.3vw); font-weight: 300; line-height: 1.2; }
@media (min-width: 1200px) { .display-3 { font-size: 4rem; } }
.fs-4 { font-size: calc(1.275rem + .3vw); } .fs-5 { font-size: 1.25rem; }
@media (min-width: 1200px) { .fs-4 { font-size: 1.5rem; } }
.text-muted { color: var(--muted); }

/* ========================================================================== 3. Layout & utilities */
.container { width: 100%; margin: 0 auto; padding: 0 .75rem; }
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.row { --gx: 1.5rem; --gy: 0px; display: flex; flex-wrap: wrap; margin: calc(-1 * var(--gy)) calc(-.5 * var(--gx)) 0; }
.row > * { flex-shrink: 0; width: 100%; max-width: 100%; padding: 0 calc(.5 * var(--gx)); margin-top: var(--gy); }
.g-0 { --gx: 0px; --gy: 0px; } .g-3 { --gx: 1rem; --gy: 1rem; } .g-4 { --gx: 1.5rem; --gy: 1.5rem; } .gx-5 { --gx: 3rem; }
.col-6 { flex: 0 0 auto; width: 50%; } .col-12 { flex: 0 0 auto; width: 100%; }
@media (min-width: 576px) { .col-sm-6 { flex: 0 0 auto; width: 50%; } }
/* Utilities win over component rules, as in Bootstrap; the 0–5 scale is 0, .25, .5, 1, 1.5, 3rem. */
.d-none { display: none !important; } .d-flex { display: flex !important; }
.flex-column { flex-direction: column !important; } .flex-wrap { flex-wrap: wrap !important; } .flex-grow-1 { flex-grow: 1 !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; } .justify-content-between { justify-content: space-between !important; }
.gap-2 { gap: .5rem !important; }
.text-center { text-align: center !important; } .text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; } .text-nowrap { white-space: nowrap !important; }
.text-white { color: #fff !important; } .text-success { color: #198754 !important; } .fw-bold { font-weight: 700 !important; }
.bg-dark { background-color: var(--dark) !important; } .bg-light { background-color: var(--band) !important; }
.bg-secondary { background-color: #6c757d !important; }
.border { border: 1px solid var(--line) !important; } .border-0 { border: 0 !important; }
.border-bottom { border-bottom: 1px solid var(--line) !important; }
.rounded { border-radius: var(--radius-sm) !important; }
.shadow-sm { box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important; }
.img-fluid { max-width: 100%; height: auto; }
.fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; }
.m-0 { margin: 0 !important; } .mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mx-1 { margin-left: .25rem !important; margin-right: .25rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; } .my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
.mt-1 { margin-top: .25rem !important; } .mt-2 { margin-top: .5rem !important; } .mt-4 { margin-top: 1.5rem !important; } .mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: .5rem !important; } .mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; } .mb-5 { margin-bottom: 3rem !important; }
.me-1 { margin-right: .25rem !important; } .me-2 { margin-right: .5rem !important; } .me-auto { margin-right: auto !important; }
.ms-1 { margin-left: .25rem !important; } .ms-2 { margin-left: .5rem !important; } .ms-3 { margin-left: 1rem !important; } .ms-auto { margin-left: auto !important; }
.p-0 { padding: 0 !important; } .p-3 { padding: 1rem !important; } .p-4 { padding: 1.5rem !important; }
.px-2 { padding-left: .5rem !important; padding-right: .5rem !important; } .ps-3 { padding-left: 1rem !important; }
.pb-2 { padding-bottom: .5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; } .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* Screen-size versions come last so they win over the plain utilities above */
@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 auto; width: 25%; } .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.6667%; } .col-md-9 { flex: 0 0 auto; width: 75%; }
    .text-md-start { text-align: left !important; }
}
@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 auto; width: 25%; } .col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; } .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
    .text-lg-start { text-align: left !important; } .text-lg-end { text-align: right !important; }
    .d-lg-none { display: none !important; } .d-lg-flex { display: flex !important; }
    .mb-lg-0 { margin-bottom: 0 !important; } .py-lg-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
}

/* ========================================================================== 4. Components */
/* Buttons */
.btn { display: inline-block; padding: .375rem .75rem; font-size: 1rem; font-weight: 400; line-height: 1.5; color: var(--ink); text-align: center;
    text-decoration: none; vertical-align: middle; user-select: none; background: transparent; border: 1px solid transparent;
    border-radius: var(--radius-sm); transition: color .15s, background-color .15s, border-color .15s; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .25rem; }
.btn-primary, .btn-xl { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
.btn-primary:hover, .btn-primary:focus, .btn-xl:hover, .btn-xl:focus { color: #000; background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-xl { padding: 20px 40px; border-radius: 3px; }
.btn-outline-secondary { color: var(--gray); border-color: var(--gray); }
.btn-outline-secondary:hover { color: #fff; background: var(--gray); }
.btn-outline-danger { color: #dc3545; border-color: #dc3545; }
.btn-outline-danger:hover { color: #fff; background: #dc3545; }
.btn-outline-dark { color: var(--ink); border-color: var(--ink); }
.btn-outline-dark:hover { color: var(--page); background: var(--ink); }
.btn-outline-light { color: #f8f9fa; border-color: #f8f9fa; }
.btn-outline-light:hover { color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
.btn-group { display: inline-flex; vertical-align: middle; }
.btn-group > .btn:not(:first-of-type) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group > .btn:not(:last-of-type) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-check { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; }
.btn-check:checked + .btn-outline-secondary { color: #fff; background: var(--gray); }
.btn-close { box-sizing: content-box; width: 1em; height: 1em; padding: .25em; border: 0; border-radius: var(--radius-sm); opacity: .5;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat; }
.btn-close:hover { opacity: .75; }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* Cards */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.card-body { flex: 1 1 auto; padding: 1rem; }
.news-card { font-size: .95rem; }

/* Icons: inline SVG symbols from img/icons.svg */
.icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; fill: currentColor; overflow: visible; }
.icon-xs { width: .75em; height: .75em; vertical-align: 0; }
.icon-heatlab { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.3em; background-color: currentColor;
    -webkit-mask: url('../img/logos/HEATlab_robot_white.png') center / contain no-repeat; mask: url('../img/logos/HEATlab_robot_white.png') center / contain no-repeat; }

/* Navbar, with the HMC logo hanging below it at the top of the page and shrinking once scrolled */
#mainNav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: .25rem 0;
    transition: padding .35s cubic-bezier(.4, 0, .2, 1); }
#mainNav > .container { display: flex; flex-wrap: inherit; align-items: center; justify-content: space-between; overflow: visible; }
#mainNav .navbar-brand { position: relative; display: flex; align-items: center; height: 32px; margin-right: 2rem; padding: 0; overflow: visible; }
#mainNav .navbar-brand::after { content: ""; display: inline-block; width: 140px; height: 1px; }
#mainNav .navbar-brand img { position: absolute; top: 0; left: 0; z-index: 1050; height: 40px; width: auto; max-width: none;
    transform-origin: top left; transition: transform .35s cubic-bezier(.4, 0, .2, 1), filter .35s cubic-bezier(.4, 0, .2, 1); }
#mainNav:not(.navbar-shrink) .navbar-brand img { transform: scale(2.875); filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35)); }
#mainNav.navbar-shrink .navbar-brand img { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .2)); }
.navbar-toggler { position: relative; z-index: 1060; padding: .25rem .75rem; font-size: 1.25rem; line-height: 1; color: rgba(255, 255, 255, .55);
    background: transparent; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius-sm); }
.navbar-nav { display: flex; flex-direction: column; margin: 0; padding-left: 0; list-style: none; }
.nav-link { display: block; padding: .2rem 0; margin: 0; line-height: 1.2; font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
    color: rgba(255, 255, 255, .55); text-decoration: none; }
.nav-link:hover, .nav-link:focus, .nav-link.active { color: var(--gold); }
.navbar-collapse { flex-basis: 100%; flex-grow: 1; align-items: center; background: var(--dark); padding: 1rem; border-radius: var(--radius-sm); }
.navbar-collapse:not(.show) { display: none; }
.nav-link .p4p-four { color: var(--p4p-green-light); }
@media (min-width: 992px) {
    #mainNav { flex-wrap: nowrap; justify-content: flex-start; }
    .navbar-toggler { display: none; }
    .navbar-nav { flex-direction: row; }
    .nav-link { padding-left: .5rem; padding-right: .5rem; }
    .navbar-collapse, .navbar-collapse:not(.show) { display: flex; flex-basis: auto; }
}

/* Phones and tablets: a smaller hanging logo, and an open menu that starts below it */
@media (max-width: 991.98px) {
    #mainNav:not(.navbar-shrink) .navbar-brand img { transform: scale(1.75); }
    .navbar-collapse { margin-top: 2.25rem; }
    #mainNav.navbar-shrink .navbar-collapse { margin-top: .5rem; }
}

/* Header (masthead): photo, name, buttons */
header.masthead { padding: 5rem 0 2rem; text-align: center; color: #fff;
    background: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .35)), url('../img/header-bg.webp') center / cover no-repeat; }
@media (max-width: 800px) { header.masthead { background-image: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .35)), url('../img/header-bg-800.webp'); } }
header.masthead .container { padding-top: 3rem; padding-bottom: 3rem; }
.intro-text { padding: 1rem 50px .5rem; }
@media (min-width: 768px) { .intro-text { padding-left: 100px; padding-right: 100px; } }
@media (min-width: 992px) { .intro-text { padding-left: 150px; padding-right: 150px; } }
.intro-heading { margin: .2rem 0; font-family: var(--font-head); font-size: 3.2rem; font-weight: 500; font-stretch: condensed;
    letter-spacing: .08em; line-height: 1.1; text-transform: uppercase; text-shadow: #111 0 1px 1px; }
.intro-lead-in, .intro-lead-out { font-family: var(--font-head); font-size: 1.05rem; font-weight: 400; color: rgba(255, 255, 255, .95);
    letter-spacing: .03em; line-height: 1.3; text-shadow: #111 0 1px 1px; }
.intro-lead-in { margin-bottom: .15rem; text-transform: lowercase; }
.intro-lead-out { margin: .15rem 0 1.25rem; }
/* The header's own spacing beats the utility classes on the same elements */
header.masthead { padding: 5rem 0 2rem !important; }
header.masthead .intro-heading { margin: .2rem 0 !important; font-weight: 500 !important; }
header.masthead .intro-lead-in { margin-bottom: .15rem !important; }
header.masthead .intro-lead-out { margin: .15rem 0 1.25rem !important; }
/* Phones: a shorter header, with the name on one line */
@media (max-width: 575px) {
    header.masthead { padding: 4.5rem 0 1.5rem !important; }
    header.masthead .container { padding-top: 1rem; padding-bottom: 1rem; }
    header.masthead .intro-text { margin: 1rem 0 !important; padding: .5rem 0; }
    header.masthead .intro-heading { font-size: clamp(1.9rem, 9vw, 3.2rem); letter-spacing: .04em; }
    header.masthead .btn-xl { padding: 14px 28px; }
}
.text-hmc-gold { color: var(--gold) !important; }

/* Status pills (same shape as heatlab.org's) */
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: .95rem; font-weight: 600; color: var(--on-gold);
    background: #fff; border-radius: 999px; text-decoration: none; }
.status-pill:hover { color: var(--on-gold); background: #fff7df; }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--p4p-green); }
.status-pill-quiet { color: var(--ink); background: var(--chip); border: 1px solid var(--line); vertical-align: middle; }
.status-pill-quiet:hover { color: var(--ink); background: var(--gold-tint); }
.status-pill .dot-grey { background: #9aa1ab; }

/* Section headings */
section h2.section-heading { margin: 0 0 15px; font-size: 40px; }

/* Wordmarks: HEATlab (the logo's robot is the A; a hidden "A" keeps copy/paste reading "HEATlab") and Plan4Planet */
.heat-wordmark, .heat-wordmark:visited { color: var(--ink); font-weight: 700; text-decoration: none; }
.heat-wordmark:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }
.heatbot-a { position: relative; display: inline-block; }
.heatbot-a img { height: 1.6em; width: auto; vertical-align: -.42em; margin: 0 -.06em; }
.heatbot-copy { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.p4p-wordmark, .p4p-wordmark:visited { color: var(--p4p-text); font-weight: 700; text-decoration: none; }
.p4p-wordmark:hover { color: var(--p4p-text); text-decoration: underline; text-decoration-color: var(--p4p-green); }
.p4p-four-dark { color: var(--p4p-green); }

/* Dialogs (native <dialog>): Cite, and the gallery photo viewer */
.site-dialog { width: 100%; max-width: min(92vw, 860px); padding: 0; border: 0; background: transparent; }
.site-dialog::backdrop { background: rgba(20, 22, 26, .65); }
.modal-content { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.modal-header { display: flex; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-header .btn-close { margin-left: auto; }
.modal-title { margin: 0; line-height: 1.5; }
.modal-body { padding: 1rem; }
.modal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); }
#cite-text { max-height: 60vh; overflow-y: auto; }
.lightbox { width: auto; max-width: 96vw; overflow: visible; }
.lightbox img { display: block; max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.lightbox-btn { position: absolute; width: 44px; height: 44px; font-size: 1.8rem; line-height: 1; color: #fff; background: rgba(0, 0, 0, .55); border: 0; border-radius: 50%; }
.lightbox-btn:hover { background: rgba(0, 0, 0, .8); }
.lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-close { right: 10px; top: 10px; font-size: 1.5rem; }

/* ========================================================================== 5. Page sections */
/* Profile card (About) */
.profile-hero { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--gold); }
.profile-photo { display: block; width: 100%; height: 100%; min-height: 320px; max-height: 560px; object-fit: cover; object-position: 50% 30%; }
@media (max-width: 767px) { .profile-photo { max-height: 380px; } }
.profile-body { padding: 2rem 2.25rem; }
@media (max-width: 575px) { .profile-body { padding: 1.5rem 1.25rem; } }
.profile-eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.profile-name { margin: .2rem 0 .3rem; font-size: 2.2rem; }
.profile-roles { margin-bottom: 1rem; font-size: 1rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.profile-bio { font-size: .98rem; line-height: 1.7; color: var(--soft); }
.profile-contact { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: .5rem 0 0; padding: 1rem 0 0; list-style: none;
    font-size: .92rem; color: var(--soft); border-top: 1px solid var(--line); }
.profile-contact .icon { margin-right: .45rem; color: var(--gold-dark); }

/* CV and publication PDF panels (opened by js/site.js) */
#cv-section, #pub-viewer-section { display: none; }
#cv-section.show, #pub-viewer-section.show { display: block; }
#cv-section .card, #pub-viewer-section .card { border: 0; border-radius: 8px; box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15); overflow: hidden; }
#cv-section .card-header, #pub-viewer-section .card-header-goldbg-dark { padding: 1rem; color: #fff; background: var(--dark); }

/* Plan4Planet band (brand colors from plan4planet.org) */
.p4p-band { padding: 3.5rem 0; color: #fff; background: var(--p4p-navy); border-bottom: 4px solid var(--p4p-green); }
.p4p-band p { color: #fff; }
.p4p-logo { max-height: 220px; width: auto; padding: 12px; background: #fff; border-radius: var(--radius); }
.p4p-kicker { font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; }
.p4p-four { color: var(--p4p-green-light); }
.p4p-title { margin: .25rem 0; font-size: 2.1rem; color: #fff; text-transform: uppercase; }
.p4p-tagline { margin-bottom: 1rem; font-size: 1.15rem; font-style: italic; opacity: .9; }
.p4p-meta { margin-bottom: .5rem; font-weight: 600; }
.p4p-body { max-width: 40rem; opacity: .92; }
.p4p-btn { font-weight: 700; color: #fff; background: var(--p4p-green); border: 2px solid var(--p4p-green); }
.p4p-btn:hover { color: #fff; background: #357a3c; border-color: #357a3c; }
.p4p-btn-outline { font-weight: 600; color: #fff; background: transparent; border: 2px solid rgba(255, 255, 255, .7); }
.p4p-btn-outline:hover { color: var(--p4p-navy); background: #fff; }
.p4p-also { margin-top: 1.25rem; padding-top: 1rem; font-size: .95rem; opacity: .9; border-top: 1px solid rgba(255, 255, 255, .2); }
.p4p-also a, .p4p-also a:visited, .p4p-also a:hover { font-weight: 600; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 575px) { .p4p-title { font-size: 1.6rem; } .p4p-band { padding: 2.5rem 0; } .p4p-logo { max-height: 160px; } }

/* Research: HEATlab panel, theme tiles, gallery */
.heat-panel { padding: 2rem; background: var(--card); border-radius: var(--radius); border-top: 4px solid var(--gold); box-shadow: var(--shadow); }
.heat-logo { max-height: 120px; width: auto; }
.heat-eyebrow { margin-bottom: .3rem; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); }
.heat-title { margin-bottom: .3rem; font-size: 1.6rem; }
.heat-lead { font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.heat-note { margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.theme-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 1.25rem; }
@media (max-width: 767px) { .theme-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .theme-tile { gap: 8px; padding: 8px 10px 8px 8px; font-size: .85rem; } .theme-tile img { width: 44px; height: 44px; } }
.theme-tile span { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.theme-tile { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; font-size: .92rem; font-weight: 600; line-height: 1.3;
    color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .2s, transform .2s; }
.theme-tile:hover { color: var(--ink); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.theme-tile img { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.ratio-4x3 { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; }
.ratio-4x3 > * { position: absolute; inset: 0; }
.ratio-4x3 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Alumni */
.alumni-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 1rem; }
@media (max-width: 767px) { .alumni-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .gx-5 { --gx: 1.5rem; } }   /* the alumni list's wide gutter would poke past its card on phones */
.alumni-stat { padding: 14px 16px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.alumni-stat strong { display: block; font-family: var(--font-head); font-size: 1.8rem; line-height: 1.1; color: var(--ink); }
.alumni-stat strong::after { content: ""; display: block; width: 24px; height: 3px; margin: 6px auto 4px; background: var(--gold); }
.alumni-stat span { font-size: .85rem; color: var(--muted); }
.alumni-row { display: flex; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.alumni-row:last-child { border-bottom: 0; }
.alumni-year { flex: 0 0 3.5rem; font-weight: 700; color: var(--ink); }
.alumni-names { line-height: 1.6; }

/* Teaching: course cards */
.course-card { display: flex; flex-direction: column; height: 100%; padding: 1.4rem; color: var(--ink); text-decoration: none; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .2s, transform .2s; }
.course-card:hover { color: var(--ink); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.course-code { align-self: flex-start; margin-bottom: .75rem; padding: 3px 10px; font-family: var(--font-head); font-size: .85rem; font-weight: 700;
    letter-spacing: .04em; color: var(--gold); background: var(--dark); border-radius: 999px; }
.course-title { margin-bottom: .5rem; font-size: 1.1rem; }
.course-desc { flex-grow: 1; font-size: .92rem; color: var(--soft); }
.course-meta { margin-bottom: .5rem; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.course-link { font-size: .9rem; font-weight: 600; color: var(--gold-dark); }
.course-card:hover .course-link { color: var(--ink); }

/* Community building */
.community-section { border-top: 1px solid var(--line); }
.community-card { display: flex; flex-direction: column; height: 100%; padding: 1.6rem; background: var(--card); border-radius: var(--radius);
    border-top: 4px solid var(--gold); box-shadow: var(--shadow); }
.community-card p { font-size: .95rem; color: var(--soft); }
.community-uc { border-top-color: var(--teal); }
.community-p4p { border-top-color: var(--p4p-green); }
.community-head { display: flex; align-items: center; gap: 14px; margin-bottom: 1rem; }
.community-logo { flex: none; width: 56px; height: 56px; object-fit: contain; }
.community-role { margin-bottom: .3rem; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.community-title { margin-bottom: 0; font-size: 1.35rem; }
.community-p4p .community-title { color: var(--p4p-text); }
.community-sub { font-size: .85rem; color: var(--muted); }
.community-list { margin-bottom: 1rem; padding-left: 1.1rem; font-size: .95rem; color: var(--soft); }
.community-list li { margin-bottom: .35rem; }
.community-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: auto; font-size: .9rem; font-weight: 600; }

/* In the news: press cards, collapsed behind a summary pill */
.press-details { margin-top: 1.25rem; }
.press-details > summary { display: inline-flex; align-items: center; gap: .4rem; padding: 6px 14px; font-size: .9rem; font-weight: 700; color: var(--ink);
    list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.press-details > summary::-webkit-details-marker { display: none; }
.press-details > summary::before { content: "\25B8"; color: var(--gold-dark); transition: transform .2s; }
.press-details[open] > summary::before { transform: rotate(90deg); }
.press-details > summary:hover { background: var(--gold-tint); }
.press-summary-outlet { font-weight: 400; color: var(--muted); }
.press-card { display: flex; align-items: center; margin-top: .75rem; overflow: hidden; color: var(--ink); text-decoration: none; background: var(--card);
    border: 1px solid var(--line); border-left: 4px solid #d8202a; border-radius: var(--radius); transition: box-shadow .2s; }
.press-card:hover { color: var(--ink); box-shadow: var(--shadow-hover); }
.press-photo, .press-logo-tile { flex: none; align-self: center; width: 220px; height: 170px; }
.press-photo { object-fit: cover; object-position: 50% 30%; }
.press-logo-tile { display: flex; align-items: center; justify-content: center; background: var(--dark); }
.press-logo-tile img { width: 84px; height: auto; }
.press-body { padding: 1.4rem 1.6rem; }
.press-meta { margin-bottom: .4rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.press-badge { display: inline-block; margin-right: .4rem; padding: 2px 8px; font-family: var(--font-head); font-weight: 700; letter-spacing: .02em;
    text-transform: none; color: #fff; background: #d8202a; border-radius: 4px; }
.press-title { margin-bottom: .5rem; font-size: 1.3rem; }
.press-quote { margin-bottom: .6rem; font-style: italic; color: var(--soft); }
.press-link { font-weight: 600; color: var(--gold-dark); }
.press-card:hover .press-link { color: var(--ink); }
.press-forbes { border-left-color: #111; }
.press-badge-forbes { font-family: Georgia, 'Times New Roman', serif; background: #111; }
.press-forbes .press-quote { font-style: normal; }
.press-bi { border-left-color: #1a3d8f; }
.press-badge-bi { background: #1a3d8f; }
@media (max-width: 575px) { .press-card { flex-direction: column; } .press-photo { width: 100%; height: 200px; } .press-logo-tile { width: 100%; height: 140px; } }

/* Publications: selected list, filters (Type / Topic chips) */
.pub-filter-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.pub-filter-label { margin-right: .25rem; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gray); }
.pub-filter { padding: .2rem .75rem; color: var(--ink); background: var(--card); border: 1px solid var(--chip-line); border-radius: 999px; }
.pub-filter:hover { border-color: var(--gold); }
.pub-filter.active { font-weight: 700; color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
.pub-count { font-size: .75rem; color: var(--gray); }
.pub-filter.active .pub-count { color: var(--on-gold); }
.pub-filter-status { min-height: 1.2em; text-align: center; }

/* Footer */
.footer { color: #fff; }

/* ========================================================================== Dark mode
   Follows the visitor's system setting. Brand colors (HMC gold, the Plan4Planet band, press badges) stay;
   surfaces and text flip, links switch to bright gold, and logos drawn in black get a light tile. */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --page: #15171a;
        --band: #1c1f23;
        --card: #23272c;
        --ink: #e8eaed;
        --muted: #a7adb5;
        --soft: #c6cbd1;
        --gray: #a7adb5;
        --line: #353b42;
        --chip: #2b3036;
        --chip-line: #4a5058;
        --dark: #0e1012;
        --gold-dark: #fdb913;          /* links and gold text: bright gold reads well on dark */
        --gold-tint: rgba(253, 185, 19, .14);
        --p4p-text: #8fbcef;
        --tint-green: rgba(63, 138, 70, .16);
        --shadow: 0 2px 14px rgba(0, 0, 0, .45);
        --shadow-hover: 0 6px 18px rgba(0, 0, 0, .55);
    }
    a:hover, a:focus { color: #fff; }
    .bg-secondary { background-color: #2b3036 !important; }
    .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
    .btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }
    /* Logos drawn in black: keep them on a light tile */
    /* the robot A and the HEATlab logo swap to their dark versions (img/logos/*-dark.svg) via <picture> */
    .community-logo { padding: 4px; background: #fff; border-radius: 10px; }
    .theme-tile img { background: #fff; }
    .press-forbes { border-left-color: #8a8f96; }
    .profile-photo, .press-photo, .ratio-4x3 img { filter: brightness(.94); }
}

/* Award tag on a publication (same look as heatlab.org) */
.pub-award { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; font-size: .82rem; font-weight: 700;
    color: #6b4e00; background: #fff4cc; border: 1px solid #f3dc8a; border-radius: 999px; }

/* Education & Experience timeline; Research Interests as topic links */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-years { font-family: var(--font-head); font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: var(--gold-dark); white-space: nowrap; padding-top: .1rem; }
@media (max-width: 575px) { .timeline li { grid-template-columns: 1fr; gap: 0; } }
.interest-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.interest-chip { padding: .3rem .8rem; font-size: .9rem; color: var(--ink); text-decoration: none; background: var(--chip); border: 1px solid var(--line); border-radius: 999px; transition: background .15s, border-color .15s; }
.interest-chip:hover { color: var(--ink); background: var(--gold-tint); border-color: var(--gold); }
.interest-note { margin-top: .75rem; font-size: .8rem; color: var(--muted); }
