/**
 * Phase 21.3 — Classic advanced org chart (dark About canvas)
 * Board in one horizontal row → spine → CEO. Auditor as legal side node.
 */

.ar-org--chart {
  width: 100%;
  max-width: min(960px, 100%);
  margin: 0.5rem 0 1.5rem;
  padding: 1.2rem 0.9rem 1.4rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(161, 34, 115, 0.24);
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(161, 34, 115, 0.18), transparent 60%),
    rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(8, 2, 18, 0.32);
}

.ar-org__head {
  text-align: center;
  margin-bottom: 1.15rem;
}

.ar-org__pulse {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  color: #e8d48b;
  background: rgba(161, 34, 115, 0.38);
  border: 1px solid rgba(232, 212, 139, 0.32);
  animation: ar-org-pulse 2.8s ease-in-out infinite;
}

.ar-org__pulse .ar-about-ico {
  width: 0.95rem;
  height: 0.95rem;
}

@keyframes ar-org-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(161, 34, 115, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(161, 34, 115, 0); }
}

.ar-org__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #e8d48b;
}

.ar-org__title {
  margin: 0 0 0.35rem;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 800;
  color: #f5f2fa;
  line-height: 1.4;
}

.ar-org__lead {
  margin: 0 auto;
  max-width: 34rem;
  font-size: 0.76rem;
  line-height: 1.75;
  color: rgba(250, 249, 252, 0.58);
}

.ar-org__chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ar-org__top {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  width: 100%;
}

.ar-org__side {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.65rem;
}

.ar-org__side-join {
  position: absolute;
  top: calc(1.65rem + 0.66rem + 0.3rem + 1.5rem);
  inset-inline-end: -0.65rem;
  width: 0.65rem;
  height: 1px;
  background: rgba(201, 162, 39, 0.55);
}

.ar-org__tier--board {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.ar-org__tier-tag {
  display: inline-flex;
  margin: 0 0 0.55rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(161, 34, 115, 0.3);
  background: rgba(161, 34, 115, 0.16);
  color: #e8b4d4;
  font-size: 0.66rem;
  font-weight: 800;
}

.ar-org__tier-tag--muted {
  margin-bottom: 0.35rem;
  border-color: rgba(232, 212, 139, 0.28);
  background: rgba(232, 212, 139, 0.08);
  color: #e8d48b;
  font-size: 0.6rem;
}

.ar-org__board-frame {
  position: relative;
  padding: 0.35rem 0.25rem 0.25rem;
  border-radius: 1.15rem;
  border: 1px dashed rgba(161, 34, 115, 0.28);
  background: rgba(161, 34, 115, 0.05);
}

.ar-org__rail {
  position: absolute;
  top: 2.05rem;
  left: 7%;
  right: 7%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(161, 34, 115, 0.5) 12%,
    rgba(201, 162, 39, 0.45) 50%,
    rgba(161, 34, 115, 0.5) 88%,
    transparent
  );
  pointer-events: none;
  z-index: 0;
}

.ar-org__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  position: relative;
  z-index: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ar-org__cell {
  position: relative;
  flex: 1 1 0;
  min-width: 6.5rem;
  max-width: 8.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.15rem;
  animation: ar-org-in 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 0.05s);
}

.ar-org__peg {
  display: block;
  width: 1px;
  height: 0.5rem;
  margin-bottom: 0.2rem;
  background: rgba(161, 34, 115, 0.55);
}

@keyframes ar-org-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ar-org__spine {
  width: 1px;
  height: 1.4rem;
  margin: 0.2rem 0 0.35rem;
}

.ar-org__spine span {
  display: block;
  width: 1px;
  height: 100%;
  margin-inline: auto;
  background: linear-gradient(180deg, rgba(161, 34, 115, 0.85), rgba(201, 162, 39, 0.5));
  box-shadow: 0 0 10px rgba(161, 34, 115, 0.35);
}

.ar-org__tier--ceo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

/* Nodes */
.ar-org-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 7.5rem;
  padding: 0.55rem 0.4rem 0.6rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(12, 8, 18, 0.58);
  text-align: center;
  transition:
    border-color 0.3s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    background 0.3s ease;
  z-index: 1;
}

