/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0A0B0B;
    font-family: 'Inter', sans-serif;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 100vh;
    position: relative;
}

/* Hide horizontal scrollbar but keep functionality */
body::-webkit-scrollbar {
    height: 0;
    display: none;
}
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Brand mark */
.brand-mark {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 5000;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.brand-mark:hover {
    opacity: 1;
}

.brand-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Horizontal scroll container */
.horizontal-scroll-container {
    display: flex;
    flex-direction: row;
    width: max-content;
    height: 100vh;
    overflow: visible;
}

/* Each section is full viewport width */
.scroll-section {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    position: relative;
}

/* Videos section - original 67/33 layout */
.videos-section {
    background: #0A0B0B;
}

.video-section {
    width: 67%;
    height: 100vh;
    overflow-y: auto;
    padding: 100px 40px 40px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 30px;
    align-content: start;
}

/* Hide scrollbar but keep functionality */
.video-section::-webkit-scrollbar {
    width: 6px;
}
.video-section::-webkit-scrollbar-track {
    background: transparent;
}
.video-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.video-section::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.text-section {
    width: 33%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.text-content {
    max-width: 400px;
}

.text-content h2 {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.6;
}

/* Section content for other sections */
.section-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

/* Section titles */
.section-title {
    font-size: 72px;
    font-weight: 200;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.section-subtitle {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    text-align: center;
}

/* Individual section backgrounds */
.portfolio-section {
    background: #0D1117;
}

.doing-section {
    background: #1a1a2e;
}

.socials-section {
    background: #16213e;
}

.merch-section {
    background: #1b1b2f;
}

/* Responsive section styles */
@media (max-width: 1200px) {
    .section-title {
        font-size: 56px;
        letter-spacing: 8px;
    }

    .text-content h2 {
        font-size: 26px;
    }
}

@media (max-width: 992px) {
    .section-title {
        font-size: 42px;
        letter-spacing: 6px;
    }

    .section-subtitle {
        font-size: 14px;
    }

    .text-content h2 {
        font-size: 22px;
    }
}

/* Mobile feed - hidden on desktop */
.mobile-feed {
    display: none;
}

/* Mobile Reels Feed Styles */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Hide desktop layout on mobile */
    .horizontal-scroll-container {
        display: none;
    }

    /* Show mobile feed */
    .mobile-feed {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow-y: scroll;
        scroll-snap-type: y mandatory;
        -webkit-overflow-scrolling: touch;
        background: #0A0B0B;
    }

    /* Hide scrollbar but keep functionality */
    .mobile-feed::-webkit-scrollbar {
        display: none;
    }
    .mobile-feed {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Each video item in the feed */
    .mobile-feed-item {
        width: 100vw;
        height: 100vh;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #0A0B0B;
    }

    .mobile-feed-item video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #000;
    }

    /* Play/pause indicator */
    .mobile-feed-item .play-indicator {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80px;
        height: 80px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.2s ease;
        pointer-events: none;
    }

    .mobile-feed-item .play-indicator i {
        color: #fff;
        font-size: 30px;
        margin-left: 5px;
    }

    .mobile-feed-item .play-indicator.paused i {
        margin-left: 0;
    }

    .mobile-feed-item .play-indicator.show {
        opacity: 1;
    }

    /* Video counter */
    .mobile-feed-counter {
        position: fixed;
        bottom: 30px;
        right: 20px;
        color: rgba(255, 255, 255, 0.7);
        font-size: 14px;
        font-weight: 300;
        letter-spacing: 2px;
        z-index: 100;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-feed-counter.visible {
        opacity: 1;
    }

    /* Landscape mode support */
    @media (max-width: 768px) and (orientation: landscape) {
        .mobile-feed {
            scroll-snap-type: x mandatory;
            overflow-x: scroll;
            overflow-y: hidden;
            display: flex;
            flex-direction: row;
        }

        .mobile-feed-item {
            min-width: 100vw;
            width: 100vw;
            height: 100vh;
            scroll-snap-align: start;
            flex-shrink: 0;
        }

        .mobile-feed-item video {
            object-fit: contain;
        }

        .mobile-feed-counter {
            bottom: 15px;
            right: 15px;
        }

        .scroll-hint {
            bottom: auto;
            left: auto;
            right: 80px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .scroll-hint i {
            display: inline-block;
            margin-top: 0;
            animation: bounceArrowLandscape 1s ease-in-out infinite;
        }

        @keyframes bounceArrowLandscape {
            0%, 100% { transform: translateX(0); }
            50% { transform: translateX(5px); }
        }

        .brand-mark {
            top: 15px;
            left: 15px;
        }

        .nav-menu {
            top: 15px;
            right: 15px;
        }

        .social-links {
            bottom: 15px;
            left: 15px;
        }
    }

    /* Scroll hint on first video */
    .scroll-hint {
        position: absolute;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.6);
        font-size: 12px;
        letter-spacing: 2px;
        text-transform: uppercase;
        animation: bounceHint 2s ease-in-out infinite;
    }

    .scroll-hint i {
        display: block;
        margin-top: 8px;
        font-size: 20px;
        animation: bounceArrow 1s ease-in-out infinite;
    }

    @keyframes bounceHint {
        0%, 100% { opacity: 0.6; }
        50% { opacity: 1; }
    }

    @keyframes bounceArrow {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(5px); }
    }

    /* Hide brand mark on mobile feed or reposition */
    .brand-mark {
        top: 20px;
        left: 20px;
        z-index: 6000;
    }
}

/* Video elements in grid */
.video-node {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.95);
    aspect-ratio: 9 / 16;
    width: 100%;
}

.video-node.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Varying video sizes for visual interest */
.video-node:nth-child(3n+1) {
    transform: scale(0.92);
}

.video-node:nth-child(3n+1).loaded {
    transform: scale(0.92);
}

.video-node:nth-child(5n+2) {
    transform: scale(1.05);
}

.video-node:nth-child(5n+2).loaded {
    transform: scale(1.05);
}

.video-node:nth-child(4n) {
    margin-top: 20px;
}

.video-node:nth-child(6n+3) {
    margin-top: -15px;
}

.video-node video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover effects */
.video-node:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 40px rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.video-node.dimmed {
    opacity: 0.4;
    transform: scale(0.95);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0A0B0B;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Video overlay for expanded view - Instagram style */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-overlay {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3001;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-overlay:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.overlay-video {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Navigation arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3001;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-overlay.active .nav-arrow {
    opacity: 1;
    visibility: visible;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-arrow.prev {
    left: 30px;
}

.nav-arrow.next {
    right: 30px;
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-arrow:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive design */
@media (max-width: 1200px) {
    .video-node.size-small {
        width: 160px;
        height: 107px;
    }

    .video-node.size-medium {
        width: 220px;
        height: 147px;
    }

    .video-node.size-large {
        width: 280px;
        height: 187px;
    }
}

@media (max-width: 768px) {
    .brand-mark {
        top: 20px;
        left: 20px;
    }

    .brand-text {
        font-size: 12px;
        letter-spacing: 2px;
    }

    .video-node.size-small {
        width: 140px;
        height: 93px;
    }

    .video-node.size-medium {
        width: 180px;
        height: 120px;
    }

    .video-node.size-large {
        width: 240px;
        height: 160px;
    }

    /* Adjust overlay for mobile */
    .close-overlay {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .nav-arrow {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .nav-arrow.prev {
        left: 20px;
    }

    .nav-arrow.next {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .video-node.size-small {
        width: 120px;
        height: 80px;
    }

    .video-node.size-medium {
        width: 160px;
        height: 107px;
    }

    .video-node.size-large {
        width: 200px;
        height: 133px;
    }

    /* Disable magnetic effects on small screens for performance */
    .video-node:hover {
        transform: scale(1.02);
    }

}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .brand-text {
        font-weight: 400;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .video-node.size-small {
        width: 120px;
        height: 80px;
    }

    .video-node.size-medium {
        width: 160px;
        height: 107px;
    }

    .video-node.size-large {
        width: 200px;
        height: 133px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .video-node:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .video-node:active {
        transform: scale(0.98);
    }
}

.social-links a {
    text-decoration: none !important;
}

/* Video click animation */
.video-node.video-clicked {
    animation: videoClickPulse 0.6s ease-out;
}

@keyframes videoClickPulse {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}