/* Purpose page styles */

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

html {
    overscroll-behavior-y: none;
}

body {
    width: 100%;
    background-color: #161616;
    position: relative;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior-y: none;
}

/* Page transition overlay - for smooth fade transitions between pages and on viewport resize */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #161616;
    z-index: 99999;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.page-transition-overlay.fade-out {
    opacity: 0;
}

.page-transition-overlay.fade-in {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

/* ========================================
   Navigation Menu (button-outer)
   ======================================== */

.button-outer {
    position: fixed;
    top: 23px;
    left: 21px;
    width: 88px; /* Fit PURPOSE text + padding */
    height: 34px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 7px;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 200;
}

.button-outer.expanded {
    width: 227px;
}

/* White highlight box that moves */
.button-highlight {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 66px;
    height: 26px;
    background-color: white;
    border-radius: 4px;
    transition: transform 0.3s ease, width 0.3s ease;
    transform: translateX(0px);
    z-index: 1;
}

/* Menu items */
.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    z-index: 2;
    cursor: pointer;
    flex-shrink: 0;
}

/* Hide HOME and RESEARCH by default, show PURPOSE */
.menu-item[data-item="home"],
.menu-item[data-item="research"] {
    opacity: 0;
    width: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, width 0.3s ease, margin 0.3s ease;
    margin-left: 0;
}

.menu-item[data-item="purpose"] {
    opacity: 1;
    width: 66px;
    pointer-events: auto;
}

/* On expand, reveal all items */
.button-outer.expanded .menu-item[data-item="home"] {
    opacity: 1;
    width: 45px;
    pointer-events: auto;
}

.button-outer.expanded .menu-item[data-item="research"] {
    opacity: 1;
    width: 74px;
    pointer-events: auto;
    margin-left: 8px;
}

.button-outer.expanded .menu-item[data-item="purpose"] {
    margin-left: 8px;
}

