/* ==========================================================================
   Ashburn Taylor — diagrams.css
   1) Responsive frame for the embedded animated "Transformation Programme" rings
   2) Animated Customer → Ashburn Taylor → stages engagement hierarchy
   ========================================================================== */

/* ========================================================================
   1. RINGS FRAME (embeds diagram/transformation-rings.html)
   ======================================================================== */
.rings-frame {
  width: min(620px, 92vw);
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  position: relative;
}
.rings-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* ========================================================================
   2. ENGAGEMENT HIERARCHY
   ======================================================================== */
.orgchart { max-width: 940px; margin-inline: auto; text-align: center; }

.org__node {
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1.6rem;
  border-radius: 12px;
  font-family: var(--font-display); font-weight: 600; color: #fff;
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(-14px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.org__node svg { width: 20px; height: 20px; }
.org__node--customer { background: var(--slate); }
.org__node--at { background: linear-gradient(120deg, var(--teal), var(--cyan)); color: #fff; }
.orgchart.in .org__node { opacity: 1; transform: none; }
.orgchart.in .org__node--at { transition-delay: .25s; }

.org__link {
  width: 2px; height: 36px; margin: 0 auto; display: block;
  background: var(--hairline-2);
  transform: scaleY(0); transform-origin: top;
  transition: transform .4s var(--ease-out);
}
.orgchart.in .org__link { transform: scaleY(1); }
.orgchart.in .org__link--1 { transition-delay: .15s; }
.orgchart.in .org__link--2 { transition-delay: .4s; }

.org__row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem; margin-top: 0;
  position: relative;
}
/* horizontal bus sits flush at the top of the row, aligned to each card centre.
   With 4 equal columns + 1.2rem gaps, a card centre is 12.5% − 0.45rem from the
   row edge (gap shifts it inward of the naive 12.5%), so the bus ends meet the
   outer drop lines exactly. */
.org__row::before {
  content: ''; position: absolute; top: 0;
  left: calc(12.5% - 0.45rem); right: calc(12.5% - 0.45rem);
  height: 2px; background: var(--hairline-2);
  transform: scaleX(0); transform-origin: center;
  transition: transform .5s var(--ease-out) .45s;
}
.orgchart.in .org__row::before { transform: scaleX(1); }

.org__card {
  border-radius: 16px; padding: 1.6rem 1rem 1.3rem;
  color: #fff; text-align: center;
  position: relative;
  margin-top: 36px;            /* room for the drop line from the bus */
  opacity: 0; transform: translateY(48px) scale(0.9);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
/* vertical drop from the bus down into each card */
.org__card::before {
  content: ''; position: absolute; top: -36px; left: 50%; margin-left: -1px;
  width: 2px; height: 36px; background: var(--hairline-2);
  transform: scaleY(0); transform-origin: top;
  transition: transform .35s var(--ease-out) .5s;
}
.orgchart.in .org__card::before { transform: scaleY(1); }
.org__card__icon {
  width: 62px; height: 62px; margin: 0 auto 0.9rem;
  border-radius: 50%; background: #fff;
  display: grid; place-items: center;
}
.org__card__icon svg { width: 30px; height: 30px; color: var(--slate); }
.org__card b { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.org__card--recovery   { background: #5bbfa3; }
.org__card--discovery  { background: var(--cyan); }
.org__card--engagement { background: var(--teal); }
.org__card--delivery   { background: var(--slate); }
.orgchart.in .org__card { opacity: 1; transform: none; }
.orgchart.in .org__card:nth-child(1) { transition-delay: .6s; }
.orgchart.in .org__card:nth-child(2) { transition-delay: .72s; }
.orgchart.in .org__card:nth-child(3) { transition-delay: .84s; }
.orgchart.in .org__card:nth-child(4) { transition-delay: .96s; }

/* ---- Sequenced light flow: down from Customer, through Ashburn Taylor, then
   splitting into the four boxes. One shared 4s cycle; each keyframe is only
   "active" during its window, and every pulse stays inside its line (no overshoot). */
.org__link { position: relative; }
.org__link::after, .org__card::after, .org__row::after {
  content: ''; position: absolute; pointer-events: none; opacity: 0; border-radius: 3px; z-index: 2;
}
.org__link::after, .org__card::after {
  left: 50%; margin-left: -1px; width: 2px; height: 14px;
}
.org__link::after { background: linear-gradient(180deg, transparent, var(--cyan)); box-shadow: 0 0 5px rgba(54,205,253,0.8); }
.org__card::after { background: linear-gradient(180deg, transparent, var(--mint)); box-shadow: 0 0 5px rgba(52,245,197,0.8); }

.orgchart.in .org__link--1::after { animation: org-seg1 4s linear infinite; }
.orgchart.in .org__link--2::after { animation: org-seg2 4s linear infinite; }
.orgchart.in .org__card::after    { animation: org-seg4 4s linear infinite; }
.orgchart.in .org__row::after      { animation: org-bus 4s linear infinite; }

/* the four card drops fire together — the split */
.orgchart.in .org__card:nth-child(1)::after,
.orgchart.in .org__card:nth-child(2)::after,
.orgchart.in .org__card:nth-child(3)::after,
.orgchart.in .org__card:nth-child(4)::after { animation-delay: 0s; }

/* Customer → Ashburn Taylor (link is 36px; pulse bottom stops at the box top = 36px) */
@keyframes org-seg1 {
  0%   { top: -14px; opacity: 0; }
  2%   { opacity: 1; }
  15%  { top: 16px; opacity: 1; }
  18%  { top: 22px; opacity: 0; }
  100% { top: 22px; opacity: 0; }
}
/* Ashburn Taylor → bus */
@keyframes org-seg2 {
  0%, 20% { top: -14px; opacity: 0; }
  23%  { opacity: 1; }
  36%  { top: 16px; opacity: 1; }
  39%  { top: 22px; opacity: 0; }
  100% { top: 22px; opacity: 0; }
}
/* split: bus → each box (drop line spans -36..0; pulse bottom stops at box top = 0) */
@keyframes org-seg4 {
  0%, 45% { top: -36px; opacity: 0; }
  49%  { opacity: 1; }
  64%  { top: -18px; opacity: 1; }
  68%  { top: -14px; opacity: 0; }
  100% { top: -14px; opacity: 0; }
}
/* brief glow across the bus as the flow reaches it and splits */
.org__row::after {
  top: -1px; left: calc(12.5% - 0.45rem); right: calc(12.5% - 0.45rem); height: 3px;
  background: linear-gradient(90deg, transparent, rgba(54,205,253,0.55), transparent);
}
@keyframes org-bus {
  0%, 39% { opacity: 0; }
  44% { opacity: 0.9; }
  54% { opacity: 0; }
  100% { opacity: 0; }
}
/* mobile: vertical timeline — bus hidden; drops travel the shorter 26px links */
@keyframes org-seg4-m {
  0%, 45% { top: -26px; opacity: 0; }
  49%  { opacity: 1; }
  64%  { top: -12px; opacity: 1; }
  68%  { top: -10px; opacity: 0; }
  100% { top: -10px; opacity: 0; }
}
@media (max-width: 680px) {
  .org__row::after { display: none; }
  .orgchart.in .org__card::after { animation-name: org-seg4-m; }
}
@media (prefers-reduced-motion: reduce) {
  .org__link::after, .org__card::after, .org__row::after { display: none; }
}

/* Mobile: a clean vertical timeline — compact horizontal cards joined by a
   centred drop line (the horizontal bus doesn't make sense in one column). */
@media (max-width: 680px) {
  .org__row {
    grid-template-columns: 1fr; gap: 0; margin-top: 0;
    max-width: 340px; margin-inline: auto;
  }
  .org__row::before { display: none; }       /* no horizontal bus */
  .org__card {
    margin-top: 26px;
    display: flex; align-items: center; gap: 1rem;
    text-align: left; padding: 0.9rem 1.1rem;
  }
  .org__card::before { display: block; top: -26px; height: 26px; }  /* vertical drop between cards */
  .org__card__icon { width: 44px; height: 44px; margin: 0; }
  .org__card__icon svg { width: 22px; height: 22px; }
  .org__card b { font-size: 1.02rem; }
}
