:root {
    --bg-color: #121416;
    --text-color: #F2F0EC;
    --aperture-bg: #F2F0EC;
    --texture-text: #121416;
    --font-heading: 'IBM Plex Sans', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --glow-color: rgba(242, 240, 236, 0.4);
    --glow-strong: rgba(242, 240, 236, 0.8);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ========================================
   INTRO ANIMATION (Scroll-Based)
   ======================================== */

/* Scroll Workspace - Creates scrollable height for intro (JS controls actual height) */
#scroll-workspace {
    height: 400vh;
    width: 100%;
    pointer-events: none;
    visibility: hidden;
}

/* Fixed Stage - Contains the logo animation */
#stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: none;
    /* Hidden by default to prevent flash on reload */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    will-change: transform;
}

/* Content Cluster (Logo + Wordmark + Hero) */
#content-cluster {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform;
}

/* Logo Block Wrapper */
#logo-block {
    width: 80vw;
    max-width: 500px;
    aspect-ratio: 408.08 / 265;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    opacity: 0;
    transition: opacity 3s ease-out;
}

/* Texture Underlay (Bottom Layer - Inside Logo) */
#texture-underlay {
    position: absolute;
    top: 1px;
    left: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    overflow: hidden;
    background-color: var(--aperture-bg);
}

#texture-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.2;
    color: var(--texture-text);
    word-break: break-all;
    white-space: pre-wrap;
    opacity: 1;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    will-change: opacity;
    transition: opacity 1.5s ease;
    padding: 10px;
}

#texture-content.hidden {
    opacity: 0;
}

/* Highlighted words in texture */
.highlight {
    color: inherit;
    font-weight: 700;
    text-shadow: 0 0 8px currentColor;
}

/* SVG Overlay (Top Layer - The Mask) */
svg#main-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    pointer-events: none;
    z-index: 2;
}

/* Logo Overlay Style */
.logo-overlay {
    fill: transparent;
    stroke: var(--text-color);
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
}

/* Wordmark */
#wordmark-container {
    margin-top: 2vh;
    height: 3rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

#wordmark-inner {
    display: flex;
    gap: 0.15em;
}

.char-span {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.4rem, 6vw, 2.4rem);
    letter-spacing: 0.1em;
    color: var(--text-color);
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, filter 0.6s ease-out, transform 0.8s ease-out;
}

.char-span.revealed {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

/* Hero Final Text (Subhead + CTA) */
#hero-final-text {
    position: relative;
    width: 100%;
    margin-top: 2vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease-out;
    pointer-events: none;
}

#hero-final-text.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

#hero-final-text h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0;
    color: var(--text-color);
    opacity: 0.8;
}

#hero-final-text .hero-location {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 0.5rem;
    color: var(--text-color);
    opacity: 0.6;
}

#hero-final-text button {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    margin-top: 4vh;
    padding: 0.8em 2em;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: buttonPulse 3s ease-in-out infinite;
}

#hero-final-text button:hover {
    background: var(--text-color);
    color: var(--bg-color);
    animation: none;
    box-shadow: 0 0 30px var(--glow-strong);
}

#hero-final-text button.clicked {
    animation: none;
    box-shadow: 0 0 30px var(--glow-strong);
}

/* Recruitment Section (Section 1) */
#section-1 .section-content {
    position: relative;
}

#section-1 .section-content::before {
    content: '';
    position: absolute;
    top: 17%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 143px;
    background: url('/assets/od-logo.svg') no-repeat center center;
    background-size: contain;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

/* Recruitment Section Text */
.recruit-text {
    position: relative;
    z-index: 1;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.2rem, 3.5vw, 1.4rem);
    line-height: 1.8;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    margin-bottom: 2.5rem;
}

.recruit-text strong {
    font-weight: 600;
}

/* Hide ARG content during intro */
#main-container {
    display: none;
}

#main-container.active {
    display: block;
}

/* ========================================
   NAVBAR
   ======================================== */

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(18, 20, 22, 0.95), rgba(18, 20, 22, 0.85));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: none;
}

body.loaded #navbar {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#navbar.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logo-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.navbar-logo-btn:hover {
    opacity: 0.7;
}

.navbar-logo {
    height: 28px;
    width: auto;
    opacity: 0.9;
}

#navbar-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-color);
}

/* Hamburger Menu Button */
#menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menu-toggle:hover .hamburger-line {
    box-shadow: 0 0 8px var(--glow-color);
}

/* ========================================
   SLIDE-OUT NAVIGATION MENU
   ======================================== */

#nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for Safari */
    background: linear-gradient(135deg, rgba(18, 20, 22, 0.98), rgba(30, 32, 36, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1001;
    padding: 80px 2rem 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(100%);
    transition: none;
    /* Prevent initial slide-in */
    border-left: 1px solid rgba(242, 240, 236, 0.1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent menu itself from scrolling */
}

body.loaded #nav-menu {
    transition: transform 0.4s ease;
}

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

#menu-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    line-height: 1;
}

#menu-close:hover {
    opacity: 1;
}

#nav-list {
    list-style: none;
    padding: 0 0.5rem 0 1rem;
    /* Left padding for active indicator, minimal right for scrollbar */
    margin: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    /* Allow flex item to shrink below content size */
}

#nav-list li {
    margin-bottom: 1rem;
}

#nav-list a {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--text-color);
    text-decoration: none;
    text-transform: uppercase;
    opacity: 0.7;
    transition: opacity 0.3s ease, padding-left 0.3s ease;
    display: block;
    padding: 0.5rem 0;
}

#nav-list a:hover {
    opacity: 1;
    padding-left: 0.5rem;
}

#nav-list a.active {
    opacity: 1;
    position: relative;
}

#nav-list a.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--text-color);
    box-shadow: 0 0 10px var(--glow-color);
}

.nav-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 2rem;
    border-top: 1px solid rgba(242, 240, 236, 0.1);
    background: linear-gradient(135deg, rgba(18, 20, 22, 0.98), rgba(30, 32, 36, 0.98));
    margin: auto -2rem -2rem;
    flex-shrink: 0;
}

.reset-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(242, 240, 236, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

.reset-link:hover {
    color: var(--text-color);
}

.nav-link-divider {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(242, 240, 236, 0.3);
}

/* Nav Overlay */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#nav-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   MAIN CONTENT / SECTIONS
   ======================================== */

#main-container {
    width: 100%;
    height: calc(100vh + 1px);
    height: calc(100dvh + 1px);
    /* Slightly taller to allow minimal scroll for Safari URL bar */
    position: relative;
    overflow: hidden;
}

.section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for Safari */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    padding: 1.5rem;
    padding-top: 80px;
    padding-bottom: 2rem;
    /* Allow scroll when content overflows */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.section.active {
    opacity: 1;
    pointer-events: auto;
}

.section-content {
    max-width: 600px;
    width: 100%;
    text-align: center;
    /* Position slightly above center */
    margin: auto 0;
    padding-bottom: 4rem;
}

/* ========================================
   BUTTONS WITH PULSING GLOW
   ======================================== */

.primary-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 1em 2.5em;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 1.5rem;
}

/* Arrow Button */
.arrow-btn {
    width: 3.5rem;
    height: 3.5rem;
    border: 1px solid var(--text-color);
    background: transparent;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 2rem auto 0;
    padding: 0;
}

.arrow-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--glow-strong);
}

.arrow-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 2;
}

.arrow-btn.pulse-glow {
    animation: buttonPulse 3s ease-in-out infinite;
}

.arrow-btn:hover {
    animation: none;
}

.primary-btn.pulse-glow {
    animation: buttonPulse 3s ease-in-out infinite;
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(242, 240, 236, 0.2);
    }

    50% {
        box-shadow: 0 0 25px rgba(242, 240, 236, 0.5), 0 0 40px rgba(242, 240, 236, 0.25);
    }
}

.primary-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    animation: none;
    box-shadow: 0 0 30px var(--glow-strong);
}

/* Focus styles for keyboard navigation */
.primary-btn:focus-visible,
.arrow-btn:focus-visible,
.option-btn:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 3px;
    box-shadow: 0 0 20px var(--glow-strong);
}

/* Dark variant for inverted sections */
.primary-btn.dark {
    border-color: var(--bg-color);
    color: var(--bg-color);
}

.primary-btn.dark.pulse-glow {
    animation: buttonPulseDark 3s ease-in-out infinite;
}

@keyframes buttonPulseDark {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(18, 20, 22, 0.2);
    }

    50% {
        box-shadow: 0 0 25px rgba(18, 20, 22, 0.5), 0 0 40px rgba(18, 20, 22, 0.25);
    }
}

.primary-btn.dark:hover {
    background: var(--bg-color);
    color: var(--text-color);
    animation: none;
    box-shadow: 0 0 30px rgba(18, 20, 22, 0.8);
}

.primary-btn.dark:focus-visible {
    outline: 2px solid var(--bg-color);
    outline-offset: 3px;
}

/* ========================================
   SECTION 2: CALIBRATION SURVEY
   ======================================== */

.survey-content {
    position: relative;
    /* Move survey content up */
}

