/* =====================================================
   Cifera Foundations - Theatrical Opera Experience
   Elegant figures, cinematic transitions, majestic design
   ===================================================== */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* ===================================
   CUSTOM SCROLLBAR
   Minimal floating scrollbar design
   =================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c9a962 0%, #a08339 50%, #c9a962 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4b76a 0%, #b8993f 50%, #d4b76a 100%);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Remove scrollbar buttons/arrows */
::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #c9a962 transparent;
}

/* ===================================
   PARALLAX BACKGROUND EFFECT
   Mouse-following 3D depth effect
   =================================== */

.scene--intro {
    position: relative;
    overflow: hidden;
}

.intro-parallax-bg {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image: url('assets/foundation-hero.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: transform 0.15s ease-out;
    will-change: transform;
    pointer-events: none;
}

.scene--intro .scene__content {
    position: relative;
    z-index: 1;
}

@keyframes pageReveal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--helio-color), var(--aurora-color));
    z-index: 1000;
    transition: width 100ms ease-out;
}

/* Custom Cursor for Interactive Elements */
a,
button,
.foundation-card,
[role="button"] {
    cursor: pointer;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    padding: 1rem 2rem;
    z-index: 10000;
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* Mobile: Larger touch target for music button */
@media (max-width: 768px) {
    .music-toggle {
        padding: 1rem;
        margin: -0.5rem;
    }

    .music-icon {
        width: 24px;
        height: 24px;
    }
}

/* CSS Custom Properties */
:root {
    /* Light Palette - Off-White */
    --color-bg-void: #F5F5F5;
    --color-bg-primary: #F5F5F5;
    --color-bg-elevated: #FFFFFF;
    --color-bg-light: #F5F5F5;

    /* Text colors - Dark on Light Background */
    --color-text-primary: #0a0a0e;
    --color-text-secondary: rgba(10, 10, 14, 0.75);
    --color-text-muted: rgba(10, 10, 14, 0.5);
    --color-text-subtle: rgba(10, 10, 14, 0.2);

    /* Text - Light variants for dark elements */
    --color-text-light-primary: #ffffff;
    --color-text-light-secondary: rgba(255, 255, 255, 0.75);
    --color-text-light-muted: rgba(255, 255, 255, 0.5);

    /* Foundation Accent Colors - Celestial */
    --nova-color: #ff6b6b;
    --astra-color: #4fd1c5;
    --aurora-color: #b794f6;
    --polaris-color: #63b3ed;
    --zenith-color: #fbd38d;
    --umbra-color: #a0aec0;
    --luna-color: #d6bcfa;
    --helio-color: #f6ad55;

    /* Typography - Elegant Serif */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-hero: 'Fraunces', serif;

    /* Sizes - Theatrical Scale */
    --text-xs: clamp(0.7rem, 0.6rem + 0.5vw, 0.85rem);
    --text-sm: clamp(0.85rem, 0.75rem + 0.5vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.15rem);
    --text-lg: clamp(1.2rem, 1rem + 1vw, 1.5rem);
    --text-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
    --text-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
    --text-3xl: clamp(2.5rem, 2rem + 3vw, 4.5rem);
    --text-hero: clamp(3rem, 2rem + 5vw, 7rem);

    /* Transitions */
    --ease-theatrical: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 1200ms var(--ease-theatrical);
    --transition-medium: 800ms var(--ease-theatrical);
    --transition-fast: 400ms var(--ease-theatrical);

    /* Background transition progress (0 = black, 1 = white) */
    --bg-progress: 0;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    background-color: #fdfbf7;
    /* Premium Cream Paper */
    background-image:
        linear-gradient(rgba(251, 211, 141, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(251, 211, 141, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    animation: pageReveal 0.8s ease-out 0.2s forwards;
    /* Paper Texture Overlay */
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 100;
    mix-blend-mode: multiply;
}

/* Seamless background transition layer */
.bg-transition-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Push behind content */
    pointer-events: none;
    background: transparent;
    /* Make transparent to see body bg */
}

::selection {
    background: rgba(183, 148, 246, 0.4);
    color: white;
}

/* =====================================================
   Wireframe Figures - Mantis.works Style
   Dynamic figures that change per foundation
   ===================================================== */

.figures {
    display: none;
    /* Using particle system instead */
}

.figure {
    position: absolute;
    height: 90vh;
    max-height: 900px;
    width: auto;
    max-width: 70vw;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition:
        opacity 1s var(--ease-theatrical),
        transform 1.2s var(--ease-theatrical);
}

/* Dynamic figure visibility - only show matching foundation */
.figure--foundation {
    opacity: 0;
    pointer-events: none;
}

/* Show active foundation's figure */
body.figures-visible[data-active-foundation="nova"] .figure[data-figure="nova"],
body.figures-visible[data-active-foundation="astra"] .figure[data-figure="astra"],
body.figures-visible[data-active-foundation="aurora"] .figure[data-figure="aurora"],
body.figures-visible[data-active-foundation="polaris"] .figure[data-figure="polaris"],
body.figures-visible[data-active-foundation="zenith"] .figure[data-figure="zenith"],
body.figures-visible[data-active-foundation="umbra"] .figure[data-figure="umbra"],
body.figures-visible[data-active-foundation="luna"] .figure[data-figure="luna"],
body.figures-visible[data-active-foundation="helio"] .figure[data-figure="helio"] {
    opacity: 0.85;
    transform: scale(1) translateY(0);
}

/* Foundation-specific color tinting - Standardized to Zenith Gold */
body[data-active-foundation="nova"] .figure[data-figure="nova"],
body[data-active-foundation="astra"] .figure[data-figure="astra"],
body[data-active-foundation="aurora"] .figure[data-figure="aurora"],
body[data-active-foundation="polaris"] .figure[data-figure="polaris"],
body[data-active-foundation="zenith"] .figure[data-figure="zenith"],
body[data-active-foundation="umbra"] .figure[data-figure="umbra"],
body[data-active-foundation="luna"] .figure[data-figure="luna"],
body[data-active-foundation="helio"] .figure[data-figure="helio"] {
    filter: brightness(1.15) drop-shadow(0 0 60px rgba(251, 211, 141, 0.35));
}

/* =====================================================
   Progress Indicator
   ===================================================== */

.progress {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

body.in-foundations .progress {
    opacity: 1;
}

.progress__track {
    width: 2px;
    height: 120px;
    background: var(--color-text-subtle);
    border-radius: 1px;
    overflow: hidden;
}

.progress__fill {
    width: 100%;
    height: 0%;
    background: var(--color-text-primary);
    transition: height 300ms ease-out;
}

.progress__count {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
}

/* Light progress for dark Helio section */
body[data-active-foundation="helio"] .progress__track {
    background: rgba(255, 255, 255, 0.2);
}

body[data-active-foundation="helio"] .progress__fill {
    background: rgba(246, 173, 85, 0.8);
}

body[data-active-foundation="helio"] .progress__count {
    color: rgba(212, 168, 83, 0.9);
}

/* =====================================================
   Navigation
   ===================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 400;
    color: var(--color-text-primary);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 48px;
    width: auto;
    display: block;
    filter: brightness(0);
    /* Make logo1.png black on light navbar */
}

.nav__link {
    font-size: var(--text-xs);
    color: var(--color-text-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.nav__link:hover {
    opacity: 1;
}

/* Music Toggle Button */
.nav__links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.music-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.music-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.music-toggle:focus-visible {
    outline: 2px solid var(--helio-color);
    outline-offset: 2px;
}

.music-icon {
    width: 20px;
    height: 20px;
    color: var(--color-text-primary);
}

/* Show muted icon by default, hide playing icon */
.music-icon--playing {
    display: none;
}

.music-icon--muted {
    display: block;
}

/* When playing, swap icon visibility */
.music-toggle.is-playing .music-icon--playing {
    display: block;
}

.music-toggle.is-playing .music-icon--muted {
    display: none;
}

/* =====================================================
   Scene - Full Screen Sections
   ===================================================== */

.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    scroll-snap-align: start;
}

.scene__content {
    text-align: center;
    max-width: 700px;
    padding: 2rem;
}

/* =====================================================
   Hero Scene
   ===================================================== */

.scene--hero {
    background-image: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)), url('assets/foundation-hero.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.scene--hero .scene__content {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity var(--transition-slow),
        transform var(--transition-slow);
}

body.scrolled .scene--hero .scene__content {
    opacity: 0;
    transform: translateY(-50px);
}

.scene__overline {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s var(--ease-theatrical) 0.3s forwards;
}

.scene__title {
    font-family: var(--font-hero);
    font-size: var(--text-hero);
    font-weight: 300;
    color: var(--color-text-primary);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1.2s var(--ease-theatrical) 0.5s forwards;
    text-align: center;
}

.scene__title em {
    font-style: italic;
    font-weight: 300;
}

.scene__subtitle {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 300;
    color: var(--color-text-secondary);
    font-style: italic;
    opacity: 0;
    animation: fadeInUp 1s var(--ease-theatrical) 0.8s forwards;
}

/* Hero Constellation with Connecting Lines */
.hero-constellation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Lines that draw themselves */
.line {
    stroke: rgba(160, 140, 120, 0.4);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawLine 2.5s ease-out forwards;
}

.line--1 {
    animation-delay: 0.5s;
}

.line--2 {
    animation-delay: 0.8s;
}

.line--3 {
    animation-delay: 1.1s;
}

.line--4 {
    animation-delay: 1.4s;
}

.line--5 {
    animation-delay: 1.0s;
}

.line--6 {
    animation-delay: 1.3s;
}

.line--7 {
    animation-delay: 1.6s;
}

.line--8 {
    animation-delay: 1.9s;
}

.line--9 {
    animation-delay: 2.2s;
}

.line--10 {
    animation-delay: 2.5s;
}

.line--11 {
    animation-delay: 2.8s;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Star nodes */
.node {
    fill: rgba(180, 160, 140, 0.7);
    opacity: 0;
    animation: nodeAppear 0.5s ease-out forwards;
}

.node--1 {
    animation-delay: 0.3s;
}

.node--2 {
    animation-delay: 0.6s;
}

.node--3 {
    animation-delay: 0.9s;
}

.node--4 {
    animation-delay: 1.2s;
}

.node--5 {
    animation-delay: 1.5s;
}

.node--6 {
    animation-delay: 1.1s;
}

.node--7 {
    animation-delay: 1.4s;
}

.node--8 {
    animation-delay: 1.7s;
}

.node--9 {
    animation-delay: 2.0s;
}

.node--10 {
    animation-delay: 2.3s;
}

.node--11 {
    animation-delay: 2.6s;
}

@keyframes nodeAppear {
    from {
        opacity: 0;
        transform: scale(0);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Subtle pulse after appearing */
.node {
    animation: nodeAppear 0.5s ease-out forwards, nodePulse 4s ease-in-out 3s infinite;
}

@keyframes nodePulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Scroll Prompt */
.scroll-prompt {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 1s var(--ease-theatrical) 1.5s forwards;
}

.scroll-prompt span {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.scroll-prompt__arrow {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--color-text-muted), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.5;
    }

    50% {
        transform: scaleY(1.3);
        opacity: 1;
    }
}

/* =====================================================
   Intro Scene
   ===================================================== */

.scene--intro {
    background-image:
        url('assets/left_pillar.png'),
        url('assets/right_pillar.png'),
        url('assets/foundation-hero.png');
    background-size:
        auto 150%,
        auto 150%,
        cover;
    background-position:
        left -230px bottom -230px,
        right -230px bottom -230px,
        center;
    background-repeat:
        no-repeat,
        no-repeat,
        no-repeat;
    background-attachment:
        fixed,
        fixed,
        fixed;
}

.intro-content {
    text-align: center;
    max-width: 62rem;
    padding-top: 12vh;
    opacity: 0;
    animation: fadeInUp 1.2s var(--ease-theatrical) 0.3s forwards;
}

/* Overline label - strong hierarchy */
.scene--intro .scene__overline {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    opacity: 0.75;
    margin-bottom: 2rem;
}

/* Headline - responsive with clamp */
.scene--intro .scene__title {
    font-family: var(--font-hero);
    font-size: clamp(44px, 5vw, 76px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 300;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

.intro-overline {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--color-text-primary);
    opacity: 0.7;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.intro-body {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    color: rgba(20, 20, 20, 0.70);
    line-height: 1.75;
    margin-top: 18px;
    margin-bottom: 52px;
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

.intro-why-matters {
    margin-top: 4rem;
}

.intro-why-title {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--color-text-primary);
    opacity: 0.7;
    margin-bottom: 1.5rem;
    text-align: center;
}

.intro-why-paragraph {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 400;
    color: rgba(20, 20, 20, 0.75);
    line-height: 1.85;
    text-align: center;
    max-width: 60ch;
    margin: 0 auto;
}

/* Legacy card styles - keeping for backwards compatibility */
.intro-list {
    list-style: none;
    display: grid;
    gap: 1.5rem;
}

.intro-list li {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    position: relative;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(160, 140, 120, 0.3);
    transition: transform 0.3s ease, background 0.3s ease;
}

.intro-list li::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(160, 140, 120, 0.3);
    pointer-events: none;
    background-image:
        radial-gradient(circle 2px at 0 0, var(--helio-color) 2px, transparent 2.5px),
        radial-gradient(circle 2px at 100% 0, var(--helio-color) 2px, transparent 2.5px),
        radial-gradient(circle 2px at 100% 100%, var(--helio-color) 2px, transparent 2.5px),
        radial-gradient(circle 2px at 0 100%, var(--helio-color) 2px, transparent 2.5px);
    background-repeat: no-repeat;
    background-size: 10px 10px;
    background-position: top left, top right, bottom right, bottom left;
}

.intro-list li:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.intro-list li strong {
    display: block;
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.intro-list li::before {
    display: none;
}

@media (min-width: 768px) {
    .intro-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .intro-list li {
        border-left: 1px solid rgba(160, 140, 120, 0.3);
        padding-left: 2rem;
    }
}

.scene--foundation {
    background-image:
        url('assets/left_pillar.png'),
        url('assets/right_pillar.png'),
        url('assets/foundation-hero.png');
    background-size:
        auto 150%,
        auto 150%,
        cover;
    background-position:
        left -230px bottom -230px,
        right -230px bottom -230px,
        center;
    background-repeat:
        no-repeat,
        no-repeat,
        no-repeat;
    background-attachment:
        fixed,
        fixed,
        fixed;
    position: relative;
    /* Override column layout for horizontal positioning */
    flex-direction: row;
    align-items: flex-start;
    padding-top: 12vh;
}

.scene--foundation .scene__content {
    opacity: 0;
    transform: translateY(80px) scale(0.95);
    transition:
        opacity 1.2s var(--ease-theatrical),
        transform 1.4s var(--ease-theatrical);
    max-width: 500px;
    z-index: 10;
    padding: 2rem;
}

.scene--foundation.active .scene__content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Position-based layouts - Content opposite to figures */
/* Figure LEFT (25%) = Content RIGHT */
.scene--foundation[data-position="left"] {
    justify-content: flex-end;
    padding-right: 15%;
    padding-left: 25%;
}

.scene--foundation[data-position="left"] .scene__content {
    text-align: left;
    transform-origin: right center;
}

.scene--foundation[data-position="left"].active .scene__content {
    animation: slideInFromRight 1.2s var(--ease-theatrical) forwards;
}

/* Figure RIGHT (75%) = Content LEFT */
.scene--foundation[data-position="right"] {
    justify-content: flex-start;
    padding-left: 15%;
    padding-right: 25%;
}

.scene--foundation[data-position="right"] .scene__content {
    text-align: right;
    transform-origin: left center;
}

.scene--foundation[data-position="right"].active .scene__content {
    animation: slideInFromLeft 1.2s var(--ease-theatrical) forwards;
}

/* Figure CENTER = Content CENTER with special treatment (Helio) */
/* HELIO - Premium Leadership Section - Clean Side-by-Side Layout */

.scene--foundation[data-position="center"] {
    background: transparent;
    position: relative;
}

/* Subtle ambient glow */
.scene--foundation[data-position="center"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 30%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(246, 173, 85, 0.12) 0%, transparent 60%);
    filter: blur(80px);
    pointer-events: none;
}

/* Content positioning - right side */
.scene--foundation[data-position="center"] .scene__content {
    text-align: left;
    max-width: 480px;
    position: relative;
    z-index: 20;
    padding: 2rem;
}

/* Premium card styling */
.scene--foundation[data-position="center"] .foundation-card {
    background: rgba(15, 13, 12, 0.8);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 4px;
    border-left: 3px solid rgba(246, 173, 85, 0.5);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

/* Helio number */
.scene--foundation[data-position="center"] .foundation-card__number {
    color: rgba(246, 173, 85, 0.25);
    font-size: var(--text-3xl);
    text-shadow: 0 0 40px rgba(246, 173, 85, 0.2);
}

/* Helio name - golden gradient */
.scene--foundation[data-position="center"] .foundation-card__name {
    color: #f6ad55 !important;
    font-size: var(--text-3xl);
    text-shadow: 0 0 30px rgba(246, 173, 85, 0.4);
    letter-spacing: 0.05em;
}

/* Theme label */
.scene--foundation[data-position="center"] .foundation-card__theme {
    color: rgba(246, 173, 85, 0.8) !important;
    letter-spacing: 0.3em;
}

/* Purpose statement */
.scene--foundation[data-position="center"] .foundation-card__purpose {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--text-xl);
}

/* List items */
.scene--foundation[data-position="center"] .foundation-card__list li {
    color: rgba(255, 255, 255, 0.75);
}

.scene--foundation[data-position="center"] .foundation-card__list li::before {
    color: rgba(246, 173, 85, 0.6);
}

/* Entrance animation */
.scene--foundation[data-position="center"].active .scene__content {
    animation: helioReveal 1.4s var(--ease-theatrical) forwards;
}

@keyframes helioReveal {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }

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

/* Cinematic entrance animations */
@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(60px) translateY(20px) scale(0.95);
    }

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

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-60px) translateY(20px) scale(0.95);
    }

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

@keyframes scaleInCenter {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }

    60% {
        opacity: 1;
    }

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

/* Light background mode - text color adjustments */
body.light-bg .scene--foundation .foundation-card__number {
    color: var(--color-text-dark-muted);
}

body.light-bg .scene--foundation .foundation-card__purpose {
    color: var(--color-text-dark-primary);
}

body.light-bg .scene--foundation .foundation-card__list li {
    color: var(--color-text-dark-secondary);
}

body.light-bg .scene--foundation .foundation-card__list li::before {
    color: var(--color-text-dark-muted);
}

/* Global foundation card alignment rules remain */

/* Text alignment based on position */
[data-position="left"] .foundation-card {
    text-align: left;
}

/* Foundation Layout Alignment */
[data-position="left"] .scene__content {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

[data-position="right"] .scene__content {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.foundation-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    padding-left: 1rem;
    transition: transform var(--transition-medium);
}

.foundation-header__main {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

[data-position="left"] .foundation-header {
    align-items: flex-start;
    text-align: left;
}

[data-position="right"] .foundation-header {
    align-items: flex-end;
    text-align: right;
}

[data-position="right"] .foundation-header__main {
    flex-direction: row-reverse;
}

.foundation-card__number {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: var(--text-2xl);
    font-weight: 300;
    color: #4a3721;
    margin-bottom: 0.2rem;
    opacity: 0.4;
    line-height: 1;
}

.foundation-card__name {
    font-family: 'Cormorant Garamond', serif;
    font-size: var(--text-3xl);
    font-weight: 300;
    color: #4a3721;
    margin-bottom: 0;
    letter-spacing: -0.01em;
    line-height: 1;
}

.foundation-card__theme {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #d4a853;
    display: block;
    margin-bottom: 0.5rem;
}

.foundation-card {
    position: relative;
    padding: 2.5rem 3.5rem;
    background: #ffffff;
    border: 1px solid rgba(212, 168, 83, 0.4);
    /* Inner thin border */
    max-width: 750px;
    text-align: left;
    /* Always left-aligned regardless of section position */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.foundation-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.08);
}

/* Outer Ornate Border */
.foundation-card::before {
    content: '';
    position: absolute;
    inset: -12px;
    border: 1px solid rgba(212, 168, 83, 0.2);
    pointer-events: none;
}

/* Ornate Corners - SVGs */
.foundation-card::after {
    content: '';
    position: absolute;
    inset: -18px;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 30 Q10 10 30 10' fill='none' stroke='rgb(212, 168, 83)' stroke-width='1.5'/%3E%3Ccircle cx='10' cy='30' r='2' fill='rgb(212, 168, 83)'/%3E%3Ccircle cx='30' cy='10' r='2' fill='rgb(212, 168, 83)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M70 10 Q90 10 90 30' fill='none' stroke='rgb(212, 168, 83)' stroke-width='1.5'/%3E%3Ccircle cx='70' cy='10' r='2' fill='rgb(212, 168, 83)'/%3E%3Ccircle cx='90' cy='30' r='2' fill='rgb(212, 168, 83)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 70 Q10 90 30 90' fill='none' stroke='rgb(212, 168, 83)' stroke-width='1.5'/%3E%3Ccircle cx='10' cy='70' r='2' fill='rgb(212, 168, 83)'/%3E%3Ccircle cx='30' cy='90' r='2' fill='rgb(212, 168, 83)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M70 90 Q90 90 90 70' fill='none' stroke='rgb(212, 168, 83)' stroke-width='1.5'/%3E%3Ccircle cx='70' cy='90' r='2' fill='rgb(212, 168, 83)'/%3E%3Ccircle cx='90' cy='70' r='2' fill='rgb(212, 168, 83)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: top left, top right, bottom left, bottom right;
    background-size: 40px 40px;
    pointer-events: none;
    opacity: 0.8;
}

/* Subtle accent at bottom center */
.foundation-card-accent {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 60 15' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 Q30 0 60 10' fill='none' stroke='rgb(212, 168, 83)' stroke-width='1'/%3E%3Ccircle cx='30' cy='5' r='1.5' fill='rgb(212, 168, 83)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.foundation-card__purpose {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.75rem;
    font-style: italic;
    font-weight: 400;
    color: #4a3721;
    line-height: 1.3;
    margin-bottom: 1.75rem;
    position: relative;
    padding-bottom: 1.5rem;
    max-width: 90%;
}

/* Decorative thin line after purpose */
.foundation-card__purpose::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.3), transparent);
}

.foundation-card__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.foundation-card__list li {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: #5a4631;
    padding: 0 0 0 2.5rem;
    position: relative;
    line-height: 1.4;
    text-align: left;
}

/* Ornate Leaf Bullet */
.foundation-card__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.2rem;
    height: 1.2rem;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C12 22 17 18 17 12C17 7 14 2 12 2C10 2 7 7 7 12C7 18 12 22 12 22Z' fill='rgb(212, 168, 83)' opacity='0.7'/%3E%3Cpath d='M12 22V2' stroke='rgb(212, 168, 83)' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
}

