/* Page d'accueil publique — vitrine "LSFD". Palette alignée sur assets/css/app.css. */

:root {
  --accent: #D62F37;
  --accent-2: #F0642B;
  --accent-ink: #ffffff;
  --accent-soft: rgba(214, 47, 55, .14);
  --accent-line: rgba(214, 47, 55, .38);
  --accent-glow: rgba(214, 47, 55, .30);
  --gold: #D9AE5B;
  --gold-2: #A87E34;

  --bg: #080a11;
  --bg-2: #0c0f19;
  --bg-3: #141a2a;
  --surface: #10141f;
  --border: #252a38;
  --border-2: #342f28;
  --text: #f5f1e8;
  --text-2: #b9b3a6;
  --text-3: #7c7a74;
  --display: 'Oswald', 'Arial Narrow', sans-serif;

  --r: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.hp {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.hp-nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.hp-nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.hp-nav__in {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hp-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 2px; color: var(--gold); }
/* Logo réel de la nav : sert de repère de position/taille au logo flottant
   (#hpFloatLogo, voir le script en bas de page) qui vient s'aligner dessus au
   scroll, puis reste affiché tel quel si l'animation ne tourne pas. */
.hp-brand__logo { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--border-2); color: var(--text-2);
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hp-hero {
  position: relative;
  min-height: min(78vh, 620px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px 70px;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 0%, transparent 55%, var(--bg) 100%),
    repeating-linear-gradient(135deg, rgba(217, 174, 91, .035) 0 2px, transparent 2px 22px),
    radial-gradient(120% 90% at 50% 0%, #2a0e14 0%, #12152a 55%, var(--bg) 100%);
}
.hp-hero__glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(680px circle at 50% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px circle at 85% 110%, rgba(240, 100, 43, .14), transparent 60%),
    radial-gradient(900px circle at 5% 110%, rgba(28, 44, 94, .45), transparent 60%);
}
/* Logo réel du hero : point de départ (grand format) du logo flottant, et solution
   de repli statique si l'animation ne tourne pas (voir .hp-brand__logo). */
.hp-hero__logo {
  position: relative; z-index: 1;
  display: block; margin: 0 auto 8px;
  width: min(220px, 42vw); height: auto; object-fit: contain;
  filter: drop-shadow(0 20px 50px rgba(214, 47, 55, .35));
}

/* Le VRAI logo visible : une seule image, fixe à l'écran, que le JS déplace et
   redimensionne entre le hero et la nav selon le scroll (voir script en bas de page). */
.hp-float-logo {
  position: fixed; top: 0; left: 0; z-index: 25;
  object-fit: contain; pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
  filter: drop-shadow(0 20px 50px rgba(214, 47, 55, .35));
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.hp-float-logo.is-ready { opacity: 1; }
.hp-hero h1 {
  position: relative; z-index: 1;
  margin: 4px 0 0; font-family: var(--display); font-size: clamp(40px, 7vw, 68px); font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  background: linear-gradient(180deg, #f7e3b0, var(--gold) 55%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hp-hero__tag {
  position: relative; z-index: 1;
  margin: 10px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent);
}
.hp-hero__lead {
  position: relative; z-index: 1;
  margin: 14px 0 0; max-width: 520px; color: var(--text-2); font-size: 16px; line-height: 1.6;
}
.btn-cta {
  position: relative; z-index: 1;
  margin-top: 30px; display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 12px; font-weight: 700; font-size: 14px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  box-shadow: 0 8px 30px var(--accent-soft);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 38px var(--accent-glow); }

/* ── Sections ───────────────────────────────────────────────────────────── */
.hp-main { max-width: 880px; margin: 0 auto; padding: 10px 24px 40px; }
.hp-section {
  padding: 56px 0; border-top: 1px solid var(--border);
}
.hp-section:first-child { border-top: none; }
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
.hp-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.hp-section h2 { margin: 0 0 16px; font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; line-height: 1.3; letter-spacing: -.3px; }
.hp-text { margin: 0 0 8px; color: var(--text-2); font-size: 15.5px; line-height: 1.7; max-width: 68ch; }
.hp-empty { font-style: italic; }

.hp-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hp-sec-note { display: block; margin: -8px 0 20px; color: var(--text-3); font-size: 13px; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.hp-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px;
}
.hp-stat {
  padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.hp-stat b { font-size: clamp(22px, 3.2vw, 30px); font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.hp-stat span { color: var(--text-3); font-size: 12.5px; }
.hp-stat--accent { border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-soft), transparent); }
.hp-stat--accent b { color: var(--accent); }

/* ── Steps ──────────────────────────────────────────────────────────────── */
.hp-steps { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.hp-steps li {
  position: relative; padding: 16px 18px 16px 52px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 14.5px; line-height: 1.6;
  counter-increment: step;
}
.hp-steps li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 16px; width: 24px; height: 24px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 12.5px;
  display: grid; place-items: center;
}
.hp-steps b { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 13.5px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.btn-join { border-color: transparent; background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--accent-ink); box-shadow: 0 8px 26px var(--accent-soft); }
.btn-join:hover { color: var(--accent-ink); }

/* ── Avatars (rendus par avatarTag()) ──────────────────────────────────────*/
.avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border-2); background: var(--bg-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--text-2);
}

/* ── Podium ─────────────────────────────────────────────────────────────── */
.hp-podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; margin-bottom: 18px;
}
.hp-podium__step {
  padding: 22px 14px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hp-podium__step .avatar { width: 56px; height: 56px; margin-bottom: 6px; transition: transform .25s var(--ease); }
.hp-podium__step:hover .avatar { transform: scale(1.06); }
.hp-podium__step--r1 { border-color: var(--accent-line); background: linear-gradient(165deg, var(--accent-soft), var(--surface) 60%); order: 2; padding-top: 10px; transform: translateY(-10px); }
.hp-podium__step--r1 .avatar { width: 68px; height: 68px; border-color: #ffd35c; box-shadow: 0 0 0 4px rgba(255, 211, 92, .18); }
.hp-podium__step--r2 { order: 1; }
.hp-podium__step--r2 .avatar { border-color: #c9d3e0; box-shadow: 0 0 0 4px rgba(201, 211, 224, .14); }
.hp-podium__step--r3 { order: 3; }
.hp-podium__step--r3 .avatar { border-color: #d99a5b; box-shadow: 0 0 0 4px rgba(217, 154, 91, .14); }
.hp-podium__rank { font-size: 26px; line-height: 1; }
.hp-podium__name { font-weight: 700; font-size: 14.5px; }
.hp-podium__grade { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; }
.hp-podium__pts { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.hp-podium__pts b { color: var(--text); }
.hp-podium__prime { font-size: 13px; font-weight: 700; color: var(--accent); }

/* ── Board (rangs 4+) ───────────────────────────────────────────────────── */
.hp-board { display: flex; flex-direction: column; gap: 8px; }
.hp-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.hp-row:hover { border-color: var(--border-2); transform: translateX(2px); }
.hp-row__rank { width: 22px; flex-shrink: 0; text-align: center; color: var(--text-3); font-weight: 700; font-size: 13px; }
.hp-row .avatar { width: 36px; height: 36px; flex-shrink: 0; }
.hp-row__who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-row__name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-row__grade { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.hp-row__figs { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.hp-row__courses { font-size: 12.5px; color: var(--text-2); }
.hp-row__courses i { font-style: normal; color: var(--text-3); margin-left: 3px; }
.hp-row__prime { font-size: 12.5px; font-weight: 700; color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.hp-footer {
  max-width: 880px; margin: 0 auto; padding: 24px 24px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border);
}
.hp-footer a:hover { color: var(--accent); }

/* ── Modal barème ───────────────────────────────────────────────────────── */
.hp-modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(4, 5, 9, .72); backdrop-filter: blur(4px); padding: 20px;
}
.hp-modal[hidden] { display: none; }
.hp-modal__card {
  position: relative; width: 100%; max-width: 420px; padding: 28px;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
}
.hp-modal__card h2 { margin: 0 0 16px; font-size: 18px; font-weight: 800; }
.hp-modal__close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-3); color: var(--text-2); cursor: pointer;
}
.hp-modal__close:hover { color: var(--accent); border-color: var(--accent-line); }
.hp-bareme-list { display: flex; flex-direction: column; gap: 8px; }
.hp-bareme-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border);
  font-size: 13.5px;
}
.hp-bareme-row__grade { font-weight: 600; }
.hp-bareme-row__taux { color: var(--accent); font-weight: 700; }
.hp-modal__note { margin: 16px 0 0; color: var(--text-3); font-size: 12px; line-height: 1.6; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hp-stats { grid-template-columns: 1fr; }
  .hp-podium { grid-template-columns: 1fr; }
  .hp-podium__step--r1, .hp-podium__step--r2, .hp-podium__step--r3 { order: initial; transform: none; }
  .hp-row__figs { align-items: flex-end; }
}

/* ── Accessibilité : moins de mouvement ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hp-float-logo, [data-reveal], .hp-nav, .hp-row, .hp-podium__step .avatar, .btn, .btn-cta, .btn-ghost {
    transition: none !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* LSFD : le blason est rond */
.hp-hero__logo, .hp-float-logo { border-radius: 50%; }
