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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: white;
    background-color: #000;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 33.333%;
    background: #000;
    color: white;
    padding: 2rem;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.logo {
    text-align: left;
    margin-bottom: 0.2rem;
}

.logo-icon {
    margin-bottom: 1.5rem;
    width: 100%;
    position: relative;
    height: 120px;
}

.jochi-logo {
    width: 100%;
    height: auto;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

.jochi-logo-white {
    opacity: 1;
}

.jochi-logo-black {
    opacity: 0;
}

.logo-icon svg {
    border-radius: 50%;
}

.personal-name {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: white;
}

.title {
    font-size: 1rem;
    font-weight: 300;
    color: white;
    text-transform: lowercase;
    margin-bottom: 2rem;
}

/* Bio Section */
.bio-section {
    margin-bottom: 2.5rem;
}

.bio-text {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    text-align: left;
    margin: 0 0 1.2rem 0;
}

.bio-text:last-child {
    margin-bottom: 0;
}

/* Role Filter Styles */
.role-filters {
    margin-bottom: 2rem;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 400;
    color: white;
    text-transform: lowercase;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-btn.all-projects {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
}

.role-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
}

.role-buttons-grid .filter-btn {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    justify-content: center;
}

.filter-btn {
    color: #ffffff;
    padding: 0.6em 1.2em;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: lowercase;
    border-radius: 0.5em;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.3), -6px -6px 12px rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    width: auto;
    min-width: 120px;
    max-width: 180px;
    margin: 0.25rem;
}

.filter-btn:hover {
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.filter-btn:active {
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3), -4px -4px 12px rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    color: #000000;
    background: #ffffff;
    border: 1px solid #ffffff;
    box-shadow: inset 4px 4px 12px rgba(0, 0, 0, 0.1), inset -4px -4px 12px rgba(255, 255, 255, 0.8);
}

.links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.link:hover {
    opacity: 0.7;
}

.link.email {
    text-decoration: underline;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 33.333%;
    padding: 2rem;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 800px;
    min-width: 0;
    position: relative;
    box-sizing: border-box;
}

.header-content {
    display: flex;
    align-items: baseline;
    min-width: 0;
    flex: 1;
    margin-right: 1rem;
}

.header-content .section-title {
    font-size: 1.5rem;
    margin-bottom: 0;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: white;
    text-transform: lowercase;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background-color: rgba(255, 255, 255, 0.4);
}

.toggle-switch input:checked + label:before {
    transform: translateX(20px);
}

/* Work Grid */
.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
    width: 100%;
    margin-bottom: 2rem;
    min-height: 200px; /* Prevent layout shift */
    justify-items: center; /* Center items horizontally */
}

.work-item {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px; /* Large enough to contain content */
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 500px;
}

.work-item:last-child {
    margin-bottom: 0;
}

.work-item:hover {
    transform: translateY(-5px);
}

.work-item.fade-out {
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: relative;
}

.work-item.fade-out::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    animation: gradientFadeIn 0.3s ease-out forwards;
}

@keyframes gradientFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.work-item.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.work-item.fade-in::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0) 100%);
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 5;
    animation: fadeInGradient 0.4s ease-out forwards;
}

@keyframes fadeInGradient {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.work-image {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 16/9;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    outline: none;
    border: none;
}

.work-image:hover {
    outline: none;
    border: none;
}

.work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.work-item:hover .work-image img {
    transform: scale(1.05);
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.work-item:hover .play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: black;
    transition: all 0.3s ease;
}

.play-button:hover {
    background: white;
    transform: scale(1.1);
}

.work-info {
    padding: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
}

.work-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.work-artist {
    font-size: 0.9rem;
    color: white;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.work-role {
    font-size: 0.8rem;
    color: white;
    opacity: 0.7;
    font-weight: 400;
}

/* Project Count */
.project-count {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 800px;
}

.project-count p {
    font-size: 0.9rem;
    color: white;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.project-count span {
    transition: all 0.3s ease;
    display: inline-block;
}

/* Video Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Light theme styles */
body.light-theme {
    background-color: #fff;
    color: #000;
}

body.light-theme .sidebar {
    background: #fff;
    color: #000;
}

body.light-theme .main-content {
    background: #fff;
    color: #000;
}

/* Logo transition for light theme */
body.light-theme .jochi-logo-white {
    opacity: 0;
}

body.light-theme .jochi-logo-black {
    opacity: 1;
}

body.light-theme .personal-name,
body.light-theme .title,
body.light-theme .link,
body.light-theme .section-title,
body.light-theme .work-title,
body.light-theme .work-artist,
body.light-theme .work-role,
body.light-theme .project-count p,
body.light-theme .filter-title {
    color: #000;
}

body.light-theme .bio-text {
    color: rgba(0, 0, 0, 0.75);
}

body.light-theme .filter-btn {
    color: #090909;
    background: #e8e8e8;
    border: 1px solid #e8e8e8;
    box-shadow: 6px 6px 12px #c5c5c5, -6px -6px 12px #ffffff;
}

body.light-theme .filter-btn:hover {
    border: 1px solid white;
}

body.light-theme .filter-btn:active {
    box-shadow: 4px 4px 12px #c5c5c5, -4px -4px 12px #ffffff;
}

body.light-theme .filter-btn.active {
    color: #ffffff;
    background: #2b2b2b;
    border: 1px solid #2b2b2b;
    box-shadow: inset 4px 4px 12px rgba(0, 0, 0, 0.2), inset -4px -4px 12px rgba(255, 255, 255, 0.1);
}

/* Light theme gradient for fade-out */
body.light-theme .work-item.fade-out::after {
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%);
    animation: gradientFadeIn 0.3s ease-out forwards;
}

/* Light theme gradient for fade-in */
body.light-theme .work-item.fade-in::before {
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0) 100%);
}

