/* =============================================
   CARTHOGEN - Styles de base (Enhanced)
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::selection {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 1000;
}

/* Enhanced grid background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Ambient glow effects */
.grid-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0, 212, 255, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 100%, rgba(20, 184, 166, 0.05) 0%, transparent 50%);
    animation: ambientGlow 20s ease-in-out infinite alternate;
}

@keyframes ambientGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5%, -5%) scale(1.1); }
}

/* Container commun pour les sections */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* En-tête de section - Enhanced */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-label {
    font-size: 0.8rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: var(--radius-full);
}

.section-label::before,
.section-label::after {
    content: '';
    width: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan));
}

.section-label::after {
    background: linear-gradient(90deg, var(--accent-cyan), transparent);
}

.section-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Typography enhancements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

p {
    line-height: 1.75;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-normal);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan-dim);
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Image handling */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Code/Mono text */
code, pre, .mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
