/* =========================================================================
   AEGIS — Page d'accueil
   ========================================================================= */

/* --------------------------------------------------------------- Hero */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 70px);
  padding-bottom: 40px;
  text-align: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 760px;
  z-index: -1;
  pointer-events: none;
}
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: float 14s var(--ease-soft) infinite;
}
.hero__blob.b1 { width: 460px; height: 460px; left: 8%; top: 40px;
  background: radial-gradient(circle, rgba(88,101,242,0.55), transparent 70%); }
.hero__blob.b2 { width: 380px; height: 380px; right: 10%; top: 0;
  background: radial-gradient(circle, rgba(139,92,246,0.45), transparent 70%); animation-delay: -5s; }
.hero__blob.b3 { width: 320px; height: 320px; left: 44%; top: 200px;
  background: radial-gradient(circle, rgba(236,72,153,0.30), transparent 70%); animation-delay: -9s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -28px) scale(1.06); }
  66% { transform: translate(-24px, 20px) scale(0.96); }
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding-inline: 8px 16px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 30px;
}
.hero__pill .tag {
  display: inline-flex; align-items: center;
  height: 22px; padding-inline: 9px;
  border-radius: var(--r-pill);
  background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.9rem, 8vw, 6rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}
/* padding-bottom : évite que les descendantes (g, p…) soient rognées sous le
   dégradé (background-clip: text clipe au ras de la ligne sinon). */
.hero h1 .line { display: block; padding-bottom: 0.06em; }

.hero__sub {
  max-width: 600px;
  margin: 26px auto 0;
  font-size: clamp(1.1rem, 2.1vw, 1.4rem);
  color: var(--text-secondary);
  line-height: 1.45;
}

.hero__cta {
  margin-top: 38px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__stats {
  margin-top: 64px;
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 72px);
  flex-wrap: wrap;
}
.hero__stat .n {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 680;
  letter-spacing: -0.04em;
  background: linear-gradient(160deg, var(--text), #5b5b61);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__stat .l {
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--text-tertiary);
}

/* Vitrine Discord du hero */
.hero__showcase {
  margin: 70px auto 0;
  max-width: 880px;
  perspective: 1600px;
}
.hero__window {
  transform: rotateX(7deg);
  transform-origin: center bottom;
  border-radius: var(--r-lg);
  box-shadow: 0 40px 90px -30px rgba(20, 20, 50, 0.4), var(--shadow-lg);
  transition: transform 0.8s var(--ease);
}

