/* =========================================================
   Xiaoping Fan — Academic Website
   Main stylesheet
   ========================================================= */


/* ---------------------------------------------------------
   01. Design system
   --------------------------------------------------------- */

:root {
    --bg-main: #F4EBDD;
    --bg-research: #F4EBDD;
    --bg-papers: #F4EBDD;
    --bg-about: #F4EBDD;

    --text-main: #173B2D;
    --text-body: #425A4A;
    --text-soft: #616C5D;

    --accent-green: #59733D;
    --accent-gold: #D0A62F;

    --sage: #9CAF88;
    --olive-dark: #435A31;

    --line: rgba(25, 56, 45, 0.12);
    --line-strong: rgba(25, 56, 45, 0.20);

    /*
       Main Ping-Mu-style principle:
       sections can span the viewport,
       but actual content is capped.
    */
    --content-width: 1200px;

    --page-padding: clamp(20px, 3vw, 48px);
}


/* ---------------------------------------------------------
   02. Base
   --------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--bg-main);
    color: var(--text-main);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: clamp(15.5px, 1vw, 17px);
    line-height: 1.65;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

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

p {
    margin-top: 0;
}


/* ---------------------------------------------------------
   03. Shared content container
   --------------------------------------------------------- */

.container {
    width: min(
        calc(100% - (2 * var(--page-padding))),
        var(--content-width)
    );

    margin-inline: auto;
}


/* ---------------------------------------------------------
   04. Navigation
   --------------------------------------------------------- */

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;

    width: 100%;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding-top: clamp(20px, 2vw, 30px);
}

.site-name {
    font-size: clamp(13px, 0.9vw, 15px);
    font-weight: 600;

    letter-spacing: -0.01em;
}

.nav {
    display: flex;
    align-items: center;

    gap: clamp(14px, 2vw, 30px);
}

.nav a {
    position: relative;

    font-size: clamp(12px, 0.9vw, 14px);
    line-height: 1;
}

.nav a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -6px;

    width: 0;
    height: 1px;

    background: currentColor;

    transition: width 0.25s ease;
}

.nav a:hover::after {
    width: 100%;
}


/* ---------------------------------------------------------
   05. Hero
   --------------------------------------------------------- */

.hero {
    min-height: 100vh;

    background: var(--bg-main);
}

.hero-inner {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    padding-top: clamp(95px, 8vw, 125px);
    padding-bottom: clamp(22px, 2vw, 30px);
}

.hero-content {
    flex: 1;

    display: grid;

    grid-template-columns:
        minmax(340px, 0.88fr)
        minmax(440px, 1.12fr);

    gap: clamp(42px, 5vw, 88px);

    align-items: center;
}

.hero-text {
    width: 100%;
    max-width: 640px;
}

.hero-label {
    margin: 0 0 clamp(26px, 3vw, 38px);

    color: var(--accent-green);

    font-size: clamp(11px, 0.78vw, 12px);
    font-weight: 500;

    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.hero h1 {
    max-width: 640px;

    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(35px, 3.1vw, 52px);
    font-weight: 400;

    line-height: 1.08;
    letter-spacing: -0.03em;
}

.hero-intro {
    max-width: 540px;

    margin:
        clamp(28px, 3vw, 40px)
        0
        0;

    color: var(--text-body);

    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.75;
}

.hero-topics {
    display: flex;
    flex-direction: column;

    gap: 4px;

    margin-top: clamp(22px, 2.4vw, 30px);

    color: var(--text-soft);

    font-size: clamp(12px, 0.84vw, 13.5px);
    line-height: 1.6;
}

.hero-image {
    width: 100%;

    height: clamp(420px, 62vh, 680px);

    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: 52% center;
}

.hero-footer {
    display: flex;
    justify-content: space-between;

    margin-top: clamp(28px, 3vw, 42px);
    padding-top: 15px;

    border-top: 1px solid var(--line);

    color: var(--text-soft);

    font-size: clamp(11px, 0.78vw, 12px);
}


/* ---------------------------------------------------------
   06. Shared sections
   --------------------------------------------------------- */

.section {
    padding:
        clamp(75px, 7vw, 110px)
        0
        clamp(90px, 8vw, 130px);
}

.section-header {
    display: block;

    margin-bottom:
        clamp(34px, 4vw, 54px);
}

.section-number {
    display: block;

    margin-bottom: 8px;

    color: var(--accent-green);

    font-size: clamp(11px, 0.78vw, 12px);
    letter-spacing: 0.08em;
}

.section h2 {
    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(34px, 3.4vw, 54px);
    font-weight: 400;

    line-height: 1.04;
    letter-spacing: -0.03em;
}


/* ---------------------------------------------------------
   07. Research
   --------------------------------------------------------- */

.research-section {
    background: var(--bg-research);
}

.research-list {
    border-bottom: 0;
}

.research-item {
    display: grid;

    grid-template-columns:
        clamp(42px, 4vw, 68px)
        1fr;

    padding:
        clamp(24px, 2.5vw, 34px)
        0
        clamp(28px, 2.8vw, 38px);

    transition: padding-left 0.25s ease;

    border-bottom: 1px solid rgba(36, 56, 45, 0.13);
}

.research-item:last-child {
    border-bottom: 0;
}

.research-item:hover {
    padding-left: clamp(0px, 0.8vw, 12px);
}

.research-number {
    padding-top: 7px;

    color: var(--accent-green);

    font-size: clamp(11px, 0.78vw, 12px);
}

.research-text {
    max-width: none;
}

.research-text h3 {

    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(25px, 2.45vw, 41px);
    font-weight: 400;

    line-height: 1.08;
    letter-spacing: -0.028em;
}

.research-text p {
    max-width: 620px;

    margin-top: clamp(16px, 1.7vw, 22px);
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;

    color: var(--text-soft);

    font-size: clamp(14.5px, 0.98vw, 16px);
    line-height: 1.7;
}


/* ---------------------------------------------------------
   08. Featured Papers
   --------------------------------------------------------- */

.papers-section {
    background: var(--bg-papers);
}

.papers-section .section-header {
    padding-bottom: clamp(26px, 2.5vw, 36px);
}

.papers-section h2 {
    font-size: clamp(33px, 3.1vw, 50px);
}

.papers-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 320px));

    justify-content: space-between;

    gap: clamp(28px, 3vw, 44px);

    align-items: start;
}

.paper-card {
    width: 100%;
    max-width: 320px;
    min-width: 0;
}

.paper-cover {
    position: relative;

    width: min(100%, 270px);

    aspect-ratio: 0.72;

    overflow: hidden;

    background: transparent;

    border-radius: 12px;
}

.paper-cover.placeholder::after {
    content: "Journal cover";

    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color: rgba(24, 48, 41, 0.3);

    font-size: 10px;

    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.paper-cover img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    background: transparent;

    transition: transform 0.3s ease;

    border-radius: inherit;
}

.paper-card:hover .paper-cover img {
    transform: scale(1.015);
}

.paper-meta {
    width: 100%;

    margin:
        clamp(15px, 1.5vw, 20px)
        0
        8px;

    color: var(--accent-gold);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: clamp(11.5px, 0.8vw, 13px);
    line-height: 1.5;
}

