/* =====================================================================
   UI polish – motion, hover states and details.
   Loaded after site.css; keeps the navy (#092952) / white palette and fonts.
   ===================================================================== */
:root {
    --ease: cubic-bezier(.22, .61, .36, 1);
    --shadow-sm: 0 2px 8px rgba(9, 41, 82, .08);
    --shadow-md: 0 14px 34px rgba(9, 41, 82, .16);
    --navy-tint: #f3f6fa;
}
html { scroll-behavior: smooth; }
::selection { background: var(--navy); color: #fff; }

/* ---- header: compacts after scrolling, animated underline */
.site-header { transition: height .3s var(--ease), box-shadow .3s var(--ease); box-shadow: none; }
.brand-logo, .brand-name { transition: all .3s var(--ease); }
.scrolled .site-header { box-shadow: 0 6px 24px rgba(0, 0, 0, .22); }
@media (min-width: 961px) {
    .scrolled .site-header { height: 66px; }
    .scrolled .brand-logo { height: 48px; }
    .scrolled .brand-name { font-size: 17px; }
}
@media (min-width: 961px) {
    .site-nav > ul > li > a { position: relative; border-bottom: 0 !important; }
    .site-nav > ul > li > a::after {
        content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 2px; background: #fff;
        transform: scaleX(0); transform-origin: center; transition: transform .25s var(--ease);
    }
    .site-nav > ul > li.has-sub > a::after { right: 24px; }
    .site-nav > ul > li > a:hover::after, .site-nav > ul > li.active > a::after { transform: scaleX(1); }
    .site-nav .sub { border-radius: 0 0 8px 8px; border-top: 2px solid rgba(255, 255, 255, .25); overflow: hidden; }
    .site-nav .sub a { transition: background .15s, padding .2s var(--ease); }
    .site-nav .sub a:hover { padding-left: 24px; }
    .site-nav li.has-sub > a { padding-right: 24px; }
    .site-nav li.has-sub > a::before {
        content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
        border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg); opacity: .8;
    }
}

/* reading progress (news articles) */
.read-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; opacity: .9; }

/* ---- banner: gentle zoom-in, ends with a clean straight edge (no white fade) */
.page-banner { position: relative; }
.page-banner img { animation: banner-in 1.6s var(--ease) both; }
/* page title written on the banner image (same style as the previous site) */
.page-banner-title {
    position: absolute; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 0 16px; text-align: center;
    color: #f3f3f3; font-family: var(--font-head); font-size: 24px; font-weight: 400;
    letter-spacing: 5px; line-height: 1.3; text-transform: uppercase;
    text-shadow: 2px 2px 1px #242424, 0 0 18px rgba(0, 0, 0, .45);
    animation: title-in 1s var(--ease) .25s both;
}
.page-banner:has(.page-banner-title)::before { /* soft darkening so the light title stays readable on bright images */
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, .38) 0%, rgba(0, 0, 0, .14) 60%, rgba(0, 0, 0, .05) 100%);
}
.page-banner-title { z-index: 2; }
@media (min-width: 961px) { .page-banner-title { font-size: 28px; letter-spacing: 6px; } }
@media (max-width: 576px) { .page-banner-title { font-size: 17px; letter-spacing: 3px; } }
@keyframes title-in { from { opacity: 0; transform: translateY(10px); letter-spacing: 10px; } to { opacity: 1; transform: none; } }

@keyframes banner-in { from { transform: scale(1.06); opacity: .6; } to { transform: scale(1); opacity: 1; } }

/* ---- reveal on scroll (only when JS runs) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- headings with a short accent bar */
.section-title { position: relative; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 64px; height: 3px; background: var(--navy); border-radius: 2px; }
.home-intro > h2:first-child { position: relative; padding-bottom: 14px; }
.home-intro > h2:first-child::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 3px; background: var(--navy); border-radius: 2px; }

/* ---- home */
.home-photo img { border-radius: 10px; box-shadow: var(--shadow-md); }
.home-funders { margin-top: 34px; padding: 22px 26px; background: var(--navy-tint); border-radius: 10px; }
.home-funders img { mix-blend-mode: multiply; }

/* ---- buttons */
.btn { border-radius: 999px; padding: 12px 26px; transition: background .2s, transform .2s var(--ease), box-shadow .2s; box-shadow: var(--shadow-sm); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: none; }