/* Foundation-specific colors removed in favor of unified Helio Gold */

/* =====================================================
   Footer Scene
   ===================================================== */

.scene--footer {
    min-height: 50vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}


.footer__nav {
    display: flex;
    gap: 3rem;
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeIn 1s var(--ease-theatrical) 1.5s forwards;
}

.footer__nav-link {
    font-size: var(--text-xs);
    color: rgba(10, 10, 14, 0.4);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all var(--transition-medium);
}

.footer__nav-link:hover {
    color: #0a0a0e;
    letter-spacing: 0.3em;
}

.scene--footer .scene__content {
    color: #0a0a0e;
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer__title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 6vw, var(--text-hero));
    font-weight: 300;
    color: #0a0a0e;
    line-height: 1.1;
    margin-bottom: 2.5rem;
    white-space: nowrap;
    text-align: center;
    letter-spacing: -0.02em;
}

.footer__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #0a0a0e;
    background: transparent;
    border: 1px solid rgba(10, 10, 14, 0.3);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.footer__cta svg {
    transition: transform var(--transition-fast);
}

.footer__cta:hover {
    background: #0a0a0e;
    color: #ffffff;
    border-color: #0a0a0e;
}

.footer__cta:hover svg {
    transform: translateX(5px);
}

.footer__brand {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
}

