/* ═══════════════════════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg: #ffffff;
    --bg-header: #f6f4f1;
    --bg-accent: #ede9e1;
    /* The beige from silvamuller.com */
    --bg-dark: #1a1a1a;

    --ink: #1a1a1a;
    --ink-mid: #444;
    --ink-light: #777;
    --ink-faint: #aaa;
    --ink-inverse: #ffffff;

    --accent: #2c3e50;

    --rule: #e8e6e1;
    --rule-dark: #d8d4cc;

    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'Source Sans 3', 'Helvetica Neue', sans-serif;

    --max-w: 1080px;
    --header-h: 132px;
}


/* ═══════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════ */

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

html {
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink);
    background: var(--bg) !important;
}

html.no-scroll-home,
body.no-scroll-home {
    overflow: hidden !important;
    height: 100vh;
}

body.no-scroll-home .site-container {
    height: 100vh;
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--ink);
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

::selection {
    background: var(--bg-accent);
    color: var(--ink);
}


/* ═══════════════════════════════════════════════════════════
   LAYOUT (FADE SYSTEM)
   ═══════════════════════════════════════════════════════════ */

.site-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

.header {
    background: var(--bg-header);
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--rule-dark);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.header-inner::before {
    content: "";
    position: absolute;
    right: 40px;
    bottom: -36px;
    width: 166px;
    height: 114px;
    background-image: url("assets/images/Horseman.svg");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: right bottom;
    opacity: 0.13;
    pointer-events: none;
    z-index: 0;
}

.header-inner::after {
    content: "";
    position: absolute;
    right: 332px;
    bottom: -36px;
    width: 149px;
    height: 103px;
    background-image: url("assets/images/Dromedary.svg");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: right bottom;
    opacity: 0.13;
    pointer-events: none;
    z-index: 0;
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
    padding: 20px 40px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 28px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.header-brand {
    text-align: left;
    margin-bottom: 0;
}

.header-name {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 6px;
}

.header-name a {
    color: var(--ink);
}

.header-subtitle {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--ink-mid);
}

.header-nav-container,
.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
}

.header-nav-container {
    position: relative;
}

/* Main Fade Container */
.main-content {
    margin-top: 0;
    background: var(--bg);
    flex: 1;
    /* This pushes the footer to the bottom */
}

.view-section {
    display: none;
    opacity: 0;
    padding: 60px 0 80px;
    background: var(--bg) !important;
    scroll-margin-top: calc(var(--header-h) + 18px);
}

.view-section.active {
    display: block;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 40px;
}


/* ═══════════════════════════════════════════════════════════
   NAVIGATION (Boxed Style like silvamuller.com)
   ═══════════════════════════════════════════════════════════ */

.nav-links {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links li {
    display: flex;
}

.nav-projects-group {
    position: relative;
    display: flex;
    align-items: center;
    padding-top: 0;
}

.nav-projects-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9c9a95;
    font-weight: 600;
    line-height: 1;
}

.nav-projects-links {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-projects-links::before {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    top: -7px;
    height: 8px;
    border-top: 2px solid #c9c6bf;
    border-left: 2px solid #c9c6bf;
    border-right: 2px solid #c9c6bf;
    border-radius: 2px 2px 0 0;
    pointer-events: none;
}

.nav-links a {
    font-size: 0.82rem;
    color: var(--ink-mid);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
    background: var(--bg-accent);
    border-color: var(--rule-dark);
}

.lang-toggle {
    font-size: 0.78rem;
    color: var(--ink-light);
    border: 1px solid var(--rule-dark);
    padding: 7px 11px;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.lang-toggle:hover {
    border-color: var(--ink-light);
    color: var(--ink-light);
}


/* ═══════════════════════════════════════════════════════════
   CONTENT STYLING
   ═══════════════════════════════════════════════════════════ */

.section-title {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 40px;
}

.section {
    padding: 56px 0 84px;
}

.section-heading {
    font-family: var(--sans);
    font-size: 2.6rem;
    line-height: 1.1;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 24px;
}

/* CV section */
.cv-note {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-mid);
    margin: 0 0 14px;
}

.cv-actions {
    margin: 0 0 18px;
}

.cv-download {
    text-decoration: none;
}

.cv-viewer {
    border: 1px solid var(--rule-dark);
    border-radius: 10px;
    overflow: hidden;
    background: #f8f7f4;
}

.cv-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--rule-dark);
    background: #f2f0eb;
}

