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

/* Variables */
:root {
    --primary-color: #1a2332;
    --secondary-color: #4a6fa5;
    --accent-color: #8b7355;
    --text-color: #2d2d2d;
    --light-bg: #f5f5f0;
    --white: #ffffff;
    --border-color: #d0d0c8;
}

/* Base */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--light-bg);
}

/* Links */
a {
    color: var(--secondary-color);
    text-decoration: underline;
    text-decoration-color: rgba(74, 111, 165, 0.35);
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
    color: var(--primary-color);
    text-decoration-color: rgba(26, 35, 50, 0.5);
}

/* Header & Navigation */
header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.logo .col {
    display: flex;
    flex-direction: column;
    font-size: 0.4em;
    line-height: 1.05em;
    margin-left: 0.2em;
}

.logo .col span:nth-of-type(2) {
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    font-family: 'Nanum Myeongjo', 'Proxima Nova', serif;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.nav-links a.active {
    color: var(--secondary-color);
}

/* Hero */
.hero {
    position: relative;
    background-color: #202b3d;
    background-image: url('./hero.png');
    background-size: cover;
    background-position: center 30%;
    color: var(--white);
    min-height: calc(100vh - 60px);
    padding: 4rem 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    text-align: left;
    margin-top: 60px;
    display: flex;
    align-items: center;
}

.hero.hero-research {
    background-image: url('./research_hero.png');
}

.hero.hero-flat {
    clip-path: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgb(20, 30, 48);
    z-index: 0;
    animation: hero-brighten 120s ease-out both;
}

@keyframes hero-brighten {
    from { opacity: 0.94; }
    to   { opacity: 0.68; }
}

.hero-stars-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, black 52%, transparent 70%);
    mask-image: linear-gradient(to bottom, black 52%, transparent 70%);
}

.hero-stars {
    position: absolute;
    width: 160%;
    height: 160%;
    top: -30%;
    left: -30%;
    pointer-events: none;
    transform-origin: center center;
    animation: star-pivot 120s ease-in-out infinite;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: var(--star-base-opacity, 0.15);
    animation: twinkle linear infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: var(--star-base-opacity, 0.15); }
    45%, 55% { opacity: var(--star-opacity, 0.4); }
}

@keyframes star-pivot {
    0%, 100% { transform: rotate(-8deg); }
    50%       { transform: rotate(8deg); }
}

.hero h1,
.hero p {
    position: relative;
    z-index: 3;
}


.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 400;
    font-family: 'Raleway', sans-serif;
    letter-spacing: 1px;
}

.hero p {
    font-size: 1.2rem;
    width: max-content;
    max-width: 90%;
    margin: 0;
    opacity: 0.9;
    font-style: italic;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Sections */
section {
    position: relative;
    padding: 8rem 0;
    background: var(--white);
}


section#publications {
    background: var(--white);
}

/* Margin notes */
.margin-ref {
    display: inline-block;
    width: 0;
    height: 0;
    overflow: hidden;
    vertical-align: baseline;
}

.margin-column {
    position: absolute;
    left: calc(50% + 620px);
    top: 0;
    width: 180px;
    height: 100%;
    pointer-events: none;
}

.margin-note {
    position: absolute;
    width: 180px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #888;
    border-left: 2px solid var(--border-color);
    padding-left: 0.75rem;
    font-family: 'Nanum Myeongjo', serif;
    font-style: italic;
    pointer-events: auto;
}

.margin-note strong {
    display: block;
    font-style: normal;
    font-size: 0.7rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
}

@media (max-width: 2200px) {
    .margin-column {
        display: none;
    }
}

/* Section label */
.section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.6rem;
}

/* Typography */
h2 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-weight: 400;
    font-family: 'Nanum Myeongjo', 'Proxima Nova', serif;
    letter-spacing: 0.5px;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
    font-weight: 500;
    font-family: 'Nanum Myeongjo', 'Proxima Nova', serif;
}

h4 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
    font-family: 'Nanum Myeongjo', 'Proxima Nova', serif;
}

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Pull Quote */
section#pull-quote {
    padding: 8rem 0 8rem;
    background: var(--light-bg);
    clip-path: polygon(0 0, 100% 3rem, 100% 100%, 0 calc(100% - 3rem));
    margin-bottom: -3rem;
    z-index: 1;
}

.dual-quotes {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.dual-quotes .pull-quote {
    flex: 1;
    font-size: 1.7rem;
    text-align: left;
}

.quote-divider {
    width: 1px;
    background: var(--secondary-color);
    opacity: 0.25;
    align-self: stretch;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .dual-quotes {
        flex-direction: column;
    }
    .quote-divider {
        width: 100%;
        height: 1px;
        align-self: auto;
    }
}

.pull-quote {
    margin: 0;
    padding: 0;
    font-family: 'Nanum Myeongjo', serif;
    font-size: 2.4rem;
    font-weight: 700;
    font-style: italic;
    color: var(--secondary-color);
    line-height: 1.3;
    text-align: center;
}

.pull-quote sup a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.65em;
    vertical-align: super;
}

.page-footnotes {
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    background: var(--light-bg);
}

.footnotes {
    list-style: decimal;
    margin: 0;
    padding-left: 1.5rem;
    font-size: 0.85rem;
    color: #888;
    font-family: 'Nanum Myeongjo', serif;
    font-style: italic;
}

.footnotes a {
    color: #888;
}

.pull-quote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    font-style: normal;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

/* Motivation layout */
.motivation-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.motivation-text {
    flex: 1;
}

.research-figure {
    flex: 0 0 540px;
    padding: 1rem calc(1rem + 3.5rem) calc(1rem + 3.5rem) 1rem;
}

.figure-stack {
    position: relative;
}

