/* =========================================================
   HPS GLOBAL DESIGN LAYER (v3)
   Loaded after every page stylesheet. Colours come from
   hps-tokens.css, so light and dark themes stay in step.

   1. Base & typography       6. Homepage
   2. Theme transition        7. Research map
   3. Header & navigation     8. Shared components
   4. Footer                  9. Motion & reveal
   5. Section headings       10. Responsive
========================================================= */

/* 1. BASE & TYPOGRAPHY ---------------------------------- */

html { background: var(--bg); }

body.hps-ds {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.hps-ds main h1,
.hps-ds main h2,
.hps-ds .hs-title,
.hps-ds .hs-full-carousel-title {
    font-family: var(--font-serif);
    font-optical-sizing: auto;
    font-weight: 500;
    letter-spacing: -0.015em;
}

.hps-ds main h3,
.hps-ds main h4 {
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
}

.hps-ds ::selection { background: rgb(var(--accent-rgb) / .22); }

.hps-ds a:focus-visible,
.hps-ds button:focus-visible,
.hps-ds summary:focus-visible,
.hps-ds input:focus-visible,
.hps-ds select:focus-visible,
.hps-ds textarea:focus-visible,
.hps-ds [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.hps-ds main:focus { outline: none; }

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

/* Theme-aware form controls everywhere */
.hps-ds input[type="text"],
.hps-ds input[type="search"],
.hps-ds input[type="email"],
.hps-ds input[type="url"],
.hps-ds input[type="tel"],
.hps-ds input[type="number"],
.hps-ds input[type="date"],
.hps-ds select,
.hps-ds textarea {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}
.hps-ds ::placeholder { color: var(--subtle); opacity: 1; }

.hps-skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100000;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
    transition: top .2s var(--ease);
}
.hps-skip-link:focus { top: 12px; }

/* 2. THEME TRANSITION ----------------------------------- */

.hps-theme-transition,
.hps-theme-transition *,
.hps-theme-transition *::before,
.hps-theme-transition *::after {
    transition: var(--t-theme) !important;
}

/* 3. HEADER & NAVIGATION -------------------------------- */

.hps-ds .site-header {
    background: rgb(var(--surface-rgb) / .82);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    transition: box-shadow .3s var(--ease), background-color .3s var(--ease);
}
.hps-ds .site-header.is-scrolled { box-shadow: 0 8px 30px rgb(var(--shadow-rgb) / .07); }

.hps-ds .site-header-inner {
    max-width: 1320px;
    min-height: 72px;
    padding: 0 28px;
    gap: 20px;
}

.hps-ds .site-logo { display: inline-flex; align-items: center; gap: 12px; }
.hps-monogram {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--fixed-dark), var(--fixed-dark-2));
    color: #fff;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08);
}
:root[data-theme="dark"] .hps-monogram { background: linear-gradient(145deg, #1d3264, #2a4a8c); }
.site-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.hps-ds .site-logo-name {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--text);
}
.site-logo-role { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.hps-ds .site-logo:hover .site-logo-name { color: var(--accent); }

.hps-ds .desktop-navigation { gap: 2px; }
.hps-ds .desktop-navigation a,
.hps-more-toggle {
    padding: 9px 13px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    transition: color .2s var(--ease), background-color .2s var(--ease);
}
.hps-ds .desktop-navigation a::after { display: none; }
.hps-ds .desktop-navigation a:hover,
.hps-more-toggle:hover,
.hps-more.is-open .hps-more-toggle { color: var(--text); background: var(--surface-2); }
.hps-ds .desktop-navigation a.active,
.hps-more-toggle.active { color: var(--accent); background: var(--accent-soft); }

.hps-more { position: relative; }
.hps-more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}
.hps-more-toggle svg { transition: transform .2s var(--ease); }
.hps-more.is-open .hps-more-toggle svg { transform: rotate(180deg); }
.hps-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 230px;
    padding: 8px;
    display: grid;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.hps-more.is-open .hps-more-menu,
.hps-more:focus-within .hps-more-menu { opacity: 1; visibility: visible; transform: none; }
.hps-ds .hps-more-menu a { border-radius: 10px; padding: 10px 12px; }

.hps-header-actions { display: flex; align-items: center; gap: 8px; margin-left: 6px; }

.hps-theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.hps-theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.hps-theme-toggle .hps-icon-moon { display: none; }
:root[data-theme="dark"] .hps-theme-toggle .hps-icon-sun { display: none; }
:root[data-theme="dark"] .hps-theme-toggle .hps-icon-moon { display: block; }

.hps-ds .mobile-navigation { margin-left: 0; }
.hps-ds .mobile-navigation summary {
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}
.hps-ds .mobile-navigation-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.hps-ds .mobile-navigation-menu a { color: var(--text-2); border-radius: 10px; }
.hps-ds .mobile-navigation-menu a:hover,
.hps-ds .mobile-navigation-menu a.active { color: var(--accent); background: var(--accent-soft); }

/* 4. FOOTER — a deep navy band in both themes ----------- */

.hps-ds .site-footer {
    background:
        radial-gradient(900px 400px at 85% 0%, rgb(74 110 190 / .18), transparent 60%),
        linear-gradient(180deg, #0e1a33, #0a1427);
    color: #c9d2e3;
    border-top: 0;
}
.hps-ds .site-footer h2 { font-family: var(--font-serif); font-weight: 500; color: #fff; letter-spacing: -.01em; }
.hps-ds .site-footer p, .hps-ds .site-footer strong { color: #c9d2e3; }
.hps-ds .site-footer a { color: #e3e9f5; }
.hps-ds .site-footer a:hover { color: #b9cdf6; }
.hps-ds .footer-navigation a { color: #c9d2e3; }
.hps-ds .footer-query-form textarea {
    background: rgb(255 255 255 / .05);
    border: 1px solid rgb(255 255 255 / .14);
    color: #fff;
}
.hps-ds .footer-query-form textarea::placeholder { color: #8f9bb3; }
.hps-ds .footer-query-button {
    background: #fff;
    color: #0e1a33;
    border-radius: 999px;
    font-weight: 600;
}
.hps-ds .footer-query-button:hover { background: #b9cdf6; color: #0e1a33; }
.hps-ds .footer-bottom { border-top: 1px solid rgb(255 255 255 / .08); }
.hps-ds .footer-bottom p { color: #8f9bb3; }

/* 5. SECTION HEADINGS ----------------------------------- */

.hps-ds .sec-label,
.hps-ds .hs-eyebrow,
.hps-ds .hs-full-carousel-eyebrow {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
}
.hps-ds .hs-full-carousel-eyebrow { color: var(--accent-on-dark); }

.hps-ds main section h2 > span {
    color: var(--accent);
    font-style: italic;
    font-weight: 400;
}

.hps-section-intro {
    max-width: 640px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

/* 6. HOMEPAGE ------------------------------------------- */

.hps-ds.home .site-main,
.hps-ds .home-page { background: var(--bg); }

/* Photo carousel: preserved images, calmer editorial overlay */
.hps-ds .hs-full-carousel-shade {
    background:
        linear-gradient(95deg, rgb(10 18 36 / .82) 0%, rgb(10 18 36 / .5) 42%, rgb(10 18 36 / .05) 100%),
        linear-gradient(0deg, rgb(10 18 36 / .45), transparent 40%);
}
.hps-ds .hs-full-carousel-copy .hs-full-carousel-title {
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.04;
}
.hps-ds .hs-full-carousel-actions a {
    border-radius: 999px;
    font-weight: 600;
    transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.hps-ds .hs-full-carousel-actions a:first-child {
    background: #fff;
    color: #0e1a33;
    border-color: #fff;
    box-shadow: 0 10px 30px rgb(0 0 0 / .25);
}
.hps-ds .hs-full-carousel-actions a:first-child:hover { transform: translateY(-2px); background: #e8eefb; }
.hps-ds .hs-carousel-dots button.is-active { background: #fff; }

/* Profile hero */
.hps-ds .hs-hero {
    background:
        radial-gradient(900px 520px at 88% 12%, rgb(var(--accent-rgb) / .09), transparent 62%),
        var(--bg);
}
.hps-ds .hs-hero-noise { opacity: .35; }
.hps-ds .hs-title { color: var(--text); font-weight: 500; }
.hps-ds .hs-title span { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--text-2); }
.hps-ds .hs-role { color: var(--accent); font-weight: 600; }
.hps-ds .hs-intro { color: var(--text-2); }
.hps-ds .hs-btn {
    border-radius: 999px;
    background: var(--fixed-dark);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}
:root[data-theme="dark"] .hps-ds .hs-btn { background: var(--accent); color: var(--on-accent); }
.hps-ds .hs-btn:hover { transform: translateY(-2px); }
.hps-ds .hs-focus span,
.hps-ds .tag {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    border-radius: 999px;
}
.hps-ds .hs-photo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.hps-ds .hs-floating-card {
    background: rgb(var(--surface-rgb) / .92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}
.hps-ds .hs-floating-card strong { color: var(--text); }
.hps-ds .hs-floating-card span { color: var(--muted); }
.hps-ds .hs-mini-panel { background: var(--fixed-dark); border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* 3D network sits behind the photo card */
.hs-visual { position: relative; }
.hps-hero-canvas {
    position: absolute;
    inset: -10% -18% -10% -4%;
    width: 122%;
    height: 120%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s var(--ease);
}
.hps-hero-canvas.is-ready { opacity: .9; }
:root[data-theme="dark"] .hps-hero-canvas.is-ready { opacity: .75; }
.hps-webgl .hs-orbit { display: none; }
.hs-visual > :not(canvas) { position: relative; z-index: 1; }
.hs-visual > .hs-floating-card,
.hs-visual > .hs-mini-panel { position: absolute; z-index: 2; }

.hps-ds .hs-bottom-strip { border-top: 1px solid var(--border); }
.hps-ds .hs-full-carousel-track .hs-carousel-slide img { filter: brightness(.9) saturate(1.02); }

/* Statistics: a deep navy band in both themes */
.hps-ds .hs-stats-section {
    background:
        radial-gradient(800px 300px at 15% 0%, rgb(90 130 220 / .22), transparent 60%),
        linear-gradient(135deg, #0e1a33, #15264a);
    padding: 76px 24px;
}
.hps-ds .hs-stat {
    background: rgb(255 255 255 / .04);
    border: 1px solid rgb(255 255 255 / .1);
    border-radius: var(--radius);
    box-shadow: none;
}
.hps-ds .hs-stat:hover { background: rgb(255 255 255 / .07); }
.hps-ds .hs-stat-num {
    font-family: var(--font-serif);
    font-weight: 500;
    color: #fff;
    letter-spacing: -.02em;
}
.hps-ds .hs-stat-label { color: #b5c1d8; }

/* Alternating section surfaces */
.hps-ds .education-section,
.hps-ds .home-experience-section,
.hps-ds .home-sponsored-projects { background: var(--surface-2); }
.hps-ds .research-interests-section,
.hps-ds .home-awards-section,
.hps-ds .home-patents-section { background: var(--bg); }

/* Cards */
.hps-ds .education-card,
.hps-ds .exp-card,
.hps-ds .award-item,
.hps-ds .proj-card,
.hps-ds .pat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.hps-ds .education-card:hover,
.hps-ds .exp-card:hover,
.hps-ds .award-item:hover,
.hps-ds .proj-card:hover,
.hps-ds .pat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-line);
}
.hps-ds .award-num { font-family: var(--font-serif); color: var(--accent); font-weight: 500; }
.hps-ds .proj-rank {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-line);
}
.hps-ds .exp-ico { background: var(--accent-soft); border-radius: 12px; }
.hps-ds .timeline-dot { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 6px var(--accent-soft); }

/* 7. RESEARCH MAP --------------------------------------- */

.hps-research-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 40px;
    align-items: stretch;
    margin-top: 40px;
}
.hps-research-stage {
    position: relative;
    min-height: 460px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(70% 70% at 50% 45%, rgb(var(--accent-rgb) / .08), transparent 70%),
        var(--surface);
    overflow: hidden;
}
.hps-research-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.hps-research-canvas:active { cursor: grabbing; }
.hps-research-hint {
    position: absolute;
    left: 18px;
    bottom: 14px;
    margin: 0;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--subtle);
    pointer-events: none;
}
.hps-research-labels { position: absolute; inset: 0; pointer-events: none; }
.hps-research-label {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    transition: opacity .3s var(--ease), color .3s var(--ease);
    will-change: transform;
}
.hps-research-label.is-hub {
    font-family: var(--font-serif);
    font-size: 15px;
    color: var(--text-2);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgb(var(--surface-rgb) / .8);
    border: 1px solid var(--border);
}
.hps-research-label.is-hub.is-active { color: var(--accent); border-color: var(--accent-line); }
.hps-research-label.is-sat { opacity: 0; font-size: 11.5px; }
.hps-research-label.is-sat.is-active { opacity: 1; color: var(--text-2); }
.hps-no-webgl .hps-research-stage { display: none; }
.hps-no-webgl .hps-research-layout { grid-template-columns: 1fr; }

.hps-research-panel { display: flex; flex-direction: column; gap: 22px; }
.hps-domain-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hps-domain-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font: 600 14px/1.3 var(--font-sans);
    text-align: left;
    cursor: pointer;
    transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.hps-domain-tab:hover { border-color: var(--accent-line); color: var(--text); }
.hps-domain-tab[aria-selected="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .1);
}
.hps-domain-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .7; flex: none; }
.hps-domain-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--subtle);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 2px 8px;
}
.hps-domain-detail {
    padding: 26px 26px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.hps-domain-detail[hidden] { display: none; }
.hps-domain-detail h3 { margin: 0 0 10px; font-family: var(--font-serif); font-weight: 500; font-size: 26px; color: var(--text); }
.hps-domain-detail p { margin: 0 0 18px; color: var(--text-2); line-height: 1.65; }
.hps-ds .hps-domain-detail .tags-wrap { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.hps-ds .hps-domain-detail .tag { padding: 7px 13px; font-size: 13px; margin: 0; }
.hps-link-arrow {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.hps-link-arrow:hover span { transform: translateX(3px); }
.hps-link-arrow span { transition: transform .2s var(--ease); }

/* 8. SHARED COMPONENTS (inner pages) -------------------- */

.hps-ds .site-main { background: var(--bg); }

/* Any button-like link using the accent */
.hps-ds main a[class*="btn"],
.hps-ds main button[class*="btn"] { border-radius: 999px; }

/* 9. MOTION & REVEAL ------------------------------------ */

.hps-will-reveal { opacity: 0; transform: translateY(18px); }
.hps-will-reveal.hps-in {
    opacity: 1;
    transform: none;
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    .hps-ds *,
    .hps-ds *::before,
    .hps-ds *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .hps-will-reveal { opacity: 1; transform: none; }
}

/* 10. RESPONSIVE ---------------------------------------- */

@media (min-width: 1101px) {
    .hps-ds .desktop-navigation { display: flex; }
    .hps-ds .mobile-navigation { display: none; }
}

@media (max-width: 1100px) {
    .hps-ds .desktop-navigation { display: none; }
    .hps-ds .mobile-navigation { display: block; }
    .hps-header-actions { margin-left: auto; }
}

@media (max-width: 980px) {
    .hps-research-layout { grid-template-columns: 1fr; }
    .hps-research-stage { min-height: 380px; }
}

@media (max-width: 640px) {
    .hps-ds .site-header-inner { padding: 0 16px; min-height: 64px; }
    .site-logo-role { display: none; }
    .hps-monogram { width: 36px; height: 36px; font-size: 14px; }
    .hps-domain-tabs { grid-template-columns: 1fr; }
    .hps-research-stage { min-height: 320px; }
    .hps-domain-detail { padding: 22px 18px; }
    .hps-hero-canvas { inset: -6%; width: 112%; height: 112%; }
}

/* 11. PAGE FIXES & STATUS COLOURS ------------------------ */

/* Hero bands with white text keep the deep (light-theme) accent in both themes */
.lor-header,
.resource-portal-v3 {
    --accent: #2a5bb5;
    --accent-strong: #163b7c;
    --accent-bright: #3566c4;
    --accent-line: #3d5c99;
    --accent-rgb: 31 79 163;
    --accent-soft: rgb(255 255 255 / .08);
}

/* Expert talks: "View" button text was the same colour as its background */
.expert-talks-page .expert-talk-view,
.expert-talks-page .expert-talk-view:visited { color: #fff !important; }

/* Status / category badges: deeper tones on light, lighter tones on dark */
:root {
    --st-green: #047857;
    --st-blue: #1d4ed8;
    --st-purple: #6d28d9;
    --st-orange: #c2410c;
    --st-amber: #b45309;
    --st-red: #b91c1c;
    --st-pink: #be185d;
    --st-gray: #4b5563;
}
:root[data-theme="dark"] {
    --st-green: #6ee7b7;
    --st-blue: #93c5fd;
    --st-purple: #c4b5fd;
    --st-orange: #fdba74;
    --st-amber: #fcd34d;
    --st-red: #fca5a5;
    --st-pink: #f9a8d4;
    --st-gray: #cbd5e1;
}
.hps-ds .proj-badge.cost,
.hps-ds .badge-sci,
.hps-ds .pat-status.st-granted,
.hps-ds .blog-cat-badge.cat-patent { color: var(--st-green); }
.hps-ds .proj-badge.role,
.hps-ds .badge-scopus { color: var(--st-blue); }
.hps-ds .badge-ieee,
.hps-ds .blog-cat-badge.cat-research { color: var(--st-purple); }
.hps-ds .badge-intl,
.hps-ds .blog-cat-badge.cat-conference { color: var(--st-orange); }
.hps-ds .badge-chair { color: var(--st-amber); }
.hps-ds .proj-badge.army { color: var(--st-red); }
.hps-ds .blog-cat-badge.cat-lab { color: var(--st-pink); }
.hps-ds .badge-other { color: var(--st-gray); }

:root[data-theme="dark"] .hps-ds .proj-badge,
:root[data-theme="dark"] .hps-ds .pat-status,
:root[data-theme="dark"] .hps-ds .badge,
:root[data-theme="dark"] .hps-ds .blog-cat-badge {
    background-color: rgb(255 255 255 / .06);
    border-color: rgb(255 255 255 / .14);
}
:root[data-theme="dark"] .publications-page {
    --green: #6ee7b7; --blue: #93c5fd; --purple: #c4b5fd;
}
:root[data-theme="dark"] .hps-ds .badge-book { color: var(--text); background-color: var(--accent-soft); }

/* Panels that are dark in both themes: give them dark-theme tokens */
.resource-unit5,
.resource-unit2,
.project-ideas-page .hero,
.project-ideas-page .featured-card,
.hps-ds .hs-mini-panel {
    --text: #e9edf5;
    --text-2: #c6cddb;
    --muted: #a9b3c6;
    --subtle: #9aa5b9;
    --accent: #8fb1ff;
    --accent-strong: #b7cdff;
    --accent-bright: #a3bfff;
    --accent-soft: rgb(255 255 255 / .08);
    --accent-line: rgb(255 255 255 / .18);
    --accent-rgb: 143 177 255;
    --on-accent: #0a1120;
    --border: rgb(255 255 255 / .12);
    --border-strong: rgb(255 255 255 / .2);
    --surface: #13203d;
    --surface-2: #0f1a31;
    --surface-rgb: 19 32 61;
    --white: #ffffff;
    --black: #0a1120;
    --dark-blue: #0e1a33;
    --dark-blue-2: #15264a;
    --cyan: #8fb1ff;
}
.project-ideas-page .hero { background-color: #0e1a33; }
.project-ideas-page .featured-label { color: var(--on-accent); }

.resource-portal-v3-explore { background: #fff !important; color: #163b7c !important; }
.resource-portal-v3-explore:hover { background: #e8eefb !important; }

.lor-label { color: #fff; }
.hps-ds .cat-btn.active .count { background: rgb(0 0 0 / .2); }

.hps-ds .pat-status.st-published,
.hps-ds .blog-cat-badge.cat-award,
.hps-ds .blog-cat-badge.cat-startup { color: var(--st-amber); }

/* Text on accent-filled buttons must flip with the accent */
.hps-ds .lor-btn,
.hps-ds .blog-filter-btn.active,
.hps-ds .tab-btn.active,
.hps-ds .view-btn:not(.disabled),
.hps-ds .course-btn,
.hps-ds .resource-unit5-btn { color: var(--on-accent) !important; }

/* Resources hero: navy base, softer blue glow */
.hps-ds .resource-portal-v3 { background: linear-gradient(135deg, #0b1630 0%, #13254b 60%, #1a3366 100%); }
.hps-ds .resource-portal-v3 h1 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -.02em !important; }
.hps-ds .resource-portal-v3-bg {
    background-image:
        linear-gradient(105deg, rgb(11 22 48 / .97) 0%, rgb(19 37 75 / .92) 50%, rgb(31 60 120 / .82) 100%),
        url('../images/resources-hero-bg.svg');
}
.hps-ds .resource-portal-v3-grid {
    background-image:
        linear-gradient(rgb(185 205 246 / .06) 1px, transparent 1px),
        linear-gradient(90deg, rgb(185 205 246 / .06) 1px, transparent 1px);
}
.hps-ds .resource-portal-v3-orb-a { background: radial-gradient(circle, rgb(120 160 240 / .22), transparent 70%); }

/* Small phones: keep the header inside the viewport */
@media (max-width: 520px) {
    .hps-ds .site-header-inner { gap: 10px; padding: 0 12px; }
    .hps-ds .site-logo { min-width: 0; flex: 1 1 auto; gap: 9px; }
    .site-logo-text { min-width: 0; }
    .hps-ds .site-logo-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hps-header-actions { flex: none; gap: 6px; margin-left: 0; }
    .hps-ds .mobile-navigation summary { padding: 0 11px; }
    .hps-ds .mobile-menu-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .hps-theme-toggle { width: 38px; height: 38px; }
}

@media (max-width: 640px) {
    .hps-research-label.is-sat { display: none; }
    .hps-research-label.is-hub { font-size: 12.5px; padding: 2px 8px; }
}

/* Performance: let the browser skip layout/paint of off-screen homepage sections */
.hps-ds .home-page > .education-section,
.hps-ds .home-page > .home-experience-section,
.hps-ds .home-page > .home-awards-section,
.hps-ds .home-page > .home-sponsored-projects,
.hps-ds .home-page > .home-patents-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 1100px;
}

/* Homepage hero entrance (CSS only) */
@keyframes hps-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hps-ds .hs-full-carousel-copy > * { animation: hps-rise .9s var(--ease) both; }
.hps-ds .hs-full-carousel-copy > :nth-child(2) { animation-delay: .08s; }
.hps-ds .hs-full-carousel-copy > :nth-child(3) { animation-delay: .16s; }
.hps-ds .hs-full-carousel-copy > :nth-child(4) { animation-delay: .24s; }

/* Profile visual: keep the "Research base" panel clear of the photo caption */
.hps-ds .hs-visual { padding-bottom: 84px; }
.hps-ds .hs-visual > .hs-mini-panel { bottom: 0; }
@media (max-width: 560px) {
    .hps-ds .hs-visual { padding-bottom: 76px; }
}
.hps-ds .hs-visual > .hs-card-b { top: 50%; bottom: auto; }
@media (max-width: 560px) {
    .hps-ds .hs-visual { padding-bottom: 0; grid-template-rows: auto auto; }
    .hps-ds .hs-visual > .hs-mini-panel { position: relative; left: auto; bottom: auto; justify-self: center; margin-top: 18px; width: 248px; }
    .hps-ds .hs-visual > .hs-card-b { top: 44%; }
}

/* =========================================================
   12. 3D GRADIENT BUTTONS
   One system for every call-to-action on the site:
   - primary: blue → indigo → teal gradient with a raised edge,
     pointer tilt and a light sheen that follows the cursor
   - ghost:   glass outline for use on photos and dark panels
   - chips:   filter / category pills; the active one is the gradient
========================================================= */

:root {
    --btn-grad: linear-gradient(135deg, #2457c5 0%, #4338ca 52%, #0b7f84 100%);
    --btn-grad-hover: linear-gradient(135deg, #2c64dc 0%, #4f46e5 52%, #0a8288 100%);
    --btn-edge: #1b2f74;
    --btn-text: #ffffff;
    --btn-glow: 59 91 219;
}
:root[data-theme="dark"] {
    --btn-grad: linear-gradient(135deg, #3a5fd9 0%, #5b45d6 52%, #0b7f84 100%);
    --btn-grad-hover: linear-gradient(135deg, #466ce6 0%, #6a55e6 52%, #0a8288 100%);
    --btn-edge: #1a2150;
    --btn-text: #ffffff;
    --btn-glow: 110 140 255;
}

/* ---- Primary ---- */
.hps-ds .hs-full-carousel-actions a:first-child,
.hps-ds .hs-btn,
.hps-ds .view-btn:not(.disabled),
.hps-ds .course-btn,
.hps-ds .lor-btn,
.hps-ds .vacancy-btn.primary,
.hps-ds .resource-unit3-btn,
.hps-ds .resource-unit4-btn,
.hps-ds .resource-unit5-btn,
.hps-ds .footer-query-button,
.hps-ds .resource-portal-v3-explore,
.hps-ds .expert-talks-page .expert-talk-view,
.hps-ds .home-hero-v3-btn-primary,
.hps-ds .lab-button {
    --rx: 0deg;
    --ry: 0deg;
    --mx: 50%;
    --my: 50%;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--btn-grad) !important;
    color: var(--btn-text) !important;
    font-weight: 600 !important;
    letter-spacing: .01em !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: 0 1px 1px rgb(0 0 0 / .18);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / .35),
        inset 0 -2px 0 rgb(0 0 0 / .14),
        0 4px 0 var(--btn-edge),
        0 10px 24px rgb(var(--btn-glow) / .32) !important;
    transform: perspective(600px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(0);
    transform-style: preserve-3d;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease) !important;
    will-change: transform;
}
/* light sheen that follows the pointer */
.hps-ds .hs-full-carousel-actions a:first-child::before,
.hps-ds .hs-btn::before,
.hps-ds .view-btn:not(.disabled)::before,
.hps-ds .course-btn::before,
.hps-ds .lor-btn::before,
.hps-ds .vacancy-btn.primary::before,
.hps-ds .resource-unit3-btn::before,
.hps-ds .resource-unit4-btn::before,
.hps-ds .resource-unit5-btn::before,
.hps-ds .footer-query-button::before,
.hps-ds .resource-portal-v3-explore::before,
.hps-ds .expert-talks-page .expert-talk-view::before,
.hps-ds .home-hero-v3-btn-primary::before,
.hps-ds .lab-button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background:
        radial-gradient(140px circle at var(--mx) var(--my), rgb(255 255 255 / .32), transparent 60%),
        linear-gradient(180deg, rgb(255 255 255 / .16), transparent 55%);
    opacity: .55;
    transition: opacity .2s var(--ease);
    pointer-events: none;
}
.hps-ds .hs-full-carousel-actions a:first-child:hover,
.hps-ds .hs-btn:hover,
.hps-ds .view-btn:not(.disabled):hover,
.hps-ds .course-btn:hover,
.hps-ds .lor-btn:hover,
.hps-ds .vacancy-btn.primary:hover,
.hps-ds .resource-unit3-btn:hover,
.hps-ds .resource-unit4-btn:hover,
.hps-ds .resource-unit5-btn:hover,
.hps-ds .footer-query-button:hover,
.hps-ds .resource-portal-v3-explore:hover,
.hps-ds .expert-talks-page .expert-talk-view:hover,
.hps-ds .home-hero-v3-btn-primary:hover,
.hps-ds .lab-button:hover {
    background: var(--btn-grad-hover) !important;
    color: var(--btn-text) !important;
    transform: perspective(600px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / .4),
        inset 0 -2px 0 rgb(0 0 0 / .14),
        0 6px 0 var(--btn-edge),
        0 16px 34px rgb(var(--btn-glow) / .42) !important;
}
.hps-ds .hs-full-carousel-actions a:first-child:hover::before,
.hps-ds .hs-btn:hover::before,
.hps-ds .view-btn:not(.disabled):hover::before,
.hps-ds .course-btn:hover::before,
.hps-ds .lor-btn:hover::before,
.hps-ds .vacancy-btn.primary:hover::before,
.hps-ds .resource-unit3-btn:hover::before,
.hps-ds .resource-unit4-btn:hover::before,
.hps-ds .resource-unit5-btn:hover::before,
.hps-ds .footer-query-button:hover::before,
.hps-ds .resource-portal-v3-explore:hover::before,
.hps-ds .expert-talks-page .expert-talk-view:hover::before,
.hps-ds .home-hero-v3-btn-primary:hover::before,
.hps-ds .lab-button:hover::before { opacity: 1; }
/* pressed: the button sinks onto its edge */
.hps-ds .hs-full-carousel-actions a:first-child:active,
.hps-ds .hs-btn:active,
.hps-ds .view-btn:not(.disabled):active,
.hps-ds .course-btn:active,
.hps-ds .lor-btn:active,
.hps-ds .vacancy-btn.primary:active,
.hps-ds .resource-unit3-btn:active,
.hps-ds .resource-unit4-btn:active,
.hps-ds .resource-unit5-btn:active,
.hps-ds .footer-query-button:active,
.hps-ds .resource-portal-v3-explore:active,
.hps-ds .expert-talks-page .expert-talk-view:active,
.hps-ds .home-hero-v3-btn-primary:active,
.hps-ds .lab-button:active {
    transform: perspective(600px) translateY(3px);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / .25),
        0 1px 0 var(--btn-edge),
        0 4px 10px rgb(var(--btn-glow) / .25) !important;
}
/* arrows and icons nudge forward */
.hps-ds .hs-full-carousel-actions a:first-child i,
.hps-ds .hs-btn i,
.hps-ds .resource-portal-v3-explore span { transition: transform .2s var(--ease); }
.hps-ds .hs-full-carousel-actions a:first-child:hover i,
.hps-ds .resource-portal-v3-explore:hover span { transform: translateX(3px); }

/* ---- Ghost (on photos and dark panels) ---- */
.hps-ds .hs-full-carousel-outline,
.hps-ds .home-hero-v3-btn-ghost {
    position: relative;
    border-radius: 999px !important;
    color: #fff !important;
    background:
        linear-gradient(rgb(14 26 51 / .35), rgb(14 26 51 / .35)) padding-box,
        linear-gradient(135deg, #8fb1ff, #a78bfa, #5eead4) border-box !important;
    border: 1.5px solid transparent !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-weight: 600 !important;
    transition: transform .18s var(--ease), background .2s var(--ease) !important;
}
.hps-ds .hs-full-carousel-outline:hover,
.hps-ds .home-hero-v3-btn-ghost:hover {
    transform: translateY(-2px);
    background:
        linear-gradient(rgb(255 255 255 / .14), rgb(255 255 255 / .14)) padding-box,
        linear-gradient(135deg, #b9cdf6, #c4b5fd, #99f6e4) border-box !important;
}

/* ---- Secondary (light surfaces) ---- */
.hps-ds .vacancy-btn.secondary {
    border-radius: 999px !important;
    color: var(--accent) !important;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, #2457c5, #4338ca, #0b7f84) border-box !important;
    border: 1.5px solid transparent !important;
    font-weight: 600 !important;
}
.hps-ds .vacancy-btn.secondary:hover { background: linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box, linear-gradient(135deg, #2457c5, #4338ca, #0b7f84) border-box !important; }

/* ---- Chips: filters and categories ---- */
.hps-ds .cat-btn,
.hps-ds .tab-btn,
.hps-ds .blog-filter-btn,
.hps-ds .category-button {
    border-radius: 999px !important;
    transition: transform .18s var(--ease), background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease) !important;
}
.hps-ds .tab-btn:hover,
.hps-ds .blog-filter-btn:hover,
.hps-ds .category-button:hover { transform: translateY(-1px); }
.hps-ds .cat-btn.active,
.hps-ds .tab-btn.active,
.hps-ds .blog-filter-btn.active,
.hps-ds .category-button.active,
.hps-ds .hps-domain-tab[aria-selected="true"] {
    background: var(--btn-grad) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 3px 0 var(--btn-edge), 0 8px 18px rgb(var(--btn-glow) / .28) !important;
}
.hps-ds .cat-btn.active .count { background: rgb(8 15 40 / .35) !important; color: #fff !important; }
.hps-ds .hps-domain-tab[aria-selected="true"] .hps-domain-count { background: rgb(255 255 255 / .2); color: #fff; }

/* Disabled / unavailable stay flat */
.hps-ds .vacancy-btn.unavailable,
.hps-ds .view-btn.disabled { box-shadow: none !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
    .hps-ds [class*="btn"], .hps-ds .footer-query-button, .hps-ds .lab-button { transform: none !important; }
}

/* =========================================================
   13. LIGHT THEME GRADIENTS
   Soft blue / violet / teal light washes, gradient accent words
   and fine gradient edges. Dark theme is untouched.
========================================================= */

:root:not([data-theme="dark"]) {
    --lg-blue: 59 102 214;
    --lg-violet: 124 92 230;
    --lg-teal: 13 148 136;
    --lg-ink-grad: linear-gradient(110deg, #1f4fa3 0%, #5b3fd1 55%, #0b7f84 100%);
    --lg-page:
        radial-gradient(1100px 520px at 0% 0%, rgb(var(--lg-blue) / .09), transparent 60%),
        radial-gradient(900px 480px at 100% 8%, rgb(var(--lg-violet) / .08), transparent 62%),
        radial-gradient(1000px 600px at 50% 100%, rgb(var(--lg-teal) / .06), transparent 65%),
        linear-gradient(180deg, #fbfbfe 0%, #f6f7fc 45%, #f7f9fa 100%);
    --lg-band:
        radial-gradient(800px 380px at 100% 0%, rgb(var(--lg-violet) / .07), transparent 60%),
        radial-gradient(800px 380px at 0% 100%, rgb(var(--lg-teal) / .07), transparent 60%),
        linear-gradient(180deg, #f3f5fc 0%, #f5f4fb 100%);
}

/* Page canvas */
:root:not([data-theme="dark"]) body.hps-ds,
:root:not([data-theme="dark"]) .hps-ds .site-main { background: var(--lg-page); background-attachment: scroll; }
:root:not([data-theme="dark"]) .hps-ds .expert-talks-page,
:root:not([data-theme="dark"]) .hps-ds .publications-page,
:root:not([data-theme="dark"]) .hps-ds .teaching-page,
:root:not([data-theme="dark"]) .hps-ds .home-page { background: transparent; }

/* Homepage: profile hero mesh */
:root:not([data-theme="dark"]) .hps-ds .hs-hero {
    background:
        radial-gradient(700px 460px at 92% 18%, rgb(var(--lg-violet) / .14), transparent 62%),
        radial-gradient(620px 420px at 70% 95%, rgb(var(--lg-teal) / .11), transparent 60%),
        radial-gradient(760px 520px at 8% 0%, rgb(var(--lg-blue) / .12), transparent 60%),
        linear-gradient(160deg, #fbfcff 0%, #f4f6fd 55%, #f3f8f8 100%);
}

/* Alternating homepage bands */
:root:not([data-theme="dark"]) .hps-ds .education-section,
:root:not([data-theme="dark"]) .hps-ds .home-experience-section,
:root:not([data-theme="dark"]) .hps-ds .home-sponsored-projects { background: var(--lg-band); }
:root:not([data-theme="dark"]) .hps-ds .research-interests-section,
:root:not([data-theme="dark"]) .hps-ds .home-awards-section,
:root:not([data-theme="dark"]) .hps-ds .home-patents-section { background: transparent; }

/* Gradient accent words in headings ("Research <span>Interests</span>") */
:root:not([data-theme="dark"]) .hps-ds main h1 > span,
:root:not([data-theme="dark"]) .hps-ds main h2 > span,
:root:not([data-theme="dark"]) .hps-ds .hs-title > span {
    background: var(--lg-ink-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #3b3fb8;
}
/* Hero bands with white text keep their own colours */
:root:not([data-theme="dark"]) .hps-ds .lor-header h1 > span,
:root:not([data-theme="dark"]) .hps-ds .resource-portal-v3 h1 > span,
:root:not([data-theme="dark"]) .hps-ds .project-ideas-page .hero h1 > span {
    background: linear-gradient(110deg, #b9cdf6, #c4b5fd 55%, #99f6e4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
:root:not([data-theme="dark"]) .hps-ds .sec-label,
:root:not([data-theme="dark"]) .hps-ds .hs-eyebrow {
    background: var(--lg-ink-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards: fine gradient edge, stronger on hover */
:root:not([data-theme="dark"]) .hps-ds .education-card,
:root:not([data-theme="dark"]) .hps-ds .exp-card,
:root:not([data-theme="dark"]) .hps-ds .award-item,
:root:not([data-theme="dark"]) .hps-ds .proj-card,
:root:not([data-theme="dark"]) .hps-ds .pat-card,
:root:not([data-theme="dark"]) .hps-ds .hps-domain-detail {
    border: 1px solid transparent !important;
    background:
        linear-gradient(180deg, #ffffff, #fcfcff) padding-box,
        linear-gradient(135deg, rgb(var(--lg-blue) / .22), rgb(var(--lg-violet) / .16) 50%, rgb(var(--lg-teal) / .2)) border-box !important;
    box-shadow: 0 1px 2px rgb(30 40 90 / .04), 0 10px 30px rgb(60 70 160 / .06);
}
:root:not([data-theme="dark"]) .hps-ds .education-card:hover,
:root:not([data-theme="dark"]) .hps-ds .exp-card:hover,
:root:not([data-theme="dark"]) .hps-ds .award-item:hover,
:root:not([data-theme="dark"]) .hps-ds .proj-card:hover,
:root:not([data-theme="dark"]) .hps-ds .pat-card:hover {
    background:
        linear-gradient(180deg, #ffffff, #fbfbff) padding-box,
        linear-gradient(135deg, #3b66d6, #7c5ce6 50%, #0d9488) border-box !important;
    box-shadow: 0 2px 4px rgb(30 40 90 / .05), 0 18px 44px rgb(80 80 200 / .14);
}
/* Domain panel: gradient top rule */
:root:not([data-theme="dark"]) .hps-ds .hps-domain-detail { position: relative; overflow: hidden; }
:root:not([data-theme="dark"]) .hps-ds .hps-domain-detail::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--lg-ink-grad);
}

/* Research map stage */
:root:not([data-theme="dark"]) .hps-research-stage {
    border: 1px solid transparent;
    background:
        radial-gradient(70% 70% at 50% 45%, rgb(var(--lg-violet) / .08), transparent 70%) padding-box,
        linear-gradient(160deg, #ffffff 0%, #f5f6fe 60%, #f2f9f8 100%) padding-box,
        linear-gradient(135deg, rgb(var(--lg-blue) / .25), rgb(var(--lg-violet) / .18), rgb(var(--lg-teal) / .25)) border-box;
}

/* Header: faint gradient hairline */
:root:not([data-theme="dark"]) .hps-ds .site-header {
    border-bottom: 0;
    box-shadow: 0 1px 0 rgb(var(--lg-violet) / .12);
}
:root:not([data-theme="dark"]) .hps-ds .site-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgb(var(--lg-blue) / .45), rgb(var(--lg-violet) / .45), rgb(var(--lg-teal) / .45), transparent);
    pointer-events: none;
}

/* Monogram and theme toggle pick up the gradient */
:root:not([data-theme="dark"]) .hps-monogram { background: linear-gradient(140deg, #1f4fa3, #4338ca 55%, #0b7f84); }

/* Statistics band: navy with a violet-teal sheen */
:root:not([data-theme="dark"]) .hps-ds .hs-stats-section {
    background:
        radial-gradient(700px 300px at 10% 0%, rgb(99 130 255 / .28), transparent 60%),
        radial-gradient(700px 300px at 95% 100%, rgb(20 184 166 / .18), transparent 60%),
        linear-gradient(120deg, #0e1a3d 0%, #1e1f5c 55%, #0d3340 100%);
}
:root:not([data-theme="dark"]) .hps-ds .hs-stat-num {
    background: linear-gradient(110deg, #ffffff, #c7d2fe 60%, #99f6e4);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* keep italic gradient letters from being clipped at the edge */
:root:not([data-theme="dark"]) .hps-ds main h1 > span,
:root:not([data-theme="dark"]) .hps-ds main h2 > span,
:root:not([data-theme="dark"]) .hps-ds .hs-title > span { padding-right: .12em; margin-right: -.06em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* Expert talks: keep the View button pinned to the card corner */
.hps-ds .expert-talks-page .expert-talk-view { position: absolute !important; right: 18px; bottom: 18px; padding: 8px 18px; font-size: 12.5px; }

/* =========================================================
   14. PROTON BIOSYSTEMS LAB BRANDING
========================================================= */

/* Homepage: lab button with logo */
.hps-ds .hs-btn.hps-lab-btn {
    gap: 12px;
    padding: 7px 18px 7px 7px !important;
    min-height: 52px;
}
.hps-lab-btn-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    box-shadow: 0 0 0 2px rgb(255 255 255 / .85), 0 4px 10px rgb(0 0 0 / .2);
}
.hps-lab-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.hps-lab-btn-text > span { font-size: 15px; font-weight: 700; }
.hps-lab-btn-text small { font-size: 11px; font-weight: 500; opacity: .85; letter-spacing: .02em; }
.hps-lab-btn-arrow { margin-left: 4px; font-size: 15px; transition: transform .2s var(--ease); }
.hps-ds .hs-btn.hps-lab-btn:hover .hps-lab-btn-arrow { transform: translate(2px, -2px); }

/* Career Opportunities: header with lab card */
.hps-ds .vacancies-header {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 40px;
    align-items: center;
}
.hps-ds .vacancies-header > :not(.hps-lab-card) { grid-column: 1; }
.hps-lab-card {
    grid-column: 2;
    grid-row: 1 / span 3;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px 18px 18px;
    border-radius: 22px;
    border: 1.5px solid transparent;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, #3b66d6, #7c5ce6 50%, #0d9488) border-box;
    box-shadow: 0 12px 34px rgb(60 70 160 / .14);
    text-decoration: none !important;
    color: var(--text);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.hps-lab-card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgb(80 80 200 / .22); }
.hps-lab-card img {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    object-fit: cover;
    flex: none;
    box-shadow: 0 8px 22px rgb(30 90 150 / .25);
}
.hps-lab-card-text { display: flex; flex-direction: column; gap: 3px; }
.hps-lab-card-kicker { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hps-lab-card strong { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--text); }
.hps-lab-card-tag { font-size: 13px; color: var(--text-2); }
.hps-lab-card-link { margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--accent); }

/* Career tabs as gradient chips */
.hps-ds .vac-tab { border-radius: 999px !important; transition: transform .18s var(--ease), box-shadow .2s var(--ease) !important; }
.hps-ds .vac-tab:hover { transform: translateY(-1px); }
.hps-ds .vac-tab.active {
    background: var(--btn-grad) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 3px 0 var(--btn-edge), 0 8px 18px rgb(var(--btn-glow) / .28) !important;
}
.hps-ds .vac-tab.active * { color: #fff !important; }

@media (max-width: 860px) {
    .hps-ds .vacancies-header { grid-template-columns: 1fr; }
    .hps-lab-card { grid-column: 1; grid-row: auto; margin-top: 22px; justify-self: start; }
}
@media (max-width: 420px) {
    .hps-lab-card img { width: 72px; height: 72px; border-radius: 16px; }
    .hps-lab-card strong { font-size: 19px; }
}

/* =========================================================
   15. HEADER NAVIGATION BUTTONS
========================================================= */

.hps-ds .desktop-navigation { gap: 4px; padding: 4px; border-radius: 999px; }
.hps-ds .desktop-navigation > a,
.hps-ds .hps-more-toggle {
    position: relative;
    padding: 9px 15px;
    border-radius: 999px;
    font-weight: 500;
    color: var(--text-2);
    transition: color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), transform .18s var(--ease);
}
.hps-ds .desktop-navigation > a:hover,
.hps-ds .hps-more-toggle:hover,
.hps-ds .hps-more.is-open .hps-more-toggle {
    color: var(--text);
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, rgb(59 102 214 / .55), rgb(124 92 230 / .5), rgb(13 148 136 / .55)) border-box;
    box-shadow: inset 0 0 0 1px transparent, 0 4px 14px rgb(60 70 160 / .12);
    border: 1px solid transparent;
    padding: 8px 14px;
    transform: translateY(-1px);
}
.hps-ds .desktop-navigation > a.active,
.hps-ds .hps-more-toggle.active {
    color: #fff !important;
    background: var(--btn-grad) !important;
    border: 0;
    padding: 9px 15px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 3px 0 var(--btn-edge), 0 8px 20px rgb(var(--btn-glow) / .3);
    transform: none;
}
.hps-ds .hps-more-menu a.active { color: #fff !important; background: var(--btn-grad) !important; }
.hps-ds .hps-more-menu a:hover:not(.active) { background: var(--accent-soft); color: var(--accent); }

/* Theme toggle and mobile menu button: gradient ring */
.hps-theme-toggle,
.hps-ds .mobile-navigation summary {
    border: 1.5px solid transparent !important;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, #3b66d6, #7c5ce6 50%, #0d9488) border-box !important;
    box-shadow: 0 4px 12px rgb(60 70 160 / .12);
    transition: transform .18s var(--ease), box-shadow .2s var(--ease);
}
.hps-theme-toggle:hover,
.hps-ds .mobile-navigation summary:hover { transform: translateY(-1px) rotate(-6deg); box-shadow: 0 8px 18px rgb(80 80 200 / .2); }
.hps-ds .mobile-navigation summary:hover { transform: translateY(-1px); }
.hps-ds .mobile-navigation[open] summary { background: var(--btn-grad) !important; color: #fff; }
.hps-ds .mobile-navigation[open] summary .mobile-menu-icon span { background: #fff; }
.hps-ds .mobile-navigation-menu a.active { color: #fff !important; background: var(--btn-grad) !important; }

/* =========================================================
   16. DARK THEME GRADIENTS
========================================================= */

:root[data-theme="dark"] {
    --dg-blue: 79 125 255;
    --dg-violet: 139 108 245;
    --dg-teal: 34 195 181;
    --dg-ink-grad: linear-gradient(110deg, #9db8ff 0%, #c4b5fd 52%, #5eead4 100%);
    --dg-page:
        radial-gradient(1100px 520px at 0% 0%, rgb(var(--dg-blue) / .14), transparent 60%),
        radial-gradient(900px 480px at 100% 6%, rgb(var(--dg-violet) / .13), transparent 62%),
        radial-gradient(1000px 600px at 50% 100%, rgb(var(--dg-teal) / .08), transparent 65%),
        linear-gradient(180deg, #0a1120 0%, #0c1226 50%, #0a1420 100%);
    --dg-band:
        radial-gradient(800px 380px at 100% 0%, rgb(var(--dg-violet) / .12), transparent 60%),
        radial-gradient(800px 380px at 0% 100%, rgb(var(--dg-teal) / .09), transparent 60%),
        linear-gradient(180deg, #0d1528 0%, #10142c 100%);
}
:root[data-theme="dark"] body.hps-ds,
:root[data-theme="dark"] .hps-ds .site-main { background: var(--dg-page); }
:root[data-theme="dark"] .hps-ds .expert-talks-page,
:root[data-theme="dark"] .hps-ds .publications-page,
:root[data-theme="dark"] .hps-ds .teaching-page,
:root[data-theme="dark"] .hps-ds .home-page { background: transparent; }

:root[data-theme="dark"] .hps-ds .hs-hero {
    background:
        radial-gradient(700px 460px at 92% 18%, rgb(var(--dg-violet) / .2), transparent 62%),
        radial-gradient(620px 420px at 70% 95%, rgb(var(--dg-teal) / .13), transparent 60%),
        radial-gradient(760px 520px at 8% 0%, rgb(var(--dg-blue) / .18), transparent 60%),
        linear-gradient(160deg, #0b1226 0%, #0e1230 55%, #0a1a22 100%);
}
:root[data-theme="dark"] .hps-ds .education-section,
:root[data-theme="dark"] .hps-ds .home-experience-section,
:root[data-theme="dark"] .hps-ds .home-sponsored-projects { background: var(--dg-band); }
:root[data-theme="dark"] .hps-ds .research-interests-section,
:root[data-theme="dark"] .hps-ds .home-awards-section,
:root[data-theme="dark"] .hps-ds .home-patents-section { background: transparent; }

:root[data-theme="dark"] .hps-ds main h1 > span,
:root[data-theme="dark"] .hps-ds main h2 > span,
:root[data-theme="dark"] .hps-ds .hs-title > span,
:root[data-theme="dark"] .hps-ds .sec-label,
:root[data-theme="dark"] .hps-ds .hs-eyebrow,
:root[data-theme="dark"] .hps-ds .hs-stat-num {
    background: var(--dg-ink-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #c4b5fd;
    padding-right: .12em;
    margin-right: -.06em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

:root[data-theme="dark"] .hps-ds .education-card,
:root[data-theme="dark"] .hps-ds .exp-card,
:root[data-theme="dark"] .hps-ds .award-item,
:root[data-theme="dark"] .hps-ds .proj-card,
:root[data-theme="dark"] .hps-ds .pat-card,
:root[data-theme="dark"] .hps-ds .hps-domain-detail {
    border: 1px solid transparent !important;
    background:
        linear-gradient(180deg, #121b31, #10182c) padding-box,
        linear-gradient(135deg, rgb(var(--dg-blue) / .35), rgb(var(--dg-violet) / .25) 50%, rgb(var(--dg-teal) / .3)) border-box !important;
}
:root[data-theme="dark"] .hps-ds .education-card:hover,
:root[data-theme="dark"] .hps-ds .exp-card:hover,
:root[data-theme="dark"] .hps-ds .award-item:hover,
:root[data-theme="dark"] .hps-ds .proj-card:hover,
:root[data-theme="dark"] .hps-ds .pat-card:hover {
    background:
        linear-gradient(180deg, #141f38, #111a30) padding-box,
        linear-gradient(135deg, #6a91ff, #a78bfa 50%, #2dd4bf) border-box !important;
    box-shadow: 0 18px 44px rgb(0 0 0 / .45), 0 0 30px rgb(var(--dg-violet) / .15);
}
:root[data-theme="dark"] .hps-ds .hps-domain-detail { position: relative; overflow: hidden; }
:root[data-theme="dark"] .hps-ds .hps-domain-detail::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--dg-ink-grad);
}
:root[data-theme="dark"] .hps-research-stage {
    border: 1px solid transparent;
    background:
        radial-gradient(70% 70% at 50% 45%, rgb(var(--dg-violet) / .14), transparent 70%) padding-box,
        linear-gradient(160deg, #101a30 0%, #0f1530 60%, #0c1c24 100%) padding-box,
        linear-gradient(135deg, rgb(var(--dg-blue) / .4), rgb(var(--dg-violet) / .3), rgb(var(--dg-teal) / .4)) border-box;
}
:root[data-theme="dark"] .hps-ds .hs-stats-section {
    background:
        radial-gradient(700px 300px at 10% 0%, rgb(99 130 255 / .3), transparent 60%),
        radial-gradient(700px 300px at 95% 100%, rgb(20 184 166 / .2), transparent 60%),
        linear-gradient(120deg, #0c1636 0%, #1b1a52 55%, #0b2c38 100%);
}
:root[data-theme="dark"] .hps-ds .site-header { border-bottom: 0; box-shadow: 0 1px 0 rgb(var(--dg-violet) / .18); }
:root[data-theme="dark"] .hps-ds .site-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgb(var(--dg-blue) / .6), rgb(var(--dg-violet) / .6), rgb(var(--dg-teal) / .6), transparent);
    pointer-events: none;
}
:root[data-theme="dark"] .hps-ds .site-footer {
    background:
        radial-gradient(900px 400px at 85% 0%, rgb(var(--dg-violet) / .16), transparent 60%),
        radial-gradient(700px 300px at 10% 100%, rgb(var(--dg-teal) / .1), transparent 60%),
        linear-gradient(180deg, #0b1328, #080e1d);
}
:root[data-theme="dark"] .hps-ds .desktop-navigation > a:hover,
:root[data-theme="dark"] .hps-ds .hps-more-toggle:hover,
:root[data-theme="dark"] .hps-ds .hps-more.is-open .hps-more-toggle {
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, rgb(var(--dg-blue) / .7), rgb(var(--dg-violet) / .6), rgb(var(--dg-teal) / .7)) border-box;
    box-shadow: 0 4px 16px rgb(var(--dg-violet) / .18);
}
:root[data-theme="dark"] .hps-theme-toggle,
:root[data-theme="dark"] .hps-ds .mobile-navigation summary,
:root[data-theme="dark"] .hps-lab-card {
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, #6a91ff, #a78bfa 50%, #2dd4bf) border-box !important;
}
:root[data-theme="dark"] .hps-ds .mobile-navigation[open] summary { background: var(--btn-grad) !important; }
:root[data-theme="dark"] .hps-monogram { background: linear-gradient(140deg, #3a5fd9, #5b45d6 55%, #0b7f84); }
.hps-lab-btn-logo {
    width: 64px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgb(255 255 255 / .85), 0 4px 10px rgb(0 0 0 / .2);
}
.hps-ds .hs-btn.hps-lab-btn { padding: 6px 18px 6px 6px !important; border-radius: 18px !important; }
.hps-lab-card img { width: 128px; height: 84px; border-radius: 16px; }
@media (max-width: 420px) { .hps-lab-card img { width: 96px; height: 63px; border-radius: 12px; } }

/* Project Ideas hero: 3D neural network on the right */
.project-ideas-page .hero { isolation: isolate; }
.hps-neural-canvas {
    position: absolute;
    top: 0;
    right: 0;
    width: 54%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s var(--ease);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 28%);
}
.hps-neural-canvas.is-ready { opacity: 1; }
.project-ideas-page .hero .hero-content { z-index: 2; }
@media (max-width: 900px) {
    .hps-neural-canvas { width: 100%; opacity: 0; -webkit-mask-image: none; mask-image: none; }
    .hps-neural-canvas.is-ready { opacity: .32; }
}
