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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #fafafa;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Page Management */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.page.zoom-out {
    transform: scale(1.05);
    opacity: 0;
}

.page.zoom-in {
    transform: scale(0.95);
    opacity: 0;
}

/* Cover Page */
#cover-page {
    background-color: #ffffff;
}

.cover-container {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
    margin-bottom: 60px;
}

.logo-placeholder {
    width: 200px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: border-color 0.3s ease;
}

.logo-placeholder:hover {
    border-color: #333;
}

.enter-button {
    background-color: #333;
    color: white;
    border: none;
    padding: 16px 60px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    touch-action: manipulation;
}

.enter-button:hover {
    background-color: #000;
    transform: translateY(-2px);
}

.enter-button:active {
    transform: translateY(0);
}

/* Projects Page */
#projects-page {
    background-color: #fafafa;
}

.projects-container {
    width: 100%;
    max-width: 1200px;
}

.page-title {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-bottom: 40px;
    text-align: center;
    color: #333;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.project-cell {
    aspect-ratio: 1;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.project-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.project-cell:hover::before {
    transform: translateY(0);
}

.project-cell:hover {
    border-color: #333;
    transform: translateY(-4px);
}

.project-number {
    font-size: 48px;
    font-weight: 200;
    color: #999;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.project-name {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-top: 10px;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.project-cell:hover .project-number,
.project-cell:hover .project-name {
    color: white;
}

/* Project Detail Pages */
.project-detail {
    background-color: #ffffff;
}

.detail-container {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.back-arrow {
    position: absolute;
    top: -60px;
    left: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    transition: transform 0.3s ease, color 0.3s ease;
    padding: 8px;
    touch-action: manipulation;
}

.back-arrow:hover {
    transform: translateX(-4px);
    color: #000;
}

.back-arrow svg {
    display: block;
}

.detail-content {
    padding: 40px;
    background-color: white;
    border-radius: 8px;
}

.project-title {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 30px;
    color: #333;
    letter-spacing: -0.5px;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #f5f5f5;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 30px;
}

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

.project-description p {
    margin-bottom: 16px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .page {
        padding: 15px;
    }

    .logo-container {
        gap: 30px;
        margin-bottom: 40px;
    }

    .logo-placeholder {
        width: 160px;
        height: 100px;
        font-size: 12px;
    }

    .enter-button {
        padding: 14px 50px;
        font-size: 14px;
    }

    .page-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .project-number {
        font-size: 36px;
    }

    .project-name {
        font-size: 12px;
    }

    .detail-content {
        padding: 20px;
    }

    .project-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .project-description {
        font-size: 14px;
        line-height: 1.6;
    }

    .back-arrow {
        top: -50px;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .project-number {
        font-size: 32px;
    }

    .project-name {
        font-size: 11px;
    }

    .logo-placeholder {
        width: 140px;
        height: 80px;
    }
}

/* Touch Device Optimization */
@media (hover: none) and (pointer: coarse) {
    .project-cell:active {
        transform: scale(0.97);
    }

    .enter-button:active {
        transform: scale(0.98);
    }

    .back-arrow:active {
        transform: translateX(-2px);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
