:root {
    --bg: #ffffff;
    --text: #1d1d1f;
    --accent: #0071e3;
    --glass: rgba(255, 255, 255, 0.7);
    --border: rgba(0, 0, 0, 0.1);
    --card-hover: rgba(0, 113, 227, 0.03);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --text: #f5f5f7;
        --accent: #2997ff;
        --glass: rgba(28, 28, 30, 0.7);
        --border: rgba(255, 255, 255, 0.15);
        --card-hover: rgba(41, 151, 255, 0.1);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    /* Maintained for custom scroll container */
}

/* Custom Scroll Container */
.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Momentum scrolling for mobile */
}

.page-section {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 5%;
}

.content-wrapper {
    width: 100%;
    max-width: 1200px;
}

.centered {
    text-align: center;
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.nav-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.nav-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.7;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 1;
}

#hero-nav-chips {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 10px;
    display: flex;
    gap: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: opacity 0.5s ease;
}

.nav-chip {
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.2s;
}

.nav-chip:hover {
    background: rgba(0, 0, 0, 0.05);
}

.chips-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px) !important;
}

/* HERO */
.hero-split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 40px;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.brand-container {
    margin-bottom: 20px;
    min-height: 90px;
}

#brand-name {
    font-size: clamp(40px, 6vw, 84px);
    font-weight: 700;
    letter-spacing: -0.04em;
    white-space: nowrap;
    transform-origin: left center;
}

#hero-sub-content {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: all 0.8s ease 0.5s;
}

#hero-sub-content.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* --- CENTERED TECH STACK WRAPPER --- */
.tech-stack-wrapper {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: 90vw;
}

.tech-stack-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    color: var(--text);
    opacity: 0.5;
    margin-bottom: 8px;
    text-align: center;
}

/* TECH STACK PILL */
#hero-tech-stack {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ----------------------------------- */

.tech-group {
    display: flex;
    gap: 12px;
    color: var(--text);
    font-size: 20px;
    opacity: 0.8;
}

.tech-divider {
    color: var(--text);
    opacity: 0.2;
    font-size: 20px;
    font-weight: 300;
}

.tagline {
    font-size: 18px;
    opacity: 0.7;
    margin-bottom: 30px;
    max-width: 500px;
    line-height: 1.5;
}

