/* =====================================================
   KAIROS - La mécanique fine de la résonance conversationnelle
   Styles principaux
   ===================================================== */

/* ----- Variables CSS ----- */
:root {
    /* Couleurs */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1420;
    --bg-tertiary: #1a1f2e;

    --text-primary: #e4e6eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-blue: #667eea;
    --accent-blue-light: #818cf8;
    --accent-orange: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    /* Typographie */
    --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Espacements */
    --container-max: 1200px;
    --content-max: 720px;
    --section-padding: 80px;
    --section-padding-mobile: 48px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);

    /* Header */
    --header-height: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Container ----- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-blue-light);
}

p {
    margin-bottom: 1.5em;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-blue-light);
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* =====================================================
   HEADER
   ===================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    z-index: 1000;
    transition: background var(--transition-normal);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 0.1em;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

.nav-link.active {
    color: var(--accent-blue);
    background: rgba(102, 126, 234, 0.15);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.hamburger {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: calc(var(--header-height) + 40px) 24px 80px;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(102, 126, 234, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(102, 126, 234, 0.08), transparent),
        radial-gradient(ellipse 40% 30% at 20% 80%, rgba(245, 158, 11, 0.05), transparent);
}

.hero-particles {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(102, 126, 234, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(245, 158, 11, 0.2) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 200px 200px;
    animation: particleFloat 20s linear infinite;
}

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

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
}

.hero-tag {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-blue);
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 50px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.hero-meta .author {
    font-weight: 600;
    color: var(--text-secondary);
}

.hero-meta .separator {
    color: var(--accent-blue);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-blue) 0%, #5a67d8 100%);
    border-radius: 8px;
    text-decoration: none;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: var(--text-primary);
}

.hero-cta svg {
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(5px); }
    60% { transform: translateY(3px); }
}

/* =====================================================
   SECTIONS
   ===================================================== */
.section {
    padding: var(--section-padding) 0;
}

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

.section-header {
    max-width: var(--content-max);
    margin-bottom: 48px;
}

.section-number {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-blue);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
}

.content {
    max-width: var(--content-max);
}

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

.content p.lead {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-primary);
}

/* ----- Pull Quotes ----- */
.pull-quote {
    font-size: 1.375rem;
    line-height: 1.6;
    font-weight: 500;
    font-style: italic;
    color: var(--accent-blue-light);
    border-left: 4px solid var(--accent-blue);
    padding-left: 24px;
    margin: 48px 0;
}

.final-quote {
    text-align: center;
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding: 32px 0;
}

/* ----- Code Example Block ----- */
.code-example {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent-orange);
    border-radius: 0 8px 8px 0;
    padding: 24px 32px;
    margin: 32px 0;
    overflow-x: auto;
}

.code-example pre {
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ----- Highlight (inline code) ----- */
.highlight {
    display: inline;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent-orange);
}

/* ----- Styled Lists ----- */
.styled-list {
    list-style: none;
    margin: 32px 0;
}

.styled-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.styled-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.styled-list li strong {
    color: var(--text-primary);
}

/* =====================================================
   EQUATION
   ===================================================== */
.equation {
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    padding: 40px;
    margin: 48px 0;
    text-align: center;
}

.equation-formula {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--accent-blue);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.equation-caption {
    margin-top: 16px;
    margin-bottom: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Variables Grid */
.variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.variable-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    transition: all var(--transition-normal);
}

.variable-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.variable-card.negative {
    border-color: rgba(239, 68, 68, 0.3);
}

.variable-card.negative:hover {
    border-color: var(--accent-red);
}

.variable-card.negative .variable-symbol {
    color: var(--accent-red);
}

.variable-symbol {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.variable-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.variable-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.5;
}

/* =====================================================
   CHARTS
   ===================================================== */
.chart-wrapper {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 32px;
    margin: 40px 0;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-caption {
    margin-top: 20px;
    margin-bottom: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* =====================================================
   TABLES
   ===================================================== */
.table-wrapper {
    overflow-x: auto;
    margin: 40px 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.comparison-table th {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-table td {
    color: var(--text-secondary);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table .value {
    font-weight: 700;
    font-family: var(--font-mono);
}

.comparison-table .value.positive {
    color: var(--accent-green);
}

.comparison-table .value.negative {
    color: var(--accent-red);
}

.comparison-table .value.neutral {
    color: var(--text-muted);
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    padding: 60px 0 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-brand {
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 0.1em;
}

.footer-tagline {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-meta {
    text-align: right;
}

.footer-meta p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin: 0;
}

/* =====================================================
   MOBILE NAVIGATION
   ===================================================== */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
}

.mobile-nav-link {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 24px;
    transition: color var(--transition-fast);
}

.mobile-nav-link:hover {
    color: var(--accent-blue);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    :root {
        --section-padding: var(--section-padding-mobile);
    }

    body {
        font-size: 16px;
    }

    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + 60px) 20px 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-meta {
        flex-direction: column;
        gap: 4px;
    }

    .hero-meta .separator {
        display: none;
    }

    .section-header {
        margin-bottom: 32px;
    }

    .pull-quote {
        font-size: 1.125rem;
        padding-left: 16px;
        margin: 32px 0;
    }

    .equation {
        padding: 24px;
    }

    .equation-formula {
        font-size: 1.25rem;
    }

    .variables-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        padding: 20px;
    }

    .chart-container {
        height: 250px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 16px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-meta {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* =====================================================
   ANIMATIONS & EFFECTS
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Fade in animation for sections */
.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header scroll effect */
.header.scrolled {
    background: rgba(10, 14, 26, 0.95);
    box-shadow: var(--shadow-md);
}