/* Toggle switch colors for light theme */
body.light-theme .toggle-switch label {
    background-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .toggle-switch label:before {
    background-color: #000;
}

body.light-theme .toggle-switch input:checked + label {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Large Desktop: 1200px+ */
@media (max-width: 1200px) {
    .work-grid {
        gap: 1.75rem;
        max-width: 900px;
    }
}

/* Large Tablets: 1024-1199px */
@media (max-width: 1024px) {
    .work-grid {
        gap: 1.5rem;
        max-width: 700px;
    }
}

/* Medium Tablets: 900-1023px */
@media (max-width: 900px) {
    .sidebar {
        width: 35%;
        padding: 1.5rem;
    }

    .main-content {
        margin-left: 35%;
        padding: 1.5rem;
    }

    .work-grid {
        gap: 2rem;
        max-width: 550px;
    }

    .content-header {
        padding-right: 50px;
    }

    .header-content {
        margin-right: 0.5rem;
    }

    .header-content .section-title {
        font-size: 1.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 50px);
    }

    .toggle-switch {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        flex-shrink: 0;
    }
}

/* Medium Small Screens: 820-899px */
@media (max-width: 820px) {
    .sidebar {
        width: 38%;
        padding: 1.25rem;
    }

    .main-content {
        margin-left: 38%;
        padding: 1.25rem;
    }

    .work-grid {
        gap: 1.75rem;
        max-width: 500px;
    }
}

/* Small Medium Screens: 768-819px */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .logo-icon {
        height: 120px;
        margin-bottom: 1rem;
        width: 100%;
    }

    .jochi-logo {
        position: absolute;
        width: 100%;
        height: auto;
    }

    .logo {
        margin-bottom: 1rem;
    }

    .title {
        margin-bottom: 1.2rem;
    }

    .bio-section {
        margin-bottom: 2rem;
    }

    .bio-text {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .role-filters {
        margin-bottom: 1.5rem;
    }

    .filter-buttons {
        gap: 0.75rem;
    }

    .role-buttons-grid {
        gap: 0.4rem;
    }

    .filter-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
        min-width: 100px;
        max-width: 140px;
    }

    .links {
        margin-top: 0;
        gap: 0.75rem;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1.5rem;
        max-width: none;
        width: 100%;
    }

    .container {
        flex-direction: column;
        min-height: auto;
    }

    .work-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        width: 100%;
        margin: 0 auto 2rem auto;
        justify-items: center;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .work-item {
        width: 100%;
        max-width: 500px;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 2rem;
    }

    .work-image {
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
    }

    .work-info {
        width: 100%;
        padding: 0;
        text-align: left;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding-right: 0;
        min-height: auto;
    }

    .header-content {
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .header-content .section-title {
        font-size: 1.5rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        max-width: 100%;
    }

    .toggle-switch {
        position: static;
        align-self: flex-end;
        margin-top: -3rem;
        flex-shrink: 0;
    }

    .modal-content {
        width: 95%;
        max-width: 95vw;
        max-height: 95vh;
    }

    .modal {
        padding: 0.5rem;
    }

    .close-modal {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 1rem;
    }

    .logo-icon {
        height: 120px;
        margin-bottom: 0.75rem;
        width: 100%;
    }

    .jochi-logo {
        position: absolute;
        width: 100%;
        height: auto;
    }

    .logo {
        margin-bottom: 0.5rem;
    }

    .title {
        margin-bottom: 0.75rem;
    }

    .bio-section {
        margin-bottom: 1.8rem;
    }

    .bio-text {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.9rem;
    }

    .role-filters {
        margin-bottom: 1rem;
    }

    .filter-buttons {
        gap: 0.6rem;
    }

    .role-buttons-grid {
        gap: 0.3rem;
    }

    .filter-btn {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }

    .links {
        gap: 0.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .work-grid {
        gap: 1rem;
    }

    .work-title {
        font-size: 1rem;
    }

    .work-artist {
        font-size: 0.8rem;
    }

    .play-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .category-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease;
}