.cv-zoom-btn {
    border: 1px solid var(--rule-dark);
    background: var(--bg);
    color: var(--ink-mid);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
}

.cv-zoom-btn:hover {
    background: var(--bg-accent);
    color: var(--ink);
}

.cv-zoom-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cv-zoom-level {
    min-width: 54px;
    text-align: center;
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--ink-light);
}

.cv-embed-wrap {
    position: relative;
    min-height: min(72vh, 920px);
    padding: 0;
    background: #efede8;
}

.cv-pages {
    padding: 14px;
}

.cv-page {
    position: relative;
    margin: 0 auto 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.cv-page:last-child {
    margin-bottom: 0;
}

.cv-page canvas {
    display: block;
    width: 100%;
    height: auto;
}

.cv-text-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    line-height: 1;
    text-size-adjust: none;
    transform-origin: 0 0;
}

.cv-text-layer span,
.cv-text-layer br {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0 0;
}

.cv-load-msg {
    margin: 14px;
    font-size: 0.9rem;
    color: var(--ink-light);
    background: #fff;
    border: 1px solid var(--rule-dark);
    border-radius: 8px;
    padding: 12px 14px;
    max-width: 520px;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
}

.cv-viewer.is-ready .cv-load-msg {
    display: none;
}

.cv-fallback {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--ink-light);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: minmax(220px, 260px) 1fr;
    gap: 50px;
}

.about-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.about-photo {
    margin: 0;
    border: 1px solid var(--rule-dark);
    border-radius: 10px;
    overflow: hidden;
    background: #efede8;
}

.about-photo-img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 12%;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

.about-photo[data-protect-media] {
    position: relative;
}

.about-photo[data-protect-media]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: var(--ink-mid);
}

.about-lead {
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--ink) !important;
    margin-bottom: 24px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-item dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    margin-bottom: 4px;
}

.info-item dd {
    font-size: 0.95rem;
    color: var(--ink-mid);
    line-height: 1.4;
}

/* Research Section */
.research-category {
    margin-bottom: 120px;
}

.category-title {
    font-family: var(--serif);
    font-size: 1.7rem;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--bg-accent);
    padding-bottom: 12px;
    color: var(--ink);
    font-weight: 500;
}

.project-item {
    margin-bottom: 72px;
}

.research-with-index {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.research-index {
    position: sticky;
    top: calc(var(--header-h) + 12px);
    align-self: start;
    padding-right: 8px;
    overflow: visible;
}

.research-index-toggle {
    position: absolute;
    top: 2px;
    right: -14px;
    width: 24px;
    height: 24px;
    border: 1px solid var(--rule-dark);
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink-light);
    font-family: var(--sans);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.research-index-toggle:hover {
    color: var(--ink);
    border-color: var(--ink-light);
}

.research-with-index.index-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
    gap: 0;
}

.research-with-index.index-collapsed .research-index {
    width: 0;
    padding-right: 0;
}

.research-with-index.index-collapsed .research-index-title,
.research-with-index.index-collapsed .research-index-nav {
    opacity: 0;
    pointer-events: none;
}

.research-with-index.index-collapsed .research-index-toggle {
    left: -32px;
    right: auto;
    top: 14px;
}

.research-index-title {
    font-family: var(--sans);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-light);
    margin: 0 0 12px;
}

.research-index-nav {
    display: grid;
    gap: 7px;
    border-left: 1px solid var(--rule-dark);
    padding-left: 12px;
}

.research-index-nav a {
    font-family: var(--sans);
    font-size: 0.86rem;
    line-height: 1.25;
    color: var(--ink-mid);
    text-decoration: none;
}

