:root {
    --uah-blue: #004a98;
    /* inspired by UAH corporate blue */
    --uah-blue-light: #e3f2fd;
    --uah-gray-light: #f5f5f5;
    --uah-gray-mid: #888888;
    --uah-accent: #009688;
    --text-main: #222222;
    --text-muted: #555555;
    --max-width: 1100px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background-color: #ffffff;
    line-height: 1.6;
}

a {
    color: var(--uah-blue);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #ffffff;
    color: #000000;
    padding: 0.5rem 1rem;
    z-index: 1000;
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

/* Header & navigation */
header {
    background-color: #ffffff;
    border-bottom: 3px solid var(--uah-blue);
    /*position: sticky;*/
    top: 0;
    z-index: 999;
}

header#main-header {
    position: sticky;
}

.top-bar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Branding variants */
.logo-combo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.uah-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.traps-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.about-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 1rem;
}

.project-logo {
    display: block;
    margin: 1rem auto;
    width: auto;
    max-height: 100px;
    min-height: 50px;
    height: auto;
    border-radius: 8px;
}

.group-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--uah-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--uah-blue);
    background: var(--uah-blue-light);
}

.logo-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--uah-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.branding-text {
    display: flex;
    flex-direction: column;
}

.branding-text span.small {
    font-size: 0.75rem;
    color: var(--uah-gray-mid);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.branding-text span.group-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--uah-blue);
}

.home-link {
    font-size: 0.85rem;
    color: var(--uah-gray-mid);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
}

nav a {
    color: var(--text-main);
    font-weight: 600;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
}

nav a:hover,
nav a:focus {
    border-bottom-color: var(--uah-blue);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--uah-blue);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    color: var(--uah-blue);
}

@media (max-width: 700px) {
    nav ul {
        display: none;
        position: absolute;
        right: 1rem;
        top: 56px;
        flex-direction: column;
        background: #ffffff;
        border: 1px solid #dddddd;
        padding: 0.75rem 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    nav ul.open {
        display: flex;
    }

    .nav-toggle {
        display: inline-block;
    }
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--uah-blue) 0%, #005fcc 45%, #0d47a1 100%);
    color: #ffffff;
    padding: 3.5rem 1rem 3rem;
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem;
    align-items: center;
}

.hero h1 {
    margin-top: 0;
    font-size: clamp(2rem, 3vw + 1rem, 2.6rem);
}

.hero h1 span.acronym {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85em;
    display: block;
    margin-bottom: 0.25rem;
}

.hero p.lead {
    font-size: 1.05rem;
    max-width: 40rem;
    margin-bottom: 1.5rem;
}

.hero-meta {
    font-size: 0.9rem;
}

.hero-meta strong {
    display: block;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8bc34a;
}

.hero-visual {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-visual h2 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Hero lists/tags variants */
.hero-tags,
.hero-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-tags li {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.78rem;
}

.hero-list {
    flex-direction: column;
    font-size: 0.88rem;
}

.hero-list li {
    margin-bottom: 0.35rem;
}

.hero-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.funder-logo {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.funder-logo img {
    height: 80px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    border-radius: 4px;
    padding: 2px 4px;
}

.footer-copyright-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-funding-line {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.funding-acknowledgments {
    font-size: 0.74rem;
    line-height: 1.35;
    max-width: 500px;
    color: var(--text-muted);
    margin: 0;
}

.copyright-text {
    line-height: 1.3;
}

.footer-logos {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.footer-logos img {
    height: 64px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    border-radius: 4px;
    padding: 4px 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Layout helpers */
main {
    padding: 2.5rem 1rem 3rem;
}

.section {
    max-width: var(--max-width);
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.section:last-of-type {
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.6rem;
    margin: 0;
    color: var(--uah-blue);
}

.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--uah-gray-mid);
    margin-bottom: 0.25rem;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.25rem;
    align-items: flex-start;
}

@media (max-width: 900px) {

    .hero-inner,
    .two-column {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Common components */
.highlight-box {
    background: var(--uah-gray-light);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
    border-left: 4px solid var(--uah-blue);
    font-size: 0.9rem;
}

.subsection-title {
    font-size: 1.02rem;
    margin-top: 0;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.pill-list {
    list-style: none;
    padding: 0;
    margin: 0.4rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pill-list li {
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--uah-blue-light);
    color: var(--text-muted);
}

/* About section (Specific to index) */
.about-text p {
    margin-top: 0;
    margin-bottom: 0.9rem;
}

.about-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.about-list li {
    padding-left: 1.2rem;
    position: relative;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.about-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--uah-accent);
}

.about-aside {
    background: var(--uah-gray-light);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    border-left: 4px solid var(--uah-blue);
    font-size: 0.9rem;
}

.about-aside h3 {
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.about-affiliation {
    margin: 0;
}

.about-affiliation strong {
    display: block;
}

.about-image-placeholder {
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px dashed #cccccc;
    padding: 0.75rem;
    background: #ffffff;
    font-size: 0.8rem;
    color: var(--uah-gray-mid);
}

/* People section (Specific to index) */
.people-intro {
    max-width: var(--max-width);
    font-size: 0.98rem;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.75rem;
}

.person-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.1rem 1.2rem 1.2rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.person-header {
    display: flex;
    align-items: normal;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.person-img {
    width: 64px;
    height: 80px;
    border-radius: 30%;
    object-fit: cover;
    border: 2px solid var(--uah-blue-light);
    flex-shrink: 0;
}

.person-meta {
    flex: 1;
}

.person-name {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
}

.person-name h3 {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    color: var(--uah-blue);
}

.person-link {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--uah-gray-mid);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: color 0.15s ease;
}

.person-link:hover {
    color: var(--uah-accent);
}

.person-role {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--uah-gray-mid);
    margin-bottom: 0.35rem;
}

.person-bio {
    font-size: 0.9rem;
    margin: 0;
}

/* Research topics section (Specific to index) */
.topics-intro {
    max-width: var(--max-width);
    font-size: 0.98rem;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.75rem;
}

.topic-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.25rem 1.3rem 1.4rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.topic-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--uah-blue);
}

.topic-meta {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--uah-gray-mid);
    margin-bottom: 0.4rem;
}

.topic-card p {
    font-size: 0.92rem;
    margin-bottom: 0.6rem;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.topic-tags li {
    font-size: 0.78rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--uah-blue-light);
    color: var(--text-muted);
}

/* Projects section (Specific to index) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.2rem 1.3rem 1.3rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
    color: var(--uah-blue);
}

.project-meta {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--uah-gray-mid);
    margin-bottom: 0.4rem;
}

.project-card p {
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

.project-links a {
    font-size: 0.86rem;
    font-weight: 600;
}

/* Footer */
footer {
    border-top: 1px solid #e0e0e0;
    padding: 1.25rem 1rem 1.75rem;
    background: #fafafa;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.footer-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    white-space: nowrap;
}

.back-to-top {
    margin-left: auto;
}

.back-to-top a {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
}

/* Focus outlines */
:focus-visible {
    outline: 2px solid var(--uah-accent);
    outline-offset: 2px;
}