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

a {
    font-family: 'Share Tech Mono', monospace;
}

body {
    font-family: 'Lato', sans-serif;
    /* background-color:#b27013; */
    background-color: #000;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem 0;
    color: #fff;
}

#site-header {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 1;
    pointer-events: none;
    /* Let clicks pass through to content below */
    width: 100%;
}

#site-header>* {
    pointer-events: auto;
    /* Re-enable clicks on children */
}

.header-logos {
    display: flex;
    align-items: center;
}

/* Landing page */
#landing-page {
    /* background-color: #1482a7; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-height: auto;
    padding: 0 2rem 2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Main experience container */
#main-experience {
    display: none;
}

#demo-camera-page {
    display: none;
}

#landing-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.landing-desc {
    font-size: 1.3rem;
    color: #ccc;
    margin-bottom: 2rem;
}

.landing-info p,
#demo-camera-page .story-box>p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #aaa;
    margin-bottom: 1rem;
}

.page-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.container {
    text-align: left;
    padding: 2rem;
    border-radius: 8px;
    margin: 1rem;
}

h1 {
    font-size: 1.20rem;
    color: #fff;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.20rem;
    color: #fff;
    margin-bottom: 1rem;
}

p {
    color: #ccc;
    margin-bottom: 1rem;
}

button {
    padding: 10px 20px;
    /* background-color: #007bff; */
    background-color: #000;
    color: white;
    border: none;
    border-radius: 1px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    /* <-- add this */
    margin-top: 1rem;
}

button:hover {
    opacity: 0.7;
}

/* Camera-specific styles */
#container {
    text-align: left;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto;
    width: 420px;
    height: 420px;
    border: 2px solid #fff;
    overflow: visible;
    position: relative;
    max-width: 100%;
}

#demo-video-container {
    text-align: left;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto;
    width: 420px;
    height: 420px;
    border: 2px solid #fff;
    overflow: visible;
    position: relative;
    max-width: 100%;
}

#videoElement {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

#canvas {
    margin-top: 1rem;
    max-width: 100%;
}

#about-us-page h1,
#about-tech-page h1 {
    color: #6060F4;
    font-family: 'Share Tech Mono', monospace;
    margin-bottom: 1rem;
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
}

#about-us-page h1::after,
#about-tech-page h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #6060F4;
}

/* Story display styles */
.story-box {
    /* background: #9c1d74; */
    background: #000;
    color: white;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 1rem;
    flex: 0 0 auto;
    /* prevent stretching to fill row */
    width: 100%;
    /* fills remaining space between the fixed side paddings */
    max-width: 660px;
}


.story-box h2 {
    color: white;
    margin-bottom: 0.8rem;
}

.story-header-row {
    /* background: #1fc757; */
    background: #000;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    justify-content: center;
    /* margin-top: 1rem; */
    padding: 0 1rem;
    /* fixed left/right padding on the row */
    /* max-width: 1800px; */
    /* min-width: 1000px; */
}

.main-wrapper {
    /* flex-direction: row; */
    justify-content: center;
    gap: 2rem;
    /* max-width: 2800px; */
    /* min-width: 1000px; */
    background-color: #000;
    /* background-color: #1d1d76; */

    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}


/* Error message display above camera */
.error-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    color: #dc3545;
    border-radius: 0;
    padding: 10px 15px;
    text-align: center;
    z-index: 10;
    visibility: hidden;
    font-size: 1.5rem;
}

.error-message.visible {
    visibility: visible;
}

/* Emotion display section */
.emotion-display {
    border-radius: 1px;
}

.emotions-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    justify-content: space-between;
    /* Snaps first emoji to left edge, last to right edge */
    flex-wrap: nowrap;
    /* max-width: 420px; */
}

.emotion-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1px 15px;

}

.emotion-label {
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
}

.emotion-icon {
    width: 90px;
    height: 90px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.emotion-confidence {
    display: none;
}


#story-text {
    font-family: 'Lato', sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #aaa;
    padding: 0 1rem;
    min-height: 3rem;
    transition: opacity 0.4s ease;
    background: rgba(0, 0, 0, 0.2);
}

#scene-progress {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-align: left;
    margin-top: 0.8rem;
}

.story-buttons {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
}

#back-btn {
    padding: 6px 14px;
    background: #000;
    color: white;
    border: 1px solid #000;
    border-radius: 1px;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    transition: background 0.2s ease;
    /* margin-top: 17.5rem;
    margin-left: 0; */
}


#back-btn:hover {
    opacity: 0.7;
}

#begin-story-btn,
#return-to-landing-btn {
    padding: 12px 28px;
    background-color: #6060F4;
    color: white;
    border: none;
    border-radius: 1px;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: opacity 0.3s ease;
    margin: 2rem auto;
    display: block;
}