.footer__logo {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: #0a0a0e;
    display: flex;
    align-items: center;
}

.footer__logo .logo-img {
    height: 40px;
    /* Removed inversion for white background */
}

.footer__copy {
    font-size: var(--text-xs);
    color: rgba(10, 10, 14, 0.5);
}

/* =====================================================
   Animations
   ===================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 1024px) {
    .figure {
        height: 70vh;
        max-width: 80vw;
        opacity: 0.7;
    }
}

@media (max-width: 768px) {

    .figures,
    #figure-canvas {
        opacity: 0.5;
    }

    .progress {
        right: 1rem;
    }

    .header {
        padding: 1rem 1.5rem;
    }

    .scene__content {
        padding: 1.5rem;
    }

    .foundation-card__list li {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .progress {
        display: none;
    }

    .figures,
    #figure-canvas {
        opacity: 0.3;
    }
}

/* =====================================================
   3D Figure Canvas
   ===================================================== */

#figure-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s var(--ease-theatrical);
}

body.figures-visible #figure-canvas {
    opacity: 1;
}

body.light-bg #figure-canvas {
    filter: invert(1) hue-rotate(180deg);
}

/* Ambient glows removed to maintain plain paper aesthetic */
body::before {
    display: none;
}

/* =====================================================
   Helio Section - Royal Gold Border
   ===================================================== */

