/* Xiangyu Wen - Academic Website | NCSU Red Theme */

:root {
    --red-primary:   #CC0000;
    --red-dark:      #990000;
    --red-light:     #FFE4E4;
    --red-50:        #fff5f5;
    --dark-bg:       #0D1117;
    --dark-mid:      #161B22;
    --dark-card:     #1E2530;
    --dark-border:   rgba(255,255,255,0.08);
    --text-primary:  #1a1a1a;
    --text-secondary:#555;
    --text-muted:    #888;
    --text-light:    rgba(255,255,255,0.90);
    --text-light-2:  rgba(255,255,255,0.55);
    --bg-white:      #FFFFFF;
    --bg-light:      #F8F9FA;
    --bg-alt:        #F0F4F8;
    --border-light:  #E2E8F0;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg:     0 8px 40px rgba(0,0,0,0.15);
    --shadow-red:    0 4px 20px rgba(204,0,0,0.3);
    --radius-sm:     6px;
    --radius-md:     12px;
    --radius-lg:     20px;
    --transition:    all 0.3s cubic-bezier(0.4,0,0.2,1);
    --nav-h:         64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---- NAVBAR ---- */
#navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: transparent;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
    height: var(--nav-h);
}
#navbar.scrolled {
    background: rgba(13,17,23,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.nav-container {
    max-width: 1100px; margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-size: 1.1rem; font-weight: 400; color: #fff;
    font-family: 'IM Fell English', serif;
    letter-spacing: 0.02em; transition: color 0.2s;
}
.nav-logo:hover { color: var(--red-primary); }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem; font-weight: 500;
    padding: 6px 13px; border-radius: 999px;
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: #fff; background: rgba(204,0,0,0.25);
}
.hamburger {
    display: none; background: none; border: none;
    cursor: pointer; color: #fff; font-size: 1.3rem; padding: 4px;
}

