/* =========================================================
   RESEARCH PAGE
   ========================================================= */

:root {
    --research-text: #eef6ff;
    --research-muted: #b8c8da;
    --research-blue: #7ec8ff;
    --research-bright-blue: #a9ddff;
    --research-card: rgba(7, 24, 48, 0.82);
    --research-card-light: rgba(15, 42, 75, 0.72);
    --research-border: rgba(144, 205, 255, 0.22);
    --research-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
}

/* Keep the star canvas behind everything */
#starfield {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

body {
    margin: 0;
    color: var(--research-text);
    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(27, 85, 145, 0.22),
            transparent 35%
        ),
        radial-gradient(
            circle at 80% 65%,
            rgba(55, 45, 145, 0.15),
            transparent 40%
        ),
        #020c1d;
}

.research-page {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 80px;
}

.research-page * {
    box-sizing: border-box;
}

.research-page h1,
.research-page h2,
.research-page h3,
.research-page p,
.research-page figure {
    margin-top: 0;
}

.research-page h1,
.research-page h2,
.research-page h3 {
    color: var(--research-text);
}

.research-page p {
    color: var(--research-muted);
    line-height: 1.75;
}

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

/* =========================================================
   BACK BUTTON
   ========================================================= */

.home-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 30px 10px;
    padding: 11px 18px;
    color: var(--research-text);
    text-decoration: none;
    border: 1px solid var(--research-border);
    border-radius: 999px;
    background: rgba(10, 31, 59, 0.72);
    backdrop-filter: blur(10px);
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.home-button:hover {
    transform: translateY(-2px);
    background: rgba(24, 65, 104, 0.82);
    border-color: rgba(144, 205, 255, 0.48);
}

.home-arrow {
    transition: transform 0.2s ease;
}

.home-button:hover .home-arrow {
    transform: translateX(-3px);
}

/* =========================================================
   GENERAL COMPONENTS
   ========================================================= */

.content-card {
    margin-bottom: 34px;
    padding: clamp(26px, 4vw, 48px);
    border: 1px solid var(--research-border);
    border-radius: 24px;
    background:
        linear-gradient(
            145deg,
            rgba(16, 44, 79, 0.84),
            rgba(5, 19, 40, 0.88)
        );
    box-shadow: var(--research-shadow);
    backdrop-filter: blur(14px);
}