.hero-btns {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.cta-primary {
    background: var(--accent);
    color: white;
    padding: 12px 28px;
    border-radius: 980px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.cta-secondary {
    background: transparent;
    color: var(--text);
    padding: 12px 28px;
    border-radius: 980px;
    text-decoration: none;
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* HERO RIGHT */
.hero-right {
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translate3d(30px, 0, 0);
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s;
}

.hero-right.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.journey-card {
    border-left: 3px solid var(--border);
    padding-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

.journey-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.journey-text {
    flex: 1;
}

.journey-item.highlight .year {
    color: var(--accent);
}

.journey-item .year {
    font-size: 13px;
    color: var(--text);
    opacity: 0.6;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 5px;
}

.journey-item h4 {
    font-size: 24px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

/* SECTIONS COMMON */
.section-header h2 {
    font-size: clamp(32px, 5vw, 42px);
    font-weight: 700;
    margin-bottom: 20px;
}

.section-desc {
    font-size: clamp(16px, 2vw, 20px);
    opacity: 0.8;
    line-height: 1.6;
}

/* PAGE 2 */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.align-top {
    align-items: flex-start;
}

.story-column {
    padding-right: 20px;
}

.track-record-column {
    border-left: 1px solid var(--border);
    padding-left: 40px;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timeline-card {
    border-left: 3px solid var(--accent);
    padding: 25px;
    transition: transform 0.2s;
}

.timeline-card:hover {
    transform: translateX(5px);
}

.timeline-card.compact {
    padding: 20px;
}

.timeline-card.compact h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.timeline-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.company {
    font-weight: 600;
    opacity: 0.6;
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

/* VIDEO & TELEMETRY CONTAINERS */
.wide-viewport {
    width: 100%;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.full-width-video-card {
    height: 70vh !important;
    width: auto;
    aspect-ratio: 16 / 9;
    max-width: 95vw;
    padding: 0 !important;
    border-radius: 30px !important;
    overflow: hidden;
    border: none !important;
    margin: 0 auto;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    background: #000;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* APPLE SLIDER */
.slider-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: #000;
    color: #f5f5f7;
    padding-bottom: 60px;
}

.slider-header-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px;
    z-index: 10;
}

.highlights-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.005em;
    color: #f5f5f7;
}

.watch-film-link {
    font-size: 17px;
    color: #2997ff;
    text-decoration: none;
    font-weight: 400;
    margin-bottom: 10px;
}

.highlights-viewport {
    width: 100%;
    overflow: hidden;
    padding: 20px 0 60px 0;
}

.highlights-track {
    display: flex;
    gap: 27px;
    width: max-content;
    transform: translateX(0);
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.highlight-card {
    width: 1120px;
    height: 633px;
    background: #000000;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8);
    transition: transform 0.5s ease;
    opacity: 0.6;
    /* Default inactive opacity */
    transform: scale(0.98);
    /* Default inactive scale */
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Active Focus Animation for Card */
.highlight-card.active-card {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
}


/* Height 80%, Position Absolute, Bottom 0 */
.card-visual {
    width: 100%;
    height: 80%;
    /* Takes bottom 80% */
    position: absolute;
    /* Fix to bottom */
    bottom: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    transition: opacity 0.5s;
}

.highlight-card.active-card .card-visual {
    opacity: 1;
}

.highlight-card:hover .card-visual {
    opacity: 0.9;
}

/* Centered text overlay remains top-aligned within the 20% black space */
.card-overlay {
    position: absolute;
    inset: 0;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    pointer-events: none;
    text-align: center;
}

.card-title {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.card-subtitle {
    font-size: 17px;
    color: #a1a1a6;
    font-weight: 500;
}

/* SLIDER PILL CONTROLS */
.project-chip {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    width: 60%;
    min-width: 250px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.project-chip:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.slider-pill-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    /* Separation between pill and button */
    margin-top: 20px;
}

.slider-controls-glass {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(40, 40, 40, 0.7);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-dots-track {
    display: flex;
    gap: 10px;
    align-items: center;
}

.slider-dot {
    width: 8px;
    height: 8px;
    background: #808080;
    border-radius: 50%;
    /* Circle by default */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.slider-dot.active {
    background: #fff;
    width: 40px;
    /* Expands to pill */
    border-radius: 20px;
    /* Pill shape */
}

/* Standalone Circular Button */
.slider-control-btn {
    background: rgba(40, 40, 40, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    width: 40px;
    /* Matches visual weight of pill */
    height: 40px;
    border-radius: 50%;
    /* Perfect circle */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: transform 0.2s, opacity 0.2s;
}

.slider-control-btn:hover {
    opacity: 1;
    transform: scale(1.05);
    background: rgba(60, 60, 60, 0.8);
}

/* SOCIAL & CONTACT */
.glass-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 24px;
}

.testimonial-card .quote {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 15px;
}

.contact-box {
    background: var(--text);
    color: var(--bg);
    padding: 60px 40px;
    border-radius: 40px;
    text-align: center;
    width: 100%;
}

.email-link {
    font-size: clamp(24px, 5vw, 48px);
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    display: block;
    margin: 30px 0;
    word-break: break-all;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 24px;
}

.social-links a {
    color: var(--bg);
    opacity: 0.8;
}

/* ------------------- MOBILE OPTIMIZATIONS ------------------- */
@media (max-width: 768px) {

    /* General */
    .page-section {
        height: auto;
        min-height: 100vh;
        padding: 100px 5% 60px 5%;
        display: block;
    }

    /* Hero - Stack Vertical */
    #hero {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-top: 120px;
    }

    .hero-split-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-left {
        align-items: center;
    }

    .brand-container {
        margin-bottom: 10px;
        min-height: auto;
    }

    #brand-name {
        transform-origin: center center;
    }

    .hero-btns {
        justify-content: center;
    }

    /* Tech Pill Wrapper - Relocate for Mobile */
    .tech-stack-wrapper {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto 30px auto;
        width: 100%;
        align-items: center;
        max-width: 90%;
    }

    /* Ensure pill itself scrolls if too wide on tiny screens */
    #hero-tech-stack {
        max-width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    /* Hero Right / Journey */
    .hero-right {
        opacity: 1;
        transform: none;
        margin-top: 20px;
    }

    .journey-card {
        border-left: none;
        padding-left: 0;
        border-top: 2px solid var(--border);
        padding-top: 30px;
    }

    .journey-item {
        flex-direction: column;
        gap: 5px;
        align-items: center;
        text-align: center;
    }

    /* Nav */
    #hero-nav-chips {
        display: none;
    }

    #main-nav {
        opacity: 1 !important;
        transform: none !important;
    }

    .nav-hidden {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-content {
        padding: 0 20px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-links li {
        display: none;
    }

    .nav-links li:nth-child(6),
    .nav-links li:nth-child(4) {
        display: block;
    }

    /* About Section */
    .split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .story-column {
        padding-right: 0;
    }

    .track-record-column {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 40px;
    }

    /* Video & Telemetry */
    .wide-viewport {
        max-width: 100vw;
    }

    .full-width-video-card {
        height: auto !important;
        aspect-ratio: 16/9;
        width: 100% !important;
        border-radius: 12px !important;
    }

    /* Slider Mobile Fixes */
    .slider-section {
        padding-top: 60px;
    }

    .slider-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        text-align: left;
    }

    .highlight-card {
        width: 85vw;
        /* Responsive Width */
        height: 50vh;
        /* Responsive Height */
        min-height: 400px;
    }

    .highlights-track {
        gap: 15px;
    }

    .card-title {
        font-size: 24px;
    }

    /* Contact */
    .contact-box {
        padding: 40px 20px;
    }

    .email-link {
        font-size: 24px;
    }
}

@media (min-width: 769px) {

    /* Restore Nav items on desktop */
    .nav-links li {
        display: block;
    }
}
/* --- RESPONSIVE VISIBILITY --- */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}