.research-index-nav a:hover {
    color: var(--ink);
}

.research-index-nav a.is-sub {
    font-size: 0.8rem;
    color: var(--ink-light);
    padding-left: 10px;
}

#cluster-periodicals,
#cluster-animals,
#cluster-societies-improvement,
#proj-auxiliador,
#proj-sciperbr,
#proj-burlamaque,
#proj-camelids,
#proj-buffon,
#proj-societies,
#proj-societies-past {
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.research-category .project-item+ .project-item {
    margin-top: 30px;
    padding-top: 38px;
    border-top: 1px solid var(--rule-dark);
}

.projects .project-box+ .project-box {
    margin-top: 30px;
    padding-top: 38px;
    border-top: 1px solid var(--rule-dark);
}

.project-cluster {
    margin-top: 18px;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.project-cluster + .project-cluster {
    margin-top: 44px;
    padding-top: 34px;
    border-top: 2px solid var(--rule-dark);
}

.project-cluster-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--sans);
    font-size: 1.14rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #0b0907;
    padding: 0;
    font-weight: 950;
    margin: 0 0 24px;
}

.project-cluster-title::before {
    content: "§";
    font-family: var(--serif);
    font-size: 1.34rem;
    font-weight: 600;
    line-height: 1;
    color: #1a1510;
}

.project-cluster-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--ink);
    margin: 0 0 31px;
    max-width: 1000px;
}

.cluster-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

/* Cluster toggles are disabled; projects stay visible. */
.cluster-toggle {
    display: none !important;
}

.cluster-toggle::after {
    content: "▾";
    font-size: 0.8rem;
    transform-origin: center;
    transition: transform 0.2s ease;
}

.cluster-toggle[aria-expanded="false"]::after {
    transform: rotate(-90deg);
}

.cluster-projects[hidden] {
    display: none;
}

.project-cluster .paper-title {
    font-size: 1.344rem;
    font-weight: 450;
    line-height: 1.28;
    margin-bottom: 16px;
}

#cluster-societies-improvement .paper-masthead {
    display: none;
}

.project-cluster .project-item + .project-item,
.project-cluster .project-box + .project-box {
    margin-top: 15px;
    padding-top: 17px;
    border-top: none;
}

.project-cluster .project-item {
    margin-bottom: 35px;
}

.paper-masthead {
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.98rem;
    color: var(--ink-mid);
    font-weight: 600;
    line-height: 1.5;
    display: block;
    margin-bottom: 12px;
}

.paper-masthead:empty {
    display: none;
    margin-bottom: 0;
}

.paper-title {
    font-family: var(--serif);
    font-size: 1.344rem;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 20px;
}

.paper-title-prefix {
    display: block;
    font-family: var(--sans);
    font-size: 0.98rem;
    color: var(--ink-mid);
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 12px;
}

.paper-title-emphasis {
    display: block;
    font-size: 1em;
    line-height: 1.25;
    font-weight: 500;
}

.project-summary {
    font-size: 1.02rem;
    color: var(--ink);
    line-height: 1.8;
    border: 1px solid var(--rule-dark);
    border-radius: 10px;
    background: #f8f7f4;
    padding: 18px 20px 16px;
}

.project-banner-image {
    margin: 14px 0 0;
    overflow: hidden;
}

.project-banner-image img {
    display: block;
    width: 100%;
    max-height: 210px;
    object-fit: cover;
    object-position: center center;
    height: auto;
    border: 1px solid var(--rule);
    border-radius: 6px;
    opacity: 0.82;
    filter: grayscale(18%) contrast(92%) saturate(78%);
}

.project-banner-image-dromedary img {
    object-position: 0% 32%;
    transform: translateX(12%) scale(1.45);
    transform-origin: center center;
    opacity: 0.95;
    filter: grayscale(100%) contrast(98%) saturate(0%);
}

.project-banner-image-buffon img {
    object-position: center center;
    transform: scale(1.2);
    transform-origin: center center;
    opacity: 0.92;
    filter: grayscale(100%) contrast(96%) saturate(0%);
}

