/* Reset & Variables */
/* Updated */
:root {
    --bg-color: #f8f8f8;
    --text-color: #1a1a1a;
    --accent-color: #555;
    --font-main: 'Inter', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", "Helvetica", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial", "Yu Gothic", "Meiryo", sans-serif;
    font-weight: 300;
    background-color: var(--bg-color);
    color: #333333;
    /* Gray close to black */
    line-height: 1.8;
    overflow-x: hidden;
    opacity: 0;
    animation: fadeIn 1.5s ease-out forwards;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 300;
    letter-spacing: 0.05em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity var(--transition-speed);
}

a:hover {
    opacity: 0.6;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    color: #333;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    backdrop-filter: blur(2px);
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-link-container {
    flex: 1;
    text-align: center;
}

.date-link {
    display: inline-block;
    color: #333;
    font-family: var(--font-main);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-decoration: underline;
    text-underline-offset: 4px;
    opacity: 1 !important;
    visibility: visible !important;
    white-space: nowrap;
}

.date-link:hover {
    opacity: 0.6 !important;
}

/* Sections */
main {
    width: 100%;
    min-height: 100vh;
}

.section {
    display: none;
    padding-top: 6rem;
    min-height: 100vh;
    animation: fadeIn 0.5s ease-out;
}

.section.active {
    display: block;
}

/* Top Page - Scatter */
#scatter-container {
    position: relative;
    width: 100%;
    height: 150vh;
    /* Allow scrolling (User Request) */
    overflow: hidden;
    top: -6rem;
    /* Counteract padding to fill screen */
}

.scatter-item {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 1s ease-out;
    max-width: 20vw;
    /* Limit image size on top page */
    max-height: 30vh;
    object-fit: contain;
    filter: grayscale(10%);
}

@media (max-width: 768px) {
    .scatter-item {
        filter: none;
        /* Disable grayscale on mobile for performance */
        transition: opacity 1s ease-out;
        /* Disable transform transition on mobile */
    }
}

.scatter-item:hover {
    z-index: 100 !important;
    transform: scale(1.05);
    filter: grayscale(0%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Works Page */
.works-header {
    padding: 0 3rem 2rem;
}

#works-grid {
    padding: 0 3rem 8rem;
    display: flex;
    flex-direction: column;
    gap: 8rem;
}

.works-category-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.works-category-header h3 {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #555;
    text-transform: uppercase;
}

.works-subgrid {
    display: flex;
    flex-wrap: wrap;
    gap: 8rem 4rem;
    justify-content: center;
    padding-top: 4rem;
}

.work-item {
    position: relative;
    cursor: pointer;
    width: 240px;
    height: auto;
    background: transparent;
    overflow: visible;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.6s ease;
}

/* Remove constant float animation */
.work-item {
    animation: none;
}

/* Subtle movement and shadow on hover */
.work-item:hover {
    z-index: 10;
    transform: translateY(-8px) scale(1.02) !important;
    /* Forces slight lift ignoring the random rotation transform */
}

/* Banner image - Preserving natural shape */
.work-item .banner-img {
    position: relative;
    /* Changed from absolute to keep size */
    width: 100%;
    height: auto;
    display: block;
    z-index: 2;
}

.work-info {
    position: absolute;
    bottom: -3.5rem;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: var(--font-main);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #888;
    pointer-events: none;
    transition: color 0.3s;
}

.work-item:hover+.work-info,
.work-item:hover .work-info {
    color: #333;
}

/* CV & Contact */
.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 2rem 5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    font-weight: 300;
}

.cv-content p {
    margin-bottom: 0.5rem;
}

.cv-category {
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.cv-list {
    list-style: none;
}

.cv-list li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #444;
}

.contact-content {
    font-size: 1.1rem;
}

.email-link {
    display: block;
    margin: 1rem 0;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.contact-info-embedded {
    margin: 1.5rem 0 2.5rem;
}

.contact-info-embedded .social-links {
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.close-modal {
    position: absolute;
    top: 2rem;
    right: 3rem;
    font-size: 2.5rem;
    cursor: pointer;
    color: #333;
    transition: transform 0.3s;
}

.close-modal:hover {
    transform: rotate(90deg);
}

#caption {
    position: absolute;
    bottom: 2rem;
    text-align: center;
    width: 100%;
    color: #555;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Custom Cursor (Optional Premium Touch) */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 5px;
    height: 5px;
    background-color: var(--text-color);
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem 0.8rem;
        /* Further reduced vertical padding */
        gap: 0.5rem;
        /* Consistent gap */
        justify-content: space-between;
    }

    .logo {
        font-size: 0.75rem;
        /* Slightly smaller logo */
        flex: 0 0 auto;
    }

    .date-link-container {
        flex: 1 1 auto;
        min-width: 60px;
        /* Ensure space for date */
    }

    .date-link {
        font-size: 0.6rem;
        /* Smaller date font */
    }

    nav {
        flex: 0 0 auto;
    }

    nav ul {
        gap: 0.4rem;
        /* Tighten nav items */
    }

    nav a {
        font-size: 0.6rem;
        /* Smaller nav font */
    }

    #works-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        padding: 0 1.5rem 2rem;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Gallery Overlay */
.gallery-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 3000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6rem 2rem 4rem;
}

.gallery-overlay.active {
    display: block;
}

.gallery-close-btn {
    position: fixed;
    top: 2rem;
    left: 3rem;
    z-index: 3100;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.8rem;
    color: #333;
    letter-spacing: 0.1em;
}

#gallery-content {
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-header {
    text-align: center;
    margin-bottom: 6rem;
}

.gallery-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.gallery-meta {
    font-size: 0.9rem;
    color: #888;
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 8rem;
}

.gallery-item {
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item img,
.gallery-item video {
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
}

/* removed click-hint */

.video-item {
    position: relative;
}

.video-ui {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 11px;
}

.vol-slider {
    width: 60px;
    height: 4px;
    cursor: pointer;
}

.status-badge {
    color: #555;
    pointer-events: none;
}

@media (max-width: 768px) {
    .gallery-overlay {
        padding: 5rem 1rem 2rem;
    }

    .gallery-close-btn {
        top: 2rem;
        left: 2rem;
        font-size: 0.9rem;
        border: none;
        text-decoration: underline;
        padding: 0;
        background: transparent;
    }

    .gallery-container {
        gap: 5rem;
    }
}