:root {
    --color-charcoal: #2F495A;
    --color-teal: #00C399;
    --color-yellow: #FFBC42;
    --color-cyan: #16A8E2;
    --color-orange: #FC594D;
    --color-bg: #F5F7F9;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-light: #6B6B6B;
    --color-border: #E5E5E5;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    position: sticky;
    top: 0;
    background: rgba(245, 247, 249, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    padding: 20px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    height: 80px;
    width: auto;
    display: block;
}

.logo-link {
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
}

/* Hero */
.hero {
    text-align: center;
}

.hero h1 {
    font-family: 'Roboto Slab', 'Nunito', Georgia, serif;
    font-size: clamp(36px, 8vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-top: 40px;
    margin-bottom: 24px;
    color: var(--color-text);
}

.hero-highlight {
    color: var(--color-orange);
    font-weight: 700;
}

.hero .subtitle {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 400;
    color: var(--color-text-light);
    max-width: 700px;
    margin: 0 auto 16px;
    line-height: 1.5;
}

.hero .subtitle strong {
    color: var(--color-teal);
    font-weight: 600;
}

.hero .dates {
    font-size: 28px;
    font-weight: 500;
    color: var(--color-text-light);
    letter-spacing: 0.1em;
    margin-bottom: 0;
}

.hero-image {
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 24px;
}

.summary-image {
    max-width: 500px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px auto;
    display: block;
}

/* Sections */

.hero {
    padding-top: 0;
}

h2 {
    font-family: 'Roboto Slab', 'Nunito', Georgia, serif;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: 40px;
    margin-bottom: 32px;
    color: var(--color-text);
}

h2::before {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-teal);
    margin-bottom: 20px;
}

.section-intro {
    font-size: 20px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 60px;
}

/* Summary */
.summary {
    background: var(--color-surface);
    padding: 5%;
    margin: 7% 0;
    border-left: 6px solid var(--color-teal);
}

.summary h2 {
    margin-top: 40px;
    margin-bottom: 40px;
}

.summary h2::before {
    background: var(--color-teal);
}

.summary p {
    font-size: 18px;
    line-height: 1.8;
    color: var(--color-text-light);
    margin-bottom: 28px;
}

.summary p:last-child {
    margin-bottom: 0;
}

.closure-date {
    color: var(--color-orange);
    font-weight: 600;
}

/* Team Section */
.team {
    background: var(--color-surface);
    padding: 5%;
    margin: 7% 0;
    border-left: 6px solid var(--color-yellow);
}

.team h2 {
    margin-bottom: 40px;
}

.team h2::before {
    background: var(--color-yellow);
}

.team h3 {
    font-family: 'Roboto Slab', 'Nunito', Georgia, serif;
    font-size: 24px;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 32px;
    color: var(--color-text);
    padding-bottom: 12px;
    position: relative;
}

.team h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-cyan);
}

.team-member {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    padding: 32px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.team-member:hover {
    border-color: var(--color-teal);
    box-shadow: 0 6px 20px rgba(0, 195, 153, 0.12);
}

.team-member-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid var(--color-teal);
}

.team-member-image-2 {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid var(--color-cyan);
}

.team-member h4 {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.team-member a {
    color: var(--color-cyan);
    font-weight: 500;
    text-decoration: none;
}

.team-member a:hover {
    color: var(--color-teal);
}

.team-member .role {
    display: inline-block;
    background: var(--color-teal);
    color: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

.team-member .role.collaborator {
    background: var(--color-cyan);
}

.team-member p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-top: 12px;
}

/* Social icon images */
.social-icon {
    width: 1.2rem;
    height: 1.2rem;
    object-fit: contain;
    vertical-align: middle;
}

/* Social media icons for team members */
.team-social-icons {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.75rem;
}

.team-social-icons a {
    color: var(--color-cyan);
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.team-social-icons a:hover,
.team-social-icons a:focus-visible {
    color: var(--color-yellow);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    margin-bottom: 40px;
}

/* Achievements/Our Work */
.achievements {
    background: var(--color-surface);
    padding: 5%;
    margin: 7% 0;
    border-left: 6px solid var(--color-teal);
}

.achievements h2 {
    margin-bottom: 40px;
}

.achievements h2::before {
    background: var(--color-teal);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 60px;
}

.project-card {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    padding: 40px;
    transition: all 0.3s ease;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--color-teal), var(--color-cyan), var(--color-orange));
}

