/* ==========================================================================
   SASLab — single stylesheet
   Clean, simple, responsive. No framework.
   ========================================================================== */

:root {
    --color-bg: #ffffff;
    --color-surface: #f6f7f9;
    --color-border: #e2e6eb;
    --color-text: #1c2530;
    --color-muted: #5b6673;
    --color-accent: #7b1e3a;      /* Temple-ish cherry */
    --color-accent-dark: #5a1329;
    --color-accent-soft: #f3e6ea;

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-head: Georgia, "Times New Roman", serif;

    --maxw: 1080px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(20, 30, 45, 0.06), 0 8px 24px rgba(20, 30, 45, 0.06);
}

/* --- Reset-ish ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; font-weight: 700; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* Visible keyboard focus everywhere; mouse clicks stay clean via :focus-visible. */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 3px;
}
/* On dark/accent surfaces a light ring reads better. */
.btn:focus-visible, .skip-link:focus-visible,
.site-footer a:focus-visible { outline-color: #fff; }
/* The skip target itself shouldn't show a ring when focused programmatically. */
#main:focus { outline: none; }

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Give anchored/scrolled targets room under the sticky header. */
#main, [id] { scroll-margin-top: 5rem; }

/* --- Layout helpers ------------------------------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.5rem 0; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 100;
    background: var(--color-accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* --- Header / nav -------------------------------------------------------- */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky; top: 0; z-index: 20;
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding-top: .9rem; padding-bottom: .9rem;
}
.brand { display: flex; align-items: center; gap: .7rem; line-height: 1.2; }
.brand:hover, .brand:focus { text-decoration: none; }
.brand__logo { width: 40px; height: 40px; flex: 0 0 auto; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--color-text); text-transform: uppercase; letter-spacing: .03em; }
.brand__tagline { font-size: .8rem; color: var(--color-muted); }

.site-nav__list {
    list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0;
}
.site-nav a {
    color: var(--color-text); font-weight: 500; font-size: .98rem;
    padding: .35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a:focus { text-decoration: none; color: var(--color-accent); }
.site-nav a.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.nav-toggle { display: none; }

/* --- Hero / page intro --------------------------------------------------- */
.page-hero {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 3rem 0;
}
.page-hero__eyebrow {
    text-transform: uppercase; letter-spacing: .12em; font-size: .75rem;
    font-weight: 700; color: var(--color-accent); margin: 0 0 .5rem;
}
.page-hero h1 { margin: 0 0 .75rem; font-size: clamp(1.75rem, 5vw, 2.5rem); }
.page-hero__lead { margin: 0; max-width: 62ch; color: var(--color-muted); font-size: clamp(1rem, 2.5vw, 1.1rem); }

/* --- Home hero (banner with optional background image) ------------------- */
.home-hero {
    position: relative;
    background: linear-gradient(135deg, var(--color-accent-dark), var(--color-text));
    color: #fff;
    overflow: hidden;
}
.home-hero__bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
}
/* Dark scrim so white text stays readable over a busy image (WCAG AA). */
.home-hero--image::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(20,18,22,.86) 0%, rgba(20,18,22,.66) 55%, rgba(20,18,22,.42) 100%);
}
.home-hero__inner { position: relative; z-index: 1; padding: clamp(3rem, 8vw, 6rem) 1.25rem; max-width: var(--maxw); }
.home-hero__eyebrow {
    text-transform: uppercase; letter-spacing: .12em; font-size: .78rem;
    font-weight: 700; color: #f3c9d4; margin: 0 0 .75rem;
}
.home-hero h1 {
    margin: 0 0 1rem; color: #fff; font-size: clamp(2rem, 5.5vw, 3rem);
    max-width: 20ch; text-wrap: balance;
}
.home-hero__lead { margin: 0 0 1.75rem; max-width: 60ch; font-size: clamp(1.05rem, 2.5vw, 1.2rem); color: #eef1f4; }
.home-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }

