:root {
    --canvas-white: #ffffff;
    --text-black: #0a0a0a;
    --muted-gray: #86868b;
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", sans-serif;
}

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

body {
    background-color: var(--canvas-white);
    font-family: var(--font-stack);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#hero {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    padding: 18vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

/* APPLE-STYLE HERO BACKGROUND */
.hero-background {
    position: absolute;
    top: -25vh;
    left: -25vw;
    width: 150vw;
    height: 150vh;
    z-index: -1;
    pointer-events: none;
    filter: blur(50px);
    will-change: transform, opacity;
}

/* ENTRANCE BLOOM STATES */
.bloom-ready {
    opacity: 0;
    transform: translateY(5vh) scale(0.92);
}

.bloom-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 2s ease-out, transform 2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .bloom-active {
        transition: opacity 2s linear;
        transform: none;
    }
    .bloom-ready {
        transform: none;
    }
}

/* GRADIENT SHAPES */
.gradient-container > div {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.gradient-rose {
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle at center, rgba(255, 182, 193, 0.8) 0%, rgba(255, 182, 193, 0) 65%);
    top: 45vh;
    left: 20vw;
    animation: driftRose 22s infinite alternate ease-in-out;
}

.gradient-amber {
    width: 70vw;
    height: 70vh;
    background: radial-gradient(circle at center, rgba(255, 191, 0, 0.7) 0%, rgba(255, 191, 0, 0) 65%);
    top: 65vh;
    right: 15vw;
    animation: driftAmber 26s infinite alternate ease-in-out;
}

.gradient-lavender {
    width: 90vw;
    height: 85vh;
    background: radial-gradient(circle at center, rgba(216, 191, 216, 0.8) 0%, rgba(216, 191, 216, 0) 70%);
    top: 37vh;
    left: 40vw;
    animation: driftLavender 18s infinite alternate ease-in-out;
}

.gradient-chartreuse {
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle at center, rgba(223, 255, 0, 0.5) 0%, rgba(223, 255, 0, 0) 60%);
    top: 80vh;
    left: 30vw;
    animation: driftChartreuse 20s infinite alternate ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .gradient-container > div {
        animation: none !important;
    }
}

@keyframes driftRose {
    0% { transform: translate(0, 0) scale(0.95); }
    100% { transform: translate(4%, -5%) scale(1.05); }
}

@keyframes driftAmber {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5%, -4%) scale(0.96); }
}

@keyframes driftLavender {
    0% { transform: translate(0, 0) scale(0.98); }
    100% { transform: translate(-3%, 6%) scale(1.04); }
}

@keyframes driftChartreuse {
    0% { transform: translate(0, 0) scale(1.02); }
    100% { transform: translate(5%, 3%) scale(0.95); }
}

/* CONTENT CONTAINER */
.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: none;
}

/* TYPOGRAPHY */
.watermark {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--muted-gray);
    margin-bottom: 100px; /* Separated by 80px-120px negative space */
    
    /* Load State */
    opacity: 0;
    transform: translateY(24px);
    /* Sharp cubic-bezier timing function over 600ms, zero bounce */
    animation: fadeUpText 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

.headline {
    font-size: clamp(60px, 8vw, 110px); /* Scaled down fluid size */
    font-weight: 800;
    letter-spacing: -0.03em; /* Tracking pulled tight */
    color: var(--text-black);
    line-height: 1.05; /* Kept extremely tight */
    
    /* Load State */
    opacity: 0;
    transform: translateY(24px);
    /* Sharp cubic-bezier timing function over 800ms, zero bounce */
    animation: fadeUpText 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

/* Fallback for smaller mobile views ensuring it scales well */
@media (max-width: 768px) {
    .headline {
        font-size: clamp(48px, 10vw, 60px);
    }
}

@keyframes fadeUpText {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SECTION 2: THE QUANT PARADIGM */
#paradigm {
    position: relative;
    width: 100vw;
    background-color: var(--canvas-white);
    padding: 160px 5vw;
    border: none;
    display: block; /* No grids/boxes */
}

/* Static, ultra-faint radial gradient in the bottom corner */
.radial-glow {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle at bottom right, rgba(180, 170, 220, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.editorial-column {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    max-width: 640px;
    text-align: left;
}

.editorial-column p {
    font-size: clamp(16px, 1.5vw, 22px);
    font-weight: 400; /* Light to Regular */
    line-height: 1.65; /* Extremely generous */
    color: #1d1d1f;
    margin-bottom: 40px;
    letter-spacing: -0.01em;
    text-wrap: pretty;
}

.stat-punctuation {
    font-size: clamp(48px, 4vw, 64px);
    font-weight: 600;
    letter-spacing: -0.04em; /* Tight tracking */
    color: #0a0a0a;
    margin: 80px 0; /* At least 80px vertical whitespace */
    text-align: left;
}

/* Focus-Pull Initial State */
.focus-text {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(12px);
    will-change: opacity, transform, filter;
    transition: opacity 800ms ease-out, transform 800ms ease-out, filter 800ms ease-out;
}

/* Focus-Pull Triggered State */
.focus-text.is-focused {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* SECTION 3: THE INFRASTRUCTURE BLOCK */
#infrastructure {
    position: relative;
    width: 100vw;
    background-color: var(--canvas-white);
    padding: 160px 5vw;
    border: none;
}

.infra-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .infra-grid {
        grid-template-columns: 1fr;
    }
}

.infra-card {
    position: relative;
    background-color: #fafafa;
    border-radius: 36px;
    padding: 80px 60px;
    min-height: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    overflow: hidden;
    /* Default variables for mouse position */
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.infra-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--hover-color) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 500ms ease-out;
    pointer-events: none;
    z-index: 0;
}

.infra-card:hover::before {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
}

.card-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted-gray);
    margin-bottom: 24px;
}

