/* =====================================================================
   Thème « Fondation » : inspiré de l'esthétique de la série (Apple TV+), version claire.
   - Ivoire, or et encre : lumière chaude, architecture épurée, titres espacés en capitales
   - Trantor seule dans le ciel, avec son orbite
   - Le Radiant : objet d'obsidienne d'où se déploient des sphères d'équations en 3D.
     Il sert d'introduction (une fois par visite) puis « projette » les éléments de l'interface,
     qui se déploient à l'écran comme les équations du Radiant (fondation.js).
   Tout est dessiné en CSS/SVG (créations originales, aucun visuel de la série).
   Les animations s'arrêtent avec « Réduire les animations » ou le réglage du système.
   Versions précédentes : fondation-technique.css (HUD), fondation-classique.css, fondation-nuit.css.
   ===================================================================== */

.theme-fondation {
    --bg: #f6f2ea;
    --surface: rgba(255, 253, 248, 0.78);
    --surface-strong: rgba(255, 253, 248, 0.94);
    --text: #161a26;
    --muted: #555a68;
    --border: rgba(150, 110, 40, 0.22);
    --accent: #8a5a12;       /* or sombre : liens, lisible sur l'ivoire */
    --accent-text: #fff8ea;
    --gold: #c8952f;         /* or du Radiant */
    --glow: #f3c063;         /* lumière des équations */
    --ink: #151925;          /* obsidienne du Radiant */
    --code-bg: #efe8da;
    --focus: #c8952f;
    --radius: 4px;
    --font: "Inter", "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --display: "Avenir Next", "Futura", "Century Gothic", "Jost", "Segoe UI", system-ui, sans-serif;
    --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

/* Réglages d'accessibilité : ils restent prioritaires sur le thème. */
.a11y-readable .theme-fondation { --font: Verdana, Tahoma, sans-serif; --display: Verdana, Tahoma, sans-serif; --mono: Verdana, Tahoma, sans-serif; }
.a11y-contrast .theme-fondation { --text: #000; --muted: #000; --surface: #fff; --surface-strong: #fff; --border: #000; --accent: #5c3a00; }
.theme-fondation [data-a11y="theme"] { display: none; } /* thème clair uniquement */

/* ----- Ciel : lumière chaude et orbites concentriques ----- */
.theme-fondation {
    background:
        radial-gradient(circle at 78% 22%, transparent 0 17vw, rgba(200, 149, 47, 0.12) calc(17vw + 1px), transparent calc(17vw + 2px)),
        radial-gradient(circle at 78% 22%, transparent 0 29vw, rgba(200, 149, 47, 0.09) calc(29vw + 1px), transparent calc(29vw + 2px)),
        radial-gradient(circle at 78% 22%, transparent 0 44vw, rgba(200, 149, 47, 0.07) calc(44vw + 1px), transparent calc(44vw + 2px)),
        radial-gradient(ellipse 70% 55% at 50% -10%, rgba(255, 214, 140, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(214, 196, 166, 0.45) 0%, transparent 70%),
        linear-gradient(180deg, #fbf6ec 0%, #f6f2ea 55%, #efe9de 100%);
    background-attachment: fixed;
}

/* ----- Décor : Trantor seule (créée par fondation.js) ----- */
.fondation-scene { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fondation-scene .trantor {
    position: absolute;
    width: min(26vw, 380px);
    aspect-ratio: 1;
    right: -7vw;
    top: 8vh;
}
.fondation-scene .planet-crop { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; box-shadow: 0 0 0 1px rgba(200, 149, 47, 0.6), 0 0 0 6px rgba(255, 253, 248, 0.9), 0 0 0 7px rgba(169, 174, 187, 0.7), 0 20px 60px rgba(20, 30, 60, 0.35); }
.fondation-scene .trantor-canvas { width: 100%; height: 100%; display: block; }
/* Orbite inclinée, en perspective */
.fondation-scene .orbit {
    position: absolute;
    inset: -22% -30%;
    border: 1px solid rgba(200, 149, 47, 0.5);
    border-radius: 50%;
    transform: rotateX(74deg) rotateZ(-14deg);
}
.fondation-scene .orbit::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--glow);
    box-shadow: 0 0 12px var(--glow);
}
.fondation-scene .tag {
    position: absolute;
    left: 50%;
    top: 108%;
    transform: translateX(-50%);
    white-space: nowrap;
    font: 500 0.66rem/1 var(--display);
    letter-spacing: 0.45em;
    color: var(--accent);
}
@media (max-width: 900px) {
    .fondation-scene .trantor { width: 46vw; right: -18vw; top: 4vh; opacity: 0.35; }
    .fondation-scene .tag { display: none; }
}

/* ----- Typographie : capitales espacées, comme le générique ----- */
.theme-fondation h1,
.theme-fondation h2,
.theme-fondation h3 { color: var(--text); font-family: var(--display); }
.theme-fondation h1,
.theme-fondation h2 { font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em; }
.theme-fondation h1 { font-size: 2.1rem; line-height: 1.2; }
.theme-fondation h2 { font-size: 1.15rem; }
.theme-fondation h3 { font-weight: 600; letter-spacing: 0.01em; }
.theme-fondation .competence h2 { text-transform: none; letter-spacing: 0.02em; font-weight: 600; font-size: 1.1rem; }
/* Étiquette au-dessus des titres de page */
.theme-fondation main > h1::before,
.theme-fondation article > h1::before {
    content: "Encyclopédie galactique" / "";
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font: 500 0.68rem/1 var(--display);
    letter-spacing: 0.4em;
    color: var(--accent);
}
/* Sections de l'accueil numérotées en chiffres romains */
.theme-fondation main { counter-reset: section; }
.theme-fondation main > section:not(.competence):not(.hero) > h2::before {
    counter-increment: section;
    content: counter(section, upper-roman) "  ·  " / "";
    color: var(--gold);
    font-weight: 400;
}
.theme-fondation .lead { color: var(--muted); }
.theme-fondation .meta,
.theme-fondation .breadcrumb,
.theme-fondation .node-count { font-size: 0.8rem; letter-spacing: 0.06em; }
.theme-fondation a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.theme-fondation a:hover { color: var(--text); }
.theme-fondation code { font-family: var(--mono); }
.theme-fondation pre { border: 1px solid var(--border); border-left: 2px solid var(--gold); }

/* ----- En-tête ----- */
.theme-fondation .site-header {
    background: rgba(251, 247, 239, 0.75);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.theme-fondation .brand {
    color: var(--text);
    font: 500 0.95rem/1 var(--display);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}
/* Le Radiant en miniature : icosaèdre ambré aux arêtes dorées */
.theme-fondation .brand::before {
    content: "";
    width: 1.35rem;
    height: 1.35rem;
    background: url("../../img/fondation/radiant-icone.svg") center / contain no-repeat;
    filter: drop-shadow(0 0 5px rgba(243, 192, 99, 0.7));
}
.theme-fondation .sound-toggle { padding: 0; border-radius: 50%; letter-spacing: 0; background: var(--surface-strong); backdrop-filter: blur(8px); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(80, 60, 20, 0.12); }
.theme-fondation .sound-toggle[aria-pressed="true"] { border-color: var(--gold); color: var(--accent); box-shadow: 0 0 18px rgba(243, 192, 99, 0.6); }
.theme-fondation .main-nav a { color: var(--muted); font-size: 0.86rem; font-weight: 500; letter-spacing: 0.04em; }
.theme-fondation .main-nav ul { column-gap: 0.9rem; }
.theme-fondation .main-nav a:hover { color: var(--text); }
.theme-fondation .main-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }
.theme-fondation .a11y { background: rgba(251, 247, 239, 0.55); backdrop-filter: blur(8px); border-bottom-color: var(--border); }

/* ----- Panneaux : ivoire translucide, filet doré ----- */
.theme-fondation .hero,
.theme-fondation .card,
.theme-fondation .competence,
.theme-fondation .facts,
.theme-fondation .sv-panel,
.theme-fondation .login {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(14px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(80, 60, 20, 0.07);
}
.theme-fondation .card::before,
.theme-fondation .competence::before,
.theme-fondation .sv-panel::before,
.theme-fondation .hero::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
/* Survol : le panneau visé s'élève, se cerne d'un filet or et argent qui scintille,
   et les autres panneaux s'effacent nettement pour le laisser seul en lumière. */
.theme-fondation .card,
.theme-fondation .competence { transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s, border-color 0.45s, background-color 0.45s, opacity 0.45s, filter 0.45s; }
.theme-fondation .card::before,
.theme-fondation .competence::before { transition: left 0.45s, right 0.45s, height 0.45s, top 0.45s, box-shadow 0.45s, background 0.45s; }
.theme-fondation .card::after,
.theme-fondation .competence::after {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 2px;
    border-radius: inherit;
    background: linear-gradient(115deg, #b07d1f, #f3c063 18%, #f4f5f8 32%, #9aa1b0 46%, #e3c27a 60%, #c8952f 72%, #eef0f4 86%, #a9aebb);
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s;
}
.theme-fondation .card:hover,
.theme-fondation .card:focus-within,
.theme-fondation .competence:hover,
.theme-fondation .competence:focus-within {
    transform: translateY(-8px) scale(1.025);
    border-color: transparent;
    background-color: #fffdf8;
    box-shadow: 0 0 0 5px rgba(255, 253, 248, 0.95), 0 0 0 6px #a9aebb, 0 0 46px rgba(243, 192, 99, 0.5), 0 34px 60px rgba(60, 40, 10, 0.3);
    transition-delay: 0s;
    z-index: 2;
}
.theme-fondation .card:hover::after,
.theme-fondation .card:focus-within::after,
.theme-fondation .competence:hover::after,
.theme-fondation .competence:focus-within::after { opacity: 1; animation: filet-sheen 3.5s linear infinite alternate; }
.theme-fondation .card:hover::before,
.theme-fondation .card:focus-within::before,
.theme-fondation .competence:hover::before,
.theme-fondation .competence:focus-within::before {
    top: -2px;
    left: 8%;
    right: 8%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c8952f, #ffffff, #9aa1b0, #ffffff, #c8952f, transparent);
    box-shadow: 0 0 14px rgba(243, 192, 99, 0.9), 0 0 4px #fff;
    z-index: 1;
}
.theme-fondation .competence:hover h2,
.theme-fondation .competence:focus-within h2 { color: var(--accent); }
.theme-fondation .competence:hover .code,
.theme-fondation .competence:focus-within .code { box-shadow: 0 0 0 1px var(--gold), 0 0 0 3px #d9dce3, 0 0 16px rgba(243, 192, 99, 0.8); }
.theme-fondation .cards:has(.card:hover) .card:not(:hover),
.theme-fondation main:has(.competence:hover) .competence:not(:hover) { opacity: 0.35; filter: grayscale(0.7) blur(1px); transition-delay: 0s; }
@keyframes filet-sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.theme-fondation .card h3 a { color: var(--text); text-decoration: none; }
.theme-fondation .card h3 a:hover { color: var(--accent); }
.theme-fondation .competence { scroll-margin-top: 5rem; }
.theme-fondation .code {
    font: 600 0.8em var(--display);
    letter-spacing: 0.1em;
    background: var(--ink);
    color: var(--glow);
    border-radius: 2px;
}
.theme-fondation .tags li { font-size: 0.8rem; border-color: var(--border); background: var(--surface-strong); color: var(--muted); }
.theme-fondation .related { border-left-color: var(--gold); }

/* ----- Accueil ----- */
.theme-fondation .hero {
    margin-top: 1.5rem;
    padding: 2.75rem 2.25rem 2.25rem;
    display: grid;
    grid-template-columns: 1fr 180px;
    column-gap: 2rem;
    max-width: 880px;
}
.theme-fondation .hero > * { grid-column: 1; }
.theme-fondation .hero h1 { font-size: 2.6rem; font-weight: 400; letter-spacing: 0.22em; margin: 0 0 0.75rem; }
.theme-fondation .subtitle { font: 500 0.74rem/1.6 var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
/* Le Radiant posé, à droite du panneau (canvas ajouté par fondation.js) */
.theme-fondation .hero .hero-radiant {
    position: static;
    transform: none;
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    justify-self: center;
}
@media (max-width: 760px) {
    .theme-fondation .hero { display: block; padding: 2rem 1.25rem 1.5rem; }
    .theme-fondation .hero .hero-radiant { display: none; }
    .theme-fondation .hero h1 { font-size: 1.8rem; letter-spacing: 0.14em; }
}

/* ----- Le Radiant : sphère d'équations en 3D autour des compétences ----- */
.theme-fondation .plan { margin: 3.5rem 0; }
.theme-fondation .radiant {
    position: relative;
    width: min(100%, 660px);
    aspect-ratio: 1;
    margin: 1rem auto;
    perspective: 1100px;
}
/* Anneaux d'équations ajoutés par fondation.js */
.radiant-sphere {
    position: absolute;
    inset: 17%;
    transform-style: preserve-3d;
    animation: sphere-turn 60s linear infinite;
    pointer-events: none;
}
.radiant-sphere .ring,
.radiant-intro .ring {
    position: absolute;
    inset: 0;
    transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
}
.radiant-sphere .ring svg,
.radiant-intro .ring svg { width: 100%; height: 100%; overflow: visible; animation: ring-spin var(--speed, 40s) linear infinite; }
.ring circle { fill: none; stroke: var(--gold); stroke-width: 0.25; opacity: 0.7; }
.ring circle.dash { stroke-dasharray: 0.6 2.4; stroke-width: 0.8; opacity: 0.5; }
.ring text { fill: #9a6a17; font: 3.2px var(--font); letter-spacing: 0.4px; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes sphere-turn { to { transform: rotateY(360deg); } }
/* Cœur : le Radiant Prime en 3D (canvas dessiné par fondation.js), centré dans sa scène */
.radiant-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}
/* Rayons de lumière du cœur vers chaque compétence */
.theme-fondation .radiant-nodes::after {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: repeating-conic-gradient(from -0.3deg, rgba(200, 149, 47, 0.5) 0 0.6deg, transparent 0.6deg 60deg);
    -webkit-mask: radial-gradient(circle, transparent 0 14%, #000 15% 100%);
    mask: radial-gradient(circle, transparent 0 14%, #000 15% 100%);
}
.theme-fondation .radiant-nodes { position: absolute; inset: 0; margin: 0; display: block; }
.theme-fondation .radiant-nodes li {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 172px;
    margin: -46px 0 0 -86px;
    z-index: 1;
    /* 6 compétences réparties de 60° en 60° en partant du haut */
    transform: rotate(var(--angle)) translateY(-262px) rotate(calc(-1 * var(--angle)));
}
.theme-fondation .radiant-nodes li:nth-child(1) { --angle: 0deg; }
.theme-fondation .radiant-nodes li:nth-child(2) { --angle: 60deg; }
.theme-fondation .radiant-nodes li:nth-child(3) { --angle: 120deg; }
.theme-fondation .radiant-nodes li:nth-child(4) { --angle: 180deg; }
.theme-fondation .radiant-nodes li:nth-child(5) { --angle: 240deg; }
.theme-fondation .radiant-nodes li:nth-child(6) { --angle: 300deg; }
.theme-fondation .radiant-nodes a {
    align-items: flex-start;
    text-align: left;
    background: var(--surface-strong);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-top: 2px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(120, 90, 30, 0.14);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 0.55rem 0.7rem;
    color: var(--text);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.theme-fondation .radiant-nodes a:hover,
.theme-fondation .radiant-nodes a:focus-visible { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(200, 149, 47, 0.3); border-color: var(--gold); }
.theme-fondation .node-count { font-weight: 500; color: var(--muted); }

@media (max-width: 760px) {
    .theme-fondation .radiant { width: 100%; aspect-ratio: auto; padding-top: 250px; }
    .theme-fondation .radiant-sphere { inset: 0 auto auto 50%; width: 220px; height: 220px; margin-left: -110px; }
    .theme-fondation .radiant .radiant-core { top: 110px; }
    .theme-fondation .radiant-nodes::after { display: none; }
    .theme-fondation .radiant-nodes { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
    .theme-fondation .radiant-nodes li { position: static; width: auto; margin: 0; transform: none; }
}

/* ----- Boutons : obsidienne et lumière dorée ----- */
.theme-fondation .button,
.theme-fondation button { border-radius: 2px; font-weight: 500; letter-spacing: 0.08em; padding: 0.65rem 1.3rem; }
.theme-fondation .button { background: var(--ink); border-color: var(--ink); color: #fbf3e2; box-shadow: 0 8px 20px rgba(21, 25, 37, 0.2); }
.theme-fondation .button:hover { background: #262c3c; color: var(--glow); }
.theme-fondation .button.secondary,
.theme-fondation .a11y button,
.theme-fondation .menu-toggle { background: transparent; color: var(--text); border-color: rgba(21, 25, 37, 0.35); box-shadow: none; }
.theme-fondation .button.secondary:hover { border-color: var(--gold); color: var(--accent); }
.theme-fondation .a11y button { font-size: 0.8rem; letter-spacing: 0.02em; }
.theme-fondation .a11y button[aria-pressed="true"] { background: var(--ink); color: #fbf3e2; }

/* ----- Formulaires, tableaux, pied de page ----- */
.theme-fondation input,
.theme-fondation textarea,
.theme-fondation select { background: var(--surface-strong); border-color: var(--border); border-radius: 2px; }
.theme-fondation table { background: var(--surface-strong); }
.theme-fondation th, .theme-fondation td { border-color: var(--border); }
.theme-fondation thead th { font: 500 0.74rem var(--display); letter-spacing: 0.14em; text-transform: uppercase; background: rgba(200, 149, 47, 0.1); color: var(--text); }
.theme-fondation td.check { color: var(--accent); }
.theme-fondation .site-footer { background: rgba(251, 247, 239, 0.6); backdrop-filter: blur(8px); border-top-color: var(--border); }
.theme-fondation .site-footer p { font-size: 0.78rem; letter-spacing: 0.06em; }
.theme-fondation .site-footer p::before { content: "Plan BTS SIO SISR · " / ""; color: var(--accent); text-transform: uppercase; letter-spacing: 0.3em; }

/* =====================================================================
   Cinématique du Radiant (classes posées par fondation.js, uniquement
   si les animations sont autorisées : sans JavaScript, tout reste visible).
   ===================================================================== */

/* 1. Introduction : le Radiant attend d'être activé, puis déploie ses sphères d'équations.
      Durées fournies par fondation.js (variables CSS) : 12 s pour l'introduction complète, 3 s à chaque changement de page. */
.radiant-intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 45%, #fffaf0 0%, #f6f2ea 45%, #e9e0cf 100%);
    perspective: 1000px;
}
.radiant-intro.active { animation: intro-out var(--out-dur, 0.9s) ease-in var(--out-at, 11.1s) forwards; }
.radiant-intro .radiant-core { cursor: pointer; pointer-events: auto; }
.radiant-intro .stage {
    position: relative;
    width: min(70vmin, 560px);
    aspect-ratio: 1;
    transform-style: preserve-3d;
    transform: rotateY(-40deg) rotateX(18deg);
}
.radiant-intro.active .stage { animation: stage-turn var(--turn, 12s) cubic-bezier(0.3, 0.6, 0.2, 1) forwards; }
.radiant-intro .ring { opacity: 0; transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) scale(0.05); }
.radiant-intro.active .ring { animation: ring-open var(--ring-dur, 3.2s) cubic-bezier(0.2, 0.9, 0.2, 1) forwards; animation-delay: var(--delay, 2.4s); }
/* En attente : le Radiant est éteint, il respire à peine */
/* Version courte, à chaque changement de page : pas d'écran d'attente, ni de titre animé */
.radiant-intro.short .gate,
.radiant-intro.short .skip { display: none; }
.radiant-intro.short .title { animation: none; }
.radiant-intro .title {
    position: absolute;
    left: 0;
    right: 0;
    top: 9vh;
    text-align: center;
    font: 400 0.8rem/1.8 var(--display);
    letter-spacing: 0.6em;
    text-transform: uppercase;
    color: var(--text);
    animation: title-in 2s ease-out 0.3s both;
}
.radiant-intro .title span { display: block; color: var(--accent); font-size: 0.68rem; letter-spacing: 0.45em; }
.radiant-intro .gate {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10vh;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1rem;
}
.radiant-intro .gate .hint { flex-basis: 100%; margin: 0.25rem 0 0; text-align: center; font-size: 0.78rem; letter-spacing: 0.08em; color: var(--muted); }
.radiant-intro .activate { background: var(--ink); color: #fbf3e2; border: 1px solid var(--ink); box-shadow: 0 0 0 1px var(--gold), 0 10px 30px rgba(200, 149, 47, 0.35); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.8rem; padding: 0.8rem 1.5rem; }
.radiant-intro .activate:hover { color: var(--glow); }
.radiant-intro .silent { background: transparent; color: var(--text); border: 1px solid rgba(21, 25, 37, 0.3); letter-spacing: 0.1em; font-size: 0.8rem; padding: 0.8rem 1.2rem; }
.radiant-intro.active .gate { animation: gate-out 0.6s ease-in forwards; }
.radiant-intro .skip {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
}
@keyframes core-sleep { 50% { box-shadow: 0 0 0 1px rgba(200, 149, 47, 0.8), 0 0 40px rgba(243, 192, 99, 0.45); } }
@keyframes core-wake {
    0% { transform: rotate(45deg) scale(0.9); box-shadow: 0 0 0 1px rgba(200, 149, 47, 0.5); }
    70% { transform: rotate(45deg) scale(1.08); box-shadow: 0 0 0 1px var(--glow), 0 0 160px 50px rgba(243, 192, 99, 0.9); }
    100% { transform: rotate(45deg) scale(1); box-shadow: 0 0 0 1px var(--gold), 0 0 70px 14px rgba(243, 192, 99, 0.6); }
}
@keyframes ring-open {
    0% { opacity: 0; transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) scale(0.05); }
    25% { opacity: 1; }
    100% { opacity: 1; transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) scale(1); }
}
@keyframes stage-turn { from { transform: rotateY(-40deg) rotateX(18deg); } to { transform: rotateY(40deg) rotateX(6deg); } }
@keyframes title-in { from { opacity: 0; letter-spacing: 1.2em; } to { opacity: 1; letter-spacing: 0.6em; } }
@keyframes gate-out { to { opacity: 0; transform: translateY(12px); visibility: hidden; } }
@keyframes intro-out { to { opacity: 0; transform: scale(1.6); filter: blur(8px); visibility: hidden; } }

/* 2. Déploiement de l'interface : chaque élément est « projeté » par le Radiant */
.fx .fx-item {
    opacity: 0;
    transform: perspective(900px) rotateX(22deg) translateY(28px) scale(0.97);
    transform-origin: 50% 0;
    filter: blur(6px);
}
.fx .fx-item.is-in {
    opacity: 1;
    transform: none;
    filter: none;
    transition: opacity 0.9s ease, transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.9s ease;
    transition-delay: calc(var(--i, 0) * 90ms);
}
/* Éclat doré au moment où un panneau se matérialise */
.fx .card.is-in,
.fx .competence.is-in,
.fx .hero.is-in { animation: materialise 1.6s ease-out calc(var(--i, 0) * 90ms) backwards; }
@keyframes materialise {
    0% { box-shadow: 0 0 0 1px rgba(243, 192, 99, 0), 0 0 0 rgba(243, 192, 99, 0); }
    35% { box-shadow: 0 0 0 1px rgba(243, 192, 99, 0.9), 0 0 40px rgba(243, 192, 99, 0.45); }
    100% { box-shadow: 0 18px 40px rgba(80, 60, 20, 0.07); }
}
/* Les compétences jaillissent du cœur du Radiant */
.fx .radiant .radiant-sphere { transform: scale(0.1); opacity: 0; }
.fx .radiant.is-in .radiant-sphere { transform: none; opacity: 1; transition: transform 1.6s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.8s; }
.fx .radiant-nodes::after { opacity: 0; }
.fx .radiant.is-in .radiant-nodes::after { opacity: 1; transition: opacity 1s 0.9s; }
@media (min-width: 761px) {
    .fx .radiant-nodes li { opacity: 0; transform: rotate(var(--angle)) translateY(0) rotate(calc(-1 * var(--angle))) scale(0.2); }
    .fx .radiant.is-in .radiant-nodes li {
        opacity: 1;
        transform: rotate(var(--angle)) translateY(-262px) rotate(calc(-1 * var(--angle)));
        transition: transform 1.2s cubic-bezier(0.2, 0.9, 0.25, 1.05), opacity 0.6s;
    }
    .fx .radiant.is-in .radiant-nodes li:nth-child(2) { transition-delay: 0.12s; }
    .fx .radiant.is-in .radiant-nodes li:nth-child(3) { transition-delay: 0.24s; }
    .fx .radiant.is-in .radiant-nodes li:nth-child(4) { transition-delay: 0.36s; }
    .fx .radiant.is-in .radiant-nodes li:nth-child(5) { transition-delay: 0.48s; }
    .fx .radiant.is-in .radiant-nodes li:nth-child(6) { transition-delay: 0.6s; }
}

/* ----- Accessibilité et impression ----- */
.a11y-contrast .fondation-scene,
.a11y-contrast .radiant-sphere { display: none; }
.a11y-contrast .theme-fondation { background: #fff; }
.a11y-motion .radiant-intro { display: none; }
@media (prefers-reduced-motion: reduce) {
    .radiant-intro { display: none; }
}
@media print {
    .fondation-scene, .radiant-intro, .radiant-sphere, .radiant-core, .theme-fondation .hero .hero-radiant { display: none; }
    .theme-fondation { background: #fff; }
    .theme-fondation .site-header { position: static; }
    .fx .fx-item, .fx .radiant-nodes li { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* Anneaux de l'introduction plus lumineux, pour bien distinguer l'animation */
.radiant-intro .ring circle { stroke-width: 0.4; opacity: 0.9; }
.radiant-intro .ring circle.dash { stroke-width: 1; opacity: 0.7; }
.radiant-intro .ring text { fill: #8a5a12; font-weight: 600; }
.radiant-intro .ring svg { filter: drop-shadow(0 0 2px rgba(243, 192, 99, 0.8)); }

/* Ouverture du Radiant : la galaxie de particules se forme dans la pièce claire.
   Les étapes suivent la durée de l'introduction (--turn). */
.radiant-galaxy { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.radiant-intro .title, .radiant-intro .gate, .radiant-intro .skip { z-index: 3; }

/* Survol après le déploiement : réaction immédiate, le panneau visé passe devant les autres. */
.fx .fx-item.is-in.settled { transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s, border-color 0.45s, opacity 0.45s, filter 0.45s; transition-delay: 0s; }
.fx .card.is-in:hover,
.fx .card.is-in:focus-within,
.fx .competence.is-in:hover,
.fx .competence.is-in:focus-within { transform: translateY(-8px) scale(1.025); }

/* Passage d'une page à l'autre : la page s'efface pendant que sa poussière (canvas .page-dust) rejoint le Radiant. */
.page-dust, .radiant-galaxy.free { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.page-dust { z-index: 200; }
.radiant-galaxy.free { z-index: 101; }
html.leaving body > *:not(.page-dust) { opacity: 0; transition: opacity 0.25s ease-out; }
/* Introduction courte : prend le relais de la poussière de la page quittée et se dissout sans à-coup pendant que la page se déploie. */
.radiant-intro.short.active { animation: intro-dissolve var(--out-dur, 0.9s) ease-in-out var(--out-at, 2.1s) forwards; }
@keyframes intro-dissolve { to { opacity: 0; transform: scale(1.12); filter: blur(6px); visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
    .theme-fondation .card::after, .theme-fondation .competence::after { animation: none !important; }
}

/* Compétence choisie depuis l'accueil : centrée à l'écran (main.js) et cernée du filet or et argent. */
.theme-fondation .competence:target {
    border-color: transparent;
    background-color: #fffdf8;
    box-shadow: 0 0 0 5px rgba(255, 253, 248, 0.95), 0 0 0 6px #a9aebb, 0 0 46px rgba(243, 192, 99, 0.5), 0 34px 60px rgba(60, 40, 10, 0.3);
}
.theme-fondation .competence:target::after { opacity: 1; animation: filet-sheen 3.5s linear infinite alternate; }
.theme-fondation .competence:target h2 { color: var(--accent); }

/* ----- Supervision : titres en capitales espacées, chiffres en or ----- */
.theme-fondation .sv-panel h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.92rem; }
.theme-fondation .sv-stats dd { font-family: var(--mono); color: var(--accent); }
