/* =============================================
   JIAHUI ARCHIVE - COMPLETE STYLESHEET
   ============================================= */

/* =============================================
   GLOBAL RESET & BASE STYLES
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --archive-cream: #f5f1e8;
    --archive-paper: #faf8f3;
    --archive-dark: #2d2d2d;
    --archive-gold: #c9a961;
    --archive-border: #d4c5a9;
    --archive-accent: #8b7355;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background-color: var(--archive-cream);
    color: var(--archive-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

body.intro-active {
    overflow: hidden;
}

.container,
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* =============================================
   INTRO STAMP ANIMATION
   ============================================= */
.intro-stamp-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--archive-cream);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.rotating-stamp {
    width: 300px;
    height: 300px;
    animation: rotateStamp 8s linear infinite;
}

@keyframes rotateStamp {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stamp-text {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    fill: var(--archive-dark);
}

.stamp-inner-circle {
    fill: none;
    stroke: var(--archive-dark);
    stroke-width: 2;
}

.stamp-center-text {
    font-family: 'Cinzel', serif;
    font-size: 42px;
    font-weight: 700;
    fill: var(--archive-dark);
    text-anchor: middle;
    dominant-baseline: middle;
}

.scroll-hint {
    margin-top: 3rem;
    text-align: center;
    opacity: 0.7;
}

.scroll-hint p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--archive-accent);
}

.scroll-arrow {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* =============================================
   FIXED STAMP (BOTTOM-LEFT CORNER)
   ============================================= */
.fixed-stamp {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 120px;
    height: 120px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.fixed-stamp.visible {
    opacity: 0.6;
}

.fixed-stamp:hover {
    opacity: 1;
}

.fixed-stamp svg {
    width: 100%;
    height: 100%;
    animation: rotateStamp 8s linear infinite;
}

.stamp-text-small {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    fill: var(--archive-dark);
}

.stamp-inner-circle-small {
    fill: none;
    stroke: var(--archive-dark);
    stroke-width: 1.5;
}

.stamp-center-text-small {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 700;
    fill: var(--archive-dark);
    text-anchor: middle;
    dominant-baseline: middle;
}

/* =============================================
   NAVIGATION BAR
   ============================================= */
.navbar {
    position: sticky;
    top: 0;
    background-color: var(--archive-paper);
    border-bottom: 2px solid var(--archive-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.navbar-brand-link {
    text-decoration: none;
    color: inherit;
}

.navbar-brand {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.brand-initials {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--archive-dark);
    letter-spacing: 2px;
}

.brand-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--archive-accent);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar-menu a {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: var(--archive-dark);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--archive-gold);
    border-bottom-color: var(--archive-gold);
}

.navbar-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--archive-dark);
}

.navbar-list {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--archive-paper);
    border: 2px solid var(--archive-border);
    border-top: none;
    list-style: none;
    padding: 1rem;
    min-width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.navbar-list li {
    padding: 0.5rem 0;
}

.navbar-list a {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: var(--archive-dark);
    text-decoration: none;
    display: block;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.navbar-list a:hover,
.navbar-list a.active {
    color: var(--archive-gold);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.archive-content {
    min-height: 100vh;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
    padding: 6rem 0 4rem;
    text-align: center;
    background-color: var(--archive-paper);
    border-bottom: 2px solid var(--archive-border);
}

.archive-tag {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--archive-accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--archive-dark);
    margin-bottom: 1rem;
    letter-spacing: 3px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--archive-accent);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-subtitle .divider {
    color: var(--archive-gold);
}

.hero-description {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    color: var(--archive-dark);
    line-height: 1.8;
}

/* =============================================
   ARCHIVE SECTIONS
   ============================================= */
.archive-section {
    padding: 5rem 0;
}

.archive-section.alt-bg {
    background-color: var(--archive-paper);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-stamp {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--archive-accent);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.section-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--archive-dark);
    margin-bottom: 1rem;
}

.section-line {
    width: 80px;
    height: 2px;
    background-color: var(--archive-gold);
    margin: 1rem auto 0;
}

/* =============================================
   ABOUT SECTION (LIFE PAGE)
   ============================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    height: auto;
    border: 8px solid var(--archive-paper);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.image-caption {
    font-size: 0.95rem;
    color: var(--archive-accent);
    margin-top: 1rem;
    text-align: center;
    font-style: italic;
}

.about-text {
    padding: 1rem 0;
}

.lead-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--archive-dark);
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.interests {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.interest-tag {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--archive-paper);
    border: 2px solid var(--archive-border);
    border-radius: 20px;
    color: var(--archive-dark);
}

/* =============================================
   EDUCATION SECTION (ACADEMIC PAGE)
   ============================================= */
.education-timeline {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.edu-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--archive-cream);
    border: 2px solid var(--archive-border);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.edu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
}

.edu-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.edu-logo img {
    max-width: 100%;
    height: auto;
}

.edu-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.edu-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--archive-dark);
}

.edu-date {
    font-size: 1rem;
    color: var(--archive-accent);
    font-style: italic;
}

.edu-degree {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--archive-gold);
    margin-bottom: 1rem;
}

.edu-details p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.coursework-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.coursework-list li {
    font-size: 0.95rem;
    color: var(--archive-dark);
}

