/* ============================================================================
   HUB — landing plateforme Fact Hack (selecteur d'outils, au DS Editorial Arena).
   Shell no-scroll : une vue = un viewport ; defilement interne uniquement si besoin.
   ============================================================================ */

.hub {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(1.5rem, 4vh, 3rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  overflow-y: auto;
  text-align: center;
}

/* Illustration hub — platform/images/hub/stage.webp (parité PickPol intro-stage). */
.hub::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/platform/images/hub/stage.webp") center / cover no-repeat;
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

/* Voile papier : lisibilité du hero et des cartes outils sur l'illustration */
.hub::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--paper) 8%, transparent) 0%,
      color-mix(in srgb, var(--paper) 20%, transparent) 42%,
      color-mix(in srgb, var(--paper) 32%, transparent) 100%
    ),
    radial-gradient(
      ellipse 90% 70% at 50% 38%,
      color-mix(in srgb, var(--paper) 40%, transparent),
      transparent 72%
    );
  pointer-events: none;
  z-index: 1;
}

.hub > * {
  position: relative;
  z-index: 2;
}

.hub-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 48ch;
}

.hub-logo { height: clamp(48px, 8vh, 76px); width: auto; }

/* ─── Accès admin discret (flip logo → shield-cog, hub-admin-gate.js) */
.hub-brand-gate {
  --hub-gate-size: clamp(76px, 15vw, 104px);
  width: var(--hub-gate-size);
  height: var(--hub-gate-size);
  perspective: 900px;
  flex-shrink: 0;
}

.hub-brand-gate-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.hub-brand-gate--revealed .hub-brand-gate-inner {
  transform: rotateY(180deg);
}

.hub-brand-gate-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xs);
}

.hub-brand-gate-face--logo {
  transform: rotateY(0deg);
}

.hub-brand-gate-face--logo.shell-brand {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.hub-brand-gate-face--logo.shell-brand:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(21, 17, 14, 0.14);
}

.hub-brand-gate-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hub-brand-gate-face--admin {
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid rgba(21, 17, 14, 0.14);
}

.hub-brand-gate-admin {
  width: calc(var(--hub-gate-size) - 12px);
  height: calc(var(--hub-gate-size) - 12px);
  color: var(--text-faint);
}

.hub-brand-gate--revealed .hub-brand-gate-admin {
  color: var(--seam);
  border-color: rgba(228, 0, 43, 0.22);
  background: rgba(228, 0, 43, 0.06);
}

.hub-brand-gate--revealed .hub-brand-gate-admin:hover,
.hub-brand-gate--revealed .hub-brand-gate-admin:focus-visible {
  color: var(--seam);
  border-color: var(--seam);
  background: rgba(228, 0, 43, 0.1);
}

.hub-brand-gate--pinned {
  outline: 2px solid rgba(228, 0, 43, 0.18);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
}

@media (prefers-reduced-motion: reduce) {
  .hub-brand-gate-inner {
    transition: none;
  }

  .hub-brand-gate:not(.hub-brand-gate--revealed) .hub-brand-gate-face--admin {
    opacity: 0;
    visibility: hidden;
  }

  .hub-brand-gate--revealed .hub-brand-gate-face--logo {
    opacity: 0;
    visibility: hidden;
  }

  .hub-brand-gate--revealed .hub-brand-gate-face--admin {
    opacity: 1;
    visibility: visible;
    transform: none;
    position: static;
  }

  .hub-brand-gate--revealed .hub-brand-gate-inner {
    transform: none;
  }
}

.hub-title { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.02; }

.hub-lead {
  color: var(--text-dim);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  max-width: 42ch;
}

.hub-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
  width: min(100%, 760px);
  list-style: none;
}

@media (max-width: 640px) {
  .hub-tools { grid-template-columns: 1fr; }
}

.hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-ink);
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s,
    border-color 0.25s;
}

a.hub-card:hover,
a.hub-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}

.hub-card-kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seam);
}

.hub-card-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  letter-spacing: -0.02em;
}

.hub-card-desc {
  color: var(--text-ink-dim);
  font-size: 0.92rem;
  line-height: 1.45;
}

.hub-card-cta {
  margin-top: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
}

.hub-card--soon { opacity: 0.6; cursor: not-allowed; }
.hub-card--soon .hub-card-cta { color: var(--text-faint); }

.hub-foot {
  color: var(--text-faint);
  font-size: 0.78rem;
}
