/* ── Page Hiérarchie EMS — timeline par paliers ── */

body.home-page--hierarchie {
  background: #2a1420;
}

.hierarchie-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hierarchie-bg-photo {
  position: absolute;
  inset: -4%;
  background: url('../assets/home-hero-bg.jpg') center 38% / cover no-repeat;
  transform: scale(1.07);
  filter: saturate(1.1) brightness(0.8) contrast(1.04);
  animation: hier-bg-photo-drift 26s ease-in-out infinite alternate;
}

@keyframes hier-bg-photo-drift {
  from { transform: scale(1.07) translate(0, 0); }
  to   { transform: scale(1.11) translate(-1.5%, 0.8%); }
}

.hierarchie-bg-mesh {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(92, 34, 69, 0.55) 0%, rgba(196, 77, 138, 0.38) 45%, rgba(74, 48, 64, 0.6) 100%),
    linear-gradient(25deg, rgba(248, 212, 228, 0.2) 0%, transparent 40%);
}

.hierarchie-bg-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
  opacity: 0.2;
}

/* Bulles dégradé rose → violet */
.hierarchie-bubble {
  position: absolute;
  filter: blur(50px);
  opacity: 0.68;
  pointer-events: none;
}

.hierarchie-bubble--1 {
  width: 420px;
  height: 340px;
  top: -5%;
  left: -12%;
  border-radius: 62% 38% 55% 45% / 50% 58% 42% 50%;
  background: linear-gradient(130deg, #f8d4e4 0%, #e889b4 30%, #c44d8a 60%, #7a2d5c 100%);
  animation: hier-bubble-a 19s ease-in-out infinite;
}

.hierarchie-bubble--2 {
  width: 360px;
  height: 280px;
  top: 28%;
  right: -14%;
  border-radius: 40% 60% 65% 35% / 58% 42% 58% 42%;
  background: linear-gradient(215deg, #ecc4d8 0%, #c44d8a 45%, #5c2245 100%);
  animation: hier-bubble-b 22s ease-in-out infinite reverse;
}

.hierarchie-bubble--3 {
  width: 240px;
  height: 240px;
  bottom: 22%;
  left: 6%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5d4e4 0%, #e889b4 40%, #7a2d5c 100%);
  filter: blur(42px);
  opacity: 0.6;
  animation: hier-bubble-c 14s ease-in-out infinite;
}

.hierarchie-bubble--4 {
  width: 200px;
  height: 360px;
  bottom: -4%;
  right: 18%;
  border-radius: 48% 52% 35% 65% / 42% 58% 42% 58%;
  background: linear-gradient(175deg, #e889b4 0%, #923c72 50%, #4a3040 100%);
  animation: hier-bubble-a 21s ease-in-out infinite reverse;
  animation-delay: -7s;
}

.hierarchie-bubble--5 {
  width: 160px;
  height: 160px;
  top: 52%;
  left: 48%;
  border-radius: 55% 45% 50% 50% / 45% 55% 45% 55%;
  background: linear-gradient(90deg, #c44d8a 0%, #7a2d5c 50%, #c44d8a 100%);
  filter: blur(35px);
  opacity: 0.5;
  animation: hier-bubble-c 12s ease-in-out infinite reverse;
}

@keyframes hier-bubble-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%       { transform: translate(24px, -20px) rotate(5deg); }
}

@keyframes hier-bubble-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(-30px, 16px) scale(1.07); }
}

@keyframes hier-bubble-c {
  0%, 100% { transform: translate(0, 0); }
  33%       { transform: translate(14px, 18px); }
  66%       { transform: translate(-12px, -14px); }
}

body.home-page--hierarchie .home-topbar,
body.home-page--hierarchie .home-inner,
body.home-page--hierarchie .home-footer {
  position: relative;
  z-index: 1;
}

body.home-page--hierarchie .home-topbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(196, 77, 138, 0.2);
}

body.home-page--hierarchie .home-back {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

body.home-page--hierarchie .home-footer p {
  color: rgba(255, 255, 255, 0.8);
}

body.home-page--hierarchie .home-footer .footer-line {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
}

.home-inner--wide {
  max-width: 960px;
  padding-top: 5rem;
}

/* Hero bandeau */
.hierarchie-hero {
  margin-bottom: 2.5rem;
  padding: 2rem 1.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--plum) 0%, #9e3d72 55%, var(--rose) 100%);
  color: #fff;
  box-shadow: 0 12px 40px rgba(122, 45, 92, 0.28);
  overflow: hidden;
  position: relative;
}

.hierarchie-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.hierarchie-hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.5rem;
}

