/* ============================================================
   STRUCTIFY TECH — MAIN.CSS
   Variables globales, reset, typographie, layout de base,
   classes utilitaires.
   Police : Syne (titres) + DM Sans (corps)
   ============================================================ */

/* ----------------------------------------------------------
   0. IMPORTS GOOGLE FONTS
   ---------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,200;0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=DM+Mono:wght@300;400;500&display=swap');


/* ----------------------------------------------------------
   1. VARIABLES CSS — DESIGN TOKENS
   ---------------------------------------------------------- */
:root {

    /* Couleurs principales */
    --color-navy:        #0D1B2A;
    --color-navy-mid:    #152236;
    --color-navy-light:  #1E3148;
    --color-blue:        #1A56DB;
    --color-blue-mid:    #2563EB;
    --color-blue-light:  #3B82F6;
    --color-blue-pale:   #DBEAFE;
    --color-white:       #FFFFFF;
    --color-warm:        #F7F5F0;
    --color-warm-mid:    #EDE9E0;
    --color-cream:       #FAF8F4;

    /* Texte */
    --color-text-primary:   #0D1B2A;
    --color-text-secondary: #4A5568;
    --color-text-muted:     #718096;
    --color-text-light:     #A0AEC0;
    --color-text-inverse:   #F7F5F0;

    /* Bordures & séparateurs */
    --color-border:         #E2E8F0;
    --color-border-dark:    rgba(13, 27, 42, 0.12);
    --color-border-inverse: rgba(247, 245, 240, 0.12);

    /* Surfaces */
    --color-surface:        #FFFFFF;
    --color-surface-raised: #F7F5F0;
    --color-surface-dark:   #0D1B2A;

    /* Accent */
    --color-accent:         #1A56DB;
    --color-accent-hover:   #1744B8;

    /* Ombres */
    --shadow-xs:   0 1px 2px rgba(13, 27, 42, 0.06);
    --shadow-sm:   0 2px 8px rgba(13, 27, 42, 0.08);
    --shadow-md:   0 4px 20px rgba(13, 27, 42, 0.10);
    --shadow-lg:   0 8px 40px rgba(13, 27, 42, 0.14);
    --shadow-xl:   0 16px 64px rgba(13, 27, 42, 0.18);

    /* Typographie */
    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --font-mono:    'DM Mono', monospace;

    /* Tailles de police */
    --text-xs:   0.70rem;    /* 11.2px */
    --text-sm:   0.813rem;   /* 13px  */
    --text-base: 0.9375rem;  /* 15px  */
    --text-md:   1.0625rem;  /* 17px  */
    --text-lg:   1.1875rem;  /* 19px  */
    --text-xl:   1.375rem;   /* 22px  */
    --text-2xl:  1.625rem;   /* 26px  */
    --text-3xl:  2rem;       /* 32px  */
    --text-4xl:  2.5rem;     /* 40px  */
    --text-5xl:  3.25rem;    /* 52px  */
    --text-6xl:  4rem;       /* 64px  */
    --text-7xl:  5rem;       /* 80px  */

    /* Interlignes */
    --leading-tight:  1.15;
    --leading-snug:   1.35;
    --leading-normal: 1.60;
    --leading-relaxed:1.80;

    /* Espacement */
    --space-1:   0.25rem;
    --space-2:   0.5rem;
    --space-3:   0.75rem;
    --space-4:   1rem;
    --space-5:   1.25rem;
    --space-6:   1.5rem;
    --space-8:   2rem;
    --space-10:  2.5rem;
    --space-12:  3rem;
    --space-16:  4rem;
    --space-20:  5rem;
    --space-24:  6rem;
    --space-32:  8rem;
    --space-40: 10rem;

    /* Border radius */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast:   0.15s ease;
    --transition-base:   0.25s ease;
    --transition-slow:   0.40s ease;
    --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --container-max:    1200px;
    --container-narrow: 800px;
    --container-wide:   1400px;

    /* Navigation */
    --nav-height:       72px;
    --nav-height-mob:   60px;

    /* Z-index */
    --z-base:     0;
    --z-raised:   10;
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-nav:      300;
    --z-overlay:  400;
    --z-modal:    500;
    --z-float:    600;
    --z-toast:    700;
}


