*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: #05091a;
  color: #ddeaff;
  overflow-x: hidden;
}
canvas { position: fixed; inset: 0; width: 100%; height: 100%; }

/* ── Portail centré ── */
.portal {
  position: relative; z-index: 10;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem;
}

/* ── Logo ── */
.portal-logo {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; color: inherit;
  margin-bottom: 2rem;
  opacity: 0; animation: fadeUp .7s .1s both;
}
.portal-logo svg { width: 44px; height: 50px; }
.portal-logo span {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em;
}
.portal-logo .c-sys   { color: #0088ff; }
.portal-logo .c-forge { color: #00d4ff; }

/* ── Textes intro ── */
.portal-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .65rem; font-weight: 600;
  letter-spacing: .25em; text-transform: uppercase;
  color: #374d6e;
  margin-bottom: .6rem;
  opacity: 0; animation: fadeUp .7s .2s both;
}
.portal-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 600; text-align: center;
  color: #ddeaff;
  margin-bottom: .5rem;
  opacity: 0; animation: fadeUp .7s .3s both;
}
.portal-sub {
  font-size: .95rem; color: #7a90b8; text-align: center;
  margin-bottom: 3rem;
  opacity: 0; animation: fadeUp .7s .4s both;
}

/* ── Cartes ── */
.portal-cards {
  display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center;
  opacity: 0; animation: fadeUp .7s .55s both;
}
.portal-card {
  position: relative;
  width: 280px;
  background: rgba(7, 16, 35, 0.85);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 2.2rem 2rem;
  cursor: pointer;
  text-decoration: none; color: inherit;
  transition: border-color .25s, transform .45s cubic-bezier(.34,1.4,.64,1), box-shadow .35s, opacity .35s;
  display: flex; flex-direction: column; gap: 1rem;
  backdrop-filter: blur(12px);
}
.portal-card:hover { transform: translateY(-4px); }

.portal-card.pro  { border-color: rgba(0,136,255,.25); }
.portal-card.pro:hover  { border-color: #0088ff; box-shadow: 0 8px 40px rgba(0,136,255,.18); }
.portal-card.part { border-color: rgba(167,139,250,.25); }
.portal-card.part:hover { border-color: #a78bfa; box-shadow: 0 8px 40px rgba(167,139,250,.18); }

/* ── États d'animation au clic ── */
.portal-card.chosen.pro  {
  border-color: #0088ff;
  box-shadow: 0 0 0 4px rgba(0,136,255,.25), 0 12px 60px rgba(0,136,255,.45);
  transform: scale(1.05);
}
.portal-card.chosen.part {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167,139,250,.25), 0 12px 60px rgba(167,139,250,.45);
  transform: scale(1.05);
}
.portal-card.dismissed {
  opacity: 0;
  transform: scale(0.92) translateY(10px);
  pointer-events: none;
}
.portal-cards.animating .portal-label,
.portal-title.fade-out,
.portal-sub.fade-out,
.portal-label.fade-out,
.portal-reset.fade-out {
  opacity: 0 !important;
  transform: translateY(-12px);
  transition: opacity .3s ease, transform .3s ease;
}

/* ── Overlay plein écran ── */
.portal-flash {
  position: fixed;
  border-radius: 50%;
  transform: scale(0);
  z-index: 50;
  pointer-events: none;
  transition: transform .55s cubic-bezier(.4,0,.2,1), opacity .2s ease .45s;
}
.portal-flash.expand { transform: scale(1); }
.portal-flash.fade   { opacity: 0; }

.card-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.pro  .card-icon { background: rgba(0,136,255,.12); }
.part .card-icon { background: rgba(167,139,250,.12); }
.card-icon svg { width: 26px; height: 26px; }

.card-type {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .6rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  margin-bottom: -.5rem;
}
.pro  .card-type { color: #0088ff; }
.part .card-type { color: #a78bfa; }

.card-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.3rem; font-weight: 700;
}
.card-desc { font-size: .88rem; color: #7a90b8; line-height: 1.65; }

.card-tags {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin-top: .25rem;
}
.card-tag { font-size: .7rem; padding: 2px 8px; border-radius: 20px; }
.pro  .card-tag { background: rgba(0,136,255,.12); color: #0088ff; }
.part .card-tag { background: rgba(167,139,250,.12); color: #a78bfa; }

.card-arrow {
  margin-top: auto;
  font-family: 'Chakra Petch', sans-serif;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: center; gap: .4rem;
  transition: gap .2s;
}
.pro  .card-arrow { color: #0088ff; }
.part .card-arrow { color: #a78bfa; }
.portal-card:hover .card-arrow { gap: .7rem; }

/* ── Bouton reset ── */
.portal-reset {
  margin-top: 2.2rem;
  font-size: .75rem; color: #374d6e;
  cursor: pointer; background: none; border: none;
  font-family: inherit; letter-spacing: .05em;
  transition: color .2s;
  opacity: 0; animation: fadeUp .7s .7s both;
}
.portal-reset:hover { color: #7a90b8; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Tablette portrait ── */
@media (max-width: 768px) {
  .portal-cards { gap: 1rem; }
  .portal-card { width: 240px; padding: 1.8rem 1.5rem; }
  .portal-sub { margin-bottom: 2.2rem; }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .portal {
    justify-content: flex-start;
    padding: 2.5rem 1.25rem 2rem;
    min-height: 100svh;
  }
  .portal-logo { margin-bottom: 1.5rem; }
  .portal-logo svg { width: 36px; height: 41px; }
  .portal-logo span { font-size: 1.25rem; }
  .portal-sub { margin-bottom: 1.8rem; font-size: .88rem; }
  .portal-card { width: 100%; max-width: 360px; padding: 1.6rem 1.4rem; }
  .portal-reset { margin-top: 1.5rem; }
}

/* ── Petit mobile ── */
@media (max-width: 400px) {
  .portal { padding: 2rem 1rem 1.5rem; }
  .portal-logo span { font-size: 1.1rem; }
  .portal-title { font-size: 1.4rem; }
  .portal-sub { font-size: .82rem; }
  .card-desc { font-size: .83rem; }
}
