:root {
    --frame-stroke-width: 1px;
    --head-pic-border-radius: 1vw;
    --nav-icon-size: 3.2vw;
    --overlay-size: 650px;
    --controls-bg: var(--primary-color);
    --controls-fg: var(--hl-tertiary-color);
    --controls-bg-alpha: 0.9;
    --target-size: 44px;
    --focus-ring: #fff;
    --nav-mobile-gap: 4px;
    /* default tile size for page overlays */
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    /* Use a consistent site-wide body background */
    background-size: var(--overlay-size);
    color: var(--text-color);
    max-width: 100vw;
    overflow-x: hidden;
    z-index: 3;
}

/* Page-level scroll snapping only on videos page */
body.videos-page {
    scroll-snap-type: y mandatory;
}

#patterned-background,
#patterned-background-shape {
    background-image: url("../assets/overlays/rough-pattern.png");
    background-repeat: repeat;
    background-size: 9px;
    /* Adjust as needed */
    background-blend-mode: multiply;
    /* Overlay to enhance pattern visibility */
    z-index: 3;
}

/* Header Section */
.header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease-in-out;
    padding: 2vh 1vw;
    background-color: var(--secondary-color);
    height: auto;
    width: 100%;
    z-index: 100;
    box-sizing: border-box;
}


.background-shape,
.head-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 10rem;
    height: 10rem;
    background-color: var(--secondary-color);
    border-radius: 0 0 50% 0;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.head-pic-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    height: auto;
    transform: translate(-50%, -50%);
    background-color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    z-index: 2;
}

.head-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.head-inner {
    fill: var(--secondary-color);
}

/* Header Content Styling */
.header-content {
    position: relative;
    z-index: 2;
    color: rgb(41, 50, 178);
    padding-left: 18vw;
    padding-top: 1vh;
}

.title {
    margin-left: 10rem;
}

.title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-family: "Rubik", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    color: var(--text-color);
    text-shadow: 1px 1px 2px var(--hl-secondary-color);
}

.title h2 {
    margin: 0.5rem 0 0 0;
    font-size: 1.2rem;
    color: #ddd;
    font-family: "Rubik", sans-serif;
    font-optical-sizing: auto;
    font-style: italic;
    text-shadow: 1px 1px 2px var(--hl-dark-color);
}

/* Navigation Bar */
.nav-wrap {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.8vw;
    z-index: 2;
}

.navigation-bg {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1vh 1vw;
    /* background-color: #4b4848;*/
    background-color: var(--grey-color);
    z-index: 0;
    border-radius: 0 0 0 3.2vw;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    width: auto;
    overflow: hidden;
    clip-path: inset(0 round 0 0 0 3.2vw);
    box-shadow:
        inset 14px 0 18px -14px rgba(0, 0, 0, 0.45),
        inset 0 -10px 14px -14px rgba(255, 255, 255, 0.08);
}

.nav-wrap .navigation-bg {
    position: relative;
    top: auto;
    right: auto;
}

.navigation {
    display: flex;
    gap: 1.75vw;
    padding-right: 1vw;
    justify-content: center;
    align-items: center;
}

.page-note {
    display: none;
    z-index: 12;
    font-family: var(--videos-info-font, "Source Sans 3", "Segoe UI", Tahoma, Geneva, Verdana, system-ui, sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    color: var(--hl-tertiary-color);
    background: color-mix(in oklab, var(--primary-color) 82%, transparent);
    border: 2px solid color-mix(in oklab, var(--hl-secondary-color) 70%, transparent);
    border-radius: 999px;
    padding: 6px 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    letter-spacing: 0.02em;
    pointer-events: none;
}

.page-note--nav {
    position: relative;
    top: auto;
    left: auto;
}

body[data-has-glb="true"]:not([data-page="videos"]) .page-note--nav {
    display: inline-flex;
}

body[data-page="videos"][data-has-glb="true"][data-intro-done="true"] .page-note--nav {
    display: inline-flex;
}

.nav-icon {
    width: var(--nav-icon-size);
    height: var(--nav-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background-color: var(--grey-color);
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: background-color .2s ease, box-shadow .2s ease, transform .1s ease;
    text-decoration: none;
}

.nav-icon img {
    width: 100%;
    height: 100%;
}

.settings-icon {
    background-color: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.settings-icon:hover,
.settings-icon:active {
    background-color: transparent;
    box-shadow: none;
    transform: none;
}

/* Default state - no glow */
.nav-icon svg {
    display: inline-block;
    width: 100%;
    height: 100%;
    padding: 0;
    filter: none;
    transition: filter 0.3s ease;
    border-radius: 50%;
    background-color: transparent !important;
    /* ensure container color shows */
}

/* Button-like interaction states */
.nav-icon:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
    transform: translateY(-1px);
}

.nav-icon:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3) inset;
}

.nav-icon:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: -3px;
}


.nav-separator {
    height: var(--nav-icon-size);
    width: .3vw;
    background-color: var(--hl-tertiary-color);
}

/* Content Section */

/* Unified content frame: matches About's panel but themed by variables */
.content {
    position: relative;
    inline-size: min(96vw, 1120px);
    margin: calc(10rem + 1.5rem) 25% 3rem 15%;
    padding: 024px;
    line-height: 1.6;
    font-size: 1.05rem;
    text-wrap: wrap;
    background: color-mix(in oklab, var(--primary-color), transparent 40%);
    border: none;
    /* outline is drawn via ::after */
    border-radius: 35px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .25), 0 2px 8px rgba(0, 0, 0, .15);
    z-index: 1;
    
}

/* Thin stroke around the content frame */
.content::after {
    content: "";
    position: absolute;
    inset: 0;
    /* aligns to the panel edges */
    border: var(--frame-stroke-width, 2px) solid var(--secondary-color);
    border-radius: inherit;
    pointer-events: none;
    box-sizing: border-box;
    opacity: 0.9;
}