.figure-front,
.figure-back {
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    padding: 0.75rem;
    background: var(--white);
    aspect-ratio: 3/2;
}

.figure-front {
    display: block;
    position: relative;
    z-index: 2;
    width: 100%;
}

.figure-front img,
.figure-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.figure-back {
    position: absolute;
    top: 3.5rem;
    left: 3.5rem;
    z-index: 1;
    width: 100%;
}

.research-figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #777;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .motivation-layout {
        flex-direction: column;
    }

    .research-figure {
        flex: none;
        width: 100%;
    }
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

/* Achievements */
.achievement {
    background: var(--white);
    padding: 2rem;
    margin: 2rem 0;
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.achievement h3 {
    margin-top: 0;
}

/* Team */
.team-members {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--white);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.team-member:nth-child(odd) {
    padding-right: 1.5rem;
}

.team-member:nth-child(even) {
    padding-left: 1.5rem;
}

.team-member img {
    width: 9rem;
    height: 9rem;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    display: block;
    margin: 0 auto 1.25rem;
    filter: grayscale(30%);
    flex-shrink: 0;
}

.team-member-info {
    flex: 1;
}

.team-member h4 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Nanum Myeongjo', serif;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    margin: 0 0 0.15rem;
}


.team-member .member-title {
    display: block;
    font-size: 0.78rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary-color);
    margin-bottom: 0.1rem;
}

.team-member .affiliation {
    display: block;
    font-size: 0.78rem;
    color: #999;
    font-style: italic;
    font-family: 'Nanum Myeongjo', serif;
    margin-bottom: 0.4rem;
}

.team-member .email-link {
    margin: 0;
}

.team-member .email-link a {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.team-member .email-link a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Publications (index inline list) */
.publications-list {
    background: var(--white);
    padding: 1.5rem;
    border-left: 2px solid var(--border-color);
}

.publication {
    margin: 1rem 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-bg);
    line-height: 1.6;
}

.publication:last-child {
    border-bottom: none;
}

/* Work Streams */
.work-stream {
    margin: 0;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
}

.work-stream h4 {
    margin-top: 0.25rem;
    font-size: 1.45rem;
    color: var(--primary-color);
}

/* Support Section */
.support-reasons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.reason {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.reason-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Research Page */
.research-category {
    margin-bottom: 4rem;
}

.research-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-weight: 500;
    font-family: 'Nanum Myeongjo', 'Proxima Nova', serif;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.publication-item {
    background: var(--white);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.publication-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.publication-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'Nanum Myeongjo', 'Proxima Nova', serif;
}

.publication-authors {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.publication-venue {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.publication-abstract {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.publication-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.pub-link::before {
    content: '↗';
    font-size: 0.9em;
    letter-spacing: 0;
}

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

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

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

.publication-type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.6rem;
    margin-right: 1rem;
}

.publication-type.FIG-fellow {
    color: var(--secondary-color);
    font-style: italic;
}

.fig-author {
    color: var(--secondary-color);
}

/* Textbook-style publication entries */
.pub-entry {
    margin: 2rem 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.pub-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pub-title {
    font-size: 1.25rem;
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0 0.3rem;
    line-height: 1.35;
}

.pub-abstract {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.65;
    border-left: 3px solid var(--border-color);
    padding-left: 1.25rem;
    margin: 0.75rem 0 1rem;
    font-style: italic;
}

.pub-entry .publication-authors {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-style: normal;
    letter-spacing: 0.02em;
    margin-bottom: 0;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 3rem 2rem;
    border-top: 3px solid var(--secondary-color);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
}

footer p {
    opacity: 0.85;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
}

/* Utilities */
.highlight {
    color: var(--secondary-color);
    font-weight: 600;
}

.emphasis {
    background: linear-gradient(120deg, rgba(52, 152, 219, 0.1) 0%, rgba(52, 152, 219, 0.1) 100%);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    nav {
        padding: 0 1.5rem;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .team-members {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    nav {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .nav-links {
        flex-direction: row;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.9rem;
    }

    header {
        padding: 0.5rem 0;
    }

    .hero {
        min-height: calc(100vh - 80px);
        padding: 2rem 1.5rem;
        margin-top: 80px;
        align-items: flex-start;
    }

    .hero-content {
        padding-top: 4rem;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
    }

    section {
        padding: 3rem 0;
    }

    h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    p {
        font-size: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .achievement {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }

    .team-members {
        grid-template-columns: 1fr;
    }

    .team-member:nth-child(odd),
    .team-member:nth-child(even) {
        padding: 2rem 1.5rem;
    }

    .work-stream {
        padding: 1.5rem 0;
    }

    .support-reasons {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .reason {
        padding: 1.5rem;
    }

    .publications-list {
        padding: 1rem;
    }

    .publication {
        font-size: 0.95rem;
    }

    .category-title {
        font-size: 1.4rem;
    }

    .publication-item {
        padding: 1.5rem;
    }

    .publication-title {
        font-size: 1.1rem;
    }

    .publication-authors,
    .publication-venue {
        font-size: 0.9rem;
    }

    .publication-abstract {
        font-size: 0.95rem;
    }

    .research-category {
        margin-bottom: 3rem;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }

    .nav-links {
        font-size: 0.85rem;
        gap: 0.75rem;
    }

    .hero {
        min-height: calc(100vh - 90px);
        padding: 2rem 1rem;
        margin-top: 90px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    section {
        padding: 2.5rem 0;
    }

    .card,
    .achievement {
        padding: 1rem;
    }

    footer {
        padding: 2rem 1rem;
        font-size: 0.9rem;
    }

    .publication-item {
        padding: 1rem;
    }

    .publication-links {
        flex-direction: column;
    }

    .pub-link {
        justify-content: center;
    }
}
