:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #333333;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    --grid-gap: 20px;
    --transition-speed: 0.3s;
    interpolate-size: allow-keywords;
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #f5f5f5;
    --accent-color: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.9);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1.6;
}

header {
    padding: 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: transparent;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;

    img {
        width: 5rem;
        background-blend-mode: overlay;
        transition: filter 0.3s cubic-bezier(0, 0.69, 0.25, 1);

        &:hover {
            filter: hue-rotate(45deg);
        }
    }
}

#theme-toggle,
#view-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

#theme-toggle:hover,
#view-toggle:hover {
    opacity: 0.7;
}

#theme-toggle .sun {
    display: none;
}

[data-theme="dark"] #theme-toggle .sun {
    display: block;
}

[data-theme="dark"] #theme-toggle .moon {
    display: none;
}

/* Hero Section */
.hero {
    height: auto;
    width: 100%;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #000;
    aspect-ratio: 1 / 1;
}

.hero.contained {
    /* height: auto; */
    aspect-ratio: 16 / 9;
}

.hero-video-container {
    width: 100%;
    height: 100%;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s cubic-bezier(0, 0.51, 0.19, 0.99) all;
}

.hero.contained .hero-video {
    height: auto;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

.hero-overlay h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-overlay p {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
}

/* Portfolio Grid */
.portfolio {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--grid-gap);
}

.video-item {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    border-radius: 4px;
}

.video-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.8;
}

.video-item:hover img {
    transform: scale(1.05);
    opacity: 1;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

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

.play-overlay svg {
    width: 30px;
    height: 30px;
    color: white;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    width: 90%;
    max-width: 1000px;
    position: relative;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.close-lightbox {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
}

footer {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 0.9rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .hero-overlay h1 {
        font-size: 2.5rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
}