:root {
    --bg-deep: #0a0806;
    --bg-panel: rgba(20, 14, 10, 0.85);
    --bg-alt: #0f0c09;
    --accent-gold: #c9963d;
    --accent-crimson: #8b2035;
    --accent-amber: #e8b96a;
    --accent-warm: rgba(201, 150, 61, 0.15);
    --text-primary: #e8ddd0;
    --text-secondary: rgba(232, 221, 208, 0.6);
    --text-muted: rgba(232, 221, 208, 0.35);
    --border: rgba(201, 150, 61, 0.12);
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --nav-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 300;
    line-height: 1.75;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* ── NAV ── */
.glass-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 100;
    background: rgba(10, 8, 6, 0.75);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}
.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.logo {
    font-weight: 600;
    font-size: 1rem;
    color: var(--accent-amber);
    white-space: nowrap;
    letter-spacing: 0.03em;
}
.logo .dot { color: var(--accent-crimson); }
.nav-links {
    display: flex;
    list-style: none;
    gap: 1.8rem;
    margin-left: auto;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--accent-amber); }
.nav-links .home-link { color: var(--accent-gold); font-weight: 600; }
.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    margin-left: auto;
}

/* ── HERO ── */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-h) + 2rem) 2rem 4rem;
}
.overline {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.2s forwards;
}
.hero h1 {
    font-size: clamp(2.2rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    opacity: 0;
    animation: fadeUp 0.8s 0.4s forwards;
}
.hero h1 .highlight {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-crimson));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.subtitle {
    max-width: 650px;
    margin: 1.5rem auto 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    opacity: 0;
    animation: fadeUp 0.8s 0.6s forwards;
}
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    opacity: 0;
    animation: fadeUp 0.8s 1.2s forwards;
}
.mouse {
    width: 22px; height: 36px;
    border: 1.5px solid var(--text-muted);
    border-radius: 11px;
    display: flex;
    justify-content: center;
    padding-top: 5px;
}
.wheel {
    width: 3px; height: 6px;
    background: var(--accent-gold);
    border-radius: 2px;
    animation: scroll-wheel 2s infinite;
}
@keyframes scroll-wheel { 0%, 100% { opacity: 1; transform: translateY(0); } 50% { opacity: 0; transform: translateY(8px); } }

/* ── SECTIONS ── */
.content-section {
    position: relative;
    z-index: 1;
    padding: 7rem 2rem;
}
.alt-bg { background: rgba(15, 12, 9, 0.6); }
.container { max-width: 1200px; margin: 0 auto; }
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* ── TEXT CONTENT ── */
.section-tag {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}
.text-content h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    line-height: 1.2;
}
.text-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.text-content strong { color: var(--accent-amber); font-weight: 600; }
.text-content em { color: var(--text-primary); font-style: italic; }

.quote-block {
    margin-top: 1.5rem;
    padding: 1.2rem 1.5rem;
    border-left: 3px solid var(--accent-crimson);
    background: rgba(139, 32, 53, 0.08);
    border-radius: 0 8px 8px 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.quote-icon { color: var(--accent-crimson); font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.quote-block p { color: var(--text-primary); margin: 0; font-style: italic; font-size: 0.9rem; }

.math-block {
    margin: 1.5rem 0;
    padding: 1.2rem 1.5rem;
    background: rgba(201, 150, 61, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}
.math-block .math-caption {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ── CANVAS WRAP ── */
.canvas-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.canvas-wrap canvas {
    width: 100%;
    max-width: 420px;
    height: 320px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15, 12, 9, 0.8);
}
.caption {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 380px;
    line-height: 1.5;
}

/* ── CENTERED CONTENT ── */
.centered-content {
    text-align: center;
}
.centered-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    margin: 1rem 0 2rem;
}
.wide-text {
    max-width: 750px;
    margin: 0 auto 1.2rem;
    color: var(--text-secondary);
    font-size: 0.97rem;
    line-height: 1.9;
}
.recognition-seal {
    margin-top: 3rem;
    font-size: 1.3rem;
    color: var(--accent-gold);
    opacity: 0.7;
    letter-spacing: 0.1em;
}

/* ── IA DETAILS ── */
.ia-details {
    background: rgba(15, 12, 9, 0.9);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}
.ia-summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ia-summary::-webkit-details-marker { display: none; }
.mono-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-gold);
    letter-spacing: 0.05em;
}
.ia-content {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.ia-content h4 {
    color: var(--accent-amber);
    font-size: 0.85rem;
    margin: 1.2rem 0 0.5rem;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}
.ia-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.75;
}
.ia-content strong { color: var(--text-primary); }

/* ── FOOTER ── */
footer {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
    background: rgba(10, 8, 6, 0.9);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    justify-content: space-between;
}
.brand h3 { color: var(--accent-amber); font-size: 1rem; margin-bottom: 0.3rem; }
.brand p { color: var(--text-muted); font-size: 0.8rem; }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}
.footer-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s;
}
.footer-link:hover { color: var(--accent-amber); border-color: var(--accent-gold); }
.footer-link.home { color: var(--accent-gold); font-weight: 600; }
.copyright { color: var(--text-muted); font-size: 0.75rem; align-self: flex-end; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { opacity: 0; animation: fadeUp 0.8s forwards; }
.delay-1 { animation-delay: 0.6s !important; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; gap: 2.5rem; }
    .order-mobile { order: -1; }
    .order-desktop { order: 1; }
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        background: rgba(10, 8, 6, 0.97);
        padding: 1.5rem 2rem;
        border-bottom: 1px solid var(--border);
    }
    .menu-btn { display: block; }
    .canvas-wrap canvas { height: 240px; }
}

/* -------------------------------------------
   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;
    }
}
