@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-color: #030712;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.4);
    --secondary: #818cf8;
    --accent: #2dd4bf;
    --accent-glow: rgba(45, 212, 191, 0.3);
    --text-main: #f8fafc;
    --text-muted: #64748b;
    --glass-border: rgba(255, 255, 255, 0.08);
    --nav-height: 80px;
    --container-padding: 3rem; /* Increased */
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50% { box-shadow: 0 0 40px var(--primary-glow); }
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

h1, h2, h3, .font-heading {
    font-family: 'Outfit', sans-serif;
}

p {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

/* --- Layout --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

main {
    position: relative;
    z-index: 10;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* --- Glassmorphism --- */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
}

.glass-pill {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Typography --- */
.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-desc {
    max-width: 1000px;
    font-size: 1.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1024px) {
    .hero-desc {
        white-space: normal;
        max-width: 600px;
    }
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 100;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
}

.logo-box {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 3s infinite ease-in-out;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    box-shadow: 0 10px 25px -5px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px -5px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: #fff;
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* --- Sections --- */
section {
    padding: 8rem 0;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 3rem;
    justify-items: center;
}

.stat-card {
    width: 100%;
    max-width: 280px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.feature-card {
    padding: 2.5rem;
    transition: transform 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -20px var(--primary-glow);
}

.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    box-shadow: inset 0 0 10px var(--primary-glow);
}

/* --- Animations --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    section {
        padding: 4rem 0;
    }
}

/* --- Document Pages Layout --- */
.doc-header {
    padding: 8rem 0 5rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 5rem;
}

.mt-20 { margin-top: 6rem; }
.mt-32 { margin-top: 9rem; }
.mt-48 { margin-top: 12rem; }
.mt-64 { margin-top: 16rem; }

.doc-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 5rem;
    align-items: start;
    padding: 0 2rem;
}

@media (max-width: 968px) {
    .doc-content {
        grid-template-columns: 1fr;
    }
    
    .doc-sidebar {
        display: none;
    }
}

.doc-sidebar {
    position: sticky;
    top: 120px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
}

.sidebar-link {
    display: block;
    padding: 0.75rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.doc-article {
    padding: 6rem 6rem;
    line-height: 1.8;
    border-radius: 4rem;
    overflow: hidden;
    word-break: break-word; /* Ensure text doesn't overflow */
}

.doc-section {
    margin-bottom: 1.5rem; /* Tighter sections */
}

.doc-article ul, .doc-article ol {
    padding-left: 1.5rem;
    margin-top: 0; /* No top margin */
    margin-bottom: 1rem;
}

.doc-article li {
    margin-bottom: 0.5rem;
    list-style-position: outside;
}

/* Ensure glass cards inside docs don't overflow */
.doc-article .glass {
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 2.5rem !important; /* Fixed padding for inner cards */
    margin: 1rem 0;
}

/* --- Sub-Canvas --- */
.sub-canvas-container {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    border-radius: 2rem;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
}