/* =============================================
   RESEARCH SECTION (ACADEMIC PAGE)
   ============================================= */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.research-card {
    padding: 2rem;
    background-color: var(--archive-cream);
    border: 2px solid var(--archive-border);
    border-radius: 8px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
}

.card-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.8rem;
    background-color: var(--archive-gold);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
}

.research-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--archive-dark);
}

.research-org {
    font-size: 1.1rem;
    color: var(--archive-accent);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.research-date {
    font-size: 0.95rem;
    color: var(--archive-accent);
    font-style: italic;
    margin-bottom: 1rem;
}

.research-desc {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.research-tags span {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    background-color: var(--archive-paper);
    border: 1px solid var(--archive-border);
    border-radius: 15px;
}

/* =============================================
   SKILLS SECTION (ACADEMIC PAGE)
   ============================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    padding: 2rem;
    background-color: var(--archive-paper);
    border: 2px solid var(--archive-border);
    border-radius: 8px;
}

.skill-category h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--archive-dark);
    text-align: center;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.skill-tag {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    background-color: var(--archive-cream);
    border: 2px solid var(--archive-border);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--archive-gold);
    color: white;
    border-color: var(--archive-gold);
}

/* =============================================
   PUBLICATIONS SECTION (ACADEMIC PAGE)
   ============================================= */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.publication-item {
    padding: 2rem;
    background-color: var(--archive-cream);
    border: 2px solid var(--archive-border);
    border-left: 6px solid var(--archive-gold);
    border-radius: 8px;
}

.pub-type {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--archive-accent);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.pub-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--archive-dark);
    margin-bottom: 0.8rem;
}

.pub-authors {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.pub-venue {
    font-size: 1rem;
    color: var(--archive-accent);
    font-style: italic;
    margin-bottom: 1rem;
}

.pub-link {
    font-size: 1rem;
    color: var(--archive-gold);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

/* =============================================
   GALLERY SECTION (LIFE PAGE)
   ============================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.gallery-card {
    background-color: var(--archive-paper);
    border: 2px solid var(--archive-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.gallery-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-image img {
    transform: scale(1.1);
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-info h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--archive-dark);
}

.gallery-info .location {
    font-size: 1rem;
    color: var(--archive-accent);
    margin-bottom: 0.3rem;
}

.gallery-info .date {
    font-size: 0.95rem;
    color: var(--archive-accent);
    font-style: italic;
    margin-bottom: 0.8rem;
}

.gallery-info .description {
    font-size: 1rem;
    line-height: 1.6;
}

/* =============================================
   TIMELINE (LIFE PAGE)
   ============================================= */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--archive-border);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
    margin-left: 0;
    padding-right: 3rem;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
    margin-right: 0;
    padding-left: 3rem;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: var(--archive-gold);
    border: 4px solid var(--archive-paper);
    border-radius: 50%;
    z-index: 10;
}

.timeline-content {
    max-width: 45%;
    padding: 1.5rem;
    background-color: var(--archive-paper);
    border: 2px solid var(--archive-border);
    border-radius: 8px;
}

.timeline-date {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--archive-gold);
    font-weight: 600;
    letter-spacing: 2px;
}

.timeline-content h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    margin: 0.5rem 0;
    color: var(--archive-dark);
}

.timeline-content p {
    font-size: 1rem;
    color: var(--archive-accent);
}

/* =============================================
   CONTACT SECTION
   ============================================= */
.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-intro,
.contact-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.social-links,
.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-button,
.contact-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: var(--archive-paper);
    border: 2px solid var(--archive-border);
    border-radius: 30px;
    text-decoration: none;
    color: var(--archive-dark);
    font-size: 1.1rem;
    font-family: 'Cormorant Garamond', serif;
    transition: all 0.3s ease;
}

.social-button:hover,
.contact-button:hover {
    background-color: var(--archive-gold);
    color: white;
    border-color: var(--archive-gold);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.social-button .icon,
.contact-button span:first-child {
    font-size: 1.3rem;
}

/* =============================================
   FOOTER
   ============================================= */
.archive-footer {
    background-color: var(--archive-dark);
    color: var(--archive-cream);
    padding: 3rem 0;
    text-align: center;
    border-top: 4px solid var(--archive-gold);
}

.footer-content p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.9rem;
    color: var(--archive-accent);
    font-style: italic;
}

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

/* Tablet */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
    }

    .navbar-toggle {
        display: block;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .edu-logo {
        justify-content: flex-start;
    }

    .edu-logo img {
        max-width: 120px;
    }

    .coursework-list {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        max-width: 100%;
        margin-left: 50px;
        padding-left: 1.5rem;
        text-align: left;
    }

    .timeline-marker {
        left: 20px;
        transform: translateY(-50%);
    }

    .fixed-stamp {
        width: 80px;
        height: 80px;
        bottom: 1rem;
        left: 1rem;
    }
}

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

    .navbar {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .hero-subtitle .divider {
        display: none;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .rotating-stamp {
        width: 200px;
        height: 200px;
    }

    .gallery-grid,
    .research-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .social-links,
    .contact-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* =============================================
   PAGE TRANSITION ANIMATIONS
   ============================================= */
.page-transition {
    position: relative;
}

body.transitioning {
    overflow: hidden;
}

.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--archive-cream);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}
