:root {
    --bg-color: #050508; /* Deep Space Black */
    --surface-color: rgba(15, 10, 20, 0.4); /* Almost invisible glass */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0aa;
    --highlight-primary: #b14cff; /* Neon Violet for the horizon */
    --highlight-secondary: #ffffff; /* Bright White / Stellar flash */
    --border-color: rgba(177, 76, 255, 0.15); /* Tinted subtle borders */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

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

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

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

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(5, 5, 8, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--highlight-secondary);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

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

/* Burger Menu */
.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.burger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    padding-top: 80px;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-content .highlight {
    color: var(--highlight-primary);
    font-weight: 600;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
}

/* Content Sections */
.content-section {
    padding: 8rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.content-section.alt-bg {
    background: linear-gradient(135deg, rgba(15,10,20, 0.5) 0%, rgba(5,5,8, 0) 100%);
    max-width: 100%;
    padding-left: calc(50vw - 600px);
    padding-right: calc(50vw - 600px);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.text-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--highlight-secondary);
}

.text-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.text-content.full-width {
    grid-column: 1 / -1;
}

.text-content.centered {
    grid-column: 1 / -1;
    text-align: center;
}

/* Canvas Containers */
.canvas-container {
    width: 100%;
    height: 400px;
    background: var(--surface-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-container canvas {
    width: 100%;
    height: 100%;
}

/* IA Details Section */
.ia-details {
    background: rgba(177, 76, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.ia-details summary {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--highlight-primary);
    cursor: pointer;
    user-select: none;
    outline: none;
}

.ia-content {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

.ia-content h4 {
    color: var(--highlight-secondary);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

/* Footer */
footer {
    background: rgba(5, 5, 8, 0.8);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.brand h3 {
    font-size: 1.5rem;
    color: var(--highlight-secondary);
    margin-bottom: 0.5rem;
}

.brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.footer-link {
    color: var(--highlight-primary);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.footer-link:hover {
    border-bottom-color: var(--highlight-primary);
}

.copyright {
    margin-top: 3rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s forwards ease-out;
}

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

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

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsiveness */
@media (max-width: 900px) {
    .content-section {
        grid-template-columns: 1fr;
        padding: 4rem 1.5rem;
    }

    .content-section.alt-bg {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .order-mobile {
        order: -1;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 5, 8, 0.95);
        padding: 2rem;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.nav-active {
        display: flex;
    }

    .burger {
        display: block;
    }
}

/* -------------------------------------------
   RESPONSIVE TEXT & OVERFLOW FIXES (Mobile)
   ------------------------------------------- */
body {
    word-break: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}
.math-display, .math-box, .ia-content, pre, code {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}
@media (max-width: 768px) {
    .glass-panel {
        padding: 1.5rem !important;
    }
    .ia-details {
        padding: 1rem 1.2rem !important;
    }
    .hero h1 {
        font-size: 2.2rem !important;
    }
    .section {
        padding: 4rem 0 !important;
    }
    .container {
        padding: 0 1rem !important;
    }
}