.project-card:hover {
    border-color: var(--color-teal);
    box-shadow: 0 8px 24px rgba(0, 195, 153, 0.12);
    transform: translateY(-4px);
}

.project-card h3 {
    font-family: 'Roboto Slab', 'Nunito', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text);
    margin-top: 8px;
}

.project-card p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.project-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-cyan);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.project-link:hover {
    color: var(--color-teal);
}

.project-link::after {
    content: '→';
    transition: transform 0.2s;
}

.project-link:hover::after {
    transform: translateX(4px);
}

/* Resources */
.resources {
    background: var(--color-surface);
    padding: 5%;
    margin: 7% 0;
    border-left: 6px solid var(--color-cyan);
}

.resources h2 {
    margin-bottom: 50px;
}

.resources h2::before {
    background: var(--color-cyan);
}

/* Contact Section */
.contact {
    background: var(--color-surface);
    padding: 80px;
    margin: 100px 0;
    border-left: 6px solid var(--color-orange);
}

.contact h2 {
    margin-bottom: 40px;
}

.contact h2::before {
    background: var(--color-orange);
}

.resource-section {
    margin-bottom: 60px;
}

.resource-section .resource-item {
    margin-bottom: 20px;
}

.resource-section .resource-item:last-child {
    margin-bottom: 0;
}

.resource-section:last-child {
    margin-bottom: 0;
}

.resource-section h3 {
    font-family: 'Roboto Slab', 'Nunito', Georgia, serif;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--color-text);
    position: relative;
    padding-bottom: 12px;
}

.resource-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-yellow);
}

.resource-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.resource-item {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.resource-item::left {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-yellow);
    border-radius: 8px 0 0 8px;
}

.resource-item:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 6px 20px rgba(22, 168, 226, 0.1);
}

.resource-item h4 {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.resource-item p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

.resource-meta {
    font-size: 13px;
    color: var(--color-text-light);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
}

.resource-meta a {
    color: var(--color-cyan);
    font-weight: 500;
}

.resource-meta a:hover {
    color: var(--color-teal);
}

.placeholder {
    color: var(--color-text-light);
    opacity: 0.6;
    font-style: italic;
}

/* GitHub Repository Cards */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.repo-card {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.repo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.repo-card h4 {
    font-family: 'Roboto Slab', 'Nunito', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.repo-card h4 a {
    color: inherit;
    text-decoration: none;
}

.repo-card h4 a:hover {
    text-decoration: underline;
}

.repo-card p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

.repo-card .repo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    padding: 8px 16px;
    background: var(--color-surface);
    border-radius: 0;
    transition: all 0.2s ease;
}

.repo-link, .start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    padding: 8px 16px;
    background: var(--color-surface);
    border-radius: 0;
    transition: all 0.2s ease;
}

/* General repo-link hover - for Publications & Resources */
.repo-link:hover {
    color: white;
    background: var(--color-cyan);
}

.start-btn{
    color: white;
    background: var(--color-cyan);
}

.start-btn:hover{
    color: white;
    background: var(--color-teal);
}

/* Repo card color variants */
.repo-card--teal::before { background: var(--color-teal); }
.repo-card--teal:hover { border-color: var(--color-teal); }
.repo-card--teal .repo-link:hover { background: var(--color-teal) !important; color: white !important; }

.repo-card--yellow::before { background: var(--color-yellow); }
.repo-card--yellow:hover { border-color: var(--color-yellow); }
.repo-card--yellow .repo-link:hover { background: var(--color-yellow) !important; color: white !important; }

.repo-card--cyan::before { background: var(--color-cyan); }
.repo-card--cyan:hover { border-color: var(--color-cyan); }
.repo-card--cyan .repo-link:hover { background: var(--color-cyan) !important; color: white !important; }

.repo-card--orange::before { background: var(--color-orange); }
.repo-card--orange:hover { border-color: var(--color-orange); }
.repo-card--orange .repo-link:hover { background: var(--color-orange) !important; color: white !important; }

.repo-card--charcoal::before { background: var(--color-charcoal); }
.repo-card--charcoal:hover { border-color: var(--color-charcoal); }
.repo-card--charcoal .repo-link:hover { background: var(--color-charcoal) !important; color: white !important; }

/* Footer */
footer {
    background: var(--color-charcoal);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 0;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-logo {
    display: flex;
    justify-content: center;
}

.footer-logo img {
    width: 120px;
    height: 42px;
    filter: none;
}

.footer-text {
    color: #FFFFFF;
}

.footer-text p {
    margin: 0;
    font-size: 14px;
}

.footer-text a {
    color: var(--color-cyan);
    text-decoration: none;
}

.footer-text a:hover {
    color: var(--color-teal);
    text-decoration: underline;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--color-teal);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 195, 153, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-cyan);
    transform: translateY(-5px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-logo {
    display: flex;
    justify-content: center;
}

.footer-logo img {
    width: 120px;
    height: 42px;
    filter: none;
}

.footer-text {
    color: #FFFFFF;
}

.footer-text p {
    margin: 0;
    font-size: 14px;
}

.footer-text a {
    color: var(--color-cyan);
    text-decoration: none;
}

.footer-text a:hover {
    color: var(--color-teal);
    text-decoration: underline;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-text);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-yellow);
    outline-offset: 3px;
}