/* Remove any leftover per-page divider lines now that the frame has a stroke */
.section-divider {
    display: none !important;
}

.content p {
    margin: 0 0 1rem;
}

/* Head Outline */

/* page-level snap anchors (used by videos page) */
#lane-snap-upper, #lane-snap-lower { height: 1px; scroll-snap-align: start; }
/* reserve space for fixed header during snap alignment */
body.videos-page { scroll-padding-top: calc(10rem + 1.5rem); }


@media screen and (max-width: 1024px) {

    /* Adjust content layout for medium-sized screens */
    .header-content {
        padding-left: 5vw;
        /* Reduce padding */
    }

    .title h1 {
        font-size: 1.2rem;
        /* Adjust title size */
    }

    .title h2 {
        font-size: .75rem;
    }

    .title {
        margin-left: 10vw;
    }

    .title h1 {
        margin: 0;
        font-size: 1.3rem;
    }

    .title h2 {
        margin: 0.5rem 0 0 0;
        font-size: .9rem;
        color: #ddd;
    }

    .navigation-bg {
        width: calc(38vw + 3vw);
        /* Adjust navigation width */
        height: 7vh;
        padding: 1.5vh 3vw;
    }

    .navigation {
        gap: 1.5vw;
    }

    .nav-icon {
        width: 4.5vw;
        height: 4.5vw;
    }

    .nav-separator {
        height: 6vh;
        width: .3vw;
    }

    .content {
        font-size: 1.2rem;
        padding-right: 5vw;
        padding-left: 5vw
    }

    .content p {
        padding: 10vw 5vw;
        text-align: justify;
    }
}

/* Media Query for smartphones (e.g., iPhone or Android) */
@media only screen and (max-width: 768px),
only screen and (min-device-pixel-ratio: 2) {

    /* Adjust layout for mobile devices */
    .header {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        height: auto;
        z-index: 100;
    }

    .header-content {
        padding-left: 5vw;
        height: auto;
    }

    .background-shape,
    .head-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 20vw;
        height: 20vw;
        background-color: var(--secondary-color);
        border-radius: 0 0 50% 0;
        z-index: -1;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .head-pic-container {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 90%;
        height: auto;
        transform: translate(-50%, -50%);
        background-color: var(--secondary-color);
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 50%;
        z-index: 2;
    }

    .title h1 {
        font-size: 1rem;
        padding-left: 3rem;
    }

    .title h2 {
        font-size: .8rem;
        padding-left: 3rem;
    }

    .navigation-bg {
        position: absolute;
        width: 100%;
        height: 4vh;
        padding: 1.5vh 3vw;
        border-radius: 0 0 0 3.2vw;
        clip-path: inset(0 round 0 0 0 3.2vw);
        top: 100%
    }

    .navigation {
        position: relative;
        gap: 1vw;
        left: 50px;
    }

    .nav-icon {
        width: 7vw;
        height: 7vw;
    }

    .nav-separator {
        height: 5vh;
        width: .5vw;
    }

    .content {
        font-size: 1rem;
        padding-right: 5vw;
    }
}

/* Shared HTML navigation and scene alternatives. Insets keep focus rings
   visible inside the clipped navigation background. */
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    transform: translateY(-200%);
    z-index: 100002;
    padding: 12px 16px;
    background: #10141d;
    color: #fff;
    border-radius: 6px;
}
.skip-link:focus { transform: none; }
:where(button, input, select, summary, a):focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #10141d;
}
.a11y-focus-always :where(button, input, select, summary, a):focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}
.scene-alternative {
    position: fixed;
    right: 50px;
    bottom: 14px;
    z-index: 101;
    max-width: min(390px, calc(100vw - 100px));
    box-sizing: border-box;
    background: #10141d;
    color: #f4f6fb;
    border: 1px solid #8fa2b5;
    border-radius: 8px;
    font: 16px/1.5 system-ui, sans-serif;
}
.scene-alternative summary {
    box-sizing: border-box;
    min-height: var(--target-size);
    padding: 10px 12px;
    cursor: pointer;
}
.scene-alternative-content { max-height: 55vh; overflow: auto; padding: 0 16px 12px; }
.scene-alternative-content a { color: #bce4ff; }
.scene-alternative-content li { margin-block: 8px; }
.site-audio-consent {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    background: rgba(8, 10, 14, .72);
    padding: 24px;
}
.site-audio-consent__box {
    max-width: 460px;
    padding: 22px;
    border-radius: 18px;
    background: #10141d;
    color: #f4f6fb;
    font: 16px/1.5 sans-serif;
}
.site-audio-consent__box button { min-width: var(--target-size); min-height: var(--target-size); margin-right: 8px; }

@media (max-width: 768px) {
    body .header { min-height: 144px; padding-bottom: 68px; }
    body .header .nav-wrap {
        top: auto;
        bottom: 0;
        width: 100%;
        justify-content: center;
    }
    body .header .nav-wrap .page-note.page-note--nav { display: none; }
    body .header .navigation-bg {
        position: relative;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        padding: 8px;
    }
    body .header .navigation {
        position: static;
        gap: var(--nav-mobile-gap);
        padding: 0;
        flex-wrap: wrap;
    }
    body .header .nav-icon {
        box-sizing: border-box;
        flex: 0 0 var(--target-size);
        width: var(--target-size);
        height: var(--target-size);
    }
    body .header .nav-separator { width: 1px; height: 36px; margin-inline: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    .navigation *, .header, .skip-link { transition: none !important; }
}
.a11y-motion-reduced .navigation *,
.a11y-motion-reduced .header,
.a11y-motion-reduced .skip-link { transition: none !important; }