/* ---- HERO ---- */
#hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: url('../img/bg.jpg') center center / cover no-repeat;
    overflow: hidden;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(13,17,23,0.82) 0%, rgba(30,10,10,0.75) 100%);
    z-index: 1;
}
.hero-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 40px 24px;
    animation: fadeInUp 0.9s ease both;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-avatar-wrap {
    width: 140px; height: 140px; border-radius: 50%;
    border: 3px solid var(--red-primary);
    box-shadow: 0 0 0 6px rgba(204,0,0,0.15), var(--shadow-lg);
    overflow: hidden; margin-bottom: 24px;
}
.hero-avatar { width: 100%; height: 100%; object-fit: cover; }
.hero-name {
    font-size: clamp(2.2rem,5vw,3.2rem); font-weight: 400;
    font-family: 'IM Fell English', serif;
    color: #fff; letter-spacing: 0.01em; margin-bottom: 10px;
}
.hero-title { font-size: 1.15rem; font-weight: 400; font-family: 'Cormorant Garamond', serif; font-style: italic; color: rgba(255,255,255,0.85); margin-bottom: 8px; letter-spacing: 0.03em; }
.wolf-icon { font-size: 1.1rem; filter: grayscale(1) brightness(10); }
.hero-affil { font-size: 1.15rem; font-family: 'Cormorant Garamond', serif; color: rgba(255,255,255,0.75); margin-bottom: 22px; letter-spacing: 0.02em; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 28px; }
.hero-tag {
    padding: 6px 18px;
    background: rgba(204,0,0,0.18);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,120,120,0.4);
    box-shadow: 0 2px 12px rgba(180,0,0,0.18), inset 0 1px 0 rgba(255,180,180,0.35);
    color: rgba(255,255,255,0.95);
    border-radius: 999px; font-size: 1rem; font-weight: 400;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.03em;
    transition: var(--transition);
}
.hero-tag:hover {
    background: rgba(204,0,0,0.32);
    border-color: rgba(255,150,150,0.6);
    box-shadow: 0 4px 20px rgba(180,0,0,0.28), inset 0 1px 0 rgba(255,200,200,0.45);
    transform: translateY(-1px);
}
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 24px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.45);
    color: #fff; border-radius: 999px;
    font-size: 1.05rem; font-weight: 500;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.04em;
    transition: var(--transition);
}
.hero-btn:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 8px 28px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.55);
    transform: translateY(-2px);
}
.hero-scroll-hint {
    position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
    z-index: 2; color: rgba(255,255,255,0.35); font-size: 1.1rem;
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* ---- SECTIONS COMMON ---- */
.section { padding: 90px 0; }
.section-light { background: var(--bg-white); }
.section-alt   { background: var(--bg-light); }
.section-dark  { background: var(--dark-bg); }
.section-contact { background: linear-gradient(135deg, #0a0a0f 0%, #1a0505 100%); }
.section-contact-bg {
    position: relative;
    background: url('../../assets/img/final.jpg') center center / cover no-repeat;
}
.contact-bg-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    z-index: 1;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section-title {
    font-size: 1.9rem; font-weight: 500;
    font-family: 'Cormorant Garamond', serif;
    color: var(--text-primary);
    margin-bottom: 32px;
    position: relative; padding-bottom: 12px;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 40px; height: 3px;
    background: var(--red-primary); border-radius: 2px;
}
.section-title-light { color: #fff; }
.section-title-center { text-align: center; }
.section-title-center::after { left: 50%; transform: translateX(-50%); }

/* ---- ABOUT + NEWS ---- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.about-bio { font-size: 0.97rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.8; }
.about-link { color: var(--red-primary); text-decoration: none; font-weight: 500; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.about-link:hover { border-bottom-color: var(--red-primary); }
.about-interests {
    margin-top: 28px; background: var(--bg-light);
    border-radius: var(--radius-md); padding: 20px 24px;
    border: 1px solid var(--border-light);
}
.about-interests h4 {
    font-size: 0.85rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--red-dark); margin-bottom: 14px;
}
.about-interests ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.about-interests li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--text-secondary); }
.about-interests li i { color: var(--red-primary); width: 16px; text-align: center; }

/* NEWS */
.news-scroll { max-height: 460px; overflow-y: auto; padding-right: 6px; }
.news-scroll::-webkit-scrollbar { width: 4px; }
.news-scroll::-webkit-scrollbar-track { background: var(--bg-light); border-radius: 2px; }
.news-scroll::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }
.news-list { list-style: none; display: flex; flex-direction: column; }
.news-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.news-item:last-child { border-bottom: none; }
.news-date-badge {
    flex-shrink: 0; font-size: 0.75rem; font-weight: 700;
    color: var(--red-primary); background: var(--red-50);
    border: 1px solid var(--red-light); border-radius: var(--radius-sm);
    padding: 3px 8px; height: fit-content; white-space: nowrap; margin-top: 2px;
}
.news-tag {
    display: inline-block; font-size: 0.72rem; font-weight: 600;
    padding: 1px 7px; border-radius: 999px; margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.news-tag.red    { background: var(--red-light);  color: var(--red-dark); }
.news-tag.blue   { background: #E3F2FD; color: #1565C0; }
.news-tag.green  { background: #E8F5E9; color: #2E7D32; }
.news-tag.orange { background: #FFF3E0; color: #E65100; }
.news-item-title { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); line-height: 1.5; }

/* ---- EXPERIENCE + AWARDS ---- */
.exp-awards-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: start; }
.tl-group-label {
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--red-primary); margin-bottom: 14px;
    padding-bottom: 6px; border-bottom: 1px solid rgba(204,0,0,0.25);
}
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--dark-border); }
.tl-item:last-child { border-bottom: none; }
.tl-logo {
    flex-shrink: 0; width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 4px;
}
.tl-logo img { width: 100%; height: 100%; object-fit: contain; }
.tl-body { flex: 1; min-width: 0; }
.tl-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 8px; margin-bottom: 2px; flex-wrap: wrap;
}
.tl-org  { font-size: 0.9rem;  font-weight: 600; color: var(--text-primary); }
.tl-date { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.tl-role { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 4px; }
.tl-loc  { font-size: 0.78rem; color: var(--text-muted); }
.tl-loc i { margin-right: 4px; font-size: 0.7rem; }
.tl-detail { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; margin-top: 4px; }

/* AWARDS */
.awards-simple { list-style: none; padding: 0; margin: 0; }
.awards-simple li {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}
.awards-simple li:last-child { border-bottom: none; }
.award-title { color: var(--text-secondary); font-weight: 500; line-height: 1.5; }
.award-year  { color: var(--text-muted); font-size: 0.82rem; white-space: nowrap; flex-shrink: 0; }
.award-icon {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    background: rgba(204,0,0,0.15); border: 1px solid rgba(204,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--red-primary); font-size: 0.82rem;
}
.award-name { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.award-from { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ---- PROJECTS ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.project-card {
    background: var(--bg-white); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
}
.project-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-md);
    border-color: var(--red-light);
}
.project-img-wrap {
    width: 100%; height: 180px; overflow: hidden;
}
.project-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.4s ease;
}
.project-card:hover .project-img { transform: scale(1.04); }
.project-body { padding: 20px 22px; flex: 1; display: flex; flex-direction: column; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.project-tag {
    font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
    border-radius: 999px; background: var(--red-50);
    color: var(--red-dark); border: 1px solid var(--red-light);
}
.project-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; line-height: 1.4; }
.project-desc  { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; flex: 1; }
.project-links { display: flex; gap: 10px; margin-top: 16px; }
.project-link {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.8rem; font-weight: 600; color: var(--red-primary);
    border: 1px solid var(--red-light); padding: 4px 12px;
    border-radius: 999px; transition: var(--transition);
}
.project-link:hover { background: var(--red-primary); color: #fff; border-color: var(--red-primary); }

/* ---- PUBLICATIONS ---- */
.pub-subtitle { color: rgba(255,255,255,0.55); text-align: center; margin-top: -20px; margin-bottom: 32px; font-size: 0.88rem; }
.pub-list { list-style: none; display: flex; flex-direction: column; gap: 20px; }
.pub-item {
    display: flex; gap: 16px; padding: 20px 22px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md); transition: var(--transition);
}
.pub-item:hover { background: rgba(255,255,255,0.07); border-color: rgba(204,0,0,0.3); }
.pub-num {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(204,0,0,0.15); border: 1px solid rgba(204,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--red-primary); font-size: 0.78rem; font-weight: 700;
    margin-top: 2px;
}
.pub-body { flex: 1; min-width: 0; }
.pub-title { font-size: 0.92rem; font-weight: 600; color: var(--text-light); line-height: 1.5; margin-bottom: 5px; }
.pub-title em { font-style: italic; }
.pub-authors { font-size: 0.82rem; color: rgba(255,255,255,0.55); margin-bottom: 5px; }
.pub-authors strong { color: rgba(255,255,255,0.85); }
.pub-venue { font-size: 0.8rem; color: rgba(255,255,255,0.4); font-style: italic; margin-bottom: 8px; }
.pub-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; font-weight: 600; padding: 2px 9px;
    border-radius: 999px; border: 1px solid;
}
.pub-badge.conf { background: rgba(204,0,0,0.15); color: #ff8080; border-color: rgba(204,0,0,0.3); }
.pub-badge.link { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.15); }
.pub-badge.link:hover { background: var(--red-primary); color: #fff; border-color: var(--red-primary); }

/* ---- CONTACT ---- */
.contact-desc {
    text-align: center; font-size: 1rem; color: rgba(255,255,255,0.6);
    max-width: 560px; margin: -16px auto 40px;
    line-height: 1.8;
}
.contact-cards {
    display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
    max-width: 700px; margin: 0 auto;
}
.contact-card-glass {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 24px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.4);
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem; font-weight: 500;
    transition: var(--transition);
    min-width: 220px;
}
.contact-card-glass:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 8px 28px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.5);
    transform: translateY(-2px);
    color: #fff;
}
.contact-card-glass i { font-size: 1.2rem; color: rgba(255,255,255,0.85); width: 24px; text-align: center; }

