/* ========================================
   Reset & Base Styles
======================================== */

/* Custom Font */
@font-face {
    font-family: 'Vinque';
    src: url('vinque.woff2') format('woff2'),
         url('vinque.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --top-bar-height: 72px;
    --side-margin: 160px;
    --page-width: 80vw;
    --color-bg: #0a0a0a;
    --color-text: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-accent: #A5464D;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

/* Always show scrollbar to prevent layout shift between pages */
html {
    overflow-y: scroll;
}

body {
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 21px;
}

/* ========================================
   Top Bar
======================================== */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        inset 0 0 40px rgba(255, 255, 255, 0.03);
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--side-margin);
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 2px;
}

.logo img {
    max-height: 60px;
    width: auto;
}

.logo picture {
    display: flex;
    align-items: center;
}

.logo a:hover {
    color: var(--color-accent);
}

.header-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-text span {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 30px;
}

.desktop-home-link {
    display: none;
}

.nav-btn {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.nav-btn:hover,
.nav-btn-active {
    border-color: #ffffff;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.social-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: #A5464D;
    color: #A5464D;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   Horizontal Scroll Container
======================================== */

.horizontal-scroll-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.scroll-wrapper {
    display: flex;
    height: 100%;
    width: fit-content;
    will-change: transform;
}

/* ========================================
   Individual Pages - OVERLAP DESIGN
   Earlier pages stack ON TOP of later pages
   so each page's image peeks over the next.
======================================== */

.page {
    position: relative;
    flex-shrink: 0;
    width: var(--page-width);
    height: 100%;
}

/* Earlier pages on top → image right-bleed peeks over next page */
[data-page="1"] { z-index: 6; }
[data-page="2"] { z-index: 5; }
[data-page="3"] { z-index: 4; }
[data-page="4"] { z-index: 3; }
[data-page="5"] { z-index: 2; }
[data-page="6"] { z-index: 7; }

.page-image img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-image img.loaded {
    opacity: 1;
}

/* Last page takes full viewport - no 20% overlap on right */
.page:last-child {
    width: 120vw;
}

.page:last-child .page-image {
    left: 0;
    right: 0;
    width: 100%;
}

.page-image {
    position: absolute;
    top: 0;
    /* At design width (1920px) left is -6vw.
       Below 1920px, shift further left by the pixel deficit
       so the image container stays the same total width. */
    left: min(-6vw, calc(94vw - 1920px));
    /* Lock right bleed at 384px (=20vw at 1920px) minimum,
       scale up at wider viewports. */
    right: min(-20vw, -384px);
    height: 100%;
    overflow: hidden;
}

.page-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 20% center;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

/* Page 6 image shifted left */
[data-page="6"] .page-image img {
    object-position: 40% center;
}

/* ========================================
   Page Content (Text)
======================================== */

.page-content {
    position: absolute;
    z-index: 10;
    bottom: 100px;
    left: 60px;
    right: auto;
    top: auto;
}

.page-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.page-text {
    font-family: 'Vinque', serif;
    font-size: 61px;
    font-weight: 400;
    color: var(--color-text);
    line-height: 73.2px;
    white-space: nowrap;
    will-change: transform, opacity;
    transition: none; /* JS handles animation */
    position: relative;
    z-index: 1000;
}

/* Page 3 text - black color */
[data-page="3"] .page-text {
    color: #000;
}

/* Hide parallax text by default — JS will fade them in */
[data-page="2"] .page-text,
[data-page="3"] .page-text,
[data-page="4"] .page-text,
[data-page="5"] .page-text {
    opacity: 0;
}

/* Parallax text effects */
.page-text.parallax-up {
    /* First text - moves up on scroll */
}

.page-text.parallax-left {
    /* Second text - moves left and slightly up on scroll */
}

/* Page indicators hidden */
.page-indicators {
    display: none;
}

/* Mobile text helpers - hidden on desktop */
.text-mobile,
.text-mobile-only {
    display: none;
}

.text-desktop {
    display: inline;
}

/* ========================================
   Page 1 Specific Styles
======================================== */

.page-1-content {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 120px 60px 60px var(--side-margin);
}

.page-1-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.page-1-featured-image {
    max-width: 500px;
}

.page-1-featured-image img {
    width: 100%;
    height: auto;
}

.page-1-buttons {
    display: flex;
    gap: 15px;
    width: 500px;
    justify-content: center;
}

.page-1-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: linear-gradient(90deg, #c06068 0%, #8a3a40 40%, #8a3a40 60%, #c06068 100%);
    color: #ffffff;
    border: none;
    overflow: hidden;
}

.page-1-btn::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(
        from 0deg,
        rgba(255,255,255,0.6) 0deg,
        rgba(255,255,255,0.3) 20deg,
        rgba(255,255,255,0.1) 40deg,
        transparent 60deg 300deg,
        rgba(255,255,255,0.1) 320deg,
        rgba(255,255,255,0.3) 340deg,
        rgba(255,255,255,0.6) 360deg
    );
}

.page-1-btn::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 50px;
    background: linear-gradient(90deg, #c06068 0%, #8a3a40 40%, #8a3a40 60%, #c06068 100%);
}

.page-1-btn:hover::before {
    animation: snake-rotate 1.5s linear infinite;
}

@keyframes snake-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.page-1-btn svg {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.page-1-btn span {
    position: relative;
    z-index: 1;
}

.page-1-btn-outline {
    background: linear-gradient(90deg, #6a6a6a 0%, #3a3a3a 40%, #3a3a3a 60%, #6a6a6a 100%);
}

.page-1-btn-outline::after {
    background: linear-gradient(90deg, #6a6a6a 0%, #3a3a3a 40%, #3a3a3a 60%, #6a6a6a 100%);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    right: 0;
    bottom: 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-family: 'Vinque', serif;
    font-size: 24px;
    font-weight: normal;
    letter-spacing: 2px;
}

.scroll-arrow {
    display: inline-block;
    animation: scrollArrow 1.5s ease-in-out infinite;
}

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

/* Bottom thumbnails - reusable component */
.bottom-thumbnails {
    height:52px;
    position: absolute;
    bottom: 46px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 41px;
    z-index: 999;
}

.thumb {
    overflow: hidden;
    transition: all 0.3s ease;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   Page 6 - Final Page
======================================== */

.page-6-center {
    position: absolute;
    top: 50%;
    left: calc(70px + var(--side-margin));
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    z-index: 10;
}

.page-6-text {
    margin: 0;
    opacity: 0;
}

.page-6-btn {
    margin-top: 30px;
    opacity: 0;
}

/* ========================================
   Scroll Progress Bar
======================================== */

.scroll-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-accent);
    z-index: 1001;
    width: 0%;
}

/* ========================================
   Mobile Menu Toggle
======================================== */

.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: 13px;
    gap: 8px;
    transition: background 0.3s ease;
}

.mobile-menu-toggle .hamburger-line {
    display: block;
    height: 2px;
    background: #ffffff;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.mobile-menu-toggle .hamburger-line:nth-child(1) {
    width: 22px;
}

.mobile-menu-toggle .hamburger-line:nth-child(2) {
    width: 11px;
}

.mobile-menu-toggle .hamburger-line:nth-child(3) {
    width: 22px;
}

/* X animation when open */
.mobile-menu-toggle.open {
    padding-left: 14px;
}

.mobile-menu-toggle.open .hamburger-line:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
    width: 20px;
}

.mobile-menu-toggle.open .hamburger-line:nth-child(2) {
    opacity: 0;
    width: 0;
}

.mobile-menu-toggle.open .hamburger-line:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
    width: 20px;
}

