@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Playfair+Display:wght@400;700&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #333333;
    --transition-speed: 0.4s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Top Header - P + T */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 80px;
    background-color: var(--bg-color);
    z-index: 999;
    font-family: 'Playfair Display', serif;
    font-size: 72px;
    font-weight: 400;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.3s ease;
}

.top-header.menu-open {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-left,
.header-right {
    flex: 1;
}

.header-center {
    font-size: 64px;
    cursor: pointer;
    transition: transform 0.3s ease;
    font-weight: 700;
}

.header-center:hover {
    transform: scale(1.1);
}

.header-center.active {
    transform: rotate(45deg);
}

.header-right {
    text-align: right;
}

/* Category Menu */
.category-menu {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    background-color: #f5f5f5;
    color: var(--text-color);
    padding: 110px 40px 40px 40px;
    z-index: 997;
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow-y: auto;
    max-height: 90vh;
}

.category-menu.active {
    top: 0;
}

.menu-list {
    list-style: none;
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
}

.menu-list li {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0;
}

.menu-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: block;
    font-weight: 400;
    padding: 20px 30px;
    text-align: center;
}

.menu-list a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-papers {
    font-weight: 400;
}

.menu-footer {
    padding: 30px 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 20px;
}

.menu-footer p {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-color);
    font-weight: 400;
}

/* Main Content */
main {
    min-height: 100vh;
    padding: 120px 40px 40px 40px;
}

/* Home Page */
.home-page {
    display: none;
}

.home-page.active {
    display: block;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.image-wrapper {
    width: 100%;
    height: 350px;
    overflow: hidden;
    margin-bottom: 20px;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

/* Hover effect - show color when mouse is on image */
.image-wrapper:hover img {
    filter: grayscale(0%);
}

/* First click - keep color even when not hovering */
.image-wrapper img.colored {
    filter: grayscale(0%);
}

.project-info {
    padding: 0 10px;
}

.project-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 700;
}

.project-info p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.project-type {
    font-style: italic;
    color: #666;
}

/* Papers Page */
.papers-page {
    display: none;
    background-color: #ffffff;
    transition: background-color 0.3s ease;
}

.papers-page.active {
    display: block;
}

.papers-page.detail-view {
    background-color: #fdf5f5;
}

.papers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
}

.paper-card {
    background-color: #e8e8e8;
    padding: 30px 20px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.paper-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    transition: opacity 0.3s ease;
}

.paper-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.paper-image-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.paper-card:hover .paper-image-overlay {
    opacity: 0.9;
}

.paper-card:hover .paper-card-content {
    opacity: 0;
}

/* Different background colors for papers */
.paper-card:nth-child(5n+1) {
    background-color: #d4e4e7;
}

.paper-card:nth-child(5n+2) {
    background-color: #e1d4d9;
}

.paper-card:nth-child(5n+3) {
    background-color: #e8e4d4;
}

.paper-card:nth-child(5n+4) {
    background-color: #d4e0dd;
}

.paper-card:nth-child(5n+5) {
    background-color: #e0dce4;
}

.paper-number {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #000;
}

.paper-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 15px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paper-info {
    font-size: 10px;
    line-height: 1.4;
    color: #333;
}

/* Paper Detail Page */
.paper-detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 40px 80px 40px;
    text-align: center;
}

.paper-detail-header h1 {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.paper-detail-header h2 {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.paper-detail-meta {
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #333;
}

.paper-detail-image {
    width: 100%;
    max-width: 450px;
    max-height: 280px;
    margin: 0 auto 30px auto;
    overflow: hidden;
}

.paper-detail-image img {
    width: 100%;
    height: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
}

.paper-detail-content {
    text-align: justify;
    font-size: 12px;
    line-height: 1.7;
    max-width: 650px;
    margin: 0 auto;
}

.paper-detail-content p {
    margin-bottom: 15px;
}

/* Category Page */
.category-page {
    display: none;
}

.category-page.active {
    display: block;
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 700;
}

.category-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Project Detail Page */
.project-detail-page {
    display: none;
}

.project-detail-page.active {
    display: block;
}

.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 40px;
}

/* Close button positioned under T */
.detail-close-btn {
    position: fixed;
    top: 90px;
    right: 80px;
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    color: #999;
    font-weight: 300;
    transition: all 0.3s ease;
    z-index: 900;
}

.detail-close-btn:hover {
    color: #333;
    transform: rotate(90deg);
}

.detail-image {
    width: 100%;
    max-width: 1000px;
    height: auto;
    margin: 0 auto 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

.detail-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 70vh;
}

.detail-content {
    padding: 0 20px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.detail-content h2 {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.detail-content p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.detail-type {
    font-style: italic;
    color: #666;
    margin-bottom: 30px;
    font-size: 13px;
}

.info-toggle {
    background: none;
    color: #999;
    border: none;
    padding: 15px 40px;
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.info-toggle:hover {
    color: #333;
}

/* Info Panel (Slides from Bottom) */
.info-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    z-index: 1001;
    transition: bottom 1.8s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
    padding: 80px 60px 60px 60px;
}

.info-panel.active {
    bottom: 0;
}

.close-panel {
    position: fixed;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    font-size: 50px;
    cursor: pointer;
    transition: transform 0.3s ease;
    color: var(--text-color);
    font-weight: 300;
    z-index: 1002;
    display: none;
}

.info-panel.active .close-panel {
    display: block;
}

.close-panel:hover {
    transform: rotate(90deg);
}

.panel-content {
    max-width: 1400px;
    margin: 0 auto;
}

.panel-content h3 {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    margin-bottom: 40px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.panel-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.panel-images {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.panel-images img {
    width: 100%;
    height: auto;
    object-fit: contain;
    background-color: #f8f8f8;
    padding: 20px;
}

.panel-text {
    font-size: 13px;
    line-height: 1.9;
    font-weight: 400;
}

.panel-text p {
    margin-bottom: 20px;
    text-align: justify;
}

.panel-text h4 {
    font-size: 14px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 700;
}

.panel-text ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.panel-text li {
    margin-bottom: 10px;
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .papers-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .papers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .projects-grid,
    .category-projects-grid {
        grid-template-columns: 1fr;
    }

    .papers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-header {
        padding: 8px 30px;
        font-size: 48px;
    }

    .header-center {
        font-size: 42px;
    }

    .category-menu {
        padding: 100px 20px 30px 20px;
    }

    .menu-list {
        max-width: 100%;
    }

    main {
        padding: 110px 20px 20px 20px;
    }

    .detail-close-btn {
        top: 70px;
        right: 30px;
        font-size: 32px;
    }

    .panel-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .info-panel {
        padding: 80px 30px 40px 30px;
    }
}

@media (max-width: 480px) {
    .papers-grid {
        grid-template-columns: 1fr;
    }
}

/* Smooth transitions between pages */
section {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}