button,
.page-btn,
#start-btn,
#restart-btn,
#page-btn {
    padding: 12px 28px;
    background-color: #6060F4;
    color: white;
    border: none;
    border-radius: 1px;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: opacity 0.3s ease;
    margin-top: 1rem;
}

.scene-btn {
    padding: 12px 28px;
    background-color: #6060F4;
    color: white;
    border: none;
    border-radius: 1px;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: opacity 0.3s ease;
}


#about-us-page,
#about-tech-page {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-height: auto;
    padding: 0 2rem 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.separator {
    width: 420px;
    max-width: 100%;
    border: none;
    height: 2px;
    background-color: #fff;
    margin: 3rem auto 0 auto;
}



/* Desktop logo — top left corner */
#logo-desktop {
    /* position: fixed;
    top: 3rem;
    left: 3rem;
    width: 140px;
    z-index: 100; */
    width: 100px;
    display: block;
}

/* Mobile logo — hidden by default */
#logo-mobile {
    /* position: fixed;
    top: 1rem;
    left: 1rem;
    width: 80px;
    z-index: 100;
    display: none; */

    width: 80px;
    display: none;
}


#demoVideoElement {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #666;
}

.demo-progress-links {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 550px;
    max-width: 100%;
    margin-top: -5%;
}

.demo-progress-links a:first-child {
    margin-left: 60px;
}

.demo-progress-links a {
    position: relative;
    padding: 8px 10px;
    color: #6060F4;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: opacity 0.2s ease;
    background: transparent;
}

.demo-progress-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    width: auto;
    margin-left: -1px;
    margin-right: -1px;
    height: 1px;
    background-color: #6060F4;
}

.demo-progress-links a:hover {
    opacity: 0.7;
}


.right-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
    text-align: right;
}

/* 🔹 Matches .about-link extended underline style */
.right-nav-links a {
    position: relative;
    /* Required for pseudo-element positioning */
    padding: 8px 10px;
    /* Standardized spacing */
    color: #6060F4;
    text-decoration: none;
    /* Remove native underline */
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Share Tech Mono', monospace;
    transition: opacity 0.2s ease;
    background: transparent;
}

/* 🔹 Extended underline for nav links */
.right-nav-links a:after {
    content: '';
    position: absolute;
    bottom: -2px;
    /* Matches about-link vertical spacing */
    left: 0;
    right: 0;
    width: auto;
    margin-left: -1px;
    /* ← Tweak: Adds extension to the left */
    margin-right: -1px;
    /* ← Tweak: Adds extension to the right */
    height: 1px;
    /* Matches about-link line thickness */
    background-color: #6060F4;
}

.right-nav-links a:hover {
    opacity: 0.7;
}


.landing-mobile-links {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
}

/* 🔹 Matches .about-link extended underline style */
.landing-mobile-links a {
    position: relative;
    padding: 5px 5px;
    color: #6060F4;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Share Tech Mono', monospace;
    transition: opacity 0.3s ease;
}

/* 🔹 Extended underline for mobile landing links */
.landing-mobile-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    width: auto;
    margin-left: -1px;
    /* ← Tweak: Adds extension to the left */
    margin-right: -1px;
    /* ← Tweak: Adds extension to the right */
    height: 1px;
    background-color: #6060F4;
}

.landing-mobile-links a:hover {
    opacity: 0.7;
}


#about-us-page .page-buttons,
#about-tech-page .page-buttons {
    flex-direction: column;
    /* Stack vertically on ALL screens */
    align-items: center;
    /* Center button and link horizontally */
    gap: 2rem;
    /* Spacing between button and link */
}


#about-us-page .page-buttons .about-link,
#about-tech-page .page-buttons .about-link {
    position: relative;
    /* Required for ::after positioning */
    color: #6060F4;
    font-family: 'Share Tech Mono', monospace;
    /* font-size: 0.95rem; */
    text-decoration: none;
    /* Remove default native underline */
    padding: 10px 10px;
    /* Gives the text breathing room */
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#about-us-page .page-buttons .about-link::after,
#about-tech-page .page-buttons .about-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    /* Adjusts vertical spacing */

    /* Reset coordinates to align perfectly with the link box */
    left: 0;
    right: 0;
    width: auto;

    /* 🔥 SYMMETRIC EXTENSION */
    margin-left: -1px;
    /* Extends line LEFT by this amount */
    margin-right: -1px;
    /* Extends line RIGHT by the same amount */

    height: 1px;
    /* Line thickness */
    background-color: #6060F4;
}

#about-us-page .page-buttons .about-link:hover,
#about-tech-page .page-buttons .about-link:hover {
    opacity: 0.7;
    /* ✅ Matches nav hover effect */
}

#scene-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: -5%;
}