#question-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.question-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.2rem, 3.5vw, 1.4rem);
    line-height: 1.7;
    text-align: center;
    max-width: 500px;
    margin-bottom: 1.5rem;
    /* Extra gap below question */
}

.question-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
    /* Additional spacing above buttons */
}

/* Survey Back Button */
/* Survey Back Button (Global) */
.survey-back-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 2rem;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: 1px solid rgba(242, 240, 236, 0.3);
    color: rgba(242, 240, 236, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    padding: 0;
}

.survey-back-btn svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    stroke-width: 2;
}

.survey-back-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.survey-back-btn:hover {
    color: var(--text-color);
    border-color: var(--text-color);
    background: rgba(242, 240, 236, 0.1);
}

.survey-back-btn.inverted {
    border-color: rgba(18, 20, 22, 0.3);
    color: rgba(18, 20, 22, 0.5);
}

.survey-back-btn.inverted:hover {
    color: var(--bg-color);
    /* #121416 */
    border-color: var(--bg-color);
    background: rgba(18, 20, 22, 0.05);
}

.option-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0.8em 2em;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.option-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--glow-color);
}

/* Slider Styles */
.slider-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.confidence-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(242, 240, 236, 0.3);
    border-radius: 2px;
    outline: none;
}

.confidence-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--glow-color);
    transition: box-shadow 0.3s ease;
}

.confidence-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 20px var(--glow-strong);
}

.confidence-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--glow-color);
}

/* Mini Egress Animation Overlay */
.scan-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.15s ease;
}

.scan-overlay.active {
    opacity: 1;
}

#scan-canvas {
    width: 100%;
    height: 100%;
}

/* ========================================
   SECTION 3+: CAPABILITIES ASSESSMENT
   ======================================== */

.assessment-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.3rem, 4vw, 1.6rem);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 2.5rem;
}

.coordinates-link {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(242, 240, 236, 0.5);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.coordinates-link:hover {
    border-color: var(--text-color);
    box-shadow: 0 2px 0 var(--glow-color);
}

.phase-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.15rem, 3vw, 1.25rem);
    color: var(--text-color);
    text-align: left;
    margin-bottom: 1.5rem;
}



.phase-text em {
    font-style: italic;
    color: rgba(242, 240, 236, 0.9);
}

/* Hidden links for Section 3B puzzle */
.hidden-link {
    color: inherit;
    text-decoration: none;
    cursor: text;
    /* No visual indication it's clickable */
}

.hidden-link:hover {
    /* No hover effect */
    color: inherit;
}

/* Verification Grid (Section 3D) */
.verification-grid {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.grid-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Decorative vertical lines on sides */
.grid-lines {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    align-self: flex-start;
    margin-top: 1rem;
    /* Push down to align center with 2nd row */
}

.grid-line {
    width: 2px;
    height: 120px;
    background: linear-gradient(180deg, transparent, rgba(242, 240, 236, 0.6), transparent);
    box-shadow: 0 0 8px var(--glow-color);
}

.grid-line-center {
    height: 170px;
}

.grid-top,
.grid-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.grid-bottom {
    grid-template-rows: repeat(2, 1fr);
}

.grid-bottom .grid-box {
    width: 2rem;
    height: 2rem;
}

.grid-divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(242, 240, 236, 0.5), transparent);
    margin: 0.5rem 0;
}

.grid-box {
    width: 3.5rem;
    height: 3.5rem;
    background: transparent;
    border: 1px solid var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    /* Eliminates 300ms mobile tap delay */
}

.grid-box:hover {
    border-color: var(--text-color);
    box-shadow: 0 0 15px var(--glow-color);
}

.grid-box:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 3px;
}

.grid-box.selected {
    background: var(--text-color);
    box-shadow: 0 0 20px var(--glow-color), 0 0 40px rgba(242, 240, 236, 0.3);
    animation: boxGlow 2s ease-in-out infinite;
}

@keyframes boxGlow {

    0%,
    100% {
        box-shadow: 0 0 15px var(--glow-color), 0 0 30px rgba(242, 240, 236, 0.2);
    }

    50% {
        box-shadow: 0 0 25px var(--glow-strong), 0 0 50px rgba(242, 240, 236, 0.4);
    }
}

/* Success pulse animation for correct grid pattern */
.grid-box.selected.success {
    animation: successPulse 3s ease-in-out 1;
}

@keyframes successPulse {

    0%,
    100% {
        box-shadow: 0 0 25px var(--glow-strong), 0 0 50px rgba(242, 240, 236, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 40px var(--glow-strong), 0 0 70px rgba(242, 240, 236, 0.6);
        transform: scale(1.1);
    }
}


/* ========================================
   SECTION HEADING & DIVIDER
   ======================================== */

.section-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1.5rem;
}

