@import url('https://fonts.googleapis.com/css2?family=Roboto+Serif:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Gotham:wght@200;300;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Iansui:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600&display=swap');

@font-face {
    font-family: 'Pitchsans Semibold';
    src: url('https://cdn.prod.website-files.com/5e2520252e290c852ed89624/5e8aa48a4fbaea249d25baf9_pitch-sans-web-semibold.woff2') format('woff2'),
         url('https://cdn.prod.website-files.com/5e2520252e290c852ed89624/5e8aa48a8a0cee09608541d8_pitch-sans-web-semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: auto;
}

@font-face {
    font-family: 'Pitchsans Regular';
    src: url('https://cdn.prod.website-files.com/5e2520252e290c852ed89624/5e8aa5e7ab1cf843e0a81ef9_PitchSansWeb-Regular.woff2') format('woff2'),
         url('https://cdn.prod.website-files.com/5e2520252e290c852ed89624/5e8aa5e74fbaea7b2d25bfa0_PitchSansWeb-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: auto;
}

:root {
    --y2k-primary: #d3f5f5;
    --y2k-secondary: #698aff;
    --y2k-accent: #e96a6a; /* Updated to match the requested darker pink */
    --y2k-accent-light: #ff8e8e; /* Lighter pink for main title */
    --y2k-metallic: #fafafabe;
    --y2k-light: #ffffff;
    --y2k-dark: #364043;
}

/* Chinese font setup for zh mode - scoped to i18n elements only */
:root { --cjk-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Noto Serif CJK SC', 'Source Han Serif CN', 'Songti SC', 'SimSun', serif; }

/* Remove blanket override: ensure only translatable nodes switch font */
body[data-lang="zh"] [data-i18n] { font-family: var(--cjk-serif) !important; letter-spacing: 0.04em; }

/* Base Styles */
body {
    font-family: 'Pitchsans Regular', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

/* Header and Navigation */
.navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 20px 0%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-link-group {
    display: flex;
    gap: 20px;
    max-width: 960px;
    width: 90%;
    margin: 0 auto;
    justify-content: flex-start;
    align-items: center;
}

.header-link {
    font-family: 'Pitchsans Semibold',"Iansui", sans-serif;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    padding: 6px 0;
    margin: 0;
}

.header-link:hover {
    color: var(--y2k-accent);
    font-family: 'Pitchsans Semibold',"Iansui", sans-serif;
    /* font-weight: 600; */
}

.header-link.w--current {
    color: var(--y2k-accent);
    font-family: 'Pitchsans Semibold',"Iansui", sans-serif;
}

/* Hide "Shang Gao" on narrow screens */
@media (max-width: 768px) {
    .header-link .full-name {
        display: none;
    }
    
    .header-link:first-child::before {
        content: "高尚";
        font-size: 16px;
        font-family: 'Pitchsans Semibold',"Iansui", sans-serif;
    }
}

/* Container */
.standard-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 180px 5% 60px;
}

/* Section Headers */
.section-heading-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 48px;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    color: #333;
}

/* Content Wrappers */
.content-wrapper {
    margin-bottom: 200px;
}
@media (max-width: 768px) {
    .content-wrapper {
        margin-bottom: 64px;
    }
}

/* Extra top spacing for section headings inside sections */
.content-wrapper > .section-heading-title {
    margin-top: 96px;
}
@media (min-width: 992px) {
    .content-wrapper > .section-heading-title {
        margin-top: 72px;
    }
}

/* Prevent fixed header from covering anchored sections */
.content-wrapper[id] {
    scroll-margin-top: 120px;
}
@media (max-width: 768px) {
    .content-wrapper[id] {
        scroll-margin-top: 90px;
    }
}

/* Bio/About Specific */
.bio-statement-and-portrait {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 80px;
    margin-bottom: 60px;
    align-items: stretch; /* make columns equal height */
}

.personal-statement {
    font-size: 18px;
    line-height: 1.8;
    max-width: 800px;
    display: flex;              /* distribute heading and bottom text */
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.portrait-container {
    text-align: right;
    margin-top: 0;
    display: flex;              /* keep image at top and contact at bottom */
    flex-direction: column;
    justify-content: space-between;
}

.arlen-portrait {
    width: 300px;
    height: 300px;
    object-fit: cover;
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 50%;
}

.bio-highlights {
    display: grid;
    grid-template-columns: repeat(3, 2fr);
    gap: 30px;
    margin-top: 60px;
}

.bio-highlight-square {
    padding: 30px;
    background: var(--y2k-light);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.grid-titles {
    font-family: "Pitchsans Semibold", sans-serif;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--y2k-dark);
}

.grid-paragraph {
    font-size: 16px;
    color: var(--y2k-dark);
    opacity: 0.8;
}

/* Education Specific */
.education-wrapper {
    display: grid;
    /* grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); */
    gap: 30px;
    margin-bottom: 60px;
}

.education-item {
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.education-title {
    font-family: 'Pitchsans Semibold', sans-serif;
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.education-subtitle {
    font-family: 'Pitchsans Regular', sans-serif;
    font-size: 18px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.education-date {
    font-family: 'Pitchsans Semibold', sans-serif;
    font-size: 16px;
    color: var(--y2k-accent);
    margin-bottom: 15px;
}

.education-description {
    font-size: 16px;
    line-height: 1.8;
    color: #666;
}

/* Research Specific */
.research-wrapper {
    margin-bottom: 60px;
}



.research-item {
    margin-bottom: 40px;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.research-title {
    font-family: 'Pitchsans Semibold', sans-serif;
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.research-subsection-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 28px;
    letter-spacing: 0.05em;
    margin: 100px 0 30px;
    color: var(--y2k-dark);
    border-bottom: 1.5px solid var(--y2k-accent);
    padding-bottom: 10px;
}

/* Remove huge top margin if subsection title immediately follows section title */
.section-heading-title + .research-subsection-title {
    margin-top: 20px;
}

.research-authors {
    font-family: 'Pitchsans Regular', sans-serif;
    font-size: 18px;
    color: #666;

    margin-bottom: 10px;
}

.research-status {
    font-family: 'Pitchsans Regular', sans-serif;
    font-size: 18px;
    color: var(--y2k-accent);
    margin-bottom: 15px;
    font-style: italic;
    font-weight: 600;
}

.research-abstract {
    font-size: 18px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.research-abstract.expanded {
    max-height: 1000px; /* Adjust this value based on your longest abstract */
}

.abstract-toggle {
    display: inline-block;
    color: var(--y2k-secondary);
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.abstract-toggle:hover {
    color: var(--y2k-accent);
}

.abstract-toggle::after {
    content: "▶";
    font-size: 12px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.abstract-toggle.expanded::after {
    content: "▼";
    font-size: 12px;
    margin-left: 5px;
    transform: none;
}

.research-link {
    display: inline-block;
    color: var(--y2k-secondary);
    font-size: 18px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.research-link:hover {
    color: #ff8e8e;
}

/* Teaching Specific */
.teaching-wrapper {
    margin-bottom: 60px;
}

.teaching-item {
    margin-bottom: 30px;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.teaching-title {
    font-family: 'Pitchsans Semibold', sans-serif;
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.teaching-subtitle {
    font-family: 'Pitchsans Regular', sans-serif;
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.teaching-description {
    font-size: 16px;
    line-height: 1.8;
    color: #666;
}

.teaching-description ul {
    list-style-type: none;
    padding-left: 0;
}

.teaching-description li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.teaching-description li:before {
    content: "•";
    color: var(--y2k-accent);
    position: absolute;
    left: 0;
}

/* Footer */
.footer-wrap {
    background: #ffffff;
    padding: 20px 5%;
    margin-top: 10px;
    /* box-shadow: 0 -2px 10px rgba(0,0,0,0.05); */
}

.footer-links {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
}

.footer-item {
    font-family: 'Pitchsans Regular', sans-serif;
    text-decoration: none;
    color: var(--y2k-dark);
    font-size: 16px;
    transition: color 0.3s ease;
}

.footer-item:hover {
    color: var(--y2k-accent);
}

/* Compact contact under portrait */
.contact-compact {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
}
.contact-compact a {
    color: #3366cc;
    text-decoration: none;
}
.contact-compact a:hover {
    text-decoration: underline;
}

/* Hide old highlight boxes section on the homepage to tighten layout */
.bio-highlights { display: none; }

/* General Link Style (excluding header) */
a:not(.header-link) {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-thickness: 1px;
    /* text-decoration-color: rgba(0, 0, 0, 0.4); */
    text-underline-offset: 4px;
    /* color: inherit; */ /* Inherit causes issues if color wasn't set */
    transition: all 0.3s ease;
}

.author-link {
    color: var(--y2k-secondary);
    font-weight: 600;
}

a:not(.header-link):hover {
    color: var(--y2k-accent) !important; /* Force override of specific inline colors if needed */
    text-decoration-color: var(--y2k-accent);
    text-decoration-style: solid;
}

/* Specific override for research link titles to ensure they behave */
.research-link-title {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(0, 0, 0, 0.4);
    text-underline-offset: 4px;
    color: inherit;
    transition: all 0.3s ease;
}

.research-link-title:hover {
    color: var(--y2k-accent);
    text-decoration-color: var(--y2k-accent);
    text-decoration-style: solid;
}

/* Tighten research items into single-line rows without boxes */
.research-item {
    background: transparent;
    box-shadow: none;
    padding: 6px 0;
}
.research-title,
.research-authors,
.research-status {
    display: inline;
    margin-right: 8px;
}
.research-link { display: inline; margin-left: 8px; }
.abstract-toggle, .research-abstract { display: none; }

/* Responsive Design */
@media (max-width: 992px) {
    .bio-statement-and-portrait {
        grid-template-columns: 1fr;
        gap: 40px;
        align-items: start; /* natural flow */
    }
    
    .portrait-container {
        text-align: center;
        order: -1; /* Move portrait to top */
        display: block; /* reset flex */
    }
    
    .personal-statement {
        max-width: 100%;
        display: block; /* reset flex */
        height: auto;
    }
}

@media (min-width: 992px) {
    /* Align hero heading with portrait top on wide screens */
    .bio-statement-and-portrait .section-heading-title {
        margin-top: 0;
    }
    .arlen-portrait {
        margin-top: 6px; /* nudge image down slightly for visual alignment */
    }
}

@media (max-width: 768px) {
    .arlen-portrait {
        width: 250px;
        height: 250px;
    }

    .bio-highlights {
        grid-template-columns: 1fr;
    }

    .navigation {
        padding: 15px 5%;
    }

    .header-link-group {
        gap: 20px;
    }

    .section-heading-title {
        font-size: 28px;
    }

    .education-item,
    .research-item,
    .teaching-item {
        padding: 20px;
    }

    .footer-links {
        /* flex-direction: column; */
        align-items: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .arlen-portrait {
        width: 200px;
        height: 200px;
    }
    .bio-highlights {
        grid-template-columns: 1fr;
    }
} 

/* Pill (capsule) link */
.pill-link {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    line-height: 1;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pill-link:hover {
    background: #ececec;
    border-color: #ccc;
}

/* Space above contact list under portrait */
.contact-compact { margin-top: 12px; }
.contact-compact .pill-link { margin-top: 8px; } 

/* Language toggle button */
.lang-toggle {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}
.lang-toggle:hover { background: #ececec; }

/* Language visibility */
.lang-zh { display: none; }
body.lang-zh .lang-en { display: none; }
body.lang-zh .lang-zh { display: inline; }

/* For block elements in zh */
.lang-zh.block { display: none; }
body.lang-zh .lang-zh.block { display: block; } 

/* Align language link to the right within header group */
.lang-link { margin-left: auto; font-size: 16px; line-height: 1; padding: 6px 0; }

/* Reduce paragraph spacing in bio */
.personal-statement p { margin: 6px 0 8px; } 