/* ----------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Masquer les éléments de langue non actifs */
body.lang-fr [data-lang="en"],
body.lang-en [data-lang="fr"] {
    display: none !important;
}

img, video, svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
}

/* Selection */
::selection {
    background-color: var(--color-blue-pale);
    color: var(--color-navy);
}


/* ----------------------------------------------------------
   3. TYPOGRAPHIE
   ---------------------------------------------------------- */

/* Titres display — Syne */
.display-xl {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 7vw, var(--text-7xl));
    font-weight: 800;
    line-height: var(--leading-tight);
    letter-spacing: -0.03em;
    color: var(--color-text-primary);
}

.display-lg {
    font-family: var(--font-display);
    font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl));
    font-weight: 800;
    line-height: var(--leading-tight);
    letter-spacing: -0.025em;
}

.display-md {
    font-family: var(--font-display);
    font-size: clamp(var(--text-2xl), 3.5vw, var(--text-5xl));
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
}

h1, .h1 {
    font-family: var(--font-display);
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

h2, .h2 {
    font-family: var(--font-display);
    font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
    font-weight: 700;
    line-height: var(--leading-snug);
    letter-spacing: -0.015em;
    color: var(--color-text-primary);
}

h3, .h3 {
    font-family: var(--font-display);
    font-size: clamp(var(--text-xl), 2vw, var(--text-3xl));
    font-weight: 600;
    line-height: var(--leading-snug);
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
}

h4, .h4 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--color-text-primary);
}

h5, .h5 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--color-text-primary);
}

h6, .h6 {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--color-text-primary);
}

p, .body-text {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

.lead {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
    font-weight: 300;
}

.small {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.caption {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Label de section — style agence */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-blue);
    margin-bottom: var(--space-6);
}

.section-label::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: var(--color-blue);
    flex-shrink: 0;
}

.section-label.inverse {
    color: rgba(247, 245, 240, 0.6);
}

.section-label.inverse::before {
    background: rgba(247, 245, 240, 0.4);
}

/* Texte accentué */
.text-accent     { color: var(--color-blue); }
.text-muted      { color: var(--color-text-muted); }
.text-light      { color: var(--color-text-light); }
.text-inverse    { color: var(--color-text-inverse); }
.text-primary    { color: var(--color-text-primary); }
.text-secondary  { color: var(--color-text-secondary); }

.font-display    { font-family: var(--font-display); }
.font-mono       { font-family: var(--font-mono); }

.font-light      { font-weight: 300; }
.font-normal     { font-weight: 400; }
.font-medium     { font-weight: 500; }
.font-semibold   { font-weight: 600; }
.font-bold       { font-weight: 700; }
.font-extrabold  { font-weight: 800; }

.italic          { font-style: italic; }

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }


/* ----------------------------------------------------------
   4. MISE EN PAGE — CONTENEURS & GRILLES
   ---------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-8);
    padding-right: var(--space-8);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

/* Sections */
.section {
    padding-top: var(--space-32);
    padding-bottom: var(--space-32);
}