/* Royal gold ornate border around the card */
.foundation-card--helio {
    position: relative;
    padding: 0 1rem;
    /* No vertical padding, border hugs content */
    /* Tighter but comfortable */
    /* More internal padding */
    margin: 1rem;
    /* Space between border and content area */
    border: 1px solid rgba(212, 168, 83, 0.5);
    /* Thinner, more elegant */
    box-shadow:
        0 0 40px rgba(212, 168, 83, 0.08),
        inset 0 0 60px rgba(212, 168, 83, 0.03);
}

/* Outer decorative border - creates double-border effect */
.foundation-card--helio::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid rgba(212, 168, 83, 0.25);
    pointer-events: none;
}

/* Corner accents - subtle L-shapes */
.foundation-card--helio::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    width: 30px;
    height: 30px;
    border-top: 2px solid #d4a853;
    border-left: 2px solid #d4a853;
    pointer-events: none;
}

/* Bottom-right corner accent */
.foundation-card--helio .foundation-card__number {
    position: relative;
}

.foundation-card--helio .foundation-card__number::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: -12px;
    width: 30px;
    height: 30px;
    border-bottom: 2px solid #d4a853;
    border-right: 2px solid #d4a853;
    pointer-events: none;
}

/* Gold accents for text - Helio Header elements */
.helio-number {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: var(--text-2xl) !important;
    color: #4a3721;
    opacity: 0.4;
}