.section-eyebrow {
    margin-bottom: 8px;
    color: var(--research-blue) !important;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.section-heading {
    margin-bottom: 30px;
}

.section-heading h2 {
    margin-bottom: 12px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.1;
}

.centered-heading {
    max-width: 760px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

/* =========================================================
   HERO
   ========================================================= */

.research-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 46px;
    align-items: center;
    min-height: 520px;
    margin-bottom: 38px;
    padding: clamp(30px, 5vw, 64px);
    overflow: hidden;
    border: 1px solid var(--research-border);
    border-radius: 28px;
    background:
        linear-gradient(
            115deg,
            rgba(7, 30, 61, 0.94),
            rgba(12, 49, 89, 0.76)
        );
    box-shadow: var(--research-shadow);
}

.research-hero h1 {
    margin-bottom: 18px;
    font-size: clamp(3.5rem, 8vw, 6.8rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.research-introduction {
    max-width: 700px;
    font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.research-hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.research-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    padding: 12px 20px;
    color: var(--research-text);
    font-weight: 700;
    text-decoration: none;
    border-radius: 999px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.research-button:hover {
    transform: translateY(-2px);
}

.primary-button {
    color: #02101f;
    background: linear-gradient(135deg, #9cddff, #5ebfff);
    box-shadow: 0 8px 25px rgba(75, 179, 255, 0.25);
}

.secondary-button {
    border: 1px solid rgba(153, 213, 255, 0.45);
    background: rgba(72, 141, 196, 0.12);
}

.secondary-button:hover {
    background: rgba(72, 141, 196, 0.25);
}

.research-hero-image {
    margin: 0;
}

.research-hero-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid rgba(190, 225, 255, 0.22);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
}

.research-hero-image figcaption {
    margin-top: 13px;
    color: var(--research-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

/* =========================================================
   OVERVIEW
   ========================================================= */

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.overview-item {
    padding: 24px;
    border: 1px solid rgba(139, 202, 250, 0.16);
    border-radius: 18px;
    background: var(--research-card-light);
}

.overview-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    color: var(--research-bright-blue);
    font-size: 1.4rem;
    border: 1px solid rgba(150, 211, 255, 0.3);
    border-radius: 50%;
    background: rgba(84, 165, 225, 0.12);
}

.overview-item h3 {
    margin-bottom: 10px;
}

/* =========================================================
   PROJECTS
   ========================================================= */

.projects-section {
    margin: 70px 0;
}

.featured-project {
    display: grid;
    grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.12fr);
    gap: clamp(28px, 5vw, 58px);
    align-items: center;
}

.reverse-project .featured-project-image {
    order: 2;
}

.featured-project-image img {
    width: 100%;
    min-height: 320px;
    max-height: 470px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid rgba(160, 216, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.project-number {
    margin-bottom: 8px;
    color: var(--research-blue) !important;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.featured-project h3 {
    margin-bottom: 18px;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
}

.project-tags span {
    padding: 7px 12px;
    color: #cfeaff;
    font-size: 0.78rem;
    border: 1px solid rgba(148, 206, 248, 0.22);
    border-radius: 999px;
    background: rgba(59, 130, 184, 0.13);
}

/* =========================================================
   POLARIMETRY PROCESS
   ========================================================= */

.polarimetry-process {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    gap: 15px;
    align-items: center;
}

.process-step {
    min-width: 0;
    text-align: center;
}

.process-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-bottom: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.step-number {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 10px;
    color: #061321;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 50%;
    background: var(--research-blue);
}

.process-step h3 {
    font-size: 1rem;
}

.process-step p {
    font-size: 0.88rem;
}

.process-arrow {
    color: var(--research-blue);
    font-size: 1.6rem;
}

/* =========================================================
   GALLERY
   ========================================================= */

.research-gallery-section {
    margin: 70px 0;
}

.research-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.gallery-item {
    grid-column: span 4;
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--research-border);
    border-radius: 20px;
    background: var(--research-card);
    box-shadow: var(--research-shadow);
}

.gallery-item-large {
    grid-column: span 8;
}

.gallery-item-wide {
    grid-column: span 8;
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.gallery-item figcaption {
    padding: 18px 20px 22px;
    color: var(--research-muted);
    line-height: 1.55;
}

.gallery-item figcaption strong {
    display: block;
    margin-bottom: 5px;
    color: var(--research-text);
}

/* =========================================================
   TOOLS
   ========================================================= */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.tools-grid article {
    padding: 22px;
    border: 1px solid rgba(151, 208, 248, 0.15);
    border-radius: 16px;
    background: rgba(17, 49, 84, 0.45);
}

/* =========================================================
   PUBLICATIONS
   ========================================================= */

.publication-list {
    display: grid;
    gap: 20px;
}

.publication-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 28px;
    padding: 26px 0;
    border-bottom: 1px solid rgba(148, 205, 248, 0.16);
}

.publication-year {
    color: var(--research-blue) !important;
    font-weight: 800;
}

.publication-card h3 {
    margin-bottom: 8px;
    font-size: 1.35rem;
}

.publication-authors,
.publication-journal {
    margin-bottom: 5px;
}

.publication-journal {
    font-style: italic;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 17px;
}

.publication-links a {
    color: var(--research-bright-blue);
    font-weight: 700;
    text-decoration: none;
}

.publication-links a:hover {
    text-decoration: underline;
}

.all-publications-link {
    margin-top: 30px;
}

/* =========================================================
   CONTACT
   ========================================================= */

.research-contact {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 950px) {
    .research-hero,
    .featured-project {
        grid-template-columns: 1fr;
    }

    .reverse-project .featured-project-image {
        order: initial;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .polarimetry-process {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-arrow {
        display: none;
    }

    .gallery-item,
    .gallery-item-large,
    .gallery-item-wide {
        grid-column: span 6;
    }
}

@media (max-width: 650px) {
    .research-page {
        width: min(100% - 24px, 1180px);
        padding-top: 22px;
    }

    .research-hero {
        min-height: auto;
        padding: 28px 22px;
    }

    .research-hero h1 {
        font-size: clamp(3.2rem, 18vw, 5rem);
    }

    .content-card {
        padding: 25px 20px;
        border-radius: 19px;
    }

    .research-hero-links,
    .research-contact {
        align-items: stretch;
        flex-direction: column;
    }

    .research-button {
        width: 100%;
    }

    .polarimetry-process,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item,
    .gallery-item-large,
    .gallery-item-wide {
        grid-column: 1 / -1;
    }

    .publication-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