.glowing-divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--text-color), transparent);
    box-shadow: 0 0 10px var(--glow-color), 0 0 20px rgba(242, 240, 236, 0.2);
    margin: 0 auto 2rem;
}

.glowing-divider.dark {
    background: linear-gradient(90deg, transparent, var(--bg-color), transparent);
    box-shadow: 0 0 10px rgba(18, 20, 22, 0.4), 0 0 20px rgba(18, 20, 22, 0.2);
}

/* ========================================
   SECTION 5: EGRESS PROTOCOL
   ======================================== */

.egress-section {
    background: var(--bg-color);
}

.egress-section.inverted {
    background: var(--text-color);
}

.egress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.egress-instruction {
    max-width: 500px;
    text-align: center;
}

.countdown {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(5rem, 20vw, 10rem);
    color: var(--text-color);
    opacity: 0;
    display: none;
    text-align: center;
    width: 100%;
    /* Center vertically in section */
    margin: auto 0;
    padding-bottom: 7rem;
}

.countdown.active {
    display: block;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.egress-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease;
    z-index: 50;
}

.egress-animation.active {
    opacity: 1;
    pointer-events: auto;
}

#egress-canvas {
    width: 100%;
    height: 100%;
}

.protocol-complete-btn {
    opacity: 0;
    pointer-events: none;
    background: var(--bg-color);
    border-color: var(--bg-color);
    color: var(--text-color);
    z-index: 100;
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 2s ease;
}

.protocol-complete-btn.visible {
    opacity: 1;
    pointer-events: auto;
    animation: buttonPulseDark 3s ease-in-out infinite;
}

.protocol-complete-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
    box-shadow: 0 0 30px rgba(18, 20, 22, 0.8);
}

.egress-question {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bg-color);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 2s ease;
    margin: 0;
}

.egress-question.visible {
    opacity: 1;
}

/* ========================================
   SECTION 6 & 7: INVERTED SECTIONS
   ======================================== */

.inverted-section {
    background: var(--text-color);
}

.inverted-section .section-heading,
.inverted-section .phase-text,
.inverted-section .outcome-text {
    color: var(--bg-color);
}



.outcome-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    line-height: 1.8;
    text-align: center;
    margin-top: 5vh;
    margin-bottom: 1.5rem;
}

/* Reduce spacing between consecutive outcome paragraphs */
.outcome-text+.outcome-text {
    margin-top: 1rem;
}

/* Reduce spacing between outcome text and following button */
#outcome-text+.primary-btn {
    margin-top: 0.5rem;
}

/* Clickable asterisk links in outcome text */
.asterisk-link {
    color: var(--bg-color);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: inline;
    opacity: 0.7;
}

.asterisk-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.text-center {
    text-align: center !important;
}

.text-large {
    font-size: clamp(1.4rem, 4vw, 1.8rem) !important;
}

/* ========================================
   MODAL
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: none;
    padding: 1.5rem;
}

body.loaded .modal-overlay {
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 32, 36, 0.98), rgba(18, 20, 22, 0.98));
    border: 1px solid rgba(242, 240, 236, 0.2);
    border-radius: 3px;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    box-shadow: 0 0 40px rgba(242, 240, 236, 0.1);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.75rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
}

#modal-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    text-align: center;
}

#modal-text a {
    color: var(--text-color);
    text-decoration: underline;
}

/* Easter Egg Modal Styles */
.easter-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.easter-modal-image {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(242, 240, 236, 0.3);
}

.easter-modal-text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    color: var(--text-color);
    margin: 0;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (min-width: 768px) {
    .section-content {
        max-width: 650px;
    }
}

@media (min-width: 1024px) {
    .section {
        padding: 2rem;
        padding-top: 100px;
    }

    .section-content {
        max-width: 700px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .primary-btn.pulse-glow,
    .primary-btn.dark.pulse-glow {
        animation: none;
    }

    .scan-overlay {
        animation: none !important;
    }

    .section {
        transition: none;
    }

    .countdown {
        animation: none;
    }
}

/* Section 7 Background Logo */
#section-7 .section-content {
    position: relative;
    text-align: center;
}

#section-7 .phase-text {
    text-align: center;
    font-size: clamp(1.25rem, 3.5vw, 1.4rem);
}

#section-7 .section-content::before {
    content: '';
    position: absolute;
    top: 36%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 143px;
    background: url('/assets/od-logo.svg') no-repeat center center;
    background-size: contain;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
    filter: invert(1);
}

#section-7 .phase-text,
#section-7 .section-heading,
#section-7 .primary-btn,
#section-7 a {
    position: relative;
    z-index: 1;
}