.helio-title {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: var(--text-3xl) !important;
    color: #4a3721 !important;
    letter-spacing: -0.01em !important;
}

.helio-label {
    font-family: var(--font-body) !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.3em !important;
    color: #d4a853 !important;
}

.foundation-card--helio .foundation-card__name {
    color: #d4a853;
}

.foundation-card--helio .foundation-card__theme {
    color: #d4a853;
}

/* =====================================================
   Reduced Motion Accessibility
   Respects user's motion preferences
   ===================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .scroll-prompt__arrow {
        animation: none;
    }

    .scene--foundation .scene__content {
        transition: opacity 0.01ms !important;
    }

    #scribble-container,
    #helio-particles {
        transition: opacity 0.01ms !important;
    }
}

/* =====================================================
   Mobile Responsive - Helio Section
   ===================================================== */

@media (max-width: 1024px) {
    .scene--foundation[data-position="center"] {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 8vh 2rem;
    }

    .scene--foundation[data-position="center"] .scene__content {
        max-width: 90%;
        text-align: center;
    }

    .scene--foundation[data-position="center"] .foundation-card {
        text-align: center;
        border-left: none;
        border-top: 3px solid rgba(246, 173, 85, 0.5);
        padding: 2rem;
    }

    .scene--foundation[data-position="center"]::before {
        left: 50%;
        top: 30%;
    }
}