#scene-buttons-container .about-link {
    position: relative;
    color: #6060F4;
    font-family: 'Share Tech Mono', monospace;
    text-decoration: none;
    padding: 10px 10px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#scene-buttons-container .about-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    width: auto;
    margin-left: -1px;
    margin-right: -1px;
    height: 1px;
    background-color: #6060F4;
}

#scene-buttons-container .about-link:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {

    /* 🔹 Header & Nav */
    #site-header {
        padding: 1rem 1.5rem;
    }

    .right-nav-links {
        gap: 0.4rem;
        position: static;
        top: auto;
        right: auto;
    }

    /* 🔹 Logo Logic & Back Button Trigger */
    #logo-desktop {
        display: none;
    }

    #logo-mobile {
        display: block;
        width: 60px !important;
        height: auto !important;
    }

    /* Hide mobile logo ONLY when back button is visible/active */
    body.show-back #logo-mobile,
    [data-force-hide="true"]#logo-mobile {
        display: none !important;
    }

    /* Landing page overrides */
    body.on-landing #logo-mobile {
        display: none;
    }

    body.on-landing #logo-desktop {
        display: block;
        width: min(30vw, 90px);
        margin: 0 auto;
        position: static;
        top: auto;
        left: auto;
        transform: none;
        z-index: auto;
    }

    body.on-landing .right-nav-links {
        display: none;
    }

    body.on-landing .landing-mobile-links {
        margin-top: 3%;
        display: flex;
    }

    body.on-landing #site-header {
        justify-content: center;
    }

    body {
        font-size: 16px;
    }


    h1,
    h2,
    h3 {
        font-size: clamp(1.1rem, 3.5vw, 1.35rem);
        margin-bottom: 0.35rem;
    }

    span,
    li,
    label,
    input,
    select,
    textarea,
    a {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    #page-btn,
    .page-btn,
    #start-btn,
    .scene-btn,
    #begin-story-btn,
    #return-to-landing-btn {
        font-size: 0.9rem !important;
        padding: 10px 22px !important;
    }

    #begin-story-btn {
        font-size: 0 !important;
        /* collapse original text */
        color: transparent;
        margin-left: 37%;
    }

    #begin-story-btn::before {
        content: attr(data-mobile-text);
        color: white;
        font-size: 0.9rem !important;
        /* was 1rem — now matches the rest */
    }

    .landing-mobile-links a {
        font-size: 0.9rem !important;
        /* was 0.90rem — now matches */
        padding: 0.25rem 0.25rem;
    }

    .right-nav-links a {
        font-size: 0.8rem !important;
        padding: 0.25rem 0.25rem;
    }

    .demo-progress-links a {

        padding: 5px 5px;
    }

    .demo-progress-links a:first-child {
        margin-left: 0px;
    }


    /* 🔹 Page Spacing */
    #landing-page,
    #about-us-page,
    #about-tech-page,
    #main-experience {
        padding-top: 2.5rem;
    }

    /* 🔹 Story Box */
    .story-box {
        width: min(90vw, 660px);
        align-items: center;
        justify-content: center;
        padding: 1rem 1rem 1.5rem;
        margin: 0 auto;
    }

    /* 🔹 Camera Area (Smaller) */
    #cameraSection,
    #cameraSection-demo {
        width: 100%;
        max-width: 420px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        padding: 0 0 1rem;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    #container,
    #demo-video-container {
        width: min(65vw, 380px);
        /* Reduced from 70vw/420px */
        height: min(65vw, 380px);
        max-width: 380px;
        max-height: 380px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 🔹 Emojis (Bigger + Strictly One Line) */
    .emotion-display {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .emotions-container {
        flex-direction: row;
        flex-wrap: nowrap;
        /* Prevents wrapping */
        justify-content: center;
        align-items: center;
        gap: 0.15rem;
        /* Tighter gap to keep them together */
        width: 100%;
    }

    .separator {
        width: min(65vw, 380px);
    }

    .emotion-item {
        flex: 0 0 auto;
        /* Keeps each item consistent */
        padding: 1px 1px;
        max-width: (65vw, 380px);
        /* Fixed invalid syntax from original: max-width: (70vw, 420px); */
    }

    .emotion-icon {
        width: 70px;
        /* Increased from 50px */
        height: 70px;
    }


    /* 🔹 Buttons & Back Arrow */
    #back-btn {
        margin: 0;
        align-self: flex-start;
        position: absolute;
        top: 5rem;
        left: 1.25rem;
        ;
        z-index: 2;
        font-size: 2rem;
        padding: 6px 14px;
        background: rgba(0, 0, 0, 0.6);
        color: white;
        /* border: 1px solid #fff; */
        border-radius: 1px;
        cursor: pointer;
    }

    .page-buttons {
        display: flex;
        gap: 1rem;
        margin-top: 2rem;
    }

    #about-us-page .page-buttons .about-link,
    #about-tech-page .page-buttons .about-link {
        padding: 5px 5px;
        /* Gives the text breathing room */
    }

}