/* pc-ia.cube3d.fr - station IA 4 x RTX 5090
   Palette reprise du rendu Blender : bleu nuit, lisere cyan AORUS, champagne. */

:root {
  --fond:       #0b0e14;
  --fond-doux:  #121826;
  --surface:    #172032;
  --surface-2:  #1e2940;
  --bord:       #2a3752;
  --bord-clair: #3b4c6f;
  --texte:      #e6ecf5;
  --texte-doux: #94a3bd;
  --texte-faible: #6b7b96;
  --cyan:       #38e1ff;
  --cyan-sombre:#0f3f52;
  --champagne:  #e3b878;
  --ombre: 0 18px 48px rgba(0, 0, 0, .55);
  --rayon: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration-color: rgba(56, 225, 255, .35); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--cyan); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); margin-top: 2.2em; }
h3 { font-size: 1.08rem; margin-top: 1.8em; color: var(--cyan); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* ---------- barre de navigation ---------- */

.entete {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.25rem;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(11, 14, 20, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bord);
}
.entete__marque {
  font-weight: 700; letter-spacing: .02em; color: var(--texte);
  text-decoration: none; display: flex; align-items: baseline; gap: .55rem;
  white-space: nowrap;
}
.entete__marque b { color: var(--cyan); font-weight: 700; }
.entete__marque span {
  font-family: var(--mono); font-size: .72rem; color: var(--texte-faible);
  letter-spacing: .06em; text-transform: uppercase;
}
.entete nav { margin-left: auto; display: flex; gap: .25rem; flex-wrap: wrap; }
.entete nav a {
  color: var(--texte-doux); text-decoration: none;
  padding: .35rem .8rem; border-radius: 999px; font-size: .92rem;
  border: 1px solid transparent; transition: color .15s, background .15s, border-color .15s;
}
.entete nav a:hover { color: var(--texte); background: var(--surface); }
.entete nav a[aria-current="page"] {
  color: var(--cyan); border-color: var(--cyan-sombre); background: rgba(56, 225, 255, .07);
}

/* ---------- pages de contenu ---------- */

.page { max-width: 62rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 5rem; }
.page__chapeau { color: var(--texte-doux); font-size: 1.06rem; max-width: 46rem; }

.tableau-enveloppe { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--fond-doux); }
table { border-collapse: collapse; width: 100%; min-width: 42rem; font-size: .93rem; }
thead th {
  text-align: left; padding: .8rem 1rem; background: var(--surface);
  color: var(--cyan); font-weight: 600; font-size: .8rem;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--bord);
}
tbody td { padding: .75rem 1rem; border-bottom: 1px solid rgba(42, 55, 82, .5); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(30, 41, 64, .45); }
td.num, th.num { font-family: var(--mono); font-size: .87rem; white-space: nowrap; }

.encadre {
  border: 1px solid var(--bord); border-left: 3px solid var(--champagne);
  background: var(--fond-doux); border-radius: 0 var(--rayon) var(--rayon) 0;
  padding: 1rem 1.25rem; margin: 1.75rem 0; color: var(--texte-doux); font-size: .95rem;
}
.encadre strong { color: var(--texte); }

.sources { font-size: .9rem; color: var(--texte-doux); }
.sources li { margin-bottom: .45rem; }

.pied {
  border-top: 1px solid var(--bord); margin-top: 3rem;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
  color: var(--texte-faible); font-size: .85rem;
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between;
}

/* ---------- scene : intro video puis visualiseur ---------- */

.scene {
  position: relative;
  height: calc(100dvh - 3.4rem);
  min-height: 30rem;
  background: radial-gradient(120% 90% at 50% 0%, #16203a 0%, var(--fond) 62%);
  overflow: hidden;
}

/* --- intro video --- */

.intro {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  background: #05070c;
  transition: opacity .7s ease, visibility .7s;
}
.intro[hidden] { display: flex; }             /* on gere la sortie en fondu, pas en display */
.intro.est-sortie { opacity: 0; visibility: hidden; pointer-events: none; }

.intro__video {
  flex: 1; min-height: 0; width: 100%;
  object-fit: contain;                        /* la source est en 4:3 (1280 x 960) */
  background: #05070c;
}

.intro__barre {
  position: absolute; inset: auto 0 0 0;
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  background: linear-gradient(to top, rgba(5, 7, 12, .92), rgba(5, 7, 12, 0));
}
.intro__titre {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--texte-doux); margin: 0;
}
.intro__titre b { color: var(--cyan); font-weight: 600; }
.intro__progres {
  flex: 1; height: 3px; border-radius: 2px; overflow: hidden;
  background: rgba(148, 163, 189, .18); max-width: 22rem;
}
.intro__progres i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .2s linear; }

