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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    line-height: 1.6;
    background: #ffffff;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fefefe;
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0 0 20px 0;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.top-nav.scrolled {
    background: rgba(254, 254, 254, 0.3);
    backdrop-filter: blur(5px);
}

.nav-container {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.nav-name {
    font-family: Arial, sans-serif;
    font-size: 35pt;
    font-weight: 600;
    color: #333;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    opacity: 1;
    position: relative;
    z-index: 1;
    margin-left: 50px;
    margin-top: 20px;
}

.nav-link {
    font-family: Arial, sans-serif;
    font-size: 35pt;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
    margin-right: 50px;
    margin-top: 20px;
    letter-spacing: -0.02em;
    opacity: 1;
}

.nav-link:hover {
    color: #333;
}

/* Hero Section */
.hero {
    margin-top: 80px;
    padding: 4rem 2rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.hero-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-video-wrapper {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
}

.hero-video,
.hero-poster,
.hero-iframe {
    position: absolute;
    inset: -1px;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    border: none;
    cursor: pointer;
    object-fit: cover;
    display: block;
}

.hero-poster {
    transition: opacity 0.3s ease;
}

.hero-poster.hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-iframe {
    cursor: default;
    z-index: 5;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.play-button-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Work Grid Section */
.work-grid {
    padding: 0;
    background: #ffffff;
    width: 100%;
}

.grid-container {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    background: #ffffff;
    contain: layout;
}

.work-item {
    aspect-ratio: 16 / 9;
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    position: relative;
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: 1px 360px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (hover: hover) {
    .work-item:hover .project-name {
        opacity: 1;
    }

    .work-item:hover::before {
        opacity: 1;
    }

    .work-item.video-tile:hover::before {
        opacity: 0;
    }

    .work-item.video-tile:hover .project-name {
        opacity: 0;
    }

    .work-item:hover .work-placeholder img {
        transform: scale(1.04);
        will-change: transform;
    }

    .work-item.video-tile:hover .work-placeholder img {
        transform: scale(1);
    }
}

.work-item.is-tapped .project-name {
    opacity: 1;
}

.work-item.is-tapped::before {
    opacity: 1;
}

.work-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 5;
    pointer-events: none;
}

.work-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #999;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    overflow: hidden;
}

.work-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}


.video-placeholder {
    padding: 0;
    background: #000;
}

.youtube-thumbnail {
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    margin: -1px;
    object-fit: cover;
    display: block;
}

.youtube-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    pointer-events: none;
}

.video-tile .youtube-play-button {
    pointer-events: auto;
}

/* YouTube Modal */
.youtube-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.youtube-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    z-index: 10001;
}

.youtube-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10002;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-modal-close:hover {
    opacity: 0.7;
}

.youtube-modal-video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.project-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    font-family: Arial, sans-serif;
    font-size: 34pt;
    font-weight: 600;
    line-height: 1em;
    color: black;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    text-align: center;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .work-item,
    .work-placeholder img,
    .play-button-overlay {
        transition: none !important;
    }
    .work-item {
        opacity: 1;
        transform: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-name {
        font-size: 22pt;
        margin-left: 24px;
        margin-top: 18px;
    }

    .nav-link {
        font-size: 22pt;
        margin-right: 24px;
        margin-top: 18px;
    }

    .top-nav {
        padding: 0 0 16px 0;
    }

    .hero {
        padding: 50px 1.5rem;
        margin-top: 70px;
        min-height: 0;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px 12px;
    }

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

@media (max-width: 480px) {
    .nav-name {
        font-size: 16pt;
        margin-left: 16px;
        margin-top: 14px;
    }

    .nav-link {
        font-size: 16pt;
        margin-right: 16px;
        margin-top: 14px;
    }

    .top-nav {
        padding: 0 0 12px 0;
    }

    .hero {
        padding: 50px 1rem;
        margin-top: 56px;
        min-height: 0;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0 8px 8px;
    }

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

