/* --- Design Tokens & Variables --- */
:root {
    --bg-color: #08080c;
    --canvas-bg: #08080c;
    --accent-color: #d1a85e; /* Elegant gold accent */
    --accent-glow: rgba(209, 168, 94, 0.3);
    --text-color: #ffffff;
    --text-muted: #88888e;
    --loader-track: #151520;
    --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
    scroll-behavior: auto; /* Let custom animation drive frames */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #1a1a24;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}



/* --- Fixed Canvas Container --- */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background-color: var(--canvas-bg);
}

#scroll-canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Will be managed dynamically in JS to fit seamlessly */
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    transition: opacity 0.5s var(--easing-standard), transform 0.5s var(--easing-standard);
}

.scroll-indicator.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
}

.mouse-icon {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.mouse-wheel {
    width: 4px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollMouse 1.8s infinite var(--easing-standard);
    box-shadow: 0 0 4px var(--accent-glow);
}

.scroll-text {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    animation: pulseText 2s infinite ease-in-out;
}

/* --- Content Overlay & Sections --- */
.scroll-content-overlay {
    position: relative;
    width: 100%;
    z-index: 2;
    pointer-events: auto;
}

.content-section {
    min-height: 120vh; /* Spreads content nicely across the scroll height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 8%;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-section {
    min-height: 100vh;
}

/* --- Frosted Glass Effect --- */
.frosted-glass {
    background-color: rgba(13, 13, 13, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

/* --- Header Navigation --- */
.app-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.5rem);
    max-width: 1152px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    border-radius: 9999px;
}

.app-header.reveal-up {
    transform: translate(-50%, 40px); /* Adjust transform origin for center */
}

.app-header.reveal-up.visible {
    transform: translate(-50%, 0);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.logo-m {
    font-weight: 800;
    font-size: 19px;
    line-height: 1;
}

.logo-slash-container {
    position: relative;
    width: 12px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-slash {
    width: 2px;
    height: 24px;
    background: linear-gradient(to bottom, #3b82f6, #a855f7);
    border-radius: 9999px;
    transform: rotate(20deg);
}

.logo-text {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.25em;
    color: rgba(255,255,255,0.9);
    margin-top: 1px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-btn, .action-btn, .login-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s;
}

.nav-btn:hover, .action-btn:hover, .login-btn:hover {
    color: #fff;
}

.nav-btn.active {
    color: #fff;
    font-weight: 500;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.6);
    border-radius: 9999px;
}

.desktop-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.login-btn {
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.4);
    padding-bottom: 2px;
}

.login-btn:hover {
    border-color: #fff;
}

/* --- Typography --- */
.tagline {
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    margin-bottom: 24px;
}

.main-title {
    font-size: 5rem;
    font-weight: 200;
    line-height: 0.95;
    letter-spacing: -0.05em;
    margin-bottom: 32px;
}

.hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.45);
    max-width: 600px;
    line-height: 1.6;
}

/* --- Metrics Bar --- */
.metrics-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 24px 40px;
    border-radius: 60px;
    margin-bottom: 80px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px;
}

.border-left {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

/* --- Mission Section --- */
.mission-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 64px;
}

.section-header {
    flex: 1;
}

.section-number {
    display: block;
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.mission-statement {
    flex: 2;
    padding: 48px;
    font-size: 1.8rem;
    font-weight: 200;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

/* --- Ecosystem Grid --- */
.ecosystem-container {
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.ecosystem-card {
    position: relative;
    padding: 1.5px;
    border-radius: 32px; /* Matches frosted glass radius */
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}

.ecosystem-card.frosted-glass {
    background-color: transparent;
}

.ecosystem-card:hover {
    transform: translateY(-4px) scale(1.04);
    border-color: transparent;
}

.card-gradient-stroke {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    border-radius: 32px;
    padding: 1.5px; /* The width of the gradient stroke */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    overflow: hidden;
    z-index: 0;
}

.ecosystem-card:hover .card-gradient-stroke {
    opacity: 1;
}

.card-gradient-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250%;
    aspect-ratio: 1; /* Ensures it's a perfect square/circle so rotation covers all corners without glitching */
    background: conic-gradient(from 0deg, transparent 30%, #3b82f6 45%, #a855f7 55%, transparent 70%);
    animation: border-spin 4s linear infinite;
    transform-origin: center;
    transform: translate(-50%, -50%) rotate(0deg);
}

@keyframes border-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.card-inner {
    position: relative;
    background-color: rgba(255, 255, 255, 0.05); /* Clean white frosted glass tint instead of dark black tint */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 32px;
    border-radius: 30.5px; /* Inner radius slightly smaller than outer */
    height: 100%;
    z-index: 10;
}

.card-inner h3 {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 24px;
}

.card-list {
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

.tree-line {
    color: rgba(255, 255, 255, 0.2);
    margin-right: 8px;
}

/* --- Footer --- */
.landing-footer {
    display: flex;
    justify-content: space-between;
    padding: 40px 8%;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: rgba(255, 255, 255, 0.2);
    max-width: 1400px;
    margin: 0 auto;
}

.footer-badges {
    display: flex;
    gap: 32px;
}

/* --- Reveal Animations --- */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--easing-standard), transform 0.8s var(--easing-standard);
    will-change: opacity, transform;
}

.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-title { font-size: 3rem; }
    .metrics-bar { grid-template-columns: repeat(2, 1fr); gap: 24px; border-radius: 32px; }
    .border-left { border: none; padding-left: 0; }
    .metric-item { padding: 0; }
    .mission-container { flex-direction: column; gap: 32px; }
    .ecosystem-grid { grid-template-columns: 1fr; }
    .landing-footer { flex-direction: column; gap: 16px; text-align: center; }
}

/* --- Animations --- */
@keyframes scrollMouse {
    0% {
        top: 6px;
        opacity: 1;
        height: 8px;
    }
    50% {
        top: 18px;
        opacity: 0.3;
        height: 6px;
    }
    100% {
        top: 6px;
        opacity: 1;
        height: 8px;
    }
}

@keyframes pulseText {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}