/* --------------------------------------------------- Mock Discord (réutilisé) */
.discord {
  display: grid;
  grid-template-columns: 64px 220px 1fr;
  height: 440px;
  background: #313338;
  border-radius: var(--r-lg);
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(0,0,0,0.4);
  font-size: 14px;
}
.discord__rail {
  background: #1e1f22;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.discord__server {
  width: 44px; height: 44px;
  border-radius: 16px;
  background: #5865f2;
  display: grid; place-items: center;
  color: #fff; font-weight: 700;
  transition: border-radius 0.2s;
}
.discord__server.muted { background: #313338; border-radius: 50%; }
.discord__rail .sep { width: 28px; height: 2px; background: #313338; border-radius: 2px; }

.discord__channels { background: #2b2d31; padding: 16px 8px; color: #949ba4; }
.discord__guild {
  font-weight: 650; color: #f2f3f5; font-size: 15px;
  padding: 4px 8px 14px; border-bottom: 1px solid rgba(0,0,0,0.2); margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.discord__cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 8px 4px; font-weight: 600; }
.discord__chan {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 6px; margin-bottom: 1px;
}
.discord__chan.active { background: #404249; color: #f2f3f5; }
.discord__chan .hash { color: #80848e; font-weight: 600; }

.discord__main { background: #313338; display: flex; flex-direction: column; }
.discord__topbar {
  height: 48px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding-inline: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.2);
  color: #f2f3f5; font-weight: 600;
}
.discord__topbar .hash { color: #80848e; }
.discord__chat {
  flex: 1; padding: 18px 16px; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
}
.dm-row { display: flex; gap: 14px; }
.dm-av {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.dm-av.bot { background: linear-gradient(135deg, #5865f2, #8b5cf6); }
.dm-av.u1 { background: #43b581; }
.dm-av.u2 { background: #faa61a; }
.dm-body { min-width: 0; }
.dm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.dm-name { color: #f2f3f5; font-weight: 600; }
.dm-bot-tag {
  background: #5865f2; color: #fff; font-size: 10px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px; letter-spacing: 0.02em;
}
.dm-time { color: #949ba4; font-size: 11px; }
.dm-text { color: #dbdee1; line-height: 1.4; }
.dm-cmd { color: #c9cdfb; background: rgba(88,101,242,0.16); padding: 1px 5px; border-radius: 4px; font-weight: 500; }

/* Embed */
.embed {
  margin-top: 8px;
  border-left: 4px solid var(--ec, #5865f2);
  background: #2b2d31;
  border-radius: 4px;
  padding: 13px 16px 14px;
  max-width: 440px;
}
.embed__author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.embed__author .ic { width: 22px; height: 22px; border-radius: 50%; background: var(--ec, #5865f2); display: grid; place-items: center; font-size: 12px; }
.embed__title { color: #f2f3f5; font-weight: 650; font-size: 15px; margin-bottom: 6px; }
.embed__desc { color: #dbdee1; font-size: 13.5px; line-height: 1.45; }
.embed__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-top: 12px; }
.embed__field .k { color: #f2f3f5; font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.embed__field .v { color: #b5bac1; font-size: 13px; }
.embed__footer { margin-top: 12px; color: #949ba4; font-size: 11.5px; display: flex; align-items: center; gap: 6px; }

/* --------------------------------------------------- Scrollytelling */
.scrolly { position: relative; }
.scrolly__inner { position: relative; height: 460vh; }
.scrolly__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.scrolly__copy { position: relative; }
.scrolly__scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
.scrolly__scene.active { opacity: 1; transform: none; position: relative; pointer-events: auto; }
.scrolly__icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: grid; place-items: center;
  margin-bottom: 22px;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.scrolly__icon svg { width: 28px; height: 28px; }
.scrolly__scene h3 {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  letter-spacing: -0.035em;
  margin-bottom: 16px;
}
.scrolly__scene p { color: var(--text-secondary); font-size: 1.15rem; line-height: 1.5; max-width: 440px; }
.scrolly__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.scrolly__visual {
  position: relative;
  height: 460px;
}
.scrolly__card {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s var(--ease-soft), transform 0.5s var(--ease);
  pointer-events: none;
}
.scrolly__card.active { opacity: 1; transform: none; pointer-events: auto; z-index: 2; }
/* 2 colonnes seulement : rail + zone principale (pas de liste de salons ici).
   3 pistes provoquaient le placement du panneau dans une colonne de largeur 0. */
.scrolly__card .discord { height: 460px; grid-template-columns: 52px 1fr; }
.scrolly__card .discord__channels { display: none; }
.scrolly__card .discord__main { grid-column: 2; }

/* --------------------------------------------------- Bento fonctionnalités */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  margin-top: 56px;
}
.bento__item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px;
  grid-column: span 2;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.bento__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.bento__item.wide { grid-column: span 3; }
.bento__item.tall { grid-row: span 2; }
.bento__ic {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  margin-bottom: 20px;
}
.bento__ic svg { width: 24px; height: 24px; }
.bento__item h3 { font-size: 1.3rem; letter-spacing: -0.025em; margin-bottom: 8px; }
.bento__item p { color: var(--text-secondary); font-size: 0.98rem; line-height: 1.5; }
.bento__cmds { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.cmd-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* --------------------------------------------------- Langues */
.langs { overflow: hidden; }
.langs__track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.langs__row:nth-child(2) .langs__track { animation-duration: 52s; animation-direction: reverse; }
.langs__row { margin-bottom: 14px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.lang-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  border-radius: var(--r-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-weight: 540;
  white-space: nowrap;
}
.lang-chip .fl { font-size: 1.3rem; }
.lang-chip .co { color: var(--text-tertiary); font-size: 0.82rem; font-family: var(--font-mono); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --------------------------------------------------- Responsive accueil */
@media (max-width: 900px) {
  .scrolly__sticky { grid-template-columns: 1fr; gap: 24px; }
  .scrolly__visual { height: 380px; order: -1; }
  .scrolly__card .discord { height: 360px; }
  .bento__item, .bento__item.wide { grid-column: span 3; }
  .bento { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .hero__showcase { margin-top: 48px; }
  .hero__window { transform: none; }
  .discord { grid-template-columns: 52px 1fr; height: 400px; }
  .discord__channels { display: none; }
  .bento { grid-template-columns: 1fr; }
  .bento__item, .bento__item.wide, .bento__item.tall { grid-column: span 1; grid-row: span 1; }
  .scrolly__visual { height: 340px; }
  .scrolly__card .discord { height: 340px; }
}
