@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono/fonts/webfonts/JetBrainsMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono/fonts/webfonts/JetBrainsMono-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Onest';
    src: url('../fonts/Onest/static/Onest-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Onest';
    src: url('../fonts/Onest/static/Onest-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Onest';
    src: url('../fonts/Onest/static/Onest-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../fonts/BricolageGrotesque/static/BricolageGrotesque-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Armada';
    src: url('../fonts/ArmadaRegular/Armada Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-bg: #04091A;
    --color-green: #08DF74;
    --color-blue: #3988D8;
    --color-hero-title-blue: #435AFA;
    --color-cyan: #00C1EB;
    --color-purple: #A855F7;
    --color-pink: #D34295;
    --color-gradient: #002FA7;
    --color-text: #ffffff;
    --color-gray: #9CA8B7;
    --color-gray-border: #8893A3;
    --color-hairline: #1A2236;
    --color-stat-bg: #23262C;

    --font-heading: 'Bricolage Grotesque', sans-serif;
    --font-body: 'Onest', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-armada: 'Armada', sans-serif;

    --content-max: 1320px;
    --page-margin: clamp(1.25rem, 4vw, 4rem);
    --nav-margin: clamp(1rem, 2.5vw, 2rem);
    --nav-height: 138px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.text-green { color: var(--color-green); }
.text-blue { color: var(--color-blue); }
.text-cyan { color: var(--color-cyan); }
.text-purple { color: var(--color-purple); }
.text-pink { color: var(--color-pink); }

.kicker {
    font-family: var(--font-armada);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.75em;
}

.section-title {
    font-family: var(--font-armada);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
}

/* Glow gradients */

.glow {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(90px);
    background: radial-gradient(circle, var(--color-gradient) 0%, transparent 70%);
}

.glow--corner {
    top: 3%;
    right: -3%;
    width: 41%;
    aspect-ratio: 1 / 1;
}

.glow--spot {
    left: -1%;
    bottom: 16%;
    width: 42%;
    aspect-ratio: 1 / 1;
}

.hero .glow--spot {
    width: 22%;
}

.cta .glow--corner {
    top: 14%;
    width: 16%;
    right: 7%
}

.cta .glow--spot {
    left: 12%;
    bottom: 27%;
    width: 16%;
}

.cta > :not(.glow),
.mission-body > :not(.glow) {
    position: relative;
    z-index: 1;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    padding: 0.95em 1.6em;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    border-radius: 0;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn-icon {
    width: 0.85em;
    height: 0.85em;
}

.btn-solid {
    background-color: var(--color-green);
    color: var(--color-bg);
}

.btn-solid:hover {
    opacity: 0.88;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-gray-border);
}

.btn-outline:hover {
    border-color: var(--color-text);
}

/* Navbar */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1.25rem var(--nav-margin);
    background-color: var(--color-bg);
}

.navbar-inner {
    margin: 0 2em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo img {
    height: 98px;
    width: auto;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.25rem;
    height: 2.25rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-item-wrap {
    position: relative;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    color: var(--color-text);
    opacity: 0.92;
}

.nav-item:hover {
    opacity: 1;
}

.nav-caret {
    display: inline-block;
    transition: transform 0.15s ease;
}

.nav-item-wrap:hover .nav-caret,
.nav-item-wrap.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    min-width: 12rem;
    background-color: #060C22;
    border: 1px solid var(--color-hairline);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.nav-item-wrap:hover .nav-dropdown-panel,
.nav-item-wrap:focus-within .nav-dropdown-panel,
.nav-item-wrap.is-open .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-link {
    padding: 0.6rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text);
}

.nav-dropdown-link:hover {
    color: var(--color-text);
    background-color: var(--color-hairline);
}

.nav-contact {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-green);
    border: 1px solid var(--color-green);
    padding: 0.55em 1.1em;
}

.nav-contact:hover {
    background-color: var(--color-green);
    color: var(--color-bg);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    letter-spacing: 0.04em;
}

.lang-btn:hover {
    color: var(--color-text);
}

.lang-btn.is-active {
    color: var(--color-green);
}

.lang-sep {
    color: var(--color-hairline);
}

/* Sections scroll normally, one after another, each with the same amount
   of breathing room above and below so the rhythm stays consistent. */

main > section {
    padding-top: calc(var(--nav-height) / 2 + 3.5rem);
    padding-bottom: calc(var(--nav-height) / 2 + 3.5rem);
    scroll-margin-top: var(--nav-height);
}

/* A section that opens a page (anything other than the full-viewport hero)
   sits flush under the fixed navbar, so it needs full clearance instead of
   the halved inter-section spacing above. :first-of-type (not :first-child)
   so this keeps matching even if a non-<section> element — the page
   loader, say — ends up as an earlier sibling inside <main>. */
main > section:first-of-type:not(.hero) {
    padding-top: calc(var(--nav-height) + 2rem);
}

.footer {
    scroll-margin-top: var(--nav-height);
}

/* Hero — the one section that keeps a full-viewport, vertically centered
   layout; the cycling banner right below it has padding-top: 0 so the two
   sit flush against each other. */

.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: var(--nav-height);
    padding-bottom: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 40%;
    padding: 0 2rem 0 var(--page-margin);
}

.hero-title {
    width: fit-content;
    max-width: 100%;
    font-family: var(--font-armada);
    font-weight: 600;
    font-size: clamp(2.75rem, 6vw, 4.5rem);
    line-height: 1.15;
    padding-bottom: 0.1em;
    background: linear-gradient(90deg, var(--color-hero-title-blue) 0%, var(--color-hero-title-blue) 0%, var(--color-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-lead {
    position: relative;
    z-index: 1;
    margin-top: 1.75rem;
    max-width: 32ch;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--color-text);
    white-space: nowrap;
}

.hero-actions {
    position: relative;
    z-index: 1;
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-visual {
    position: absolute;
    z-index: 1;
    top: var(--nav-height);
    right: 0;
    bottom: 0;
    width: 60%;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(125% 125% at 50% 50%, #000 88%, transparent 100%);
    mask-image: radial-gradient(125% 125% at 50% 50%, #000 88%, transparent 100%);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Cycling banner (partner logos) */

.cycling-banner {
    overflow: hidden;
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.cycling-track {
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.cycling-track-inner {
    display: flex;
    align-items: center;
    width: max-content;
    gap: 4rem;
    animation: cycling-scroll 36s linear infinite;
}

.cycling-track:hover .cycling-track-inner {
    animation-play-state: paused;
}

@keyframes cycling-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.cycling-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cycling-item img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.cycling-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}

.cycling-item a:hover {
    opacity: 0.75;
}

.cycling-item--text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--color-text);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .cycling-track-inner {
        animation: none;
    }
}

.cycling-cta {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

/* Áreas de Investigação */

.areas {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
}

.parceiros-em-breve {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
}

.areas-grid {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.area-card {
    padding: 2.5rem;
    border-right: 1px solid var(--color-hairline);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.area-card:nth-child(2n) {
    border-right: none;
}

.area-card:nth-child(-n+2) {
    border-bottom: 1px solid var(--color-hairline);
}

.area-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.area-number {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-gray);
    font-size: 0.95rem;
}

.area-chip,
.category-chip {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 0.45em 0.75em;
    border: 1px solid currentColor;
}

.category-chip--blue { color: var(--color-blue); }
.category-chip--cyan { color: var(--color-cyan); }
.category-chip--purple { color: var(--color-purple); }
.category-chip--pink { color: var(--color-pink); }
.category-chip--green { color: var(--color-green); }

.area-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.area-desc {
    color: var(--color-gray);
    font-size: 0.95rem;
    max-width: 42ch;
}

.area-card--blue { color: var(--color-blue); }
.area-card--cyan { color: var(--color-cyan); }
.area-card--purple { color: var(--color-purple); }
.area-card--pink { color: var(--color-pink); }

.area-card:hover {
    background-color: color-mix(in srgb, currentColor 8%, var(--color-bg));
}

/* Projetos */

.projects {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
}

.projects-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.projects-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    color: var(--color-gray);
    font-size: 0.95rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
    font-size: 0.85rem;
    color: var(--color-gray);
}

.breadcrumb-link {
    color: var(--color-gray);
}

.breadcrumb-link:hover {
    color: var(--color-text);
}

.breadcrumb-sep {
    color: var(--color-gray-border);
}

.breadcrumb-current {
    color: var(--color-text);
}

.link-icon {
    width: 0.85em;
    height: 0.85em;
}

.projects-list {
    margin-top: 2.5rem;
    border-top: 1px solid var(--color-hairline);
}

.project-row {
    display: grid;
    grid-template-columns: 4.5rem 3.5rem 9rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    padding: 1.75rem 2.5rem;
    border: none;
    border-bottom: 1px solid var(--color-hairline);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.project-row:hover {
    background-color: color-mix(in srgb, var(--color-blue) 6%, var(--color-bg));
}

.project-field {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-gray);
}

.project-year {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-gray);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.project-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
}

.project-desc {
    color: var(--color-gray);
    font-size: 0.9rem;
    max-width: 56ch;
}

.status-chip {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    justify-self: start;
}

.status-chip--blue { color: var(--color-blue); }
.status-chip--purple { color: var(--color-purple); }
.status-chip--gray { color: var(--color-gray-border); }
.status-chip--green { color: var(--color-green); }

.project-arrow {
    width: 0.85rem;
    height: 0.85rem;
    opacity: 0.9;
}

/* /projetos — all-projects page */

.projetos-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}

.projetos-title {
    color: var(--color-text);
}

.projetos-intro {
    max-width: 44ch;
    color: var(--color-gray);
    font-size: 0.95rem;
}

.project-panel-list {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
}

.project-panel-list > .project-panel {
    margin-bottom: 2rem;
}

.project-panel-list > .project-panel:last-child {
    margin-bottom: 0;
}

.project-image-fallback {
    width: 100%;
    max-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.project-image-fallback span {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--color-gray-border);
}

/* Project team grid (/projeto.php "Equipa" section) */

.team-grid {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 2rem 1rem;
    transition: background-color 0.2s ease;
}

.team-member:hover {
    background-color: color-mix(in srgb, var(--color-blue) 8%, var(--color-bg));
}

.team-member-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--color-hairline);
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A project logo isn't a headshot — cropping it to fill the circle (like a
   member photo) usually hides most of it. Shrunk to fit the circle's
   inscribed square instead, so the whole logo stays visible regardless of
   its aspect ratio, even if that means it renders smaller. */
.team-member-avatar--logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.member-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-avatar-fallback span {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-gray-border);
}

.team-member-name {
    font-weight: 600;
}

/* Member profile (/membro.php) */

.member-profile-header {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.member-profile-avatar {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--color-hairline);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-profile-avatar .member-avatar-fallback span {
    font-size: 2rem;
}

.member-profile-name {
    color: var(--color-text);
}

.member-profile-institution {
    margin-top: 0.5rem;
    color: var(--color-gray);
    font-size: 1.05rem;
}

.member-profile-email {
    margin-top: 0.35rem;
    display: inline-block;
    color: var(--color-blue);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.member-profile-email:hover {
    text-decoration: underline;
}

.member-profile-links {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.member-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    color: var(--color-text);
    font-size: 0.9rem;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.member-profile-link:hover {
    opacity: 1;
}

.member-profile-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    display: block;
}

.member-profile-resume {
    margin-top: 2.5rem;
    max-width: 65ch;
}

.member-profile-resume-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--color-gray);
    text-transform: uppercase;
}

.member-profile-resume p {
    margin-top: 0.75rem;
    color: var(--color-text);
    line-height: 1.6;
}

@media (max-width: 700px) {
    .member-profile-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.coming-soon {
    margin-top: 3rem;
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid var(--color-hairline);
    color: var(--color-gray);
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

.coming-soon-icon {
    font-size: 48px;
    color: var(--color-blue);
}

.coming-soon-text {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

/* Generic content page sections (SOBRE, INVESTIGAÇÃO, IMPACTO, RECURSOS, CONTACTOS) */

.page-block {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
}

.partner-grid {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.partner-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-height: 100px;
    background-color: #0A1128;
    border: 1px solid var(--color-hairline);
    transition: border-color 0.2s ease;
}

.partner-tile:hover {
    border-color: var(--color-gray-border);
}

.partner-tile img {
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
}

.partner-tile--text {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text);
    text-align: center;
}

.network-card {
    margin-top: 2.5rem;
    max-width: 640px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: #0A1128;
    border: 1px solid var(--color-hairline);
}

.network-card-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.3rem;
}

.network-card-desc {
    color: var(--color-gray);
}

.network-card-authors {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-gray);
}

/* O Hub (SOBRE) */

.ohub-lead {
    margin-top: 1.5rem;
    max-width: 60ch;
    font-size: 1.1rem;
    color: var(--color-text);
}

.ohub-lead p + p {
    margin-top: 1rem;
}

/* Legal pages (Privacidade / Termos / Cookies) */

.legal-body {
    margin-top: 2rem;
    max-width: 70ch;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.legal-body p {
    color: var(--color-gray);
    font-size: 1rem;
    line-height: 1.6;
}

/* Missão */

.mission {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
}

.mission-body {
    position: relative;
    margin-top: 1.5rem;
    max-width: 44rem;
}

.mission-quote {
    position: relative;
    z-index: 1;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    line-height: 1.35;
}

/* Pillars (nested inside Missão) */

.mission .pillars-grid {
    margin-top: 4rem;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.pillar {
    padding: 2.5rem 1.5rem;
    transition: background-color 0.2s ease;
}

.pillar:hover {
    background-color: color-mix(in srgb, currentColor 8%, var(--color-bg));
}

.pillar-icon {
    display: block;
    margin-bottom: 1.75rem;
}

.pillar--blue { color: var(--color-blue); }
.pillar--purple { color: var(--color-purple); }
.pillar--pink { color: var(--color-pink); }

.pillar-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--color-text);
    margin-bottom: 0.6rem;
}

.pillar-desc {
    color: var(--color-gray);
    font-size: 1rem;
    max-width: 26ch;
}

/* Stats (its own section, moved here from the home page's Colaboração block) */

.stats {
    width: 100%;
}

.stats-grid {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--page-margin);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.stat {
    background-color: var(--color-stat-bg);
    padding: 1.75rem 2rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.stat:hover {
    background-color: color-mix(in srgb, var(--color-blue) 14%, var(--color-stat-bg));
    transform: translateY(-3px);
}

.stat-number {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 2.75rem);
}

.stat-label {
    margin-top: 0.4rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
}

.stat-sub {
    margin-top: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--color-gray);
}

/* CTA / Colaboração */

.cta {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.cta .glow {
    opacity: 0.55;
}

.cta-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
    padding-bottom: 2rem;
}

.cta-row {
    margin-top: 1.5rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cta-lead {
    margin-top: 1.5rem;
    max-width: 42ch;
    color: var(--color-gray);
    font-size: 1rem;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Contactos */

.contact {
    position: relative;
    overflow: hidden;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
}

.contact-body {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
    padding-bottom: 3rem;
}

.contact-body--single {
    grid-template-columns: 1fr;
}

.contact-copy {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.contact-icon {
    flex-shrink: 0;
    color: var(--color-blue);
}

.contact-address {
    font-style: normal;
    max-width: 40ch;
    color: var(--color-gray);
    font-size: 1.1rem;
    line-height: 1.7;
}

.contact-map {
    width: 100%;
    height: 320px;
    border: 1px solid var(--color-hairline);
    overflow: hidden;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Footer */

.footer {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4rem) var(--page-margin) 2rem;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-logo img {
    height: 156px;
    width: auto;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 8rem;
}

.footer-contact-row {
    width: 100%;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.footer-link {
    color: var(--color-text);
    opacity: 0.85;
    font-size: 0.92rem;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-logos-section {
    padding: 2rem 0;
    border-top: 1px solid var(--color-hairline);
}

.footer-logos-block {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.footer-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2.5rem;
}

.footer-logos img {
    height: 32px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.footer-logos img:hover {
    opacity: 1;
}

.footer-financing {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--color-gray);
}

.footer-financing span {
    color: var(--color-text);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-hairline);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--color-gray);
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
}

.footer-legal a:hover {
    color: var(--color-text);
}

/* Page loader — covers only the content area below the fixed navbar
   (top: var(--nav-height)), so the navbar itself is never hidden. */

.page-loader {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--color-hairline);
    border-top-color: var(--color-green);
    border-radius: 50%;
    animation: page-loader-spin 0.8s linear infinite;
}

@keyframes page-loader-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .page-loader-spinner {
        animation: none;
    }
}

/* Back to top */

.back-to-top {
    position: fixed;
    right: clamp(1.25rem, 3vw, 2.5rem);
    bottom: calc(clamp(1.25rem, 3vw, 2.5rem) + var(--cookie-banner-offset, 0px));
    z-index: 40;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    border: 1px solid var(--color-hairline);
    color: var(--color-text);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, border-color 0.15s ease, bottom 0.25s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--color-text);
}

/* Cookie consent banner */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.25rem clamp(1.25rem, 3vw, 2.5rem);
    background-color: #060C22;
    border-top: 1px solid var(--color-hairline);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.is-visible {
    transform: translateY(0);
}

.cookie-banner-text {
    max-width: 70ch;
    color: var(--color-gray);
    font-size: 0.9rem;
    text-align: center;
}

.cookie-banner-text a {
    color: var(--color-blue);
    text-decoration: underline;
}

.cookie-banner-accept {
    cursor: pointer;
    flex-shrink: 0;
    padding: 0.6em 1.4em;
}

/* Projects list / single project pages */

.project-page {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--page-margin);
}

.project-page .project-panel,
.project-page#equipa {
    margin-top: 2.5rem;
}

.project-panel {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
    gap: 2rem;
    background-color: var(--color-bg);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.project-panel:hover {
    background-color: color-mix(in srgb, var(--color-blue) 6%, var(--color-bg));
    border-color: var(--color-gray-border);
}

@media (max-width: 720px) {
    .project-panel {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .project-modal-meta {
        margin-bottom: 0.5rem;
    }
}

/* Project modal */

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.project-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.project-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(4, 9, 26, 0.85);
    backdrop-filter: blur(4px);
}

.project-modal-frame {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    transform: translateY(12px);
    transition: transform 0.2s ease;
}

.project-modal.is-open .project-modal-frame {
    transform: translateY(0);
}

.project-modal-panel {
    width: 100%;
    max-height: 82vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    background-color: #0A1128;
    border: 1px solid var(--color-hairline);
}

.project-modal-close {
    position: absolute;
    top: -3.25rem;
    right: 0;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(4, 9, 26, 0.6);
    border: 1px solid var(--color-hairline);
    color: var(--color-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.project-modal-close:hover {
    border-color: var(--color-text);
}

.project-modal-image {
    min-height: 120px;
    background-color: var(--color-hairline);
}

.project-modal-image--contain {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.25rem;
}

.project-modal-image--contain img {
    max-width: 100%;
    max-height: 90px;
    object-fit: contain;
}

.project-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 20px;
}

.project-modal-meta {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.project-modal-meta .status-chip {
    margin-left: auto;
}

.project-modal-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.5rem;
}

.project-modal-desc {
    color: var(--color-text);
    font-size: 0.98rem;
}

.project-modal-footer {
    margin-top: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}

.project-modal-authors {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    min-width: 0;
    flex: 1 1 auto;
    color: var(--color-gray);
    font-size: 0.9rem;
}

.project-modal-authors .js-authors {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-modal-footer .btn {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0.55em 1.1em;
    font-size: 0.75rem;
    color: var(--color-gray);
    border: 1px solid var(--color-gray-border);
}

.project-detail-description {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-detail-coordinator,
.project-detail-entity,
.project-detail-financing {
    color: var(--color-text);
    font-size: 0.85rem;
    line-height: 1.5;
}

.project-modal-footer--end {
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.project-detail-financing a {
    color: inherit;
    text-decoration: underline;
}

.project-detail-financing-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.project-detail-financing-logos img {
    height: 2.5rem;
    width: auto;
    object-fit: contain;
}

/* ==========================================================================
   Mobile / responsive (desktop rules above are left untouched)
   ========================================================================== */

@media (max-width: 960px) {
    /* Tablet-portrait and below gets the full mobile navbar (hamburger,
       shrunk logo, no extra inner margin) — desktop keeps the full nav-menu
       at every width above this, no partial/hybrid state in between. */
    :root {
        --nav-height: 68px;
    }

    .navbar {
        padding: 0.75rem var(--nav-margin);
    }

    .navbar-inner {
        margin: 0;
    }

    .nav-logo img {
        height: 44px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background-color: var(--color-bg);
        border-top: 1px solid var(--color-hairline);
        padding: 0.5rem var(--nav-margin) 1.5rem;
    }

    .nav-menu.is-open {
        display: flex;
    }

    .nav-item-wrap {
        width: 100%;
    }

    .nav-item {
        width: 100%;
        justify-content: space-between;
        padding: 1rem 0;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--color-hairline);
    }

    .nav-dropdown-panel {
        position: static;
        left: auto;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        border: none;
        background: none;
        min-width: 0;
        padding: 0.25rem 0 0.75rem 1rem;
        display: none;
    }

    .nav-item-wrap.is-open .nav-dropdown-panel {
        display: flex;
    }

    .nav-contact {
        width: 100%;
        justify-content: center;
        margin-top: 1.25rem;
        font-size: 0.9rem;
        padding: 0.75em 1.1em;
    }

    .lang-switch {
        justify-content: center;
        margin-top: 1rem;
    }

    main > section {
        padding-top: calc(var(--nav-height) / 2 + 2rem);
        padding-bottom: calc(var(--nav-height) / 2 + 2rem);
    }

    .hero {
        min-height: auto;
    }

    .cycling-banner {
        padding-bottom: 2rem;
    }

    /* .hero-content's own box disappears so its children (title, lead,
       actions) can be reordered independently around the image below,
       while still inheriting the flex column layout from .hero. */
    .hero-content {
        display: contents;
    }

    .hero-title {
        order: 1;
        position: relative;
        z-index: 1;
        padding: 2rem var(--page-margin) 0;
    }

    .hero-visual {
        order: 2;
        position: static;
        width: 100%;
        height: 260px;
        margin-top: 1.5rem;
        padding: 0 var(--page-margin);
    }

    .hero-lead {
        order: 3;
        padding: 1.5rem var(--page-margin) 0;
        margin-top: 0;
        max-width: none;
        white-space: normal;
    }

    .hero-actions {
        order: 4;
        padding: 0 var(--page-margin);
        margin-bottom: 3rem;
    }

    /* Touch devices can get "stuck" hover states after a tap — the hero
       CTAs shouldn't visually stay pressed until the user taps elsewhere. */
    .hero-actions .btn-solid:hover {
        opacity: 1;
    }

    .hero-actions .btn-outline:hover {
        border-color: var(--color-gray-border);
    }

    .cycling-item img {
        height: 30px;
    }

    .cycling-item--text {
        font-size: 1.1rem;
    }

    .contact-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-map {
        height: 240px;
    }

    .areas-grid {
        grid-template-columns: 1fr;
    }

    .area-card {
        border-right: none;
    }

    .area-card:not(:last-child) {
        border-bottom: 1px solid var(--color-hairline);
    }

    .project-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "status"
            "info info"
            "arrow arrow";
        row-gap: 0.75rem;
        padding: 1.75rem 1.25rem;
    }

    .project-field, .project-year { display: none; }
    .project-info { grid-area: info; }
    .status-chip { grid-area: status; justify-self: end; }
    .project-arrow { grid-area: arrow; justify-self: end; }

    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cta-row {
        align-items: flex-start;
    }

    .project-modal {
        padding: 3.5rem 1.5rem 1.5rem;
    }

    .project-modal-panel {
        grid-template-columns: 1fr;
        max-height: 85vh;
    }

    .project-modal-image {
        min-height: 110px;
    }

    .project-modal-body {
        padding: 2rem;
    }
}

@media (max-width: 700px) {
    .hero-visual {
        height: 200px;
    }

    .hero-title {
        font-size: clamp(2.25rem, 9vw, 3rem);
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .cycling-cta .btn {
        width: auto;
        padding: 0.6em 1.2em;
        font-size: 0.85rem;
    }

    .areas,
    .projects,
    .mission,
    .cta-inner,
    .contact {
        padding-left: var(--page-margin);
        padding-right: var(--page-margin);
    }

    .area-card {
        padding: 1.75rem 0;
    }

    .project-row {
        padding: 1.5rem 0;
    }

    .projects-list {
        margin-top: 1.75rem;
    }

    .mission-quote {
        font-size: clamp(1.4rem, 7vw, 1.9rem);
    }

    .pillars-grid {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }

    .pillar {
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cta-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .cta-actions {
        width: 100%;
    }

    .cta-actions .btn {
        width: 100%;
    }

    .footer-top {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-columns {
        gap: 2rem 2.5rem;
    }

    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .cookie-banner-accept {
        width: 100%;
        justify-content: center;
    }

    .project-modal {
        padding: 0;
    }

    .project-modal-frame {
        max-width: 100%;
        height: 100%;
    }

    .project-modal-close {
        position: fixed;
        top: 1rem;
        right: 1rem;
    }

    .project-modal-panel {
        max-height: 100vh;
        height: 100%;
        border: none;
    }

    .project-modal-footer {
        flex-wrap: wrap;
    }

    .project-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