/* Text styling */
.menu-text {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: black;
    text-align: center;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.menu-item[data-item="research"] .menu-text,
.menu-item[data-item="home"] .menu-text {
    color: white;
}

.menu-item.active .menu-text {
    color: black;
}

.menu-item:not(.active) .menu-text {
    color: white;
}

/* Arrow container */
.button-arrow {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    margin-right: 4px;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
}

.button-outer.expanded .button-arrow {
    margin-left: 8px;
    margin-right: 4px;
}

.arrow-right,
.arrow-left {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.arrow-right {
    opacity: 0.3;
}

.arrow-left {
    opacity: 0;
}

.button-outer.expanded .arrow-right {
    opacity: 0;
}

.button-outer.expanded .arrow-left {
    opacity: 0.3;
}

/* ========================================
   Logo
   ======================================== */

.logo-container {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
}

.logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

/* ========================================
   Contact Button
   ======================================== */

.contact-button {
    position: fixed;
    top: 28px;
    right: 21px;
    width: 72px;
    height: 26px;
    background-color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.contact-text {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: black;
    display: flex;
}

.contact-text span {
    display: inline-block;
}

/* Hide mobile menu elements on desktop */
.menu-panel {
    display: none;
}

.menu-dim-overlay {
    display: none;
}

.menu-separator-line {
    display: none;
}

.mobile-menu-text {
    display: none;
}

.menu-footer-left,
.menu-footer-right {
    display: none;
}

.menu-social-links {
    display: none;
}

.menu-contact-button {
    display: none;
}

/* Hide mobile elements on desktop */
.content-container {
    display: none;
}

.mobile-grid-line-vertical,
.mobile-grid-line-horizontal,
.mobile-section-text,
.mobile-better-text,
.mobile-chevron,
.mobile-timeline-text,
.mobile-product-section,
.mobile-footer-section,
.mobile-matrix-text-container {
    display: none;
}

/* ========================================
   Page Content (Desktop)
   Height creates scrollable area for footer reveal.
   Total scroll = min-height - 100vh
   Footer shows at 500px scroll, fully visible at 1500px
   ======================================== */

.page-content {
    width: 100%;
    min-height: calc(100vh + 1500px); /* Allows 1500px of scroll */
    background-color: #161616;
    position: relative;
}

/* ========================================
   Subpage Footer (Desktop)
   Matches index.html positioning:
   - Bottom line: 60px from bottom (paddingBelowLine from index.html)
   - Top line: 355px from bottom (295px gap above bottom line)
   - Vertical lines: from top line to bottom of viewport
   - Content: 30px below top line
   - Legal: 30px above bottom line
   ======================================== */

.subpage-footer {
    position: fixed;
    left: 0;
    top: 100vh;
    width: 100%;
    height: 100vh;
    background-color: #161616;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subpage-footer.visible {
    opacity: 1;
}

/* Footer grid lines - positioned from bottom (matches index.html) */
.footer-line-horizontal-1 {
    position: absolute;
    left: 0;
    bottom: 353px; /* 295px gap + 58px from bottom, shifted down 2px */
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.footer-line-horizontal-2 {
    position: absolute;
    left: 0;
    bottom: 58px; /* shifted down 2px from 60px */
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.footer-line-vertical-left {
    position: absolute;
    left: 50px;
    bottom: 0;
    height: 353px; /* shifted down 2px to match top line */
    width: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.footer-line-vertical-right {
    position: absolute;
    right: 50px;
    bottom: 0;
    height: 353px; /* shifted down 2px to match top line */
    width: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* Footer content */
.footer-content {
    position: absolute;
    top: calc(100% - 325px); /* 30px below top line (355px - 30px) */
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: auto;
    z-index: 10;
}

.footer-column-left {
    margin-left: calc(50px + 40px); /* 40px right of left vertical line */
    pointer-events: auto;
    position: relative;
    z-index: 20;
}

.footer-column-right {
    margin-right: calc(50px + 40px); /* 40px left of right vertical line */
    text-align: right;
}

.footer-heading {
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    font-weight: 400;
    color: #6E6C6C;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.footer-link {
    font-family: 'Outfit', sans-serif;
    font-size: 25px;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin-bottom: 9px;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 20;
    display: block;
    width: fit-content;
    text-decoration: none;
    transition: color 0.3s ease-out;
}

/* Animated underline */
.footer-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-link.entering::after {
    transform: scaleX(1);
    transform-origin: left;
}

.footer-link.leaving::after {
    transform: scaleX(0);
    transform-origin: right;
}

.footer-link.dimmed {
    color: #2b2b2b !important;
}

.footer-link:visited {
    color: #ffffff;
}

.footer-link:visited.dimmed {
    color: #2b2b2b !important;
}

.footer-link:last-child {
    margin-bottom: 0;
}

.footer-social {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.social-icon {
    width: 27px;
    height: auto;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.social-icon:hover {
    opacity: 1;
}

.footer-legal {
    position: absolute;
    right: calc(50px + 40px);
    bottom: 90px; /* 30px above bottom line (60px + 30px) */
    text-align: right;
}

.footer-legal-text {
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    font-weight: 300;
    color: #6E6C6C;
    letter-spacing: -0.01em;
    margin-bottom: 7px;
}

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

/* ========================================
   Large Desktop Scaling (min-width: 1500px)
   ======================================== */

@media (min-width: 1500px) {
    /* Menu bar scaling - 75% growth */
    .button-outer {
        top: calc(-2.875px + 1.725vw); /* 23px base */
        left: calc(-2.625px + 1.575vw); /* 21px base */
        width: calc(-11px + 6.6vw); /* 88px base - fits PURPOSE text */
        height: calc(-4.25px + 2.55vw); /* 34px base */
        border-radius: calc(-0.875px + 0.525vw); /* 7px base */
        padding: calc(-0.5px + 0.3vw); /* 4px base */
    }

    .button-highlight {
        left: calc(-0.5px + 0.3vw); /* 4px base */
        top: calc(-0.5px + 0.3vw); /* 4px base */
        width: calc(-8.25px + 4.95vw); /* 66px base - purpose is active by default */
        height: calc(-3.25px + 1.95vw); /* 26px base */
        border-radius: calc(-0.5px + 0.3vw); /* 4px base */
    }

    .menu-item {
        height: calc(-3.25px + 1.95vw); /* 26px base */
    }

    .menu-item[data-item="purpose"] {
        width: calc(-8.25px + 4.95vw); /* 66px base - visible when collapsed */
    }

    .button-outer.expanded {
        width: calc(-28.375px + 17.025vw); /* 227px base */
    }

    .button-outer.expanded .menu-item[data-item="home"] {
        width: calc(-5.625px + 3.375vw); /* 45px base */
    }

    .button-outer.expanded .menu-item[data-item="research"] {
        width: calc(-9.25px + 5.55vw); /* 74px base */
        margin-left: calc(-1px + 0.6vw); /* 8px base */
    }

    .button-outer.expanded .menu-item[data-item="purpose"] {
        width: calc(-8.25px + 4.95vw); /* 66px base */
        margin-left: calc(-1px + 0.6vw); /* 8px base */
    }

    .menu-text {
        font-size: calc(-1.5px + 0.9vw); /* 12px base */
    }

    /* Arrow scaling - 75% growth (size only, margins stay fixed for positioning) */
    .button-arrow {
        width: calc(-1.25px + 0.75vw); /* 10px base */
        height: calc(-1.25px + 0.75vw); /* 10px base */
    }

    /* Logo scaling - 75% growth */
    .logo-container {
        top: calc(-2.75px + 1.65vw); /* 22px base */
    }

    .logo {
        height: calc(-4.75px + 2.85vw); /* 38px base */
    }

    /* Contact button scaling - 75% growth */
    .contact-button {
        top: calc(-3.5px + 2.1vw); /* 28px base */
        right: calc(-2.625px + 1.575vw); /* 21px base */
        width: calc(-9px + 5.4vw); /* 72px base */
        height: calc(-3.25px + 1.95vw); /* 26px base */
        border-radius: calc(-0.5px + 0.3vw); /* 4px base */
    }

    .contact-text {
        font-size: calc(-1.5px + 0.9vw); /* 12px base */
    }

    /* Footer text scaling - 65% growth */
    .footer-heading {
        font-size: calc(0.375px + 0.975vw); /* 15px base */
        margin-bottom: calc(0.3px + 0.78vw); /* 12px base */
    }

    .footer-link {
        font-size: calc(0.625px + 1.625vw); /* 25px base */
        margin-bottom: calc(0.225px + 0.585vw); /* 9px base */
    }

    .footer-social {
        gap: calc(0.375px + 0.975vw); /* 15px base */
    }

    .social-icon {
        width: calc(0.675px + 1.755vw); /* 27px base */
    }

    .footer-legal-text {
        font-size: calc(0.375px + 0.975vw); /* 15px base */
        margin-bottom: calc(0.175px + 0.455vw); /* 7px base */
    }
}

/* ========================================
   Mobile/iPad Responsive Styles (max-width: 850px)
   ======================================== */

@media (max-width: 850px) {
    /* Slide-out menu transition - S-curve bezier: slow-fast-slow */
    .logo-container,
    .page-content,
    .subpage-footer,
    .menu-separator-line,
    .menu-dim-overlay {
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    /* Ensure main content is above menu panel (z-index: 1) */
    .page-content {
        z-index: 2;
        position: relative;
    }

    .subpage-footer {
        z-index: 100;
    }

    .logo-container {
        z-index: 200;
    }

    /* Menu separator line - right edge of main frame */
    .menu-separator-line {
        display: block;
        position: fixed;
        top: 0;
        left: calc(100vw - 2px);
        width: 2px;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.1);
        z-index: 250;
        pointer-events: none;
    }

    /* Menu dim overlay - covers content when menu is open */
    .menu-dim-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100%;
        background-color: #161616;
        opacity: 0;
        z-index: 199;
        pointer-events: none;
        transition: opacity 0.94s cubic-bezier(0.76, 0, 0.24, 1), margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    body.mobile-menu-open .menu-dim-overlay {
        opacity: 0.7;
    }

    /* Menu panel - positioned in revealed area when content shifts */
    .menu-panel {
        position: fixed;
        top: 30vh;
        left: 15px;
        z-index: 1;
        display: flex;
        flex-direction: column;
        gap: 7px;
        pointer-events: none;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
        overflow: visible;
    }

    body.mobile-menu-open .menu-panel {
        pointer-events: auto;
    }

    /* When menu is open, disable pointer events on background elements so clicks pass through */
    body.mobile-menu-open .background-layer,
    body.mobile-menu-open .background-overlay,
    body.mobile-menu-open .background-4,
    body.mobile-menu-open .content-container,
    body.mobile-menu-open .page-content,
    body.mobile-menu-open .mobile-grid-line-vertical,
    body.mobile-menu-open .mobile-grid-line-horizontal,
    body.mobile-menu-open .mobile-section-text,
    body.mobile-menu-open .mobile-better-text,
    body.mobile-menu-open .mobile-chevron,
    body.mobile-menu-open .mobile-timeline-text,
    body.mobile-menu-open .mobile-product-section,
    body.mobile-menu-open .mobile-footer-section,
    body.mobile-menu-open .mobile-matrix-text-container {
        pointer-events: none !important;
    }

    /* Wrapper for reveal animation */
    .menu-panel-item-wrapper {
        overflow-x: visible;
        overflow-y: hidden;
        position: relative;
        line-height: 1.2;
        pointer-events: auto;
        z-index: 1;
    }

    .menu-panel-item-wrapper:hover {
        z-index: 2;
    }

    /* Menu panel items */
    .menu-panel-item {
        display: inline-block;
        position: relative;
        font-family: 'Outfit', sans-serif;
        font-weight: 400;
        letter-spacing: -0.01em;
        color: #ffffff;
        transform: translateY(105%);
        transition: transform 0.91s cubic-bezier(0.76, 0, 0.24, 1);
        pointer-events: auto;
        cursor: pointer;
        font-size: calc(80.1px + 4.37vw);
        will-change: transform;
        margin-left: 17px;
        white-space: nowrap; /* Prevent text wrapping during animation */
    }

    .menu-panel-item.revealed {
        transform: translateY(0);
    }

    .menu-panel-item.active {
        color: #ffffff;
    }

    .menu-panel-item:not(.active) {
        color: #676767;
    }

    .menu-item-text {
        display: inline-block;
        position: relative;
    }

    .menu-panel-item::after {
        content: '';
        display: inline-block;
        width: calc(19.6px + 1.07vw);
    }

    /* Menu item chevron */
    .menu-item-chevron {
        position: absolute;
        top: calc(9.8px + 0.535vw);
        left: 100%;
        width: calc(19.6px + 1.07vw);
        height: calc(19.6px + 1.07vw);
        pointer-events: none;
    }

    .menu-chevron-line-horizontal {
        position: absolute;
        top: 0;
        right: 0;
        width: 0;
        height: 2px;
        background-color: rgba(255, 255, 255, 0.1);
        transition: width 60ms linear;
    }

    .menu-chevron-line-vertical {
        position: absolute;
        top: 0;
        right: 0;
        width: 2px;
        height: 0;
        background-color: rgba(255, 255, 255, 0.1);
        transition: height 60ms linear;
    }

    .menu-panel-item:not(.active):hover .menu-chevron-line-horizontal {
        width: calc(19.6px + 1.07vw);
    }

    .menu-panel-item:not(.active):hover .menu-chevron-line-vertical {
        height: calc(19.6px + 1.07vw);
    }

    /* Social links container */
    .menu-social-links {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-top: 30px;
        margin-left: 17px;
        pointer-events: auto;
    }

    .menu-social-link {
        text-decoration: none;
        display: inline-block;
    }

    #menuLinkedIn {
        margin-top: -7px;
    }

    .menu-social-text {
        font-family: 'Roboto Mono', monospace;
        font-weight: 300;
        font-size: calc(9.4px + 0.51vw);
        letter-spacing: -0.01em;
        color: #6E6C6C;
        display: inline-flex;
    }

    /* Menu contact button */
    .menu-contact-button {
        margin-top: 30px;
        margin-left: 17px;
        width: calc(67.9px + 3.7vw);
        height: calc(24.5px + 1.34vw);
        background-color: white;
        border-radius: calc(3.8px + 0.21vw);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        pointer-events: auto;
    }

    .menu-contact-text {
        font-family: 'Roboto Mono', monospace;
        font-size: calc(11.3px + 0.62vw);
        font-weight: 400;
        color: black;
        display: flex;
    }

    /* Footer text */
    .menu-footer-left {
        display: block;
        position: fixed;
        bottom: 5px;
        left: 22px;
        font-family: 'Roboto Mono', monospace;
        font-weight: 300;
        font-size: calc(8.5px + 0.46vw);
        letter-spacing: -0.01em;
        color: #6E6C6C;
        pointer-events: none;
        opacity: 0;
        z-index: 1;
        transition: opacity 0.3s ease, margin-left 1.2s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .menu-footer-right {
        display: block;
        position: fixed;
        bottom: 5px;
        right: 7px;
        font-family: 'Roboto Mono', monospace;
        font-weight: 300;
        font-size: calc(8.5px + 0.46vw);
        letter-spacing: -0.01em;
        color: #6E6C6C;
        pointer-events: none;
        opacity: 0;
        z-index: 1;
        transition: opacity 0.3s ease, margin-left 1.2s cubic-bezier(0.76, 0, 0.24, 1);
    }

    body.mobile-menu-open .menu-footer-left,
    body.mobile-menu-open .menu-footer-right {
        opacity: 1;
    }

    /* Hide social links, contact button when menu is closed */
    .menu-social-links,
    .menu-contact-button {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    body.mobile-menu-open .menu-social-links,
    body.mobile-menu-open .menu-contact-button {
        opacity: 1;
    }

    /* Logo - repositioned and resized for mobile */
    .logo-container {
        display: block !important;
        top: 40px;
        left: 30px;
        transform: none;
    }

    .logo {
        height: 40px;
        width: auto;
        object-fit: contain;
    }

    /* Menu bar - repositioned to right side and scaled up */
    .button-outer {
        display: flex !important;
        align-items: center;
        top: 40px;
        left: auto;
        right: 30px;
        width: 79px;
        height: 40px;
        border-radius: 8px;
        padding: 5px;
        pointer-events: auto;
        cursor: pointer;
        transition: width 0.3s ease;
    }

    /* Expanded state when menu is open - CLOSE is 5 chars vs MENU 4 chars */
    .button-outer.menu-open {
        width: 88px;
    }

    /* Scaled up highlight */
    .button-highlight {
        left: 5px;
        top: 5px;
        width: 53px !important;
        height: 30px;
        border-radius: 5px;
        pointer-events: none;
        transition: width 0.3s ease;
        transform: none;
    }

    /* Expanded highlight when menu is open */
    .button-outer.menu-open .button-highlight {
        width: 62px !important;
    }

    /* Scaled up menu items */
    .menu-item {
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Show PURPOSE item on mobile, hide HOME and RESEARCH */
    .menu-item[data-item="purpose"] {
        width: 53px;
        transition: width 0.3s ease;
    }

    /* Expanded menu item when menu is open */
    .button-outer.menu-open .menu-item[data-item="purpose"] {
        width: 62px;
    }

    .menu-item[data-item="home"],
    .menu-item[data-item="research"] {
        display: none !important;
    }

    /* Scaled up text */
    .menu-text {
        font-size: 14px;
    }

    /* Scaled up arrow */
    .button-arrow {
        width: 12px;
        height: 12px;
        margin-left: 5px;
        margin-right: 5px;
    }

    /* Swap arrows for mobile - show left arrow instead of right (default state) */
    /* JS will toggle these when menu opens/closes */
    .arrow-right {
        visibility: visible;
        opacity: 0;
        z-index: 1;
        transition: opacity 0.3s ease;
    }

    .arrow-left {
        visibility: visible;
        opacity: 0.3;
        z-index: 2;
        transition: opacity 0.3s ease;
    }

    /* Disable expanded state on mobile */
    .button-outer.expanded {
        width: 79px;
    }

    /* Hide contact button on mobile */
    .contact-button {
        display: none !important;
    }

    /* Hide page content and subpage footer on mobile - show mobile-specific content instead */
    .page-content,
    .subpage-footer {
        display: none !important;
    }

    /* Background layer for mobile scroll */
    .content-container {
        display: block !important;
        background-color: #161616;
        position: relative;
        width: 100%;
        min-height: 100vh;
        z-index: 2;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .background-layer {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-image: url('Images/Background 2.png');
        background-size: cover;
        background-position: center center;
        z-index: 1 !important;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .background-4 {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        opacity: 0;
        z-index: 1 !important;
        background-image: url('Images/Background 4.jpg');
        background-size: cover;
        background-position: center center;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .background-overlay {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: #161616;
        z-index: 2;
        opacity: 0;
        pointer-events: none;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    /* Ensure body background is solid */
    body {
        background-color: #161616;
    }

    /* Mobile grid lines */
    .mobile-grid-line-vertical {
        display: block;
        position: fixed;
        left: 93px;
        bottom: 0;
        width: 2px;
        height: 0;
        background-color: rgba(255, 255, 255, 0.1);
        z-index: 5;
        pointer-events: none;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
        -webkit-mask-image: linear-gradient(
            to top,
            black 0,
            black calc(50vh - 68px - 6vw - 25px),
            transparent calc(50vh - 68px - 6vw - 5px),
            transparent calc(50vh + 68px + 6vw + 5px),
            black calc(50vh + 68px + 6vw + 25px),
            black 100vh
        );
        mask-image: linear-gradient(
            to top,
            black 0,
            black calc(50vh - 68px - 6vw - 25px),
            transparent calc(50vh - 68px - 6vw - 5px),
            transparent calc(50vh + 68px + 6vw + 5px),
            black calc(50vh + 68px + 6vw + 25px),
            black 100vh
        );
        -webkit-mask-size: 100% 100vh;
        mask-size: 100% 100vh;
        -webkit-mask-position: 0 bottom;
        mask-position: 0 bottom;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
    }

    .mobile-grid-line-horizontal {
        display: block;
        position: fixed;
        left: 0;
        bottom: 105px;
        width: 0;
        height: 2px;
        background-color: rgba(255, 255, 255, 0.1);
        z-index: 5;
        pointer-events: none;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    /* Mobile section text */
    .mobile-section-text {
        display: block;
        position: fixed;
        left: 30px;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
        font-family: 'Outfit', sans-serif;
        font-size: calc(34px + 3vw);
        font-weight: 300;
        line-height: calc(34px + 3vw);
        letter-spacing: -0.01em;
        color: #2B2B2B;
        z-index: 10;
        opacity: 0;
        pointer-events: none;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .mobile-section-text .mobile-word {
        color: #2B2B2B;
        transition: color 0.3s ease;
    }

    .mobile-section-text .mobile-word.filled {
        color: #FFFFFF;
    }

    .mobile-fade-letter {
        color: inherit;
        transition: opacity 0.1s ease;
    }

    /* Mobile better text */
    .mobile-better-text {
        display: block;
        position: fixed;
        left: 30px;
        top: 50%;
        transform: none;
        font-family: 'Outfit', sans-serif;
        font-size: calc(34px + 3vw);
        font-weight: 300;
        line-height: calc(34px + 3vw);
        letter-spacing: -0.01em;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .mobile-better-letter {
        color: rgba(255, 255, 255, 0);
        transition: color 0.1s ease;
    }

    /* Mobile chevron */
    .mobile-chevron {
        display: block;
        position: fixed;
        width: calc(12.6px + 1.7vw);
        height: calc(12.6px + 1.7vw);
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .mobile-chevron .mobile-chevron-line-horizontal {
        position: absolute;
        top: 0;
        right: 0;
        width: 0;
        height: 2px;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .mobile-chevron .mobile-chevron-line-vertical {
        position: absolute;
        top: 0;
        right: 0;
        width: 2px;
        height: 0;
        background-color: rgba(255, 255, 255, 0.1);
    }

    /* Mobile timeline text sections */
    .mobile-timeline-text {
        display: block;
        position: fixed;
        left: 113px;
        top: 0;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .mobile-timeline-title {
        font-family: 'Outfit', sans-serif;
        font-size: calc(30px + 0.6vw);
        font-weight: 300;
        line-height: calc(30px + 0.6vw);
        letter-spacing: -0.01em;
        color: #FFFFFF;
        margin-bottom: 15px;
    }

    .mobile-title-letter {
        opacity: 0;
    }

    .mobile-title-letter.visible {
        opacity: 1;
    }

    .mobile-timeline-subtitle {
        font-family: 'Roboto Mono', monospace;
        font-size: calc(13.4px + 0.54vw);
        font-weight: 300;
        line-height: calc(18.4px + 0.54vw);
        letter-spacing: -0.01em;
        color: #ADADAD;
    }

    .mobile-subtitle-word {
        display: inline-block;
        opacity: 0;
        transform: translateY(15px);
    }

    .mobile-subtitle-word.visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Mobile timeline image wrapper */
    .mobile-timeline-image-wrapper {
        position: relative;
        margin-top: 25px;
        padding-bottom: 2px;
        margin-left: calc(-117.545px + 8.182vw);
        width: calc(9.09px + 83.636vw);
    }

    .mobile-timeline-image {
        width: 100%;
        height: auto;
        display: block;
    }

    /* Mobile timeline border segments */
    .mobile-timeline-border-top-left,
    .mobile-timeline-border-top-right,
    .mobile-timeline-border-bottom-left,
    .mobile-timeline-border-bottom-right {
        position: absolute;
        height: 2px;
        background-color: rgba(255, 255, 255, 0.1);
        pointer-events: none;
        z-index: 2;
        width: 0;
    }

    .mobile-timeline-border-top-left,
    .mobile-timeline-border-top-right {
        top: -2px;
    }

    .mobile-timeline-border-bottom-left,
    .mobile-timeline-border-bottom-right {
        bottom: 0;
    }

    /* Mobile timeline gradient overlays */
    .mobile-timeline-gradient-left,
    .mobile-timeline-gradient-right {
        position: absolute;
        top: -5px;
        height: calc(100% + 10px - 2px);
        width: 30.3vw;
        pointer-events: none;
        z-index: 3;
    }

    .mobile-timeline-gradient-left {
        left: 0;
        background: linear-gradient(to right,
            rgba(22, 22, 22, 1) 0%,
            rgba(22, 22, 22, 1) 20%,
            rgba(22, 22, 22, 0.8) 40%,
            rgba(22, 22, 22, 0) 100%);
    }

    .mobile-timeline-gradient-right {
        right: 0;
        background: linear-gradient(to right,
            rgba(22, 22, 22, 0) 0%,
            rgba(22, 22, 22, 0.8) 75%,
            rgba(22, 22, 22, 1) 85%,
            rgba(22, 22, 22, 1) 100%);
    }

    /* Mobile 3D Carousel */
    .mobile-carousel-wrapper {
        position: relative;
        padding: 100px 80px 150px 200px;
        margin-top: -45px;
        margin-left: -200px;
        margin-right: -80px;
        margin-bottom: -150px;
    }

    .mobile-carousel-scale-wrapper {
        transform-origin: left top;
        position: relative;
        width: 567px;
        height: 621px;
    }

    .mobile-carousel-3d-container {
        position: relative;
        perspective: 1620px;
        perspective-origin: 50% 50%;
        width: 567px;
        height: 621px;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        cursor: grab;
        user-select: none;
        box-sizing: content-box;
    }

    .mobile-carousel-3d-container:active {
        cursor: grabbing;
    }

    .mobile-carousel-3d-scene {
        width: 270px;
        height: 405px;
        position: relative;
        transform-style: preserve-3d;
        transform: rotateZ(10deg) rotateY(0deg);
        pointer-events: none;
    }

    .mobile-carousel-3d-card {
        position: absolute;
        width: 270px;
        height: 405px;
        left: 50%;
        top: 50%;
        margin-left: -135px;
        margin-top: -203px;
        transform-style: preserve-3d;
        pointer-events: none;
    }

    /* Carousel card positions */
    .mobile-carousel-3d-card[data-index="0"] { transform: rotateY(0deg) translateZ(146px) translateY(-120px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="1"] { transform: rotateY(40deg) translateZ(146px) translateY(-90px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="2"] { transform: rotateY(80deg) translateZ(146px) translateY(-60px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="3"] { transform: rotateY(120deg) translateZ(146px) translateY(-30px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="4"] { transform: rotateY(160deg) translateZ(146px) translateY(0px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="5"] { transform: rotateY(200deg) translateZ(146px) translateY(30px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="6"] { transform: rotateY(240deg) translateZ(146px) translateY(60px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="7"] { transform: rotateY(280deg) translateZ(146px) translateY(90px) rotateY(90deg); }
    .mobile-carousel-3d-card[data-index="8"] { transform: rotateY(320deg) translateZ(146px) translateY(120px) rotateY(90deg); }

    .mobile-carousel-3d-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 12px;
        pointer-events: none;
    }

    .mobile-carousel-3d-card-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%, rgba(0,0,0,0.2) 100%);
        border-radius: 12px;
        pointer-events: none;
    }

    .mobile-carousel-3d-card-shine {
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
        border-radius: 12px;
        pointer-events: none;
    }

    .mobile-carousel-3d-card::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 12px;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.08);
        pointer-events: none;
    }

    /* Mobile Product Section (simplified - IS the line) */
    .mobile-product-section {
        display: block;
        position: fixed;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: rgba(255, 255, 255, 0.1);
        z-index: 1000 !important;
        overflow: visible;
        opacity: 1;
        pointer-events: none;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    /* Mobile Footer Section */
    .mobile-footer-section {
        display: block;
        position: fixed;
        left: 0;
        width: 100%;
        background-color: #161616;
        z-index: 15;
        pointer-events: none;
        opacity: 0;
        overflow: visible; /* Allow matrix text to be visible */
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .mobile-footer {
        display: flex;
        justify-content: space-between;
        align-items: stretch;
        position: absolute;
        top: 45px;
        left: 30px;
        right: 30px;
        z-index: 20;
        pointer-events: none;
        opacity: 1;
    }

    .mobile-footer-left {
        text-align: left;
        display: flex;
        flex-direction: column;
    }

    .mobile-footer-right {
        text-align: right;
        display: flex;
        flex-direction: column;
    }

    .mobile-footer-heading {
        font-family: 'Roboto Mono', monospace;
        font-size: calc(4.98px + 1.52vw);
        font-weight: 300;
        color: #6E6C6C;
        letter-spacing: -0.01em;
        margin-bottom: 7px;
    }

    .mobile-footer-link {
        font-family: 'Outfit', sans-serif;
        font-size: calc(7.48px + 2.28vw);
        font-weight: 300;
        color: #ffffff;
        letter-spacing: -0.01em;
        margin-bottom: 10px;
        pointer-events: auto;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        position: relative;
        display: block;
        width: fit-content;
        text-decoration: none;
        transition: color 0.3s ease-out;
    }

    .mobile-footer-link::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #ffffff;
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-footer-link.entering::after {
        transform: scaleX(1);
        transform-origin: left;
    }

    .mobile-footer-link.leaving::after {
        transform: scaleX(0);
        transform-origin: right;
    }

    .mobile-footer-link.dimmed {
        color: #2b2b2b !important;
    }

    .mobile-footer-link:last-child {
        margin-bottom: 0;
    }

    .mobile-footer-link:visited {
        color: #ffffff;
    }

    .mobile-footer-link:visited.dimmed {
        color: #2b2b2b !important;
    }

    /* Mobile footer social icons */
    .mobile-footer-social {
        display: flex;
        justify-content: flex-end;
        gap: calc(5.85px + 1.248vw);
        margin-top: 10px;
    }

    .mobile-social-icon {
        width: calc(12.46px + 3.8vw);
        height: calc(12.46px + 3.8vw);
        opacity: 0.6;
        transition: opacity 0.3s ease;
        cursor: pointer;
        pointer-events: auto;
    }

    .mobile-social-icon:hover {
        opacity: 1;
    }

    /* Mobile footer legal text */
    .mobile-footer-legal {
        margin-top: auto;
        text-align: right;
    }

    .mobile-footer-legal-text {
        font-family: 'Roboto Mono', monospace;
        font-size: calc(3.99px + 1.22vw);
        font-weight: 300;
        color: #6E6C6C;
        letter-spacing: -0.01em;
    }

    .mobile-footer-legal-text:first-child {
        margin-bottom: 3px;
    }

    /* Mobile Matrix Text - positioned independently for parallax effect */
    .mobile-matrix-text-container {
        display: block;
        position: fixed;
        left: 0;
        width: 100%;
        z-index: 5;
        pointer-events: none;
        opacity: 0;
        overflow: visible;
        transition: margin-left 0.94s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .mobile-matrix-svg {
        width: 100%;
        height: auto;
        display: block;
        overflow: visible;
    }

    .mobile-matrix-canvas {
        width: 100%;
        height: 100%;
        display: block;
    }
}

/* ========================================
   iPad Styles (500px - 850px)
   ======================================== */

@media (min-width: 500px) and (max-width: 850px) {
    /* iPad menu panel positioning */
    .menu-panel {
        left: 55vw;
    }

    /* Font scales for iPad */
    .menu-panel-item {
        font-size: calc(28.3px + 1.54vw);
    }

    /* iPad spacer for chevron */
    .menu-panel-item::after {
        width: calc(8.5px + 0.46vw);
    }

    /* Chevron scales proportionally */
    .menu-item-chevron {
        width: calc(8.5px + 0.46vw);
        height: calc(8.5px + 0.46vw);
        left: 100%;
        top: calc(4.25px + 0.23vw);
    }

    .menu-panel-item:not(.active):hover .menu-chevron-line-horizontal {
        width: calc(8.5px + 0.46vw);
    }

    .menu-panel-item:not(.active):hover .menu-chevron-line-vertical {
        height: calc(8.5px + 0.46vw);
    }

    /* iPad footer positioning */
    .menu-footer-left {
        left: calc(40vw + 7px);
    }

    .menu-footer-right {
        right: 7px;
    }

    /* iPad content styles - copied from css.css */
    .mobile-grid-line-vertical {
        left: calc(-24px + 23.4vw);
    }

    .mobile-section-text {
        left: calc(-87px + 23.4vw);
    }

    .mobile-better-text {
        left: calc(-87px + 23.4vw);
    }

    .mobile-timeline-text {
        left: calc(-4px + 23.4vw);
    }

    .mobile-timeline-image-wrapper {
        margin-left: calc(-0.545px - 15.218vw);
    }
}

/* ========================================
   Smaller Mobile Styles (max-width: 499px, 500px+ is iPad)
   ======================================== */

@media (max-width: 499px) {
    /* Logo - same left padding as mobile content */
    .logo-container {
        left: calc(-12px + 8.4vw);
    }

    /* Menu bar - same right padding as mobile content */
    .button-outer {
        right: calc(-12px + 8.4vw);
    }

    /* Menu panel - hide iPad menu items on mobile */
    .menu-panel {
        top: 25vh;
        gap: 0;
        left: 15px;
    }

    .menu-panel-item-wrapper {
        display: none;
    }

    /* Mobile menu text panel */
    .mobile-menu-text {
        display: flex;
        flex-direction: column;
        width: calc(100vw - 15px);
    }

    /* Wrapper for reveal animation */
    .mobile-menu-text-item {
        overflow-x: visible;
        overflow-y: hidden;
        position: relative;
        line-height: 1.2;
        margin-top: calc(3.89px - 2.78vw);
    }

    .mobile-menu-text-item:first-child {
        margin-top: 0;
    }

    /* Mobile menu item text */
    .mobile-menu-item-text {
        display: inline-block;
        position: relative;
        font-family: 'Outfit', sans-serif;
        font-size: calc(6.67px + 16.67vw);
        font-weight: 400;
        color: #6E6C6C;
        cursor: pointer;
        transform: translateY(105%);
        transition: transform 1.5s cubic-bezier(0.76, 0, 0.24, 1);
        will-change: transform;
    }

    .mobile-menu-text-item.revealed .mobile-menu-item-text {
        transform: translateY(0);
    }

    .mobile-menu-text-item.active .mobile-menu-item-text {
        color: #FFFFFF;
    }

    /* Mobile menu chevron */
    .mobile-menu-chevron {
        position: absolute;
        top: calc(-3.06px + 3.61vw);
        left: 100%;
        width: calc(-6.11px + 7.22vw);
        height: calc(-6.11px + 7.22vw);
        pointer-events: none;
    }

    .mobile-chevron-line-horizontal {
        position: absolute;
        top: 0;
        right: 0;
        width: 0;
        height: 2px;
        background-color: #6E6C6C;
        transition: width 60ms linear;
    }

    .mobile-chevron-line-vertical {
        position: absolute;
        top: 0;
        right: 0;
        width: 2px;
        height: 0;
        background-color: #6E6C6C;
        transition: height 60ms linear;
    }

    .mobile-menu-text-item:not(.active):hover .mobile-chevron-line-horizontal {
        width: calc(-6.11px + 7.22vw);
    }

    .mobile-menu-text-item:not(.active):hover .mobile-chevron-line-vertical {
        height: calc(-6.11px + 7.22vw);
    }

    /* Mobile social links */
    .menu-social-links {
        order: 2;
        margin-top: 15px;
        margin-left: 0;
        gap: 3px;
    }

    #menuLinkedIn {
        margin-top: -5px;
    }

    .menu-social-text {
        font-size: calc(7.73px + 1.33vw);
    }

    /* Mobile contact button */
    .menu-contact-button {
        order: 3;
        margin-top: 20px;
        margin-left: 0;
        width: calc(55.65px + 9.61vw);
        height: calc(20.2px + 3.44vw);
        border-radius: calc(3.12px + 0.54vw);
    }

    .menu-contact-text {
        font-size: calc(7.73px + 1.33vw);
    }

    /* Footer text */
    .menu-footer-left {
        left: 7px;
        font-size: calc(7.73px + 1.33vw);
    }

    .menu-footer-right {
        right: 7px;
        font-size: calc(7.73px + 1.33vw);
    }

    /* Mobile content styles for smaller screens - copied from css.css */
    .mobile-section-text {
        font-size: calc(7.5px + 8.3vw);
        line-height: calc(7.5px + 8.3vw);
    }

    .mobile-better-text {
        font-size: calc(7.5px + 8.3vw);
        line-height: calc(7.5px + 8.3vw);
    }

    .mobile-timeline-title {
        font-size: calc(14.5px + 3.7vw);
        line-height: calc(14.5px + 3.7vw);
    }

    .mobile-timeline-subtitle {
        font-size: calc(1.1px + 3vw);
        line-height: calc(6.1px + 3vw);
    }

    .mobile-product-text {
        font-size: calc(13px + 5.4vw);
        line-height: calc(13px + 5.4vw);
    }

    .mobile-reserve-button {
        font-size: calc(4.34px + 1.51vw);
        line-height: calc(4.34px + 1.51vw);
        padding: calc(2.8px + 1.26vw) calc(5.6px + 2.52vw);
    }

    .mobile-footer-legal-text {
        font-size: calc(1.7px + 1.67vw);
    }

    .mobile-footer-social {
        margin-top: calc(-12.2px + 4.44vw);
    }

    .mobile-footer {
        left: calc(-12px + 8.4vw);
        right: calc(-12px + 8.4vw);
    }

    /* Reorder elements: mobile menu text first, then social links, then contact button */
    .mobile-menu-text {
        order: 1;
    }

    .menu-social-links {
        order: 2;
        margin-top: 15px;
        margin-left: 0;
        gap: 3px;
    }

    #menuLinkedIn {
        margin-top: -5px;
    }

    .menu-social-text {
        font-size: calc(7.73px + 1.33vw);
    }

    .menu-contact-button {
        order: 3;
        margin-top: 20px;
        margin-left: 0;
        width: calc(55.65px + 9.61vw);
        height: calc(20.2px + 3.44vw);
        border-radius: calc(3.12px + 0.54vw);
    }

    .menu-contact-text {
        font-size: calc(7.73px + 1.33vw);
    }

    .menu-footer-left {
        left: 7px;
        font-size: calc(7.73px + 1.33vw);
    }

    .menu-footer-right {
        right: 7px;
        font-size: calc(7.73px + 1.33vw);
    }
}