/* --- visualiseur --- */

.viewer { position: absolute; inset: 0; display: flex; }
.viewer__scene { position: relative; flex: 1; min-width: 0; }
.viewer__scene canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.viewer__outils {
  position: absolute; top: 1rem; left: 1rem; z-index: 6;
  display: flex; gap: .4rem; flex-wrap: wrap;
}

.viewer__etat {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 6;
  font-family: var(--mono); font-size: .72rem; color: var(--texte-faible);
  background: rgba(11, 14, 20, .72); border: 1px solid var(--bord);
  border-radius: 8px; padding: .3rem .6rem; backdrop-filter: blur(8px);
}

/* --- panneau des sous-ensembles --- */

.panneau {
  width: 21.5rem; flex: none; display: flex; flex-direction: column;
  background: var(--fond-doux); border-left: 1px solid var(--bord);
  overflow-y: auto; overscroll-behavior: contain;
}
.panneau__tete { padding: 1.1rem 1.25rem .85rem; border-bottom: 1px solid var(--bord); }
.panneau__tete h2 { margin: 0 0 .2rem; font-size: 1rem; }
.panneau__tete p { margin: 0; font-size: .82rem; color: var(--texte-faible); }

.panneau__actions { display: flex; gap: .4rem; padding: .8rem 1.25rem; flex-wrap: wrap; }