.card-header {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-black);
}

/* SECTION 4: THE MATHEMATICAL GALLERY */
#gallery {
    position: relative;
    width: 100vw;
    background-color: var(--canvas-white); /* Will rest at pure white */
    transition: background-color 1.2s ease;
}

.exhibit {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.exhibit-content {
    text-align: center;
    transform: scale(0.96);
    filter: blur(8px);
    opacity: 0.2;
    transition: all 800ms cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, filter, opacity;
}

.exhibit-content.is-active {
    transform: scale(1);
    filter: blur(0);
    opacity: 1;
}

.exhibit-math {
    font-size: clamp(40px, 4vw, 64px);
    color: var(--text-black);
    font-weight: 400;
}

.exhibit-math .katex {
    font-size: 1em; /* Allow KaTeX to inherit fluid sizing */
}

.exhibit-caption {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted-gray);
    margin-top: 40px;
}

/* SECTION 5: THE GLOBAL ANCHOR */
#global-anchor {
    position: relative;
    width: 100vw;
    background-color: transparent;
    padding: 200px 5vw;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    overflow: hidden;
}

.ambient-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    /* Vignette mask blending into stark white at the upper edges */
    -webkit-mask-image: radial-gradient(circle at center 70%, black 10%, transparent 80%);
    mask-image: radial-gradient(circle at center 70%, black 10%, transparent 80%);
}

.vignette-node {
    position: absolute;
    border-radius: 50%;
    filter: blur(160px);
    opacity: 0.8;
}

/* Reusing full-spectrum pastels from the Hero */
.node-a {
    width: 800px;
    height: 800px;
    background: rgba(230, 180, 200, 0.6); /* Pink */
    top: 10%;
    left: 20%;
    animation: vignetteDrift1 24s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.node-b {
    width: 900px;
    height: 900px;
    background: rgba(245, 215, 170, 0.5); /* Amber */
    bottom: -10%;
    right: 15%;
    animation: vignetteDrift2 26s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.node-c {
    width: 700px;
    height: 700px;
    background: rgba(180, 170, 220, 0.6); /* Violet */
    top: 30%;
    left: 40%;
    animation: vignetteDrift3 22s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes vignetteDrift1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(15%, 10%) scale(1.1); }
}
@keyframes vignetteDrift2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-15%, -15%) scale(1.05); }
}
@keyframes vignetteDrift3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-10%, 20%) scale(1.2); }
}

.anchor-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.tracking-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted-gray);
}

.anchor-headline {
    font-size: clamp(96px, 8vw, 140px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-black);
    line-height: 1.05;
    margin-top: 40px;
    margin-bottom: 60px;
}

@media (max-width: 768px) {
    .anchor-headline {
        font-size: clamp(60px, 12vw, 96px);
    }
}

.capsule-btn {
    background-color: var(--text-black);
    color: var(--canvas-white);
    border: none;
    border-radius: 999px;
    padding: 16px 40px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-stack);
    cursor: pointer;
    transform: scale(1);
    transition: transform 200ms ease-out;
    margin-bottom: 120px;
}

.capsule-btn:hover {
    transform: scale(1.02);
}

.footer-bookend {
    margin-top: auto;
}