/* ---- FOOTER ---- */
#footer {
    background: #060810;
    padding: 28px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}
#footer p { font-size: 0.85rem; color: rgba(255,255,255,0.3); }
#footer a { color: rgba(255,255,255,0.5); transition: color 0.2s; }
#footer a:hover { color: var(--red-primary); }

/* ---- BACK TO TOP ---- */
.back-to-top {
    position: fixed; bottom: 28px; right: 28px; z-index: 999;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--red-primary); color: #fff;
    border: none; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-red);
    opacity: 0; transform: translateY(12px);
    transition: var(--transition); pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ---- SCROLL ANIMATION ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- SKILLS ---- */
.skills-list { display: flex; flex-direction: column; }
.skill-row {
    display: flex; gap: 12px; align-items: baseline;
    padding: 8px 0; border-bottom: 1px solid var(--border-light);
    font-size: 0.83rem;
}
.skill-row:last-child { border-bottom: none; }
.skill-label {
    flex-shrink: 0; width: 70px;
    font-weight: 700; color: var(--red-primary);
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.skill-val { color: var(--text-secondary); line-height: 1.6; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; gap: 4px;
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        background: rgba(13,17,23,0.97);
        padding: 16px 24px; border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .nav-links.open { display: flex; }
    .hamburger { display: block; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .exp-awards-grid { grid-template-columns: 1fr; gap: 48px; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-cards { flex-direction: column; align-items: stretch; }
    .contact-card { min-width: unset; }
}