.project-banner-image-burlamaque img {
    object-position: 50% 22%;
    transform: scale(1.25);
    transform-origin: center center;
    opacity: 0.93;
    filter: grayscale(96%) contrast(98%) saturate(8%);
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--rule-dark);
    flex-wrap: wrap;
}

.project-actions .project-expand-btn,
.project-actions .project-expand {
    margin-top: 0;
}

.project-actions .project-page-link {
    margin-top: 0;
    margin-left: 0;
}

.project-summary-periodicals .project-actions {
    margin-top: 20px;
}

.project-summary-periodicals .project-banner-image img {
    object-position: top center;
}

.project-body-image {
    margin-top: 22px;
}

.project-body-image img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--rule-dark);
    border-radius: 6px;
}

/* Keep standalone project-page images visually consistent. */
main.research .project-summary img,
main.research .project-body-image img {
    filter: grayscale(22%) contrast(94%) saturate(82%);
    opacity: 0.9;
}

.project-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.1em;
    font-weight: 700;
    padding: 8px 0;
}

.project-page-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    margin-left: 0;
    padding: 7px 12px;
    border: 1px solid var(--rule-dark);
    border-radius: 999px;
    background: #f3f1ec;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--ink-mid);
    line-height: 1;
    justify-self: start;
    width: fit-content;
}

.project-page-link:hover {
    color: var(--ink);
    border-color: var(--ink-light);
    background: var(--bg-accent);
}

.project-page-link::after {
    content: "↗";
    font-size: 0.78rem;
}

#view-current .container,
#view-projects .container,
main.research .container {
    max-width: 1080px;
}

.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s ease, opacity 0.5s ease;
    opacity: 0;
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
}

.project-details.open {
    max-height: 4000px;
    opacity: 1;
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--rule-dark);
}

.project-expand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.08em;
    font-weight: 600;
}

.project-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s ease, opacity 0.5s ease;
    opacity: 0;
    margin-top: 0;
}

.project-body.open {
    max-height: 4000px;
    opacity: 1;
    margin-top: 20px;
}

.project-body p,
.project-details p {
    font-size: 0.98rem;
    line-height: 1.7;
}

.project-details p + p,
.project-body p + p {
    text-indent: 0;
    margin-top: 10px;
}

#details-periodicals p[data-i18n="proj1_obj"] {
    display: none;
}

.project-publications {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px dashed var(--rule-dark);
}

.subhead-publications {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink-mid);
    margin-bottom: 12px;
    margin-top: 0;
    text-transform: none;
    letter-spacing: normal;
}

.project-publications-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.project-publications-list li {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 10px;
}

.project-expand[aria-expanded="true"] .expand-icon {
    transform: rotate(180deg);
}

.expand-icon {
    transition: transform 0.2s ease;
}

.subhead {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 0;
}

.project-details > .subhead[data-i18n="label_objectives"] {
    display: none;
}

/* Publications */
.pub-filters[data-pub-filter-root] {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.pub-filter-controls {
    display: grid;
    gap: 10px;
    margin: 0;
    position: sticky;
    top: calc(var(--header-h) + 12px);
}

.pub-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid var(--rule-dark);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-mid);
    font-family: var(--sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.pub-filter-btn.active {
    color: var(--ink-inverse);
    background: var(--ink);
    border-color: var(--ink);
}

.pub-filter-empty {
    grid-column: 2;
    margin: 4px 0 16px;
    color: var(--ink-light);
    font-size: 0.95rem;
}

.pub-list {
    grid-column: 2;
}

.pub-year-group {
    margin-top: 34px;
}

.pub-year-group:first-child {
    margin-top: 0;
}

.pub-year {
    font-family: var(--sans);
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-light);
    margin: 0 0 16px;
}

.pub-list li[data-year]::before {
    display: none;
}

.pub-list li {
    display: flex;
    gap: 30px;
    margin-bottom: 34px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}

.pub-item-image {
    flex: 0 0 100px;
    margin-top: 4px;
}