.section--sm {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

.section--lg {
    padding-top: var(--space-40);
    padding-bottom: var(--space-40);
}

.section--dark {
    background-color: var(--color-navy);
    color: var(--color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark .section-label {
    color: var(--color-text-inverse);
}

.section--dark p,
.section--dark .lead {
    color: rgba(247, 245, 240, 0.65);
}

.section--warm {
    background-color: var(--color-warm);
}

.section--cream {
    background-color: var(--color-cream);
}

/* Grilles flexibles */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.flex         { display: flex; }
.flex-wrap    { flex-wrap: wrap; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }


/* ----------------------------------------------------------
   5. ESPACEMENTS UTILITAIRES
   ---------------------------------------------------------- */
.mt-0  { margin-top: 0; }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }
.mt-20 { margin-top: var(--space-20); }

.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.p-10 { padding: var(--space-10); }
.p-12 { padding: var(--space-12); }

.w-full  { width: 100%; }
.w-auto  { width: auto; }
.h-full  { height: 100%; }

.block        { display: block; }
.inline-block { display: inline-block; }
.hidden       { display: none !important; }
.visible      { visibility: visible; }
.invisible    { visibility: hidden; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.rounded-sm   { border-radius: var(--radius-sm); }
.rounded      { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }


/* ----------------------------------------------------------
   6. ÉLÉMENTS STRUCTURELS — SÉPARATEURS & DÉCORATIONS
   ---------------------------------------------------------- */

/* Trait bleu de section */
.rule {
    display: block;
    width: 40px;
    height: 2px;
    background-color: var(--color-blue);
    margin-bottom: var(--space-6);
}

.rule--center {
    margin-left: auto;
    margin-right: auto;
}

.rule--white {
    background-color: rgba(247, 245, 240, 0.5);
}

/* Séparateur horizontal */
.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-12) 0;
}

.divider--dark {
    border-top-color: var(--color-border-inverse);
}

/* En-tête de section standard */
.section-header {
    margin-bottom: var(--space-16);
}

.section-header--center {
    text-align: center;
}

.section-header--center .rule {
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    margin-top: var(--space-4);
    margin-bottom: var(--space-5);
}

.section-header .lead {
    max-width: 600px;
}

.section-header--center .lead {
    margin-left: auto;
    margin-right: auto;
}


/* ----------------------------------------------------------
   7. BADGES & TAGS
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3em 0.8em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge--blue {
    background-color: var(--color-blue-pale);
    color: var(--color-blue);
    border-color: rgba(26, 86, 219, 0.2);
}

.badge--navy {
    background-color: var(--color-navy);
    color: var(--color-warm);
}

.badge--white {
    background-color: rgba(247, 245, 240, 0.12);
    color: rgba(247, 245, 240, 0.8);
    border-color: var(--color-border-inverse);
}

.badge--outline {
    background-color: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}


/* ----------------------------------------------------------
   8. ÉTATS — CHARGEMENT & ANIMATION BASE
   ---------------------------------------------------------- */

/* Reveal au scroll */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
            opacity 0.65s ease,
            transform 0.65s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.10s; }
.reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.30s; }
.reveal-delay-4 { transition-delay: 0.40s; }
.reveal-delay-5 { transition-delay: 0.50s; }

/* Fade simple */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Slide up */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Ticker scroll */
@keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}


/* ----------------------------------------------------------
   9. IMAGES & MÉDIAS
   ---------------------------------------------------------- */

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.img-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Aspect ratios */
.aspect-square  { aspect-ratio: 1 / 1; }
.aspect-video   { aspect-ratio: 16 / 9; }
.aspect-4-3     { aspect-ratio: 4 / 3; }
.aspect-3-2     { aspect-ratio: 3 / 2; }
.aspect-portrait { aspect-ratio: 3 / 4; }

/* Placeholder image (avant chargement) */
.img-placeholder {
    background-color: var(--color-warm-mid);
    position: relative;
    overflow: hidden;
}

.img-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%
    );
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}


/* ----------------------------------------------------------
   10. ACCESSIBILITÉ
   ---------------------------------------------------------- */

/* Lecteurs d'écran uniquement */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-toast);
    background: var(--color-blue);
    color: white;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: top 0.2s;
}

.skip-link:focus {
    top: var(--space-4);
}

/* Réduire les animations si l'utilisateur le préfère */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}