.btn--ghost {
    background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); color: #fff;
}
.btn--ghost:hover, .btn--ghost:focus { background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 2px #fff; color: #fff; }

/* --- People grid --------------------------------------------------------- */
.people-grid {
    display: grid;
    /* min(100%, 260px) prevents overflow on very narrow screens. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 1.5rem;
}
.person-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
}
.person-card__avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--color-accent-soft); color: var(--color-accent);
    display: grid; place-items: center;
    font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
    margin-bottom: 1rem;
}
.person-card__photo {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
    margin-bottom: 1rem; border: 1px solid var(--color-border);
}
.person-card__name { margin: 0 0 .25rem; font-size: clamp(1.4rem, 4vw, 1.6rem); font-weight: 700; letter-spacing: -0.01em; }
.person-card__role {
    margin: 0 0 .9rem; font-size: .85rem; font-weight: 600;
    color: var(--color-accent); text-transform: uppercase; letter-spacing: .04em;
}
.person-card__bio { margin: 0; color: var(--color-muted); font-size: .95rem; }
.person-card__contact { margin: 1rem 0 0; margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--color-border); }
.person-card__email {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .9rem; font-weight: 600; word-break: break-word;
}
.person-card__email-icon { flex: 0 0 auto; color: var(--color-accent); }

/* --- Prose (page copy) --------------------------------------------------- */
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1.1rem; }

/* --- Publications list ---------------------------------------------------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    display: block;
}
.pub-item:first-child { border-top: 1px solid var(--color-border); }
.pub-item__title { margin: 0 0 .35rem; font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; }
.pub-item__title a { color: var(--color-text); }
.pub-item__title a:hover, .pub-item__title a:focus { color: var(--color-accent); }
.pub-item__source {
    flex: 0 0 auto; font-size: .75rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--color-accent);
    background: var(--color-accent-soft); border-radius: 999px; padding: .2rem .7rem;
    white-space: nowrap;
}
.pub-count { color: var(--color-muted); font-size: .95rem; margin: 0 0 1.5rem; }

/* Google Scholar callout below the publications list */
.scholar-cta {
    margin-top: 2rem; padding: 1.25rem 1.5rem;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); display: flex; flex-wrap: wrap;
    align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
}
.scholar-cta p { margin: 0; color: var(--color-muted); }
.scholar-cta .btn { flex: 0 0 auto; }

.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--color-accent); color: #fff; padding: .6rem 1.1rem;
    border-radius: 8px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer;
}
.btn:hover, .btn:focus { background: var(--color-accent-dark); text-decoration: none; color: #fff; }

/* --- Lab News ------------------------------------------------------------ */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { padding: 1.5rem 0; border-bottom: 1px solid var(--color-border); }
.news-item:first-child { border-top: 1px solid var(--color-border); }
.news-item__date {
    display: block; font-size: .8rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--color-accent); margin-bottom: .35rem;
}
.news-item__title { margin: 0 0 .5rem; font-size: 1.35rem; }
.news-item__body { margin: 0; color: var(--color-muted); }
.news-item__body p { margin: 0 0 .8rem; }

/* --- Contact form -------------------------------------------------------- */
.contact-form { max-width: 560px; margin-top: 1.5rem; }
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.form-row input, .form-row textarea {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--color-border);
    border-radius: 8px; font: inherit; background: #fff; color: var(--color-text);
}
.form-row textarea { resize: vertical; }
.form-row input:focus, .form-row textarea:focus {
    outline: 2px solid var(--color-accent); border-color: var(--color-accent);
}
/* Honeypot: visually hidden but not display:none (bots skip display:none) */
.hp-field { position: absolute; left: -5000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-note {
    padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: .95rem;
}
.form-note--ok  { background: #e6f4ea; color: #1e5631; }
.form-note--err { background: #fdecea; color: #a1160f; }
.form-error { color: #a1160f; font-size: .85rem; margin: .3rem 0 0; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
    margin-top: 3rem;
    background: var(--color-text);
    color: #cdd4dc;
}
.site-footer__inner { padding: 2.5rem 1.25rem; text-align: center; }
.site-footer__brand { font-family: var(--font-head); font-weight: 700; color: #fff; font-size: 1.15rem; margin: 0 0 .35rem; text-transform: uppercase; letter-spacing: .03em; }
.site-footer__meta { margin: 0 0 .75rem; font-size: .95rem; }
.site-footer a { color: #f0d3db; }
.site-footer__copy { margin: 0; font-size: .82rem; color: #8b97a4; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; background: none; border: 1px solid var(--color-border);
        border-radius: 8px; cursor: pointer; position: relative;
    }
    .nav-toggle__bar,
    .nav-toggle__bar::before,
    .nav-toggle__bar::after {
        content: ""; position: absolute; width: 20px; height: 2px; background: var(--color-text);
        transition: transform .2s ease, opacity .2s ease;
    }
    .nav-toggle__bar::before { transform: translateY(-6px); }
    .nav-toggle__bar::after  { transform: translateY(6px); }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: rotate(-45deg); }

    .site-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--color-bg); border-bottom: 1px solid var(--color-border);
        display: none;
    }
    .site-nav.is-open { display: block; }
    .site-nav__list { flex-direction: column; gap: 0; padding: .5rem 1.25rem 1rem; }
    .site-nav__list li { border-top: 1px solid var(--color-border); }
    .site-nav__list li:first-child { border-top: 0; }
    .site-nav a { display: block; padding: .8rem 0; }
    .site-nav a.active { border-bottom-color: transparent; }
    /* Active item gets a left accent bar instead of an underline in the drawer. */
    .site-nav a.active { box-shadow: inset 3px 0 0 var(--color-accent); padding-left: .6rem; }
}

/* Tighter spacing on small phones. */
@media (max-width: 560px) {
    .section { padding: 2.5rem 0; }
    .page-hero { padding: 2rem 0; }
    .container { padding: 0 1rem; }
    .scholar-cta { flex-direction: column; align-items: flex-start; }
    .scholar-cta .btn { width: 100%; justify-content: center; }
}