.ar-org-node--md {
  max-width: 8.4rem;
  padding: 0.7rem 0.5rem 0.75rem;
  border-color: rgba(232, 212, 139, 0.35);
  background: linear-gradient(165deg, rgba(161, 34, 115, 0.24), rgba(12, 8, 18, 0.7));
  box-shadow: 0 0 22px rgba(161, 34, 115, 0.22);
}

.ar-org-node--auditor {
  max-width: 6.6rem;
  border-color: rgba(201, 162, 39, 0.3);
}

.ar-org-node:hover,
.ar-org-node:focus-within {
  z-index: 6;
  transform: translateY(-5px);
  border-color: rgba(161, 34, 115, 0.55);
  background: rgba(22, 12, 34, 0.96);
  box-shadow:
    0 16px 34px rgba(161, 34, 115, 0.3),
    0 0 0 1px rgba(161, 34, 115, 0.22);
}

.ar-org-node__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(161, 34, 115, 0.42);
  background:
    radial-gradient(circle at 30% 25%, rgba(161, 34, 115, 0.35), transparent 55%),
    #1a1024;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.ar-org-node--md .ar-org-node__avatar {
  width: 3.55rem;
  height: 3.55rem;
  border-color: rgba(232, 212, 139, 0.48);
}

.ar-org-node:hover .ar-org-node__avatar,
.ar-org-node:focus-within .ar-org-node__avatar {
  transform: scale(1.16);
  border-color: rgba(161, 34, 115, 0.8);
  box-shadow: 0 0 0 3px rgba(161, 34, 115, 0.22), 0 8px 18px rgba(161, 34, 115, 0.38);
}

.ar-org-node__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.2) contrast(1.05);
  transition: filter 0.35s ease;
}

.ar-org-node:hover .ar-org-node__avatar img,
.ar-org-node:focus-within .ar-org-node__avatar img {
  filter: none;
}

.ar-org-node__initials {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.85rem;
  font-weight: 800;
  color: #e8d48b;
}

.ar-org-node__name {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.4;
  color: #f7f4fb;
  overflow-wrap: anywhere;
}

.ar-org-node--md .ar-org-node__name {
  font-size: 0.78rem;
}

.ar-org-node__role {
  margin: 0.15rem 0 0;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.35;
  color: #d4a0c0;
}

.ar-org-node--ceo .ar-org-node__role {
  color: #e8d48b;
}

.ar-org-node__reveal {
  display: grid;
  gap: 0.28rem;
  width: 100%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
}

.ar-org-node:hover .ar-org-node__reveal,
.ar-org-node:focus-within .ar-org-node__reveal {
  max-height: 5.5rem;
  opacity: 1;
  margin-top: 0.1rem;
}

.ar-org-node__email {
  display: block;
  font-size: 0.58rem;
  font-weight: 650;
  color: rgba(232, 212, 139, 0.92);
  text-decoration: none;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.ar-org-node__email--soft {
  color: rgba(250, 249, 252, 0.45);
}

.ar-org-node__msg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #c43a8a, #A12273);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(161, 34, 115, 0.35);
}

.ar-org-node__msg:hover {
  filter: brightness(1.08);
}

.ar-org-node__ext {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(232, 212, 139, 0.7);
  text-decoration: none;
}

@media (max-width: 860px) {
  .ar-org__top {
    flex-direction: column;
    align-items: center;
  }

  .ar-org__side {
    padding-top: 0;
    order: 3;
    margin-top: 0.75rem;
  }

  .ar-org__side-join {
    display: none;
  }

  .ar-org__tier--board {
    order: 1;
    width: 100%;
  }

  .ar-org__row {
    justify-content: flex-start;
  }

  .ar-org__cell {
    flex: 0 0 auto;
  }

  .ar-org__rail {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ar-org__pulse,
  .ar-org__cell {
    animation: none !important;
  }

  .ar-org-node,
  .ar-org-node__avatar,
  .ar-org-node__reveal {
    transition: none !important;
  }

  .ar-org-node:hover {
    transform: none;
  }

  .ar-org-node__reveal {
    max-height: none;
    opacity: 1;
  }
}