.paper-card h3 {
    width: 100%;

    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: clamp(17px, 1.1vw, 20px);
    font-weight: 560;

    line-height: 1.35;
    letter-spacing: -0.012em;
}

.paper-description {
    width: 100%;

    margin:
        clamp(12px, 1.2vw, 16px)
        0
        0;

    color: var(--text-soft);

    font-size: clamp(13.5px, 0.9vw, 15px);
    line-height: 1.65;
}

.section-link {
    margin-top: clamp(45px, 4vw, 60px);

    text-align: right;
}

.section-link a {
    display: inline-block;

    padding-bottom: 3px;

    border-bottom:
        1px solid rgba(24, 48, 41, 0.35);

    font-size: clamp(12.5px, 0.9vw, 14px);

    transition: opacity 0.2s ease;
}

.section-link a:hover {
    opacity: 0.55;
}


/* ---------------------------------------------------------
   09. About
   --------------------------------------------------------- */

.about-section {
    background: var(--bg-about);
}

.about-content {
    display: grid;

    grid-template-columns:
        minmax(320px, 0.82fr)
        minmax(0, 1.18fr);

    gap: clamp(50px, 5vw, 80px);
}

.about-intro h3 {
    max-width: 820px;

    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(27px, 2.7vw, 44px);
    font-weight: 400;

    line-height: 1.1;
    letter-spacing: -0.03em;
}

.about-description {
    align-self: start;

    max-width: 500px;
}

.about-description > p {
    color: var(--text-soft);

    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.75;
}

.about-description > p:last-of-type {
    margin-bottom: 0;
}

.about-meta {
    margin-top:
        clamp(30px, 3vw, 42px);

    padding-top:
        clamp(18px, 2vw, 24px);

    border-top: 1px solid var(--line);
}

.about-meta p {
    margin: 0;

    color: var(--text-soft);

    font-size: clamp(12.5px, 0.9vw, 14px);
    line-height: 1.75;
}

.about-links {
    display: flex;
    flex-wrap: wrap;

    gap:
        12px
        clamp(16px, 2vw, 24px);

    margin-top:
        clamp(20px, 2vw, 28px);
}

.about-links a {
    padding-bottom: 3px;

    border-bottom:
        1px solid rgba(24, 48, 41, 0.3);

    font-size: clamp(12.5px, 0.9vw, 14px);

    transition: opacity 0.2s ease;
}

.about-links a:hover {
    opacity: 0.55;
}


/* ---------------------------------------------------------
   10. Footer
   --------------------------------------------------------- */

.site-footer {
    background: var(--bg-about);

    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 30px;

    padding:
        clamp(24px, 2.5vw, 32px)
        0;

    color:
        rgba(24, 48, 41, 0.6);

    font-size:
        clamp(10px, 0.75vw, 11.5px);
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;

    gap:
        clamp(14px, 2vw, 24px);
}

.footer-links a {
    transition:
        opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.55;
}


/* ---------------------------------------------------------
   11. Tablet / small laptop
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-text {
        max-width: 720px;
    }

    .hero-image {
        height:
            clamp(
                360px,
                62vw,
                620px
            );
    }

    .papers-grid {
        grid-template-columns:
            repeat(2, minmax(0, 320px));

        justify-content: start;
    }

    .about-content {
        grid-template-columns: 1fr;

        margin-left: 0;
    }

    .about-description {
        max-width: 620px;
    }
}


/* ---------------------------------------------------------
   12. Mobile
   --------------------------------------------------------- */