@media (max-width: 1024px) and (orientation: portrait),
(max-width: 768px) {
    .scene--foundation {
        padding: 4rem 1.5rem 2rem !important;
        /* Force reset of desktop side-paddings */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100dvh;
        /* Dynamic viewport height */
        min-height: 568px;
        /* Support smaller older phones */
        overflow: hidden;
        /* Hide pillars on mobile - show only background */
        background-image: url('assets/foundation-hero.png') !important;
        background-size: cover !important;
        background-position: center !important;
        /* Fix iOS Safari - doesn't support background-attachment: fixed */
        background-attachment: scroll !important;
    }

    .scene--intro {
        /* Hide pillars on intro scene too */
        background-image: url('assets/foundation-hero.png') !important;
        background-size: cover !important;
        background-position: center !important;
        /* Fix iOS Safari - doesn't support background-attachment: fixed */
        background-attachment: scroll !important;
    }

    /* Reset specific position paddings */
    .scene--foundation[data-position="left"],
    .scene--foundation[data-position="right"],
    .scene--foundation[data-position="center"] {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        justify-content: space-between;
    }

    .scene--foundation .scene__content {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        max-width: 100%;
        padding: 0;
        z-index: 10;
        position: relative;
        text-align: left;
        /* Header is left, card text is left */
    }

    .foundation-header {
        align-self: flex-start;
        text-align: left;
        margin-bottom: 0;
        width: 100%;
        padding-left: 0.5rem;
        margin-top: 1rem;
    }

    .foundation-header__main {
        gap: 0.75rem;
        flex-direction: row !important;
        /* Force Roman Numeral then Name */
    }

    .foundation-card__number {
        font-size: 1.5rem;
    }

    .foundation-card__name {
        font-size: 2rem;
    }

    .foundation-card__theme {
        font-size: 0.65rem;
    }

    /* Description Card at the Bottom */
    .foundation-card {
        width: 100%;
        max-width: 100%;
        padding: 1.75rem 1.5rem;
        margin-bottom: 2dvh;
        background: rgba(251, 251, 247, 0.9);
        /* Cream background for legibility */
        backdrop-filter: blur(10px);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
        z-index: 10;
        text-align: left;
        /* Keep internal alignment left */
    }

    .foundation-card__purpose {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        max-width: 100%;
    }

    .foundation-card__list {
        gap: 0.6rem;
        margin-top: 1rem;
    }

    .foundation-card__list li {
        font-size: 0.9rem;
        padding-left: 1.5rem;
        text-align: left;
    }

    /* Absolute Center Figure */
    .figure {
        position: absolute;
        top: 38%;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        height: 35vh;
        max-height: 300px;
        width: auto !important;
        opacity: 0.7 !important;
        z-index: 1;
        pointer-events: none;
    }
}

/* =====================================================
   CINEMATIC POLISH - Letterbox & Drift
   ===================================================== */

/* Letterbox Bars */
body.letterbox-active::before,
body.letterbox-active::after {
    content: '';
    position: fixed;
    left: 0;
    width: 100%;
    height: 0;
    background: #000;
    z-index: 90;
    transition: height 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

body.letterbox-active::before {
    top: 0;
}

body.letterbox-active::after {
    bottom: 0;
}

body.loaded.letterbox-active::before,
body.loaded.letterbox-active::after {
    height: clamp(20px, 4vh, 60px);
}

/* Subtle Camera Drift for Hero Background */
.scene--hero {
    background-position: center center;
    will-change: background-position;
    animation: driftHero 60s ease-in-out infinite alternate;
}

@keyframes driftHero {
    0% {
        background-position: 50% 50%;
    }

    100% {
        background-position: 50% 45%;
    }
}