/* Mobile Menu Panel */
.mobile-menu-overlay {
    display: none;
}

.mobile-menu {
    display: none;
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 1200px) {
    :root {
        --side-margin: 80px;
    }
}

@media (max-width: 1024px) {
    :root {
        --side-margin: 40px;
    }

    .page-text {
        font-size: 42px;
        line-height: 52px;
    }

    .page-1-featured-image {
        max-width: 380px;
    }

    .page-1-buttons {
        width: 380px;
    }
}

@media (max-width: 768px) {
    :root {
        --side-margin: 16px;
        --top-bar-height: 68px;
        --page-width: 85vw;
    }
    
    /* ---- Header ---- */
    .top-bar {
        height: var(--top-bar-height);
    }

    .top-bar-content {
        padding: 0 16px;
    }

    .logo img {
        max-height: 48px;
        width: auto;
    }
    
    .header-text {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-menu-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile menu panel - slides from right */
    .mobile-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: fixed;
        top: 82px;
        right: -16px;
        width: 320px;
        height: 472px;
        background: rgba(10, 10, 10, 0.25);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border-radius: 20px 0 0 20px;
        z-index: 1003;
        transform: translateX(calc(100% + 16px));
        transition: transform 0.3s ease;
        padding: 30px;
        box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.05), inset 0 0 60px rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-menu.open {
        transform: translateX(0);
    }

    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .mobile-menu-links .nav-btn {
        font-size: 16px;
        padding: 0;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 169px;
        height: 48px;
        box-sizing: border-box;
        border: 1px solid var(--color-accent);
    }

    .mobile-menu-bottom {
        display: flex;
        flex-direction: column;
    }

    .mobile-menu-social-section {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-menu-social-icons {
        display: flex;
        gap: 12px;
    }

    .mobile-menu-social-label {
        color: #ffffff;
        font-family: 'Vinque', serif;
        font-size: 14px;
        margin: 10px 0;
        letter-spacing: 1px;
    }

    .mobile-menu-social-border {
        width: 100%;
        height: 1px;
        background: rgba(255, 255, 255, 0.2);
    }

    .mobile-menu-social-icons .social-link {
        width: 34px;
        height: 34px;
        border-width: 1.5px;
    }

    /* Hide header social links on mobile */
    .header-social {
        display: none;
    }

    /* Header social links and logo on mobile */
    .social-links {
        gap: 12px;
    }

    .social-link {
        width: 34px;
        height: 34px;
        border-width: 1.5px;
    }

    .social-link svg {
        width: 16px;
        height: 16px;
    }

    .logo img {
        max-height: 48px;
    }

    /* ---- Pages - keep overlap design ---- */
    /* Desktop: page=80vw, image bleeds left:-100px right:-20vw */
    /* Mobile:  page=85vw, image bleeds right only into 15vw overlap zone */
    .page {
        width: 85vw !important;
    }

    /* Pages 2-5 triple width on mobile for extended scroll effects */
    [data-page="2"],
    [data-page="3"],
    [data-page="4"],
    [data-page="5"] {
        width: 255vw !important;
    }

    .page:last-child {
        width: 100vw !important;
    }

    .page:last-child .page-image {
        left: -20vw !important;
        right: 0 !important;
        width: auto !important;
    }

    .page-image {
        left: 0;
        right: -15vw;
    }

    /* Shift pages 3-5 images left to cover transitions */
    [data-page="3"] .page-image,
    [data-page="4"] .page-image {
        left: -20vw;
    }

    /* Page 6 needs more shift */
    [data-page="5"] .page-image {
        left: -25vw;
    }

    .page-image img {
        object-position: center center;
    }

    /* ---- Page content text ---- */
    .page-content {
        left: 16px !important;
        right: 16px !important;
        bottom: 100px !important;
    }
    
    .page-title {
        font-size: 28px;
    }

    .page-text {
        font-size: 24px;
        line-height: 32px;
        white-space: normal;
    }

    /* ---- Page 1 ---- */
    .page-1-content {
        padding: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        justify-content: flex-start;
    }

    /* Logo: centered on screen, 7px below header.
       Page is 85vw but screen is 100vw, so shift right by 7.5vw to center on screen. */
    .page-1-top {
        flex: none;
        justify-content: flex-start;
        align-items: center;
        padding-top: calc(var(--top-bar-height) + 7px);
        padding-left: 7.5vw;
        padding-right: 0;
    }

    .page-1-featured-image {
        max-width: 320px;
    }

    .page-1-featured-image img {
        width: 100%;
        height: auto;
    }

    /* Buttons: 44px above progress bar, stretch to 16px from real screen edges.
       Page right edge is 15vw short of screen right, so right = calc(-15vw + 16px). */
    .page-1-buttons {
        position: absolute;
        bottom: 88px;
        left: 16px;
        right: calc(-15vw + 16px);
        width: auto;
        max-width: none;
        flex-direction: row;
        gap: 16px;
        justify-content: stretch;
    }

    .page-1-btn {
        width: 169px;
        height: 48px;
        padding: 0;
        font-size: 14px;
        gap: 8px;
        justify-content: center;
        align-items: center;
        flex: none;
        box-sizing: border-box;
    }

    .page-1-btn svg {
        width: 18px;
        height: 18px;
    }

    /* YouTube button: same size, icon only */
    .page-1-btn-outline {
        flex: none;
        width: 169px;
        height: 48px;
        padding: 0;
    }

    .page-1-btn-outline span {
        display: none;
    }

    /* Hide scroll indicator on mobile */
    .scroll-indicator {
        display: none;
    }

    /* Hide bottom thumbnails on mobile */
    .bottom-thumbnails {
        display: none;
    }

    /* ---- Mobile text show/hide helpers ---- */
    .text-desktop {
        display: none;
    }

    .text-mobile {
        display: inline;
    }

    .text-mobile-only {
        display: block;
    }

    /* ---- Page 2 ---- */
    [data-page="2"] .page-content {
        top: 132px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 85vw !important;
        padding-left: 0 !important;
        text-align: left !important;
    }

    [data-page="2"] .page-text {
        font-size: 36px;
        line-height: 1.2;
        padding-left: 58px !important;
    }

    /* ---- Page 3 ---- */
    [data-page="3"] .page-content {
        top: 244px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 85vw !important;
        text-align: left !important;
    }

    [data-page="3"] .page-text {
        font-size: 36px;
        line-height: 1.2;
        padding-left: 68px !important;
    }

    /* ---- Page 4 ---- */
    [data-page="4"] .page-content {
        top: 126px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 85vw !important;
        text-align: left !important;
    }

    [data-page="4"] .page-text {
        font-size: 36px;
        line-height: 1.2;
        padding-left: 44px !important;
        white-space: nowrap;
    }

    /* ---- Page 5 ---- */
    [data-page="5"] .page-content {
        top: 220px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 85vw !important;
        text-align: left !important;
    }

    [data-page="5"] .page-text {
        font-size: 36px;
        line-height: 1.2;
        padding-left: 44px !important;
        white-space: nowrap;
    }

    /* ---- Page 6 ---- */
    .page-6-center {
        top: 250px !important;
        left: 0 !important;
        right: 16px !important;
        transform: none !important;
        width: auto;
        align-items: flex-start !important;
        text-align: left !important;
    }

    .page-6-text {
        font-size: 36px !important;
        line-height: 1.2 !important;
        padding-left: 24px !important;
    }

    .page-6-btn {
        margin-top: 20px;
        margin-left: 24px;
    }

    /* Show thumbnails on page 6 on mobile */
    [data-page="6"] .bottom-thumbnails {
        display: flex !important;
        bottom: 60px;
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
        justify-content: center;
        gap: 24px;
        height: auto;
    }

    [data-page="6"] .thumb {
        flex: none;
    }

    [data-page="6"] .thumb img {
        width: auto;
        max-height: 42px;
        height: auto;
    }

    /* ---- Progress Bar - redesigned for mobile ---- */
    .scroll-progress {
        bottom: 41px;
        left: 63px;
        right: 63px;
        width: auto !important;
        height: 3px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 2px;
    }

    .scroll-progress::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: var(--color-accent);
        border-radius: 2px;
        /* width set by JS via custom property */
        width: var(--progress, 16.66%);
    }

    /* ---- Page indicators ---- */
    .page-indicators {
        bottom: 8px;
    }
}

@media (max-width: 480px) {

    .page-1-featured-image {
        max-width: 260px;
    }

    .page-1-btn {
        font-size: 21px;
        width: 240px;
        height: 57px;
    }

    .page-1-btn-outline {
        width: 102px;
        height: 63px;
    }

    .social-links {
        gap: 8px;
    }

    .social-link {
        width: 30px;
        height: 30px;
    }

    .logo img {
        max-height: 48px;
    }
}

@media (max-width: 360px) {
    .page-text {
        font-size: 18px;
        line-height: 24px;
    }

    .page-1-featured-image {
        max-width: 170px;
    }
}