.pub-item-image img {
    width: 100%;
    height: auto;
    border: 1px solid var(--rule-dark);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    filter: grayscale(10%) contrast(96%);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.pub-list li:hover .pub-item-image img {
    transform: translateY(-2px);
    filter: none;
}

.pub-item-content {
    flex: 1;
}

.pub-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.pub-language {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}

.pub-language-en {
    color: #1e5c48;
    background: rgba(30, 92, 72, 0.08);
}

.pub-language-pt {
    color: #8a5a12;
    background: rgba(138, 90, 18, 0.1);
}

.pub-list li:last-child {
    border-bottom: none;
}

.pub-text {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--ink-mid);
    line-height: 1.7;
}

.pub-link {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--ink-light);
}

.pub-link:hover {
    color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER (CONTACT)
   ═══════════════════════════════════════════════════════════ */

.footer {
    background: var(--bg-header);
    padding: 40px 0 20px;
    border-top: 1px solid var(--rule-dark);
    position: relative;
    overflow: hidden;
}

.footer::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: min(980px, 98%);
    height: 118px;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.24;
    z-index: 0;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    background-image: url("assets/images/footer-palms.svg");
}

.footer > * {
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-title {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.contact-info a {
    display: block;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--ink-mid);
}

.email-copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.email-copy-row a,
.email-copy-row .footer-email {
    margin-bottom: 0;
}

.copy-email-btn {
    position: relative;
    order: -1;
    width: 22px;
    height: 22px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: var(--ink-light);
    flex: 0 0 22px;
}

.copy-email-btn::before,
.copy-email-btn::after {
    content: "";
    position: absolute;
    border: 1.6px solid currentColor;
    border-radius: 2px;
    background: transparent;
}

.copy-email-btn::before {
    width: 11px;
    height: 13px;
    left: 6px;
    top: 5px;
}

.copy-email-btn::after {
    width: 11px;
    height: 13px;
    left: 3px;
    top: 2px;
    background: var(--bg-header);
}

.copy-email-btn:hover {
    color: var(--ink);
    border-color: var(--rule-dark);
}

.copy-email-btn.is-copied {
    color: #2f5f3f;
    border-color: #7f9f85;
    background: rgba(255, 255, 255, 0.55);
}

.copy-email-btn.is-error {
    color: #8b4c4c;
    border-color: #c9a2a2;
    background: rgba(255, 255, 255, 0.55);
}

.copy-feedback-toast {
    position: fixed;
    transform: translate(-50%, -100%);
    z-index: 2500;
    pointer-events: none;
    font-size: 0.75rem;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #b8c7ba;
    color: #2f5f3f;
    background: rgba(246, 244, 241, 0.96);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.copy-feedback-toast.is-error {
    color: #8b4c4c;
    border-color: #d4b1b1;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    color: var(--ink-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.social-links a:hover {
    color: var(--ink);
}

.copyright {
    font-size: 0.75rem;
    color: var(--ink-faint);
    margin-top: 30px;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    :root {
        --header-h: 0px;
    }

    html.no-scroll-home,
    body.no-scroll-home {
        overflow: auto;
    }

    body.no-scroll-home .site-container {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .header {
        position: sticky;
        top: 0;
        z-index: 40;
        padding: 0;
        border-bottom: 1px solid var(--rule);
        background: var(--bg);
    }

    .header-inner::before,
    .header-inner::after {
        display: none;
    }

    .header-inner {
        max-width: 100%;
        align-items: stretch;
        justify-content: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
    }

    .header-brand {
        width: 100%;
    }

    .header-name {
        font-size: 1.35rem;
        line-height: 1.1;
        margin-bottom: 0;
    }

    .header-subtitle {
        display: none;
    }

    .header-nav-container,
    .header-right,
    #main-nav {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .nav-links {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 42px;
        text-align: center;
        font-size: 0.78rem;
        line-height: 1.2;
        letter-spacing: 0.04em;
        padding: 8px 10px;
    }

    .nav-projects-group {
        padding-top: 0;
        gap: 0;
    }

    .nav-projects-label,
    .nav-projects-links::before {
        display: none;
    }

    .main-content {
        margin-top: 0;
    }

    .view-section {
        position: static;
        opacity: 1;
        visibility: visible;
        padding: 30px 0 46px;
    }

    .container {
        padding: 0 14px;
    }

    .section {
        padding: 32px 0 46px;
    }

    .section-heading {
        font-size: 1.62rem;
        margin-bottom: 14px;
        line-height: 1.2;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    #view-about .about-content {
        order: 1;
    }

    .about-sidebar {
        order: 2;
        max-width: none;
    }

    .about-sidebar img,
    .about-photo img,
    .profile-photo,
    .profile-photo img {
        display: block;
        width: min(72vw, 260px);
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .project-cluster {
        padding: 16px 0 4px;
    }

    .project-cluster-intro,
    .project-details p,
    .project-body p {
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .project-banner-image img {
        max-height: 165px;
    }

    .paper-title {
        font-size: 1.14rem;
        line-height: 1.32;
    }

    .project-summary {
        padding: 12px;
        font-size: 0.96rem;
        line-height: 1.62;
    }

    .project-actions {
        gap: 8px;
        flex-wrap: wrap;
    }

    .project-actions .project-expand-btn,
    .project-actions .project-page-link {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .research-with-index {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #view-projects .container {
        padding-left: 12px;
        padding-right: 12px;
        overflow-x: clip;
    }

    #view-projects,
    #view-projects * {
        box-sizing: border-box;
        min-width: 0;
    }

    #view-projects .research-index {
        margin-bottom: 6px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--rule);
    }

    #view-projects .project-cluster {
        margin: 0;
        padding: 12px 0 2px;
    }

    #view-projects .project-cluster + .project-cluster {
        margin-top: 16px;
    }

    #view-projects .project-cluster-title {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0 0 10px;
        font-size: 1.06rem;
        line-height: 1.35;
        letter-spacing: 0.08em;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    #view-projects .project-cluster-title::before {
        display: none;
    }

    #view-projects .project-cluster-intro {
        margin: 0 0 14px;
    }

    #view-projects .project-item {
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }

    #view-projects .paper-title,
    #view-projects .project-cluster-intro,
    #view-projects .project-summary,
    #view-projects .project-details {
        width: 100%;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .research-index {
        position: static;
        top: auto;
        padding-right: 0;
        width: auto;
    }

    .research-index-toggle {
        display: none;
    }

    .research-index-nav {
        border-left: 0;
        padding-left: 0;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
    }

    .research-index-nav a,
    .research-index-nav a.is-sub {
        flex: 0 0 auto;
        font-size: 0.76rem;
        padding: 6px 9px;
        border: 1px solid var(--rule-dark);
        border-radius: 999px;
    }

    .pub-filters[data-pub-filter-root] {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pub-filter-controls {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .pub-filter-btn {
        width: 100%;
        min-height: 38px;
        font-size: 0.74rem;
        padding: 8px 10px;
    }

    .pub-filter-empty,
    .pub-list {
        grid-column: auto;
    }

    .pub-list li {
        margin-bottom: 22px;
        padding-bottom: 12px;
        overflow-wrap: anywhere;
    }

    .pub-text {
        font-size: 1rem;
        line-height: 1.65;
    }

    .pub-link {
        display: inline-block;
        margin-top: 4px;
    }

    .pub-plumx {
        margin-top: 0.55rem;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pub-plumx .plumx-plum-print-popup {
        display: inline-block;
        max-width: 100%;
    }

    .cv-embed-wrap {
        min-height: 58vh;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .footer::after {
        width: min(560px, 98%);
        height: 78px;
        opacity: 0.16;
        bottom: -10px;
    }
}

@media (max-width: 420px) {
    .header-inner {
        padding: 10px 12px;
    }

    .container {
        padding: 0 12px;
    }

    .section-heading {
        font-size: 1.48rem;
    }

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