@media (max-width: 600px) {

    .site-header {
        align-items: flex-start;
    }

    .nav {
        gap: 12px;
    }

    .hero {
        min-height: auto;
    }

    .hero-inner {
        min-height: auto;
    }

    .hero-image {
        height:
            clamp(
                320px,
                85vw,
                500px
            );
    }

    .hero-footer {
        margin-top: 26px;
    }

    .research-item:hover {
        padding-left: 0;
    }

    .papers-grid {
        grid-template-columns:
            minmax(0, 320px);

        justify-content: start;
    }

    .about-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   13. Publications page
   ========================================================= */

.publications-page {
    background: var(--bg-main);
}

.publications-site-header {
    position: absolute;
}

.nav a[aria-current="page"]::after {
    width: 100%;
}


/* ---------------------------------------------------------
   Publications — page title
   --------------------------------------------------------- */

.publications-hero {
    padding:
        clamp(105px, 8vw, 128px)
        0
        clamp(30px, 3vw, 44px);

    background: var(--bg-main);

    border-bottom: 0;
}

.publications-eyebrow {
    margin: 0 0 clamp(28px, 3vw, 42px);

    color: var(--accent-green);

    font-size: clamp(11px, 0.78vw, 12px);
    font-weight: 500;

    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.publications-hero h1 {
    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(54px, 5.5vw, 86px);
    font-weight: 400;

    line-height: 0.98;
    letter-spacing: -0.045em;
}


/* ---------------------------------------------------------
   Shared publications heading
   --------------------------------------------------------- */

.publications-section-heading {
    display: grid;

    grid-template-columns:
        minmax(260px, 0.7fr)
        minmax(0, 1fr);

    gap: clamp(34px, 4vw, 68px);

    align-items: end;

    margin-bottom: clamp(30px, 3.5vw, 46px);
    padding-top: clamp(18px, 2vw, 26px);

    border-top: 1px solid var(--line-strong);
}

.publications-section-heading h2 {
    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(34px, 3.3vw, 54px);
    font-weight: 400;

    line-height: 1.05;
    letter-spacing: -0.03em;
}

.publications-section-heading > p {
    max-width: 560px;

    margin: 0;

    color: var(--text-soft);

    font-size: clamp(13px, 0.95vw, 15px);
    line-height: 1.7;
}


/* ---------------------------------------------------------
   Featured papers — deliberately simple
   --------------------------------------------------------- */

.publications-featured {
    padding:
        0
        0
        clamp(68px, 6vw, 92px);

    background: var(--bg-main);
}

.pub-feature-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: clamp(30px, 3.5vw, 52px);

    align-items: start;
}

.pub-feature-card {
    min-width: 0;
}

.pub-feature-flip {
    display: block;

    width: min(100%, 290px);

    aspect-ratio: 0.72;

    perspective: 1200px;
}

.pub-feature-flip-inner {
    position: relative;

    display: block;

    width: 100%;
    height: 100%;

    transform-style: preserve-3d;

    transition:
        transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pub-feature-flip:hover .pub-feature-flip-inner,
.pub-feature-flip:focus-visible .pub-feature-flip-inner {
    transform: rotateY(180deg);
}

.pub-feature-face {
    position: absolute;
    inset: 0;

    display: block;

    overflow: hidden;

    background: transparent;

    border-radius: 12px;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    box-shadow:
        0 1px 0 rgba(36, 56, 45, 0.06);
}

.pub-feature-back {
    transform: rotateY(180deg);
}

.pub-feature-face img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    background: transparent;
}

.first-page-placeholder {
    display: none;
}

.pub-feature-back.first-page-missing .first-page-placeholder {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 24px;

    color: var(--text-soft);

    text-align: center;

    background: #ffffff;
}

.first-page-placeholder span {
    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(18px, 1.3vw, 22px);
}

.first-page-placeholder small {
    font-size: 10px;
    line-height: 1.45;
}

.pub-feature-meta {
    margin:
        clamp(16px, 1.6vw, 22px)
        0
        9px;

    color: var(--accent-gold);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: clamp(11.5px, 0.8vw, 13px);
    line-height: 1.5;
}

.pub-feature-card h3 {
    max-width: 390px;

    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: clamp(18px, 1.28vw, 22px);
    font-weight: 560;

    line-height: 1.34;
    letter-spacing: -0.012em;
}

.pub-feature-card h3 a {
    transition: opacity 0.2s ease;
}

.pub-feature-card h3 a:hover {
    opacity: 0.65;
}

.pub-feature-link {
    display: inline-block;

    margin-top: 18px;
    padding-bottom: 3px;

    border-bottom:
        1px solid rgba(24, 48, 41, 0.3);

    color: var(--text-soft);

    font-size: clamp(11.5px, 0.84vw, 13.5px);

    transition: opacity 0.2s ease;
}

.pub-feature-link:hover {
    opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {

    .pub-feature-flip-inner {
        transition: none;
    }
}




/* ---------------------------------------------------------
   Publication search
   --------------------------------------------------------- */

.publication-search {
    width: 100%;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr);

    align-items: center;

    gap: 18px;

    margin:
        clamp(30px, 3vw, 44px)
        0
        clamp(32px, 3.2vw, 48px);

    padding:
        12px
        18px;

    border:
        1px solid rgba(98, 119, 68, 0.42);

    border-radius: 999px;

    background:
        rgba(255, 253, 248, 0.72);

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.publication-search:focus-within {
    border-color:
        var(--accent-gold);

    background:
        rgba(255, 253, 248, 0.95);

    box-shadow:
        0 0 0 3px rgba(168, 97, 67, 0.08);
}

.publication-search label {
    color:
        var(--accent-gold);

    font-size:
        clamp(11.5px, 0.82vw, 13px);

    font-weight: 650;

    letter-spacing: 0.02em;
}

.publication-search input {
    width: 100%;

    min-width: 0;

    padding: 0;

    border: 0;

    outline: 0;

    background: transparent;

    color:
        var(--text-main);

    font: inherit;

    font-size:
        clamp(14px, 0.95vw, 15.5px);
}

.publication-search input::placeholder {
    color:
        rgba(104, 107, 93, 0.82);
}

.publication-search input::-webkit-search-cancel-button {
    cursor: pointer;
}

.publication-no-results {
    margin:
        0
        0
        clamp(34px, 4vw, 54px);

    color:
        var(--accent-gold);

    font-size:
        clamp(14px, 0.95vw, 15.5px);
}

.pub-row[hidden],
.publication-no-results[hidden] {
    display: none;
}


/* ---------------------------------------------------------
   All publications — Ping Mu style detailed citations
   --------------------------------------------------------- */

.all-publications {
    padding:
        clamp(72px, 7vw, 105px)
        0
        clamp(90px, 9vw, 135px);

    background: var(--bg-research);
}

.all-publications-heading {
    grid-template-columns:
        minmax(280px, 0.72fr)
        minmax(0, 1fr);

    margin-bottom: 0;
}

.pub-count {
    margin: 12px 0 0;

    color: var(--accent-green);

    font-size: clamp(11.5px, 0.82vw, 13px);
}

.all-publications-tools {
    display: flex;
    flex-direction: column;

    align-items: flex-end;

    gap: 14px;
}

.pub-legend {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 8px 18px;

    margin: 0;

    color: var(--text-soft);

    font-size: clamp(11px, 0.77vw, 12.5px);
}

.pub-legend sup,
.pub-row-citation sup {
    position: relative;

    top: -0.1em;

    font-size: 0.72em;

    line-height: 0;
}

.all-publications-tools > a {
    padding-bottom: 3px;

    border-bottom:
        1px solid rgba(24, 48, 41, 0.3);

    color: var(--text-soft);

    font-size: clamp(11.5px, 0.84vw, 13.5px);

    transition: opacity 0.2s ease;
}

.all-publications-tools > a:hover {
    opacity: 0.55;
}

.publication-rows {
    border-bottom:
        1px solid var(--line-strong);
}

.pub-row {
    display: grid;

    grid-template-columns:
        clamp(58px, 5vw, 78px)
        minmax(0, 1fr)
        minmax(82px, auto);

    gap: clamp(18px, 2.2vw, 34px);

    align-items: start;

    padding:
        clamp(24px, 2.35vw, 33px)
        0;

    border-top:
        1px solid var(--line-strong);
}

.pub-row-year {
    padding-top: 5px;

    color: var(--accent-green);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: clamp(13px, 0.9vw, 14.5px);
}

.pub-row-year a,
.pub-row-main h3 a {
    transition: opacity 0.2s ease;
}

.pub-row-year a:hover,
.pub-row-main h3 a:hover {
    opacity: 0.6;
}

.pub-row-main {
    max-width: 1060px;
}

.pub-row-main h3 {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: clamp(17.5px, 1.30vw, 22.5px);
    font-weight: 560;

    line-height: 1.34;
    letter-spacing: -0.012em;
}

.pub-row-citation {
    margin:
        10px
        0
        0;

    color: var(--text-soft);

    font-size: clamp(13px, 0.9vw, 14.5px);
    line-height: 1.62;
}

.pub-row-citation strong {
    color: var(--text-main);

    font-weight: 650;
}

.pub-row-citation em {
    color: var(--text-body);
}

.pub-row-action {
    padding-top: 4px;

    text-align: right;
}

.pub-row-link {
    display: inline-block;

    padding:
        5px
        10px;

    border:
        1px solid var(--line-strong);

    border-radius: 999px;

    color: var(--text-soft);

    font-size: clamp(10.5px, 0.75vw, 12px);

    text-transform: uppercase;
    letter-spacing: 0.06em;

    white-space: nowrap;

    transition:
        opacity 0.2s ease,
        border-color 0.2s ease;
}

.pub-row-link:hover {
    opacity: 0.6;

    border-color:
        rgba(24, 48, 41, 0.4);
}

.publications-footer {
    background: var(--bg-research);
}


/* ---------------------------------------------------------
   Publications — tablet
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .publications-section-heading {
        grid-template-columns: 1fr;

        gap: 22px;
    }

    .pub-feature-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .all-publications-tools {
        align-items: flex-start;
    }

    .pub-legend {
        justify-content: flex-start;
    }
}


/* ---------------------------------------------------------
   Publications — mobile
   --------------------------------------------------------- */

@media (max-width: 600px) {

    .publications-hero h1 {
        font-size:
            clamp(50px, 16vw, 72px);
    }

    .pub-feature-grid {
        grid-template-columns: 1fr;

        gap: 52px;
    }

    .pub-feature-flip {
        width: min(100%, 285px);
    }

    .pub-row {
        grid-template-columns:
            44px
            minmax(0, 1fr);
    }

    .pub-row-action {
        grid-column: 2;

        padding-top: 0;

        text-align: left;
    }
}


@media (max-width: 600px) {

    .publication-search {
        width: 100%;

        grid-template-columns: 1fr;

        gap: 4px;

        padding:
            11px
            16px;
    }
}


/* =========================================================
   15. Final layout polish
   ========================================================= */

/* ---------------------------------------------------------
   Navigation
   --------------------------------------------------------- */

.nav a[aria-current="page"]::after {
    width: 100%;
}


/* ---------------------------------------------------------
   Homepage hero: smaller and softer
   --------------------------------------------------------- */

.hero-content {
    grid-template-columns:
        minmax(340px, 0.95fr)
        minmax(380px, 1.05fr);

    gap: clamp(34px, 4vw, 60px);
}

.hero-image {
    width: min(100%, 610px);

    height:
        clamp(350px, 52vh, 555px);

    justify-self: end;

    overflow: hidden;

    border-radius: 16px;
}

.hero-image img {
    border-radius: inherit;
}


/* ---------------------------------------------------------
   Homepage sections: cleaner alignment
   --------------------------------------------------------- */

.section-header {
    display: block;

    margin-bottom:
        clamp(30px, 3.5vw, 48px);
}

.section-number {
    display: block;

    margin-bottom: 7px;
}

.research-text,
.research-text h3 {
    max-width: none;
}

.about-content {
    margin-left: 0;
}

.papers-grid {
    justify-content: start;

    column-gap:
        clamp(34px, 4vw, 58px);
}

.paper-card {
    max-width: 300px;
}

.paper-cover {
    width: min(100%, 265px);

    border-radius: 12px;

    background: transparent;
}

.paper-cover img {
    object-fit: cover;

    background: transparent;

    border-radius: inherit;
}


/* ---------------------------------------------------------
   Fewer divider lines on the homepage
   --------------------------------------------------------- */

.section {
    border-top: 0;
}

.papers-section .section-header {
    border-bottom: 0;
}

.research-list {
    border-bottom: 0;
}

.research-item {
    border-top: 0;
    border-bottom:
        1px solid rgba(36, 56, 45, 0.12);
}

.research-item:last-child {
    border-bottom: 0;
}


/* ---------------------------------------------------------
   Publications and Blog: same opening rhythm
   --------------------------------------------------------- */

.publications-hero,
.blog-hero {
    padding:
        clamp(90px, 7vw, 108px)
        0
        clamp(24px, 2.4vw, 34px);

    border-bottom: 0;

    background: var(--bg-main);
}

.publications-hero h1,
.blog-hero h1 {
    margin: 0;

    font-size:
        clamp(54px, 5.5vw, 86px);
}

.blog-hero .container,
.blog-list-section .container,
.publications-hero .container,
.publications-featured .container,
.all-publications .container {
    margin-inline: auto;
}

.blog-intro {
    margin-top:
        clamp(22px, 2.3vw, 30px);
}


/* ---------------------------------------------------------
   Publications: tighter spacing and repaired feature cards
   --------------------------------------------------------- */

.publications-featured {
    padding:
        0
        0
        clamp(60px, 5.5vw, 82px);
}

.publications-section-heading {
    margin-bottom:
        clamp(26px, 3vw, 40px);

    padding-top:
        clamp(14px, 1.5vw, 20px);
}

.pub-feature-grid {
    gap:
        clamp(36px, 4.5vw, 68px);
}

.pub-feature-card {
    max-width: 300px;
}

.pub-feature-flip {
    width: min(100%, 270px);

    aspect-ratio: 0.72;
}

.pub-feature-face {
    position: absolute;
    inset: 0;

    display: block;

    overflow: hidden;

    background: transparent;

    border-radius: 12px;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.pub-feature-front {
    transform: rotateY(0deg);
}

.pub-feature-back {
    transform: rotateY(180deg);
}

.pub-feature-face img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    background: transparent;

    border-radius: inherit;
}

.pub-feature-back.first-page-missing {
    background: var(--bg-main);
}


/* ---------------------------------------------------------
   Publication list typography
   --------------------------------------------------------- */

.pub-row-main h3 {
    font-size:
        clamp(16.5px, 1.22vw, 21px);

    line-height: 1.36;
}

.pub-row-citation {
    font-size:
        clamp(12.5px, 0.86vw, 14px);
}

.pub-row-citation em {
    color: var(--accent-gold);

    font-style: normal;
    font-weight: 400;
}


/* ---------------------------------------------------------
   Blog alignment
   --------------------------------------------------------- */

.blog-list-section {
    padding:
        clamp(42px, 4vw, 58px)
        0
        clamp(82px, 7vw, 110px);
}

.blog-section-heading {
    padding-top:
        clamp(14px, 1.5vw, 20px);

    margin-bottom:
        clamp(26px, 3vw, 38px);
}

.blog-empty,
.blog-entry {
    margin-left: 0;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .hero-image {
        width: 100%;

        justify-self: start;
    }

    .papers-grid {
        column-gap:
            clamp(28px, 4vw, 46px);
    }

    .pub-feature-grid {
        gap:
            42px;
    }
}

@media (max-width: 600px) {

    .hero-image {
        height:
            clamp(300px, 76vw, 430px);

        border-radius: 12px;
    }

    .paper-cover,
    .pub-feature-flip {
        width:
            min(100%, 260px);
    }
}


/* =========================================================
   17. Blog rebuilt from Publications layout
   ========================================================= */

.blog-writing-section {
    background: var(--bg-research);
}

.blog-post-list {
    border-top: 1px solid var(--line-strong);
}

.blog-empty-state {
    max-width: 640px;

    padding:
        clamp(28px, 3vw, 42px)
        0;

    color: var(--text-soft);

    font-size:
        clamp(13.5px, 0.9vw, 15px);

    line-height: 1.75;
}

.blog-empty-state p {
    margin-bottom: 8px;
}

.blog-empty-state p:first-child {
    color: var(--text-main);

    font-weight: 600;
}

.blog-post-row {
    display: grid;

    grid-template-columns:
        clamp(90px, 9vw, 130px)
        minmax(0, 1fr);

    gap:
        clamp(28px, 4vw, 60px);

    padding:
        clamp(28px, 3vw, 42px)
        0;

    border-top:
        1px solid var(--line-strong);
}

.blog-post-date {
    padding-top: 4px;

    color: var(--accent-green);

    font-size:
        clamp(11.5px, 0.82vw, 13px);
}

.blog-post-category {
    margin:
        0
        0
        8px;

    color: #8a7933;

    font-size:
        clamp(11px, 0.78vw, 12.5px);

    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.blog-post-main h3 {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size:
        clamp(17.5px, 1.25vw, 21px);

    font-weight: 560;

    line-height: 1.4;
}

.blog-post-summary {
    max-width: 720px;

    margin:
        10px
        0
        0;

    color: var(--text-soft);

    font-size:
        clamp(13px, 0.88vw, 14.5px);

    line-height: 1.7;
}

@media (max-width: 600px) {

    .blog-post-row {
        grid-template-columns: 1fr;

        gap: 10px;
    }
}


/* =========================================================
   18. Featured publication title size
   ========================================================= */

.publications-page .pub-feature-card h3 {
    font-size:
        clamp(16.5px, 1.22vw, 21px);

    line-height: 1.36;
}


/* =========================================================
   19. Blog content within Publications shell
   ========================================================= */

.blog-post-list,
.blog-empty-state,
.blog-post-row,
.blog-post-main {
    margin-left: 0;
    margin-right: 0;
}

.blog-post-list {
    width: 100%;

    border-top:
        1px solid var(--line-strong);
}

.blog-empty-state {
    max-width: 640px;

    padding:
        clamp(28px, 3vw, 42px)
        0;
}


/* =========================================================
   20. Publications heading + clean Blog layout
   ========================================================= */


/* ---------------------------------------------------------
   All publications heading
   --------------------------------------------------------- */

.all-publications-heading {
    display: flex;

    justify-content: space-between;
    align-items: flex-end;

    gap: clamp(30px, 4vw, 60px);

    grid-template-columns: none;
}

.all-publications-title-block {
    min-width: 0;
}

.all-publications-title-block h2 {
    margin: 0;
}

.all-publications-heading .pub-legend {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-start;

    gap: 6px 18px;

    margin:
        10px
        0
        0;

    color: var(--text-soft);

    font-size:
        clamp(11px, 0.77vw, 12.5px);

    text-align: left;
}

.all-publications-heading .all-publications-tools {
    flex: 0 0 auto;

    display: flex;

    align-items: flex-end;
    justify-content: flex-end;
}

.all-publications-heading .all-publications-tools > a {
    align-self: flex-end;
}


/* ---------------------------------------------------------
   Clean Blog page
   --------------------------------------------------------- */

.clean-blog-page {
    background: var(--bg-main);
}

.clean-blog-page main {
    width: 100%;
}

.clean-blog-hero,
.clean-blog-content {
    width: 100%;
}

.clean-blog-hero > .container,
.clean-blog-content > .container {
    width: min(
        calc(100% - (2 * var(--page-padding))),
        var(--content-width)
    );

    margin-inline: auto;

    padding-left: 0;
    padding-right: 0;

    text-align: left;
}

.clean-blog-hero {
    padding:
        clamp(92px, 7vw, 110px)
        0
        clamp(32px, 3vw, 42px);

    background: var(--bg-main);
}

.clean-blog-hero h1 {
    width: auto;

    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        clamp(54px, 5.5vw, 86px);

    font-weight: 400;

    line-height: 0.98;
    letter-spacing: -0.04em;

    text-align: left;
}

.clean-blog-subtitle {
    width: min(100%, 680px);

    margin:
        16px
        0
        0;

    color: var(--text-soft);

    font-size:
        clamp(13px, 0.9vw, 15px);

    line-height: 1.7;

    text-align: left;
}

.clean-blog-content {
    padding:
        clamp(44px, 4vw, 60px)
        0
        clamp(82px, 7vw, 110px);

    background: var(--bg-research);
}

.clean-blog-heading {
    width: 100%;

    margin:
        0
        0
        clamp(28px, 3vw, 40px);

    padding-top:
        clamp(16px, 1.8vw, 24px);

    border-top:
        1px solid var(--line-strong);

    text-align: left;
}

.clean-blog-heading h2 {
    margin: 0;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        clamp(32px, 3vw, 48px);

    font-weight: 400;

    line-height: 1.05;
    letter-spacing: -0.025em;

    text-align: left;
}

.clean-blog-list {
    width: 100%;

    margin: 0;

    border-top:
        1px solid var(--line-strong);
}

.clean-blog-empty {
    margin: 0;

    padding:
        clamp(24px, 2.5vw, 34px)
        0;

    color: var(--text-main);

    font-size:
        clamp(13.5px, 0.9vw, 15px);

    line-height: 1.7;

    text-align: left;
}

.clean-blog-post {
    display: grid;

    grid-template-columns:
        clamp(90px, 9vw, 130px)
        minmax(0, 1fr);

    gap:
        clamp(28px, 4vw, 60px);

    padding:
        clamp(28px, 3vw, 42px)
        0;

    border-top:
        1px solid var(--line-strong);
}

.clean-blog-date {
    color: var(--accent-green);

    font-size:
        clamp(11.5px, 0.82vw, 13px);
}

.clean-blog-category {
    margin:
        0
        0
        8px;

    color: #8a7933;

    font-size:
        clamp(11px, 0.78vw, 12.5px);

    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.clean-blog-post-main h3 {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size:
        clamp(16.5px, 1.22vw, 21px);

    font-weight: 560;

    line-height: 1.4;
}

.clean-blog-summary {
    max-width: 720px;

    margin:
        10px
        0
        0;

    color: var(--text-soft);

    font-size:
        clamp(13px, 0.88vw, 14.5px);

    line-height: 1.7;
}


@media (max-width: 700px) {

    .all-publications-heading {
        display: block;
    }

    .all-publications-heading .all-publications-tools {
        margin-top: 18px;

        justify-content: flex-start;
    }

    .clean-blog-post {
        grid-template-columns: 1fr;

        gap: 10px;
    }
}


/* =========================================================
   21. About column swap and profile links
   ========================================================= */

.about-description {
    max-width: 520px;
}

.about-intro {
    align-self: start;
}

.about-intro h3 {
    max-width: 720px;
}

@media (max-width: 900px) {

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-intro {
        order: -1;
    }
}


/* =========================================================
   22. Palette reset — warm ivory + sage + olive + ochre
   ========================================================= */

/* Large-area backgrounds */
.hero,
.research-section,
.about-section,
.publications-hero,
.publications-featured,
.clean-blog-hero {
    background: var(--bg-main);
}

.papers-section,
.site-footer,
.all-publications,
.publications-footer,
.clean-blog-content {
    background: var(--bg-papers);
}

/* Section numbers and structural micro-labels */
.section-number,
.research-number,
.hero-label,
.publications-eyebrow,
.blog-eyebrow {
    color: var(--accent-gold);
}

/* Scientific / publication metadata */
.paper-meta,
.pub-feature-meta,
.pub-row-year,
.pub-count,
.blog-date {
    color: var(--accent-green);
}

/* Journal names: olive, no italics, no bold */
.pub-row-citation em {
    color: var(--accent-green);

    font-style: normal;
    font-weight: 400;
}

/* Links and interaction */
.section-link a:hover,
.about-links a:hover,
.pub-feature-link:hover,
.pub-row-link:hover,
.all-publications-tools > a:hover,
.footer-links a:hover {
    color: var(--accent-green);
}

/* Search: green border, ochre focus */
.publication-search {
    border-color:
        rgba(104, 124, 69, 0.42);

    background:
        rgba(255, 253, 247, 0.72);
}

.publication-search label {
    color: var(--accent-green);
}

.publication-search:focus-within {
    border-color: var(--accent-gold);

    box-shadow:
        0 0 0 3px rgba(176, 138, 62, 0.09);
}

.publication-no-results {
    color: var(--accent-gold);
}

/* Small type should be readable, not washed out */
.pub-legend,
.pub-row-citation,
.paper-description,
.about-description > p,
.clean-blog-subtitle,
.clean-blog-empty {
    color: var(--text-soft);
}

/* Remove old terracotta / pinkish overrides */
.papers-section .section-number,
.about-section .section-number {
    color: var(--accent-gold);
}


/* =========================================================
   23. Richer warm ecology palette + About icons
   ========================================================= */

/* Use saturated colours as accents; large surfaces stay comfortable */
.papers-section,
.all-publications,
.publications-footer,
.clean-blog-content {
    background: var(--bg-papers);
}

.section-number,
.research-number {
    color: var(--accent-gold);
    font-weight: 600;
}

.hero-label,
.paper-meta,
.pub-feature-meta,
.pub-row-year,
.pub-count,
.blog-date {
    color: var(--accent-green);
}

.research-text p,
.about-description > p,
.pub-row-citation,
.paper-description,
.clean-blog-subtitle {
    color: var(--text-body);
}

/* A small ochre rule gives the section headings more identity */
.section-header h2,
.publications-section-heading h2,
.clean-blog-heading h2 {
    position: relative;
}

.section-header h2::after,
.publications-section-heading h2::after,
.clean-blog-heading h2::after {
    content: "";

    display: block;

    width: 42px;
    height: 3px;

    margin-top: 12px;

    border-radius: 999px;

    background: var(--accent-gold);
}

/* About links become small icon chips instead of plain underlined text */
.about-links {
    display: flex;
    flex-wrap: wrap;

    gap: 10px 12px;

    margin-top:
        clamp(22px, 2vw, 30px);
}

.about-links .about-link-item {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding:
        7px
        11px
        7px
        8px;

    border:
        1px solid rgba(89, 115, 61, 0.28);

    border-radius: 999px;

    background:
        rgba(255, 252, 244, 0.62);

    color: var(--text-main);

    font-size:
        clamp(11.5px, 0.82vw, 13px);

    line-height: 1;

    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.about-links .about-link-item:hover {
    transform: translateY(-1px);

    background:
        rgba(221, 231, 206, 0.92);

    border-color:
        rgba(89, 115, 61, 0.52);

    color: var(--olive-dark);
}

.about-icon {
    width: 27px;
    height: 27px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 27px;

    border-radius: 50%;

    background: var(--accent-green);

    color: #fff;
}

.about-icon svg {
    width: 15px;
    height: 15px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.about-icon-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ORCID gets a more recognisable sage/green variation */
.about-link-item[href*="orcid.org"] .about-icon {
    background: #7FA653;
}

/* Scholar gets ochre, adding a second accent without colouring whole sections */
.about-link-item[href*="scholar.google"] .about-icon {
    background: var(--accent-gold);
}

/* Mail stays olive; GitHub uses dark forest */
.about-link-item[href*="github.com"] .about-icon {
    background: var(--text-main);
}

/* Footer/profile links should not inherit the old underline-heavy look */
.about-links .about-link-item {
    border-bottom-width: 1px;
}

@media (max-width: 600px) {

    .about-links {
        flex-direction: row;
        align-items: center;
    }
}


/* =========================================================
   24. Card-based palette — no full-width colour bands
   ========================================================= */

/* One continuous warm ivory canvas */
body,
.hero,
.research-section,
.papers-section,
.about-section,
.publications-hero,
.publications-featured,
.all-publications,
.publications-footer,
.clean-blog-hero,
.clean-blog-content,
.site-footer {
    background: var(--bg-main);
}

/* Section numbers become compact rounded badges */
.section-number,
.research-number {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 34px;
    height: 26px;

    padding: 0 9px;

    margin-bottom: 10px;

    border:
        1px solid rgba(89, 115, 61, 0.28);

    border-radius: 999px;

    background:
        rgba(221, 231, 206, 0.74);

    color: var(--accent-green);

    font-size:
        clamp(10.5px, 0.74vw, 11.5px);

    font-weight: 650;

    letter-spacing: 0.04em;
}

/* Remove the ochre underline from section headings */
.section-header h2::after,
.publications-section-heading h2::after,
.clean-blog-heading h2::after {
    display: none;
}

/* Research rows become very light rounded panels rather than colour bands */
.research-list {
    display: grid;

    gap: 14px;
}

.research-item {
    padding:
        clamp(22px, 2.2vw, 30px)
        clamp(20px, 2.4vw, 30px);

    border:
        1px solid rgba(89, 115, 61, 0.16);

    border-radius: 18px;

    background:
        rgba(255, 252, 244, 0.52);
}

.research-item:last-child {
    border-bottom:
        1px solid rgba(89, 115, 61, 0.16);
}

/* Featured papers: each item is its own refined card */
.paper-card,
.pub-feature-card {
    padding:
        16px
        16px
        18px;

    border:
        1px solid rgba(89, 115, 61, 0.22);

    border-radius: 18px;

    background:
        rgba(255, 252, 244, 0.72);

    box-shadow:
        0 8px 24px rgba(23, 59, 45, 0.045);
}

.paper-cover,
.pub-feature-flip {
    width: min(100%, 250px);

    margin-inline: auto;
}

.paper-cover,
.pub-feature-face {
    border-radius: 14px;
}

/* Slightly richer metadata chips */
.paper-meta,
.pub-feature-meta {
    display: inline-flex;

    align-items: center;

    width: fit-content;

    margin-top: 14px;

    padding:
        5px
        9px;

    border-radius: 999px;

    background:
        rgba(208, 166, 47, 0.12);

    color: #7B671F;

    font-weight: 600;
}

/* About: keep the clean layout but give the text block a gentle panel */
.about-description {
    padding:
        clamp(20px, 2.2vw, 28px);

    border:
        1px solid rgba(89, 115, 61, 0.18);

    border-radius: 18px;

    background:
        rgba(255, 252, 244, 0.58);
}

/* Publication list: no coloured full-width section, only individual rows */
.all-publications {
    background: var(--bg-main);
}

.pub-row {
    margin-bottom: 10px;

    padding:
        clamp(20px, 2vw, 28px)
        clamp(18px, 2vw, 26px);

    border:
        1px solid rgba(89, 115, 61, 0.14);

    border-radius: 16px;

    background:
        rgba(255, 252, 244, 0.54);
}

.publication-rows {
    border-bottom: 0;
}

/* Search pill harmonises with the icon buttons */
.publication-search {
    border:
        1px solid rgba(89, 115, 61, 0.30);

    border-radius: 999px;

    background:
        rgba(255, 252, 244, 0.72);
}

/* Blog uses the same card treatment */
.clean-blog-content {
    background: var(--bg-main);
}

.clean-blog-list {
    border-top: 0;
}

.clean-blog-post,
.clean-blog-empty {
    padding:
        clamp(20px, 2vw, 28px)
        clamp(18px, 2vw, 26px);

    border:
        1px solid rgba(89, 115, 61, 0.16);

    border-radius: 16px;

    background:
        rgba(255, 252, 244, 0.56);
}

/* Footer no longer forms a separate colour stripe */
.site-footer {
    border-top:
        1px solid rgba(89, 115, 61, 0.16);
}

@media (max-width: 900px) {

    .paper-cover,
    .pub-feature-flip {
        margin-inline: 0;
    }
}

@media (max-width: 600px) {

    .research-item,
    .paper-card,
    .pub-feature-card,
    .about-description,
    .pub-row,
    .clean-blog-post,
    .clean-blog-empty {
        border-radius: 14px;
    }
}


/* =========================================================
   25. Card layout refinement
   ========================================================= */

/* ---------------------------------------------------------
   Hero: one large shared card around text + image
   --------------------------------------------------------- */

.hero-content {
    padding:
        clamp(26px, 3vw, 42px);

    border:
        1px solid rgba(89, 115, 61, 0.18);

    border-radius: 24px;

    background:
        rgba(255, 252, 244, 0.62);

    box-shadow:
        0 10px 30px rgba(23, 59, 45, 0.045);
}

.hero-image {
    width: 100%;

    max-width: 560px;

    border-radius: 18px;
}


/* ---------------------------------------------------------
   Featured Papers: wider cards, still refined
   --------------------------------------------------------- */

.papers-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        clamp(28px, 3vw, 42px);
}

.paper-card {
    width: 100%;

    max-width: none;

    padding:
        18px
        18px
        20px;
}

.paper-cover {
    width: min(100%, 300px);

    margin-inline: auto;
}

.paper-card h3 {
    max-width: none;
}

.paper-description {
    max-width: none;
}


/* Publications page Featured cards use the same wider rhythm */
.pub-feature-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        clamp(28px, 3vw, 42px);
}

.pub-feature-card {
    width: 100%;

    max-width: none;

    padding:
        18px
        18px
        20px;
}

.pub-feature-flip {
    width: min(100%, 300px);

    margin-inline: auto;
}

.pub-feature-card h3 {
    max-width: none;
}


/* ---------------------------------------------------------
   About: both columns become coordinated cards
   --------------------------------------------------------- */

.about-content {
    align-items: stretch;
}

.about-description,
.about-intro {
    height: 100%;

    padding:
        clamp(22px, 2.4vw, 30px);

    border:
        1px solid rgba(89, 115, 61, 0.18);

    border-radius: 18px;

    background:
        rgba(255, 252, 244, 0.58);
}

.about-description {
    max-width: none;
}

.about-intro {
    display: flex;

    align-items: flex-start;
}

.about-intro h3 {
    max-width: none;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .papers-grid,
    .pub-feature-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .paper-cover,
    .pub-feature-flip {
        margin-inline: 0;
    }
}

@media (max-width: 600px) {

    .hero-content {
        padding:
            20px;

        border-radius: 18px;
    }

    .papers-grid,
    .pub-feature-grid {
        grid-template-columns: 1fr;
    }

    .about-description,
    .about-intro {
        border-radius: 14px;
    }
}


/* =========================================================
   26. Publications card refinement
   ========================================================= */

/* ---------------------------------------------------------
   Featured Papers: wider cards
   --------------------------------------------------------- */

.pub-feature-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        clamp(22px, 2.4vw, 34px);
}

.pub-feature-card {
    width: 100%;
    max-width: none;

    padding:
        20px
        20px
        22px;
}

.pub-feature-flip {
    width: 100%;
    max-width: 330px;

    margin-inline: auto;
}

.pub-feature-card h3 {
    max-width: none;
}

/* Journal pill: use the same ochre family as the Scholar icon */
.pub-feature-meta,
.paper-meta {
    color: #8A6D12;

    background:
        rgba(208, 166, 47, 0.15);

    border:
        1px solid rgba(208, 166, 47, 0.16);
}

/* Read the paper: clear olive green */
.pub-feature-link,
.section-link a {
    color: var(--accent-green);

    border-bottom-color:
        rgba(89, 115, 61, 0.34);

    font-weight: 600;
}

.pub-feature-link:hover,
.section-link a:hover {
    color: var(--olive-dark);

    border-bottom-color:
        rgba(67, 90, 49, 0.58);
}


/* ---------------------------------------------------------
   All publications: one large card, not one card per paper
   --------------------------------------------------------- */

.all-publications {
    background: var(--bg-main);
}

.all-publications > .container {
    padding:
        clamp(26px, 3vw, 40px);

    border:
        1px solid rgba(89, 115, 61, 0.18);

    border-radius: 22px;

    background:
        rgba(255, 252, 244, 0.64);

    box-shadow:
        0 10px 28px rgba(23, 59, 45, 0.04);
}

/* The rows return to a clean editorial list inside the big card */
.publication-rows {
    border-top:
        1px solid rgba(89, 115, 61, 0.16);

    border-bottom: 0;
}

.pub-row {
    margin: 0;

    padding:
        clamp(22px, 2.2vw, 30px)
        0;

    border: 0;
    border-bottom:
        1px solid rgba(89, 115, 61, 0.13);

    border-radius: 0;

    background: transparent;
}

.pub-row:last-child {
    border-bottom: 0;
}

/* Years: olive green */
.pub-row-year,
.pub-count {
    color: var(--accent-green);

    font-weight: 650;
}

/* Journal names: ochre, no bold/italic */
.pub-row-citation em {
    color: #A77E10;

    font-style: normal;
    font-weight: 400;
}

/* Keep article type pills subtle */
.pub-row-link {
    color: var(--accent-green);

    border-color:
        rgba(89, 115, 61, 0.28);
}

.pub-row-link:hover {
    color: var(--olive-dark);

    border-color:
        rgba(67, 90, 49, 0.50);
}


/* ---------------------------------------------------------
   Search: olive-green pill
   --------------------------------------------------------- */

.publication-search {
    width: 100%;

    border:
        1px solid rgba(89, 115, 61, 0.34);

    background:
        rgba(221, 231, 206, 0.28);
}

.publication-search label {
    color: var(--accent-green);

    font-weight: 650;
}

.publication-search:focus-within {
    border-color: var(--accent-green);

    background:
        rgba(221, 231, 206, 0.46);

    box-shadow:
        0 0 0 3px rgba(89, 115, 61, 0.08);
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .pub-feature-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .pub-feature-flip {
        max-width: 320px;

        margin-inline: 0;
    }
}

@media (max-width: 600px) {

    .pub-feature-grid {
        grid-template-columns: 1fr;
    }

    .all-publications > .container {
        padding:
            20px;

        border-radius: 16px;
    }
}


/* =========================================================
   27. Equal-height Featured Paper cards
   ========================================================= */

/* Make every card in a row stretch to the same height */
.papers-grid,
.pub-feature-grid {
    align-items: stretch;
}

/* Cards become vertical flex containers */
.paper-card,
.pub-feature-card {
    display: flex;
    flex-direction: column;

    height: 100%;
}

/* Keep the action link aligned at the bottom of every card */
.paper-card .section-link,
.pub-feature-card .pub-feature-link {
    margin-top: auto;
}

/* Featured-paper link itself sits at the bottom after the title */
.pub-feature-card .pub-feature-link {
    align-self: flex-start;

    padding-top: 18px;
}

/* Home-page paper descriptions can expand, keeping cards even */
.paper-description {
    flex-grow: 1;
}


/* =========================================================
   28. About-first hierarchy + single-card sections
   ========================================================= */

/* About: self-introduction leads; research-focus statement is secondary */
.about-content {
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(300px, 0.85fr);

    gap:
        clamp(24px, 3vw, 40px);

    align-items: stretch;
}

.about-primary,
.about-secondary {
    height: 100%;
}

.about-primary {
    max-width: none;

    padding:
        clamp(26px, 2.6vw, 34px);

    border:
        1px solid rgba(89, 115, 61, 0.18);

    border-radius: 20px;

    background:
        rgba(255, 252, 244, 0.66);
}

.about-lead {
    margin-bottom:
        clamp(18px, 2vw, 26px);

    color: var(--text-main);

    font-size:
        clamp(17px, 1.15vw, 19px);

    line-height: 1.72;
}

.about-primary > p:not(.about-lead) {
    color: var(--text-body);

    font-size:
        clamp(14px, 0.95vw, 16px);

    line-height: 1.75;
}

.about-secondary {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding:
        clamp(26px, 2.6vw, 34px);

    border:
        1px solid rgba(208, 166, 47, 0.18);

    border-radius: 20px;

    background:
        rgba(208, 166, 47, 0.075);
}

.about-kicker {
    margin:
        0
        0
        12px;

    color: #8A6D12;

    font-size:
        clamp(11px, 0.78vw, 12.5px);

    font-weight: 650;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.about-secondary h3 {
    margin: 0;

    max-width: 620px;

    font-size:
        clamp(24px, 2.25vw, 36px);

    line-height: 1.16;
}


/* Research: one large card with internal dividers */
.research-list {
    display: block;

    padding:
        0
        clamp(22px, 2.5vw, 32px);

    border:
        1px solid rgba(89, 115, 61, 0.18);

    border-radius: 20px;

    background:
        rgba(255, 252, 244, 0.62);

    box-shadow:
        0 8px 24px rgba(23, 59, 45, 0.035);
}

.research-item {
    margin: 0;

    padding:
        clamp(26px, 2.8vw, 38px)
        0;

    border: 0;
    border-bottom:
        1px solid rgba(89, 115, 61, 0.15);

    border-radius: 0;

    background: transparent;
}

.research-item:last-child {
    border-bottom: 0;
}


/* Home Featured Papers: one large card with internal dividers */
.papers-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 0;

    padding:
        clamp(18px, 2vw, 24px);

    border:
        1px solid rgba(89, 115, 61, 0.18);

    border-radius: 20px;

    background:
        rgba(255, 252, 244, 0.64);

    box-shadow:
        0 8px 24px rgba(23, 59, 45, 0.035);
}

.paper-card {
    max-width: none;

    padding:
        0
        clamp(20px, 2.3vw, 30px);

    border: 0;

    border-right:
        1px solid rgba(89, 115, 61, 0.15);

    border-radius: 0;

    background: transparent;

    box-shadow: none;
}

.paper-card:first-child {
    padding-left: 0;
}

.paper-card:last-child {
    padding-right: 0;

    border-right: 0;
}

.paper-cover {
    width: min(100%, 290px);

    margin-inline: auto;
}


@media (max-width: 900px) {

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-secondary {
        order: 0;
    }

    .papers-grid {
        grid-template-columns: 1fr;

        padding:
            0
            clamp(20px, 3vw, 28px);
    }

    .paper-card {
        padding:
            clamp(24px, 3vw, 32px)
            0;

        border-right: 0;
        border-bottom:
            1px solid rgba(89, 115, 61, 0.15);
    }

    .paper-card:first-child {
        padding-top:
            clamp(24px, 3vw, 32px);
    }

    .paper-card:last-child {
        border-bottom: 0;
    }

    .paper-cover {
        margin-inline: 0;
    }
}


/* =========================================================
   29. Homepage spacing + research text width
   ========================================================= */

/* Hero should fit its content rather than occupy a full viewport */
.hero,
.hero-inner {
    min-height: auto;
}

.hero-inner {
    padding-top:
        clamp(92px, 7vw, 112px);

    padding-bottom:
        clamp(46px, 4.5vw, 64px);
}

.hero-content {
    flex: none;
}

/* The removed hero footer must not reserve any space */
.hero-footer {
    display: none;
}

/* Bring the large homepage modules closer together */
.section {
    padding:
        clamp(50px, 5vw, 70px)
        0
        clamp(58px, 5.5vw, 78px);
}

.section-header {
    margin-bottom:
        clamp(26px, 3vw, 40px);
}

/* Research explanatory text can use much more of the card width */
.research-text p {
    width: min(100%, 900px);

    max-width: 900px;
}

/* Slightly tighten the spacing inside each research row */
.research-item {
    padding:
        clamp(23px, 2.3vw, 32px)
        0;
}

/* Keep About → Research and Research → Featured visually connected */
.about-section {
    padding-bottom:
        clamp(52px, 5vw, 68px);
}

.research-section {
    padding-top:
        clamp(48px, 4.5vw, 64px);

    padding-bottom:
        clamp(52px, 5vw, 70px);
}

.papers-section {
    padding-top:
        clamp(48px, 4.5vw, 64px);
}

@media (max-width: 600px) {

    .hero-inner {
        padding-bottom: 42px;
    }

    .section {
        padding:
            42px
            0
            52px;
    }

    .research-text p {
        width: 100%;
        max-width: none;
    }
}


/* =========================================================
   30. About bio + reviewer-friendly expertise
   ========================================================= */

.about-content {
    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(280px, 0.65fr);

    gap:
        clamp(24px, 3vw, 38px);
}

.about-primary {
    padding:
        clamp(28px, 2.8vw, 36px);
}

.about-lead {
    max-width: 760px;

    margin:
        0
        0
        clamp(20px, 2vw, 28px);

    color: var(--text-main);

    font-size:
        clamp(16.5px, 1.08vw, 18.5px);

    line-height: 1.72;
}

.about-primary > p:not(.about-lead) {
    max-width: 760px;

    color: var(--text-body);

    font-size:
        clamp(14px, 0.95vw, 16px);

    line-height: 1.75;
}

.about-links {
    margin-top:
        clamp(28px, 3vw, 38px);
}

.about-secondary {
    justify-content: flex-start;
}

.about-expertise {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;
}

.about-expertise span {
    display: inline-flex;

    align-items: center;

    min-height: 34px;

    padding:
        7px
        11px;

    border:
        1px solid rgba(89, 115, 61, 0.24);

    border-radius: 999px;

    background:
        rgba(255, 252, 244, 0.70);

    color: var(--text-body);

    font-size:
        clamp(11.5px, 0.82vw, 13px);

    line-height: 1.25;
}

.about-expertise span:nth-child(3n + 1) {
    border-color:
        rgba(89, 115, 61, 0.34);
}

.about-expertise span:nth-child(3n + 2) {
    border-color:
        rgba(208, 166, 47, 0.34);
}

@media (max-width: 900px) {

    .about-content {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   31. Header-to-content breathing room
   ========================================================= */

/*
   The header is absolutely positioned, so page content needs its own
   deliberate top offset. Give Home, Publications and Blog the same
   calmer visual gap below the navigation.
*/

.hero-inner {
    padding-top:
        clamp(140px, 10vw, 170px);
}

.publications-hero,
.clean-blog-hero {
    padding-top:
        clamp(140px, 10vw, 170px);
}

@media (max-width: 900px) {

    .hero-inner,
    .publications-hero,
    .clean-blog-hero {
        padding-top:
            clamp(125px, 14vw, 150px);
    }
}

@media (max-width: 600px) {

    .hero-inner,
    .publications-hero,
    .clean-blog-hero {
        padding-top: 118px;
    }
}