.parties { list-style: none; margin: 0; padding: .35rem .75rem 1rem; }
.partie { border-radius: 10px; transition: background .15s; }
.partie:hover { background: var(--surface); }
.partie label {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center;
  gap: .7rem; padding: .6rem .55rem; cursor: pointer;
}
.partie input { position: absolute; opacity: 0; width: 0; height: 0; }
.partie__case {
  width: 18px; height: 18px; border-radius: 5px; flex: none;
  border: 1.5px solid var(--bord-clair); background: var(--surface-2);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.partie__case::after {
  content: ""; width: 10px; height: 10px; transform: scale(0);
  transition: transform .15s cubic-bezier(.3, 1.5, .5, 1);
  background: var(--fond); clip-path: polygon(14% 47%, 0 61%, 39% 100%, 100% 22%, 86% 8%, 38% 71%);
}
.partie input:checked + .partie__case { background: var(--pastille, var(--cyan)); border-color: var(--pastille, var(--cyan)); }
.partie input:checked + .partie__case::after { transform: scale(1); }
.partie input:focus-visible + .partie__case { outline: 2px solid var(--cyan); outline-offset: 2px; }

.partie__pastille { width: 3px; height: 26px; border-radius: 2px; background: var(--pastille, var(--cyan)); opacity: .85; }
.partie__texte { min-width: 0; }
.partie__nom { display: block; font-size: .89rem; line-height: 1.35; }
.partie input:not(:checked) ~ .partie__texte .partie__nom { color: var(--texte-faible); }
.partie__detail { display: block; font-family: var(--mono); font-size: .7rem; color: var(--texte-faible); margin-top: .1rem; }

/* --- boutons --- */

.bouton {
  font: inherit; font-size: .84rem; color: var(--texte);
  background: var(--surface); border: 1px solid var(--bord);
  padding: .42rem .85rem; border-radius: 999px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
}
.bouton:hover { background: var(--surface-2); border-color: var(--bord-clair); }
.bouton--accent { background: var(--cyan); color: #04222c; border-color: var(--cyan); font-weight: 600; }
.bouton--accent:hover { background: #6feaff; border-color: #6feaff; }
.bouton--discret { background: rgba(11, 14, 20, .72); backdrop-filter: blur(8px); }

/* --- chargement et avertissements --- */

.chargement {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-content: center; justify-items: center; gap: 1rem;
  background: var(--fond); text-align: center; padding: 2rem;
  transition: opacity .4s ease, visibility .4s;
}
.chargement.est-sortie { opacity: 0; visibility: hidden; }
.chargement p { margin: 0; color: var(--texte-doux); font-size: .92rem; }
.chargement__barre { width: min(18rem, 60vw); height: 3px; border-radius: 2px; background: rgba(148, 163, 189, .18); overflow: hidden; }
.chargement__barre i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .25s ease; }
.chargement__erreur { color: var(--champagne); max-width: 26rem; }

.bandeau-maquette {
  position: absolute; top: 1rem; right: 1rem; z-index: 7; max-width: 17rem;
  background: rgba(11, 14, 20, .82); backdrop-filter: blur(10px);
  border: 1px solid var(--bord); border-left: 3px solid var(--champagne);
  border-radius: 0 10px 10px 0; padding: .6rem .8rem;
  font-size: .78rem; line-height: 1.45; color: var(--texte-doux);
}
.bandeau-maquette b { color: var(--champagne); display: block; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; }

.mention-portee {
  padding: .8rem 1.25rem 1.4rem; margin-top: auto;
  border-top: 1px solid var(--bord); color: var(--texte-faible);
  font-size: .76rem; line-height: 1.5;
}

/* ---------- adaptation mobile ---------- */

@media (max-width: 860px) {
  .scene { height: auto; min-height: 0; overflow: visible; }
  .intro { position: relative; height: min(70dvh, 26rem); }
  .intro.est-sortie { display: none; }
  .viewer { position: relative; flex-direction: column; }
  .viewer__scene { height: min(62dvh, 30rem); }
  .panneau { width: auto; border-left: 0; border-top: 1px solid var(--bord); max-height: none; }
  .entete nav a { padding: .3rem .6rem; font-size: .85rem; }
  .entete__marque span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- pages machine et budget ---------- */

.machines { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); margin: 2rem 0; }

.machine {
  border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--fond-doux); padding: 1.25rem 1.35rem;
}
.machine--cible { border-color: var(--cyan-sombre); }
.machine h3 { margin: 0 0 .15rem; color: var(--texte); font-size: 1.05rem; }
.machine__role { margin: 0 0 1rem; font-size: .85rem; color: var(--texte-faible); }
.machine__chiffre {
  font-family: var(--mono); font-size: 1.55rem; color: var(--cyan);
  line-height: 1.1; letter-spacing: -.02em;
}
.machine__chiffre small { display: block; font-size: .72rem; color: var(--texte-faible); letter-spacing: .05em; text-transform: uppercase; margin-top: .3rem; }

/* rangee de cartes graphiques : occupees, puis reservees */
.slots { display: flex; gap: .3rem; margin: 1rem 0 .35rem; }
.slot { flex: 1; height: 34px; border-radius: 6px; display: grid; place-items: center; font-family: var(--mono); font-size: .64rem; }
.slot--occupe { background: rgba(56, 225, 255, .14); border: 1px solid var(--cyan-sombre); color: var(--cyan); }
.slot--libre { background: var(--surface); border: 1px dashed var(--bord-clair); color: var(--texte-faible); }
.slots + p { margin: 0; font-size: .78rem; color: var(--texte-faible); }

td.prix, th.prix { text-align: right; font-family: var(--mono); white-space: nowrap; }
tbody tr.total td { border-top: 1px solid var(--bord); font-weight: 600; background: rgba(30, 41, 64, .5); }
tbody tr.total td.prix { color: var(--cyan); }
td.ref { font-family: var(--mono); font-size: .78rem; color: var(--texte-faible); white-space: nowrap; }

.chiffres-cles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin: 1.75rem 0; }
.chiffre {
  border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--fond-doux); padding: 1rem 1.1rem;
}
.chiffre b { display: block; font-family: var(--mono); font-size: 1.4rem; color: var(--cyan); letter-spacing: -.02em; }
.chiffre span { display: block; font-size: .8rem; color: var(--texte-doux); margin-top: .25rem; line-height: 1.4; }

.fournisseurs { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .55rem; }
.fournisseurs li {
  border-left: 2px solid var(--bord-clair); padding: .1rem 0 .1rem .85rem;
  font-size: .9rem; color: var(--texte-doux);
}
.fournisseurs b { color: var(--texte); font-weight: 600; }
.fournisseurs .rupture { color: var(--champagne); }

/* Sous 560 px, cinq entrees ne tiennent plus a cote de la marque : on empile. */
@media (max-width: 560px) {
  .entete { flex-wrap: wrap; gap: .55rem; }
  .entete__marque { width: 100%; }
  .entete nav { margin-left: 0; }
  .chiffres-cles, .machines { gap: .75rem; }
}
