/* ============================================================================
   Cubox — page de téléchargement
   Reprend le « Cubox design system » de Cloudox (cf. Helipix,
   frontend/src/app.css) : bleu électrique + vert émeraude sur navy profond.
   Les variables portent les mêmes noms et les mêmes valeurs, volontairement :
   si la charte bouge, la correspondance reste évidente.
   ============================================================================ */

:root {
  /* Brand */
  --blue:        #2f9bf0;
  --blue-bright: #5cb6ff;
  --cyan:        #22c1e6;
  --green:       #2bd49a;
  --green-bright:#46e6ad;

  /* Navy canvas */
  --bg:        #0a0f1c;
  --surface:   #111c30;
  --surface-2: #16243d;
  --line:      rgba(94, 164, 255, .14);
  --line-soft: rgba(94, 164, 255, .07);
  --glass-bg:  rgba(10, 15, 28, .72);

  /* Text */
  --text:      #e8eefc;
  --text-soft: #9fb3d4;
  --text-fade: #6f86ac;

  /* Semantic */
  --ok:   #2bd49a;
  --warn: #f5b338;
  --err:  #ff5c7a;

  /* Signature gradients + glow */
  --grad:       linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
  --grad-soft:  linear-gradient(135deg, rgba(47, 155, 240, .16), rgba(43, 212, 154, .16));
  --glow-blue:  0 0 0 1px rgba(47, 155, 240, .35), 0 8px 30px rgba(47, 155, 240, .25);

  /* Shape / shadow / motion */
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-full: 999px;
  --sh-2: 0 8px 24px rgba(0, 0, 0, .45);
  --sh-3: 0 18px 50px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur: .22s;

  /* Type — mêmes familles que Helipix. Pas de webfont distante : la CSP
     interdit les origines externes, et une page de téléchargement ne doit
     dépendre de personne pour s'afficher. */
  --ff: 'Space Grotesk', 'DM Sans', system-ui, -apple-system, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: var(--ff);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(47, 155, 240, .18), transparent 60%),
    radial-gradient(900px 520px at -10% 5%, rgba(43, 212, 154, .14), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(34, 193, 230, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue-bright); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--green-bright); }
::selection { background: rgba(47, 155, 240, .35); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: rgba(47, 155, 240, .4) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(47, 155, 240, .32); border-radius: 999px;
  border: 2px solid transparent; background-clip: content-box;
}

h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.4rem); margin-bottom: .75rem; }
h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); margin-bottom: .4rem; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mono { font-family: var(--ff-mono); font-size: .92em; }
.muted { color: var(--text-soft); }
.small { font-size: .875rem; }

/* padding-inline et padding-block SÉPARÉS : un shorthand sur .section
   écraserait la gouttière de .container quand les deux classes cohabitent
   (contenu collé au bord sur mobile). Même piège que dans Helipix. */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(2.5rem, 5vw, 5rem); }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ── Barre du haut ──────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { justify-content: space-between; padding-block: .7rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { border-radius: 8px; }
.brand small {
  display: block; font-size: .62rem; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase; color: var(--green);
}
.nav { gap: 1.25rem; font-size: .95rem; }
.nav a { color: var(--text-soft); }
.nav a:hover { color: var(--text); }
@media (max-width: 720px) { .nav a:not(.btn) { display: none; } }

/* ── Boutons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.25rem; border-radius: var(--r-full);
  font-weight: 600; font-size: .95rem; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad); color: #071322; box-shadow: var(--glow-blue); }
.btn-primary:hover { color: #071322; box-shadow: 0 0 0 1px rgba(47,155,240,.5), 0 12px 38px rgba(47,155,240,.32); }
.btn-outline { border-color: var(--line); background: var(--grad-soft); color: var(--text); }
.btn-outline:hover { color: var(--text); border-color: rgba(94,164,255,.34); }
.btn-ghost { color: var(--text-soft); background: transparent; border-color: var(--line-soft); }
.btn-ghost:hover { color: var(--text); border-color: var(--line); }

/* ── Héros ──────────────────────────────────────────────────────────────── */
.hero { padding-block: clamp(3rem, 8vw, 6.5rem); }
.hero .lead { max-width: 62ch; margin-top: 1rem; font-size: clamp(1rem, .95rem + .3vw, 1.2rem); color: var(--text-soft); }
.hero-actions { margin-top: 2rem; }
.badge {
  display: inline-block; margin-bottom: 1.1rem;
  padding: .3rem .85rem; border-radius: var(--r-full);
  background: var(--grad-soft); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  color: var(--green-bright);
}

/* ── Grilles et cartes ──────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; margin-top: 1.75rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--sh-2);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card p { color: var(--text-soft); }
.card:hover { transform: translateY(-4px); border-color: rgba(94, 164, 255, .3); box-shadow: var(--sh-3); }
.skeleton { opacity: .6; }

/* Carte de téléchargement */
.dl { display: flex; flex-direction: column; gap: .85rem; }
.dl-os { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 700; }
.dl-os .ico { font-size: 1.5rem; line-height: 1; }
.dl-meta { font-family: var(--ff-mono); font-size: .8rem; color: var(--text-fade); }
.dl .btn { width: 100%; }
.dl-hint { font-size: .85rem; color: var(--text-soft); }

/* Étapes */
.step { position: relative; padding-top: 2.5rem; }
.step-n {
  position: absolute; top: 1.25rem; left: 1.5rem;
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--r-full); background: var(--grad); color: #071322;
  font-weight: 700; font-size: .95rem;
}

/* Encadré */
.note {
  margin-top: 1.75rem; padding: 1.25rem 1.4rem;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: rgba(245, 179, 56, .07);
  border-left: 3px solid var(--warn);
}
.note p { color: var(--text-soft); margin-top: .4rem; }
.note-err { background: rgba(255, 92, 122, .08); border-left-color: var(--err); }

/* ── Pied de page ───────────────────────────────────────────────────────── */
.footer {
  margin-top: 3rem; padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  background: rgba(10, 15, 28, .5);
  font-size: .9rem; color: var(--text-soft);
}
.footer p + p { margin-top: .5rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}