/* Global link styles for accessibility */
a {
    color: var(--color-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--color-teal);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

a:focus-visible {
    outline: 2px solid var(--color-yellow);
    outline-offset: 3px;
    border-radius: 2px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-yellow);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

@media (prefers-contrast: more) {
    :root {
        --color-text: #000000;
        --color-bg: #ffffff;
        --color-surface: #ffffff;
        --color-border: #000000;
    }
    
    .repo-card,
    .project-card,
    .team-member,
    .summary,
    .team,
    .achievements,
    .resource-item {
        border-width: 2px;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .repo-card::before,
    .project-card::before,
    .team h3::after,
    .resource-section h3::after,
    .achievements h2::before,
    .team h2::before,
    .contact h2::before {
        forced-color-adjust: none;
    }
    
    .repo-card,
    .project-card,
    .team-member,
    .summary,
    .resource-item {
        border: 2px solid ButtonText;
    }
    
    .repo-link,
    .project-link,
    a {
        color: LinkText;
    }
}

/* Logo link - remove underline */
.logo-link {
    text-decoration: none;
}

/* Report cover images */
.report-cover {
    margin: 16px 0;
    border: 2px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.report-cover--portrait {
    max-width: 200px;
    height: auto;
    max-height: 280px;
    object-fit: cover;
}

.report-cover--landscape {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}

/* Publications grid responsive */
@media (max-width: 768px) {
    .resource-list {
        grid-template-columns: 1fr;
    }
}

/* Preview images in Media & Resources */
.resource-preview {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    margin-bottom: 16px;
    border: 2px solid var(--color-border);
}

/* Media & Resources - Square cards */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.media-card {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    transition: all 0.3s ease;
    overflow: hidden;
}

.media-card:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 6px 20px rgba(22, 168, 226, 0.12);
}

.media-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.media-card-content {
    padding: 24px;
}

.media-card-content h4 {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.media-card-content p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
}

/* Publications & Resources buttons - specific hover */
.resource-list .repo-link:hover,
.resource-meta .repo-link:hover,
.media-card-content .repo-link:hover {
    color: white !important;
    background: var(--color-cyan) !important;
}

/* Mobile overflow fixes */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 16px;
    }
    
    img,
    svg,
    .report-cover,
    .media-card-image {
        max-width: 100%;
        height: auto;
    }
    
    .hero h1 {
        word-break: break-word;
    }
    
    .team-member-image,
    .team-member-image-2 {
        max-width: 100%;
        height: auto;
    }
}
