/* ============================================================
   INNODEV SOLUTIONS — SOCLE COMMUN
   Source unique des design tokens, du reset et de la typographie.
   À charger EN PREMIER sur toutes les pages.
   ============================================================ */

/* ===== DESIGN TOKENS ===== */
:root {
    /* Couleurs */
    --primary: #2A83C6;
    --primary-dark: #1e6aa5;
    --secondary: #4dbbd5;
    --cyan: #4dbbd5;
    --dark: #1b2e4b;
    --dark-light: #1e293b;
    --text: #334155;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --border: #e2e8f0;
    --navy-deep: #12213a;
    --navy-footer: #0c1729;
    --blue-soft: #eaf3fa;
    --blue-line: #cfe3f3;
    --muted: #5f6e82;
    --ai-bg: #e3f5f9;
    --ai-text: #0b5e70;
    --success: #1e7a4a;
    --success-bg: #e8f5ee;
    --warning: #9a5b00;
    --warning-bg: #fff6e5;

    /* Texte sur fond sombre — contrastes conformes AA */
    --on-dark: #ffffff;
    --on-dark-muted: rgba(255, 255, 255, 0.88);
    --on-dark-subtle: rgba(255, 255, 255, 0.78);

    /* Dégradés */
    --gradient-2: linear-gradient(135deg, #2A83C6 0%, #4dbbd5 100%);

    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);

    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Typographie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-optical-sizing: auto;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Inter : chiffres tabulaires + ligatures contextuelles = rendu produit */
    font-feature-settings: 'cv11', 'ss01';
    font-variation-settings: 'opsz' 20;
}

img,
picture,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

/* ===== TYPOGRAPHIE ===== */
h1, h2, h3, h4, h5, h6 {
    /* Inter Tight : chasse plus étroite que Inter, c'est ce qui donne
       aux titres leur densité "produit tech". */
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--dark);
    letter-spacing: -0.03em;
    text-wrap: balance;
}

h1 {
    letter-spacing: -0.042em;
    font-weight: 800;
    line-height: 1.05;
}

h2 {
    letter-spacing: -0.036em;
    font-weight: 800;
}

h3 {
    letter-spacing: -0.028em;
}

/* Les éléments qui jouent le rôle de titre sans en être une balise */
.stat-value,
.hero-title,
.section-title {
    font-family: var(--font-display);
    letter-spacing: -0.035em;
}

p {
    text-wrap: pretty;
}

/* Les chiffres des compteurs / stats ne doivent pas "sauter" en largeur */
.stat-value,
.counter {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

/* ===== ACCESSIBILITÉ ===== */

/* Lien d'évitement clavier */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 2000;
    padding: 0.75rem 1.25rem;
    background: var(--dark);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* Anneau de focus cohérent sur tout le site (clavier uniquement) */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Sur fond sombre, l'anneau bleu passe mal */
.footer-modern :focus-visible,
.section-dark :focus-visible {
    outline-color: var(--secondary);
}

/* Réservé aux lecteurs d'écran */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ANIMATIONS D'APPARITION AU SCROLL ===== */
/* Piloté par le CSS et non par le JS : si le JS échoue, le contenu reste
   visible (avant : toutes les sections étaient mises à opacity:0 en JS). */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ===== PRÉFÉRENCE MOUVEMENT RÉDUIT ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