/* ---- news cards */
.news-card-link { border-radius: 10px; border-color: rgba(9, 41, 82, .10); box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.news-card-link:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.news-card-img { position: relative; }
.news-card-img img { transition: transform .6s var(--ease); }
.news-card-link:hover .news-card-img img { transform: scale(1.06); }
.news-card-placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 64px; color: rgba(9, 41, 82, .25); }
.news-card-date {
    position: absolute; left: 14px; top: 14px; background: var(--navy); color: #fff; border-radius: 8px;
    padding: 6px 10px 5px; text-align: center; line-height: 1.05; box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.news-card-date strong { display: block; font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.news-card-date span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; opacity: .9; }
.news-card-body { padding: 18px 20px 20px; }
.news-card-body h3 { margin-top: 0; }
.news-card-more { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 13px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.news-card-more svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.news-card-link:hover .news-card-more svg { transform: translateX(5px); }

/* ---- news article */
.news-article { padding-top: 34px; }
.content .back-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-family: var(--font-head); font-weight: 500; font-size: 14px; opacity: .8; margin-bottom: 18px; transition: gap .2s, opacity .2s; }
.back-link svg { width: 18px; height: 18px; }
.content .back-link:hover { opacity: 1; gap: 10px; }
.news-article .news-date { display: table; background: var(--navy-tint); border-radius: 999px; padding: 4px 14px; font-size: 14px; opacity: 1; margin-bottom: 12px; }
.news-title { font-size: 34px; margin-bottom: 14px; }
.news-summary { border-left: 3px solid var(--navy); padding-left: 16px; }
.news-image img { border-radius: 10px; box-shadow: var(--shadow-md); }
.news-body { font-size: 17.5px; }
@media (max-width: 600px) { .news-title { font-size: 26px; } }

/* ---- pager */
.pager a, .pager span { border-radius: 999px; transition: background .2s, color .2s; }
.pager a:hover { background: var(--navy); color: #fff; }

/* ---- people */
.person-photo { border-radius: 10px; box-shadow: var(--shadow-sm); transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
.person-photo img { transition: transform .6s var(--ease); }
.person:hover .person-photo { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.person:hover .person-photo img { transform: scale(1.05); }
.person-position { display: inline-block; background: var(--navy-tint); border-radius: 999px; padding: 1px 10px; font-size: 13.5px; margin-bottom: 8px; }

/* ---- gallery: newest photo featured full width */
.gallery-item:first-child { grid-column: 1 / -1; }
.gallery-item:first-child img { aspect-ratio: 2000 / 1051; }
.gallery-item a { display: block; overflow: hidden; border-radius: 10px; box-shadow: var(--shadow-sm); position: relative; }
.gallery-item img { border-radius: 0; transition: transform .7s var(--ease); }
.gallery-item a::after {
    content: ""; position: absolute; inset: 0;
    background: rgba(9, 41, 82, 0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 46px no-repeat;
    opacity: 0; transition: opacity .3s, background-color .3s;
}
.gallery-item a:hover::after { opacity: 1; background-color: rgba(9, 41, 82, .35); }
.gallery-item a:hover img { transform: scale(1.04); }
.gallery-item figcaption { font-family: var(--font-head); font-weight: 500; letter-spacing: .3px; }

/* lightbox */
.lightbox { animation: fade-in .25s ease both; backdrop-filter: blur(4px); }
.lightbox img { border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: zoom-in .3s var(--ease) both; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .12); font-size: 30px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lightbox .lb-nav:hover { background: rgba(255, 255, 255, .25); }
.lightbox .lb-prev { left: 18px; right: auto; }
.lightbox .lb-next { right: 18px; left: auto; }
.lightbox .lb-close { top: 12px; right: 16px; }
.lightbox .lb-count { color: rgba(255, 255, 255, .7); font-size: 13px; margin-top: 4px; font-weight: 500; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- content pages */
.content img { border-radius: 8px; }
.content--research img, .content--lab-history img { box-shadow: var(--shadow-sm); }
.content--publications p {
    padding: 10px 14px 10px 16px; margin: 0 0 6px; border-left: 3px solid transparent; border-radius: 0 6px 6px 0;
    text-align: left; transition: background .2s, border-color .2s;
}
.content--publications p:hover { background: var(--navy-tint); border-left-color: var(--navy); }
.content--publications h2, .content--publications h3 { margin-top: 1.8em; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.contact-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.contact-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.content .contact-card img { border-radius: 0; margin: 0; box-shadow: none; }
.contact-content { padding: 20px 24px 24px; }

/* ---- footer */
.site-footer { position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); }
.footer-logo img { transition: transform .4s var(--ease), opacity .3s; opacity: .92; }
.footer-logo a:hover img { transform: rotate(-8deg) scale(1.04); opacity: 1; }

/* ---- back to top */
.to-top {
    position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 46px; height: 46px; border-radius: 50%;
    background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 22px rgba(9, 41, 82, .35); opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .3s, transform .3s var(--ease), visibility .3s, background .2s;
}
.to-top svg { width: 22px; height: 22px; }
.to-top:hover { background: var(--navy-2); }
.scrolled-far .to-top { opacity: 1; visibility: visible; transform: none; }
.nav-open .to-top { display: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .js .reveal { opacity: 1; transform: none; }
}
@media print { .to-top, .read-progress { display: none; } .js .reveal { opacity: 1; transform: none; } }

/* ---- news search */
.news-toolbar { padding-top: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.news-toolbar + .news-grid--list, .news-toolbar ~ .news-grid--list { padding-top: 26px; }
.news-search {
    position: relative; display: flex; align-items: center; width: min(100%, 420px); order: 2; margin-left: auto;
    border: 1px solid rgba(9, 41, 82, .25); border-radius: 999px; background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.news-search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
.news-search-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--navy); opacity: .6; pointer-events: none; }
.news-search input {
    flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
    padding: 11px 8px 11px 42px; font: 600 14px var(--font-text); color: var(--navy);
}
.news-search input::placeholder { color: #8a96a8; }
.news-search button {
    margin: 4px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; cursor: pointer;
    padding: 8px 18px; font: 500 13px var(--font-head); letter-spacing: .6px; text-transform: uppercase;
}
.news-search button:hover { background: var(--navy-2); }
.news-search-info { order: 1; margin: 0; font-size: 14px; color: #555; }
.news-search-info a { color: var(--navy); font-weight: 700; }
.news-empty { padding: 50px 0 30px; text-align: center; font-size: 16px; color: #555; }
@media (max-width: 600px) { .news-search { width: 100%; margin-left: 0; } .news-toolbar { padding-top: 28px; } }