.hierarchie-hero h1 {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.45rem;
}

.hierarchie-hero-lead {
  font-size: 0.95rem;
  opacity: 0.9;
  font-weight: 500;
}

/* Timeline */
.hierarchie-timeline {
  position: relative;
  padding-left: 2.5rem;
}

.hierarchie-timeline::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.65rem;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--plum) 0%, var(--rose) 45%, var(--rose-light) 75%, var(--text-muted) 100%);
  opacity: 0.35;
}

.hier-tier {
  position: relative;
  margin-bottom: 2.25rem;
}

.hier-tier:last-child {
  margin-bottom: 0;
}

.hier-tier-label {
  position: sticky;
  top: 4.5rem;
  z-index: 5;
  display: inline-block;
  margin: 0 0 1.1rem -2.5rem;
  padding: 0.4rem 1rem 0.4rem 2.5rem;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  border-radius: 0 100px 100px 0;
  box-shadow: 0 4px 16px rgba(122, 45, 92, 0.2);
}

.hier-tier--cmd .hier-tier-label { background: var(--plum); }
.hier-tier--para .hier-tier-label { background: var(--rose); }
.hier-tier--emt .hier-tier-label  { background: #d66a9a; }
.hier-tier--base .hier-tier-label { background: var(--text-muted); }

.hier-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

.hier-row:last-child {
  margin-bottom: 0;
}

.hier-row-dot {
  width: 14px;
  height: 14px;
  margin-top: 1.15rem;
  margin-left: -2.15rem;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--rose);
  box-shadow: 0 0 0 4px rgba(196, 77, 138, 0.15);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  z-index: 2;
}

.hier-tier--cmd .hier-row-dot { border-color: var(--plum); box-shadow: 0 0 0 4px rgba(122, 45, 92, 0.15); }
.hier-tier--para .hier-row-dot { border-color: var(--rose); }
.hier-tier--emt .hier-row-dot  { border-color: #d66a9a; box-shadow: 0 0 0 4px rgba(214, 106, 154, 0.15); }
.hier-tier--base .hier-row-dot { border-color: var(--text-muted); box-shadow: 0 0 0 4px rgba(138, 90, 114, 0.15); }

.hier-row-panel {
  position: relative;
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(196, 77, 138, 0.26) 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(122, 45, 92, 0.2) 0%, transparent 45%),
    linear-gradient(145deg, #fff9fc 0%, #fce4ef 30%, #f5cce0 65%, #ecc4d8 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(196, 77, 138, 0.25);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  box-shadow:
    0 4px 20px rgba(122, 45, 92, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.35s ease,
    background 0.4s ease;
  overflow: hidden;
}

.hier-tier--cmd .hier-row-panel {
  background:
    radial-gradient(ellipse 75% 65% at 100% 0%, rgba(122, 45, 92, 0.3) 0%, transparent 50%),
    linear-gradient(145deg, #fff8fb 0%, #f5d0e4 40%, #e8aac8 100%);
}

.hier-tier--para .hier-row-panel {
  background:
    radial-gradient(ellipse 75% 65% at 0% 0%, rgba(196, 77, 138, 0.28) 0%, transparent 48%),
    linear-gradient(145deg, #fff9fc 0%, #fad8ea 45%, #f0b8d0 100%);
}

.hier-tier--emt .hier-row-panel {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(214, 106, 154, 0.25) 0%, transparent 50%),
    linear-gradient(145deg, #fff9fc 0%, #fce0ee 50%, #f5c8dc 100%);
}

.hier-tier--base .hier-row-panel {
  background:
    radial-gradient(ellipse 65% 55% at 100% 100%, rgba(138, 90, 114, 0.2) 0%, transparent 45%),
    linear-gradient(145deg, #faf6f8 0%, #f0e0e8 50%, #e8d4de 100%);
}

.hier-row-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--rose);
  border-radius: 14px 0 0 14px;
  transform: scaleY(0);
  transform-origin: center top;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hier-tier--cmd .hier-row-panel::before { background: var(--plum); }
.hier-tier--para .hier-row-panel::before { background: var(--rose); }
.hier-tier--emt .hier-row-panel::before  { background: #d66a9a; }
.hier-tier--base .hier-row-panel::before { background: var(--text-muted); }

.hier-row-title {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--plum);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  transition: color 0.3s ease, transform 0.35s ease;
}

.hier-row-text {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--text-soft);
  line-height: 1.65;
  margin: 0;
  transition: color 0.3s ease;
}

/* Hover */
.hier-row:hover .hier-row-dot {
  transform: scale(1.35);
  box-shadow: 0 0 0 6px rgba(196, 77, 138, 0.25);
}

.hier-row:hover .hier-row-panel {
  transform: translateX(8px);
  box-shadow: 0 10px 32px rgba(122, 45, 92, 0.2);
  border-color: rgba(196, 77, 138, 0.4);
  background:
    radial-gradient(ellipse 85% 75% at 100% 0%, rgba(196, 77, 138, 0.35) 0%, transparent 52%),
    radial-gradient(ellipse 75% 65% at 0% 100%, rgba(122, 45, 92, 0.28) 0%, transparent 48%),
    linear-gradient(145deg, #fff5fa 0%, #fad4e8 35%, #efb0d0 70%, #e095bc 100%);
}

.hier-row:hover .hier-row-panel::before {
  transform: scaleY(1);
}

.hier-row:hover .hier-row-title {
  color: var(--rose);
  transform: translateX(4px);
}

.hier-row:hover .hier-row-text {
  color: var(--plum);
}

/* Notre équipe — organigramme */
.hier-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.hier-switch[hidden] {
  display: none;
}

.hier-switch a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(196, 77, 138, 0.28);
}

.hier-switch a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--plum) 0%, var(--rose) 100%);
  border-color: transparent;
}

