/* =====================================================================
   Socle commun du site : l'identité de l'accueil, partagée par toutes les pages.
   Jetons de couleur jour / nuit, police Bricolage, fond à halos, bouton en relief.
   La barre du haut a sa propre feuille (topbar.css, importée ici) : la même sur tout le site.
   Les gabarits (articles, blog, quiz) viennent par-dessus dans leur propre fichier.
   Thème : data-theme="dark" sur <html>, posé tôt par un petit script en tête de page (clé orbitech-theme).
   Le panneau Accessibilité (accessibility.css) passe devant : police, taille, contraste, mouvement.
   ===================================================================== */

@import url("/site-marketing/shared/css/topbar.css");

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("/site-marketing/shared/fonts/bricolage-grotesque.woff2") format("woff2");
    font-weight: 200 800;
    font-stretch: 75% 100%;
    font-style: normal;
    font-display: swap;
}

/* ---- Jetons : jour (bonbons sur lavande) / nuit (néon sur indigo), les mêmes que l'accueil ---- */
:root {
    --bg: #f3f2ff;
    --ink: #17123d;
    --ink-soft: #4b4680;
    --glass: rgba(255, 255, 255, .58);
    --glass-strong: rgba(255, 255, 255, .8);
    --glass-line: rgba(255, 255, 255, .95);
    --shade: 23, 18, 61;
    --extrude-1: #ddd8ff;
    --extrude-2: #c9c1ff;
    --extrude-3: #b3a8ff;
    --yellow: #ffc93c;
    --pink: #ff5da2;
    --blue: #3d8bff;
    --mint: #2ed8a3;
    --orange: #ff8a3d;
    --violet: #9c6bff;
    --accent: #5b4bff;
    --accent-deep: #2f22b8;
    /* surfaces de lecture : plus opaques que le verre, pour un texte bien posé */
    --paper: rgba(255, 255, 255, .86);
    --paper-line: rgba(124, 109, 255, .16);
    --gutter: clamp(16px, 5vw, 72px);
    --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #0d0b29;
    --ink: #f4f2ff;
    --ink-soft: #b3aee3;
    --glass: rgba(30, 26, 78, .5);
    --glass-strong: rgba(34, 29, 88, .78);
    --glass-line: rgba(255, 255, 255, .12);
    --shade: 0, 0, 0;
    --extrude-1: #3a2f9c;
    --extrude-2: #2c2380;
    --extrude-3: #1f1865;
    --accent: #8b7dff;
    --accent-deep: #4a3cd6;
    --paper: rgba(26, 22, 70, .82);
    --paper-line: rgba(255, 255, 255, .1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    background: var(--bg);
}
body {
    margin: 0;
    min-height: 100vh;
    background: transparent;
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.55;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg, video { max-width: 100%; }
.katex svg { max-width: none; }   /* sinon la flèche de \vec, dessinée en svg dans un tableau, tombe à 0 de large */
a { color: inherit; }
::selection { background: rgba(255, 201, 60, .55); color: #17123d; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* « Aller au contenu » (posé par navbar-loader.js) : caché jusqu'au premier Tab, comme sur les pages du site */
.skip {
    position: fixed; left: 16px; top: 12px; z-index: 100;
    padding: 10px 18px; border-radius: 999px;
    background: var(--ink); color: var(--bg);
    font-weight: 700; text-decoration: none;
    transform: translateY(-200%); transition: transform .2s;
}
.skip:focus { transform: none; }

/* Fond : halos de couleur fixes + grain, comme l'accueil (rien n'est plat, rien ne bouge) */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(42vmax 42vmax at 88% 6%, rgba(156, 107, 255, .30), transparent 62%),
        radial-gradient(36vmax 36vmax at 4% 36%, rgba(255, 93, 162, .20), transparent 62%),
        radial-gradient(46vmax 46vmax at 62% 102%, rgba(46, 216, 163, .20), transparent 62%);
}
body::after {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { filter: invert(1); opacity: .05; }

/* ---- Bouton en relief : il s'enfonce quand on appuie ---- */
.btn3d {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: 999px;
    padding: 12px 22px;
    font: inherit; font-weight: 750; font-size: 1rem; line-height: 1.2;
    color: #fff; cursor: pointer; text-decoration: none;
    background: linear-gradient(180deg, #7465ff, var(--accent) 55%, #4a3be6);
    box-shadow: 0 5px 0 var(--accent-deep), 0 12px 22px -8px rgba(61, 47, 214, .65), inset 0 1px 0 rgba(255, 255, 255, .45);
    transform: translateY(-4px);
    transition: transform .12s ease, box-shadow .12s ease;
}
.btn3d:hover { transform: translateY(-6px); box-shadow: 0 7px 0 var(--accent-deep), 0 16px 26px -8px rgba(61, 47, 214, .7), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn3d:active { transform: translateY(0); box-shadow: 0 1px 0 var(--accent-deep), 0 4px 10px -4px rgba(61, 47, 214, .6), inset 0 1px 0 rgba(255, 255, 255, .45); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn3d { transition: none; }
}
html[data-a11y-motion="off"] { scroll-behavior: auto; }
html[data-a11y-motion="off"] .btn3d { transition: none; }

@media print {
    html, body { background: #fff !important; color: #000 !important; }
    body::before, body::after, .topbar { display: none !important; }
}
