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

:root {
    --charcoal: #0a0a0a;
    --vanilla: #fafaf8;
    --accent: #3b82f6;
    --accent-bright: #60a5fa;
    --text-dark: #0a0a0a;
    --text-light: #ffffff;
    --text-muted: #888888;
}

/* Lenis smooth scroll compatibility */
html {
    overflow-x: hidden;
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-light);
    background: var(--charcoal);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 350;
    letter-spacing: -0.011em;
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeSpeed; 
}

/* CRITICAL: Prevent transform conflicts during scroll */
* {
    will-change: auto !important;
}

/* Only use will-change on specific animations */
.fade-in {
    will-change: opacity;
}

/* Remove any transform from sections during scroll */
section {
    transform: none !important;
    will-change: auto !important;
}

/* Ensure smooth rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Crimson Pro', Georgia, serif;
    line-height: 0.95;
    font-weight: 200;
}

h1 {
    font-size: clamp(4rem, 11vw, 9rem);
    margin-bottom: clamp(3rem, 5vw, 6rem);
    color: inherit;
    font-weight: 200;
    letter-spacing: -0.045em;
    text-indent: -0.02em;
    line-height: 0.88;
}

h2 {
    font-size: clamp(2rem, 6.5vw, 5.5rem);
    margin-bottom: clamp(2.2rem, 5vw, 5rem);
    color: inherit;
    font-weight: 200;
    letter-spacing: -0.035em;
    line-height: 0.92;
}

h3 {
    font-size: clamp(1.35rem, 3.2vw, 2.4rem);
    margin-bottom: clamp(1.2rem, 3vw, 2rem);
    color: inherit;
    font-weight: 300;
    letter-spacing: -0.015em;
    line-height: 1.05;
}

p, li {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    line-height: 1.75;
    font-weight: 350;
    color: inherit;
    letter-spacing: -0.01em;
}

.label {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.42em;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    opacity: 0.35;
    color: inherit;
}

/* Sections */
section {
    min-height: 140vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12rem, 24vw, 30rem) clamp(3rem, 9vw, 14rem);
    z-index: 1;
}

.content-wrapper {
    max-width: 1600px;
    width: 100%;
    z-index: 2;
    position: relative;
}

/* Hero Section */
.hero {
    min-height: 140vh;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
    color: var(--text-light);
    padding: clamp(14rem, 26vw, 32rem) clamp(3rem, 10vw, 16rem);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(165deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.38) 100%);
    z-index: 1;
}

.hero h1,
.hero p,
.hero .label {
    color: var(--text-light);
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

/* Image Sections */
.parallax-section {
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.parallax-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(155deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.42) 100%);
    z-index: 1;
}

.parallax-section .content-wrapper {
    color: var(--text-light);
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

/* Color Sections */
.dark-section {
    background: var(--charcoal);
    color: var(--text-light);
}

.light-section {
    background: var(--vanilla);
    color: var(--text-dark);
}

.light-section h1, .light-section h2, .light-section h3 {
    color: var(--text-dark);
}

.light-section p, .light-section li {
    color: var(--text-dark);
    font-weight: 400;
}

/* Code Blocks */
pre {
    background: rgba(0, 0, 0, 0.75);
    padding: clamp(2rem, 3.5vw, 4rem) clamp(2.5rem, 4vw, 5rem);
    padding-left: clamp(3rem, 5vw, 6rem);
    border-radius: 24px;
    overflow-x: auto;
    margin: clamp(3rem, 6vw, 5rem) 0;
    margin-left: clamp(-1rem, -2vw, -3rem);
    border-left: 6px solid var(--accent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

pre:hover {
    box-shadow: 0 24px 70px rgba(59, 130, 246, 0.2);
    border-left-color: var(--accent-bright);
}

code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    line-height: 1.8;
    color: #f0f0f0;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.light-section pre {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.light-section code {
    color: var(--text-dark);
}

/* Lists */
ul {
    list-style: none;
    margin: clamp(2.2rem, 5vw, 4rem) 0;
}

ul li {
    padding-left: 2em;
    position: relative;
    margin-bottom: 1.6em;
    color: inherit;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: -0.01em;
}

ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    opacity: 0.35;
    color: var(--accent);
    font-weight: 300;
    letter-spacing: -0.2em;
}

/* Formula Blocks */
.formula-block {
    margin: clamp(3rem, 6vw, 6rem) 0;
    margin-left: clamp(-0.5rem, -1vw, -2rem);
    padding: clamp(3rem, 5.5vw, 5rem) clamp(3rem, 6vw, 6rem);
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.12) 0%, rgba(96, 165, 250, 0.04) 100%);
    border-radius: 28px;
    border-left: 7px solid var(--accent);
    transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.formula-block:hover {
    box-shadow: 0 25px 70px rgba(59, 130, 246, 0.25);
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.15) 0%, rgba(96, 165, 250, 0.06) 100%);
}

