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

:root {
    --text-black: #000000;
    --text-gray: #666666;
    --bg-white: #ffffff;
    --border-color: #e5e5e5;
    --hover-gray: #f5f5f5;
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-en: 'Montserrat', sans-serif;
}

body {
    font-family: var(--font-jp);
    font-weight: 300;
    /* Regular to Light for Japanese */
    color: var(--text-black);
    background: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 500;
}

/* Loader */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-text {
    font-family: var(--font-en);
    font-size: 32px;
    font-weight: 900;
    /* Extra Bold for English */
    letter-spacing: 2px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    z-index: 100;
}

.header-inner {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.logo {
    font-family: var(--font-en);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 900;
    /* Logo is strong */
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Nav styles removed */

.header-info {
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-gray);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-black);
    position: relative;
    padding-bottom: 2px;
}

.social-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-black);
    transition: width 0.3s ease;
}

.social-link:hover::after {
    width: 100%;
}

/* Main Content */
.main-content {
    margin-top: 180px;
    /* Adjust based on header height */
    padding: 0 40px 80px;
    margin-left: 280px;
    /* Space for fixed sidebar header on desktop */
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px 40px;
    /* More vertical gap */
}

/* Work Item */
.work-item {
    display: flex;
    flex-direction: column;
    opacity: 0;
    /* Initial state: pushed down, rotated, and slightly scaled down */
    transform: translateY(100px) rotate(10deg) scale(0.9);
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
    /* Will be triggered by JS adding .visible */
}

.work-item.visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
}

.work-link {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

/* Thumbnail Container */
.work-thumbnail {
    width: 100%;
    height: 300px;
    /* Fixed height for the window */
    overflow: hidden;
    background-color: #f5f5f5;
    margin-bottom: 24px;
    position: relative;
    border-radius: 4px;
    /* Subtle radius */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.4s ease;
}

.work-link:hover .work-thumbnail {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

/* The Image creates the scroll effect */
.work-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top;
    transition: transform 6s ease-in-out;
    /* Slow scroll */
}

/* Hover Effect: Scroll to bottom */
/* Calculate: move up by (100% of image height - 300px container height) */
.work-link:hover .work-thumbnail img {
    transform: translateY(calc(-100% + 300px));
}

.work-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px;
}

.work-title {
    font-family: var(--font-jp);
    /* Titles are Japanese */
    font-size: 16px;
    font-weight: 400;
    /* Regular for readability but kept light */
    line-height: 1.5;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.work-link:hover .work-title {
    color: var(--text-gray);
    /* Subtle change or keep black */
    text-decoration: underline;
    text-underline-offset: 4px;
}

.work-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-en);
    /* Tags/Date are English */
    font-size: 11px;
    font-weight: 700;
    /* Bold for small English text */
    color: #888;
    line-height: 1.4;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.work-tags {
    margin-right: 10px;
}

/* Footer */
.footer {
    padding: 60px 40px;
    border-top: 1px solid var(--border-color);
    margin-left: 280px;
    /* Match main content margin */
}

.footer-copyright {
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-gray);
    letter-spacing: 0.05em;
}

/* Responsive Design */
@media (min-width: 1024px) {
    .header {
        width: 280px;
        height: 100vh;
        border-right: none;
        padding: 60px 40px;
        position: fixed;
    }

    .nav-list {
        margin-top: 60px;
        gap: 24px;
    }

    .main-content {
        margin-top: 0;
        padding-top: 60px;
        max-width: 1400px;
    }
}

@media (max-width: 1023px) {
    .header {
        position: relative;
        width: 100%;
        height: auto;
        padding: 30px 20px;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid var(--border-color);
    }

    .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 20px;
    }

    .nav-list {
        flex-direction: row;
        gap: 24px;
        flex-wrap: wrap;
    }

    .header-info {
        display: none;
    }

    .main-content {
        margin-left: 0;
        margin-top: 20px;
        padding: 0 20px 80px;
    }

    .footer {
        margin-left: 0;
        padding: 40px 20px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .works-grid {
        grid-template-columns: repeat(1, 1fr);
        /* Single column for mobile */
        gap: 40px;
    }

    .work-thumbnail {
        height: 240px;
        /* Slightly shorter on mobile */
    }

    .work-link:hover .work-thumbnail img {
        transform: translateY(calc(-100% + 240px));
    }

    .nav-list {
        width: 100%;
        justify-content: flex-start;
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
}