:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --accent-gold: rgba(184, 134, 11, 1);
    --accent-cyan: rgba(2, 132, 199, 1);
    --accent-green: rgba(21, 128, 61, 1);
    --accent-violet: rgba(109, 40, 217, 1);
    
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.portail-light-mode {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

#portail-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.container.wide { max-width: 1300px; }

/* Hero Section */
.hero {
    height: 100vh;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    position: relative; padding: 0 5%;
}

.badge {
    display: inline-block; padding: 0.4rem 1rem;
    border: 1px solid rgba(2, 132, 199, 0.2); border-radius: 50px;
    font-size: 0.8rem; font-weight: 600; color: var(--accent-cyan);
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 2rem;
    background: rgba(2, 132, 199, 0.05);
}

.hero h1 { font-size: clamp(3rem, 6vw, 5rem); line-height: 1.1; font-weight: 800; letter-spacing: -1px; margin-bottom: 1.5rem; color: var(--text-primary); }
.hero .subtitle { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-secondary); max-width: 750px; margin: 0 auto 2.5rem; }

.cta-group { display: flex; gap: 1rem; justify-content: center; z-index: 10; }
.btn { padding: 0.8rem 2rem; border-radius: 6px; font-size: 0.95rem; font-weight: 600; text-decoration: none; transition: all 0.3s ease; }
.btn-primary { background: var(--text-primary); color: #fff; }
.btn-primary:hover { background: var(--accent-cyan); transform: translateY(-2px); }
.btn-outline { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(5px); border: 1px solid; }
.btn-outline:hover { background: rgba(2, 132, 199, 0.05); }

.scroll-indicator { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; opacity: 0.6; }
.scroll-indicator .mouse { width: 24px; height: 36px; border: 2px solid var(--text-muted); border-radius: 12px; position: relative; }
.scroll-indicator .mouse::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--accent-cyan); border-radius: 50%; animation: scrollAnimation 2s infinite; }
@keyframes scrollAnimation { 0% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, 15px); opacity: 0; } }

/* Grid Categories */
.section { padding: 4rem 0; position: relative; }

.category-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 1rem; }
.category-header h2 { font-size: 1.6rem; font-weight: 500; color: var(--text-primary); }
.category-icon { font-size: 1.8rem; font-family: var(--font-mono); color: var(--text-muted); }
.text-cyan { color: var(--accent-cyan) !important; }
.text-green { color: var(--accent-green) !important; }
.text-violet { color: var(--accent-violet) !important; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

/* Portal Cards */
.portal-card {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.portal-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 1);
    border-color: rgba(2, 132, 199, 0.2);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.portal-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 2;
}

.portal-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.1;
    z-index: 1;
    transition: opacity 0.5s, transform 0.5s;
}

.portal-card:hover .card-glow {
    opacity: 0.3;
    transform: scale(1.5);
}

/* AI MANIFESTO SECTION */
.protocol-ai { padding-bottom: 8rem; }
.ai-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 12px;
    padding: 3rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.ai-box-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2.5rem; color: var(--text-primary); border-bottom: 1px dashed rgba(0,0,0,0.1); padding-bottom: 1rem; }
.ai-box-header h3 { font-size: 1.6rem; font-family: var(--font-mono); font-weight: 700; margin: 0; letter-spacing: -0.5px; }

.ai-box-content {
    color: var(--text-secondary);
}

.alt-bg { background-color: var(--bg-secondary); }

.ai-box-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Animations Reveal */
.reveal-text, .fade-in, .reveal-up { opacity: 0; }
.reveal-text.visible, .fade-in.visible { animation: fadeIn 1s ease forwards; }
.reveal-up.visible { animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
    .ai-box { padding: 2rem 1.5rem; }
    .ai-box-header { flex-direction: column; text-align: center; }
}
/* AI Technical Compilation Styles */
.ia-compilation-item {
    border: 1px solid rgba(2, 132, 199, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
}

.ia-details {
    margin-top: 1rem;
}

.ia-summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem;
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: 6px;
    background: rgba(2, 132, 199, 0.05);
    font-weight: 600;
    transition: all 0.3s ease;
}

.ia-summary:hover {
    background: rgba(2, 132, 199, 0.1);
    border-color: var(--accent-cyan);
}

.ia-summary::-webkit-details-marker {
    display: none;
}

.ia-content {
    padding: 1.5rem;
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #ffffff;
    font-size: 0.95rem;
}

.ia-content h4 {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 1rem;
    margin: 1.5rem 0 0.8rem;
    font-weight: 700;
}

.ia-content h4:first-child {
    margin-top: 0;
}

.ia-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: left;
}

.ia-content ul, .ia-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.ia-content li {
    margin-bottom: 0.5rem;
}

.ia-quote, .ia-box blockquote {
    border-left: 3px solid var(--accent-cyan);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* -------------------------------------------
   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;
    }
}