.hier-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.hier-picker-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.35rem 1.25rem;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(196, 77, 138, 0.26) 0%, transparent 50%),
    linear-gradient(145deg, #fff9fc 0%, #fce4ef 40%, #f5cce0 100%);
  border: 1px solid rgba(196, 77, 138, 0.28);
  box-shadow: 0 8px 24px rgba(122, 45, 92, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hier-picker-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(122, 45, 92, 0.2);
}

.hier-picker-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
}

.hier-picker-card strong {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.45rem;
  color: var(--plum);
}

.hier-picker-card span:last-child {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-soft);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .hier-picker-grid {
    grid-template-columns: 1fr;
  }
}

.hier-team {
  margin-top: 0;
  padding: 1.5rem 1.15rem 1.75rem;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 249, 252, 0.88) 0%, rgba(252, 228, 239, 0.78) 100%);
  border: 1px solid rgba(196, 77, 138, 0.28);
  box-shadow: 0 10px 32px rgba(122, 45, 92, 0.14);
}

.hier-tier-label--team {
  margin-left: 0;
  padding-left: 1.15rem;
  background: var(--plum);
}

.hier-team-lead {
  margin: 0.85rem 0 1.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--plum);
}

.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-level {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  position: relative;
}

.org-level--split::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rose) 12%, var(--rose) 88%, transparent);
  pointer-events: none;
}

.org-spine {
  width: 2px;
  height: 22px;
  background: var(--rose);
  border-radius: 2px;
}

.org-card {
  min-width: 148px;
  max-width: 220px;
  flex: 1 1 148px;
  text-align: center;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(196, 77, 138, 0.28);
  box-shadow:
    0 4px 16px rgba(122, 45, 92, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
}

.org-level--split .org-card::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  width: 2px;
  height: 14px;
  background: var(--rose);
  transform: translateX(-50%);
}

.org-card-role {
  display: block;
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--plum);
  line-height: 1.25;
}

.org-card--cmd {
  background: linear-gradient(145deg, #fff8fb 0%, #f5d0e4 55%, #e8aac8 100%);
}

.org-card--para {
  background: linear-gradient(145deg, #fff9fc 0%, #fad8ea 55%, #f0b8d0 100%);
}

.org-card--emt {
  background: linear-gradient(145deg, #fff9fc 0%, #fce0ee 55%, #f5c8dc 100%);
}

.org-card--base {
  background: linear-gradient(145deg, #faf6f8 0%, #f0e0e8 55%, #e8d4de 100%);
}

@media (max-width: 640px) {
  .org-level--split::before,
  .org-level--split .org-card::before {
    display: none;
  }

  .org-card {
    max-width: none;
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hierarchie-bg-photo,
  .hierarchie-bubble,
  .hier-row-panel,
  .hier-row-dot,
  .hier-row-title {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .hier-row:hover .hier-row-panel {
    transform: none;
  }
}

@media (max-width: 640px) {
  .hierarchie-timeline {
    padding-left: 1.75rem;
  }

  .hierarchie-timeline::before {
    left: 0.45rem;
  }

  .hier-tier-label {
    margin-left: -1.75rem;
    padding-left: 1.75rem;
    top: 4rem;
  }

  .hier-row-dot {
    margin-left: -1.55rem;
    width: 12px;
    height: 12px;
  }

  .hier-row:hover .hier-row-panel {
    transform: translateX(4px);
  }
}