.formula-block h3 {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    margin-bottom: 1.6rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.formula-block p {
    font-size: clamp(1.05rem, 1.9vw, 1.35rem);
}

.light-section .formula-block {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.08) 0%, rgba(96, 165, 250, 0.02) 100%);
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(3rem, 6.5vw, 5.5rem);
    margin: clamp(3rem, 6vw, 6rem) 0;
}

/* Metrics */
.metric {
    margin: clamp(2.5rem, 5vw, 4.5rem) 0;
    padding: clamp(2.4rem, 4vw, 4rem) clamp(2.4rem, 4.5vw, 4.5rem);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
    opacity: 0;
    transition: opacity 0.45s ease;
}

.metric:hover::before {
    opacity: 1;
}

.metric:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 24px 70px rgba(59, 130, 246, 0.16);
}

.metric-value {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(3.6rem, 8vw, 6.4rem);
    font-weight: 200;
    background: linear-gradient(145deg, var(--accent-bright) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 0.9;
    margin-bottom: 1.2rem;
    letter-spacing: -0.04em;
}

.metric-label {
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    opacity: 0.6;
    color: inherit;
    letter-spacing: 0.12em;
    font-weight: 500;
    text-transform: uppercase;
}

/* Animations */
.fade-in {
    opacity: 1;
}

/* Full Screen Navigation Menu */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
}

.fullscreen-menu.active {
    visibility: visible;
    pointer-events: all;
}

.fullscreen-menu-content {
    text-align: center;
}

.fullscreen-menu nav {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.fullscreen-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-size: clamp(2rem, 5vw, 4rem);
    font-family: 'Crimson Pro', serif;
    font-weight: 200;
    letter-spacing: -0.02em;
    display: block;
    transition: color 0.3s ease;
}

.fullscreen-menu a:hover {
    color: var(--accent-bright);
}

.menu-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.menu-close span {
    display: block;
    width: 30px;
    height: 2px;
    background: var(--text-light);
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center;
}

.menu-close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.menu-close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    background: rgba(15, 15, 15, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 12px 16px;
    z-index: 1000;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    box-shadow: 
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 10px 40px rgba(0, 0, 0, 0.8);
    width: auto;
    max-width: 90vw;
}

.bottom-nav nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

/* Hamburger Menu Button */
.menu-trigger {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.menu-trigger:hover {
    opacity: 0.7;
}

.menu-trigger svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

/* Nav Logo */
.bottom-nav .nav-logo {
    font-family: 'Crimson Pro', serif;
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--text-light);
    opacity: 0.9;
    letter-spacing: 0.02em;
    text-decoration: none;
}

/* Video Background Support */
.video-bg {
    position: relative;
    overflow: hidden;
}

.bg-video,
.bg-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.bg-video {
    display: block;
}

.bg-fallback {
    display: none;
}

.no-video .bg-video {
    display: none;
}

.no-video .bg-fallback {
    display: block;
}

/* Demo Cards */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.demo-card {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-card:hover {
    background: rgba(0, 0, 0, 0.75);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.demo-label {
    color: #60a5fa;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
}

.demo-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.demo-metric {
    font-size: 1.1rem;
    color: #60a5fa;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.demo-card p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.demo-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-link:hover {
    color: #93c5fd;
}

/* Funding Cards */
.funding-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.funding-card {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.funding-card h3,
.funding-card h4 {
    color: #60a5fa;
    margin-bottom: 1.5rem;
}

.priority-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.priority-item:last-child {
    border-bottom: none;
}

.priority-item h4 {
    color: #60a5fa;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 1rem;
}

.cta-button:hover {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.light-section .cta-button {
    background: #000;
    color: #fff;
}

.light-section .cta-button:hover {
    background: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Media Queries */
@media (max-width: 860px) {
    section {
        padding: clamp(8rem, 16vw, 14rem) clamp(2rem, 6vw, 4rem);
    }

    .bottom-nav {
        bottom: 16px;
        padding: 8px 12px;
    }

    .nav-logo {
        font-size: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
