/* Stensul campaign workflow diagram
   Scoped under .pdiagram so it cannot leak into the rest of the page.
   Colours are the site's warm-neutral set; the accent is Citron #FFFA66. */

.pdiagram {
  --pd-ink: #161514;
  --pd-ink-2: #332f2a;
  --pd-muted: #6b665e;
  --pd-faint: #a8a39f;
  --pd-line: #e4e1df;
  --pd-surface: #fff;
  --pd-surface-2: #f8f7f7;
  --pd-shell: #e7e4e1;
  --pd-accent: #fffa66;
  --pd-accent-deep: #e7de22;
  --pd-accent-wash: #fffdc7;
  --pd-teal: #0a7891;
  --pd-hover: #f8f7f7;
  --pd-ic-a: #fffa66;
  --ic-a: #fffa66; /* consumed by the inline Citron glyphs */

  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--pd-ink);
  -webkit-font-smoothing: antialiased;
}

.pdiagram *,
.pdiagram *::before,
.pdiagram *::after { box-sizing: border-box; }

/* ---------- grid ---------- */
.pd-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  column-gap: 32px;
  row-gap: 13px;
  padding: 14px;
}

.pd-stage-line {
  grid-column: 1;
  grid-row: 2 / 4;
  justify-self: start;
  align-self: stretch;
  width: 0;
  margin-top: 28px;
  margin-left: 9.5px;
  border-left: 1.5px dashed var(--pd-line);
  pointer-events: none;
  z-index: 1;
}

.pd-stage-line-tail {
  grid-column: 1;
  grid-row: 4;
  position: relative;
  justify-self: start;
  align-self: start;
  width: 0;
  height: 28px;
  margin-left: 9.5px;
  border-left: 1.5px dashed var(--pd-line);
  pointer-events: none;
  z-index: 1;
}

.pd-stage-line-tail::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--pd-line);
  border-bottom: 1.5px solid var(--pd-line);
  transform: translate(-50%, -50%) rotate(45deg);
}

.pd-shell {
  grid-column: 2;
  grid-row: 1 / 5;
  margin: -18px;
  background: var(--pd-shell);
  border-radius: 20px;
  z-index: 0;
}

.pd-gold {
  grid-column: 2;
  grid-row: 1 / 5;
  margin: -5px;
  border: 3px solid var(--pd-accent);
  border-radius: 15px;
  pointer-events: none;
  z-index: 3;
}

/* ---------- stage rail ---------- */
.pd-stage {
  grid-column: 1;
  z-index: 2;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 14px;
  align-self: stretch;
}

.pd-stage::after {
  content: "";
  position: absolute;
  left: -32px;
  right: -32px;
  top: -7.5px;
  height: 2px;
  background: var(--pd-faint);
  z-index: -1;
}

.pd-stage--first::after { display: none; }

.pd-stage button {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Synapse', 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--pd-ink);
  border-radius: 6px;
  padding: 2px 4px;
}

.pd-stage button:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pd-teal);
}

.pd-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--pd-faint);
  background: #fff;
  flex: none;
  transition: background .18s, border-color .18s;
}

.pd-stage.is-on .pd-dot {
  background: var(--pd-accent);
  border-color: var(--pd-accent-deep);
}

.pd-stage--static {
  font-family: 'Synapse', 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--pd-ink);
  padding-left: 4px;
  padding-top: 2px;
}

/* ---------- bands ---------- */
.pd-band {
  grid-column: 2;
  z-index: 2;
  position: relative;
  background: var(--pd-surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 37%);
  align-items: stretch;
  transition: opacity .22s, filter .22s;
}

.pd-band--gov {
  grid-template-columns: 1fr;
  padding: 14px 20px 15px;
  border-radius: 11px 11px 0 0;
}

.pd-band:not(.pd-band--gov)::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -7.5px;
  height: 2px;
  background: var(--pd-faint);
}

.pd-band:last-of-type { border-radius: 0 0 11px 11px; }

.pdiagram.is-dim .pd-band { opacity: .3; filter: saturate(.2); }
.pdiagram.is-dim .pd-band.is-focus { opacity: 1; filter: none; }

/* governance band */
.pd-gov-top {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.pd-logo {
  display: flex;
  align-items: center;
  flex: none;
  height: 22px;
}

.pd-logo img { height: 100%; width: auto; display: block; }

.pd-gov-head { text-align: center; flex: 1 1 380px; }

.pd-gov-head h3 {
  font-family: 'Synapse', 'Poppins', sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 5px;
  text-wrap: balance;
  color: var(--pd-ink);
}

.pd-gov-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  justify-content: center;
  align-items: center;
}

.pd-gov-pills span {
  font-size: 13px;
  font-weight: 500;
  color: var(--pd-ink-2);
  padding: 2px 10px;
  border-radius: 6px;
  transition: background .15s;
}

.pd-gov-pills span:hover,
.pd-gov-pills span:focus-visible { background: var(--pd-accent-wash); }
.pd-gov-pills span:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--pd-teal); }
.pd-gov-pills i { color: var(--pd-faint); font-style: normal; font-size: 11px; }

/* band body */
.pd-zone { padding: 12px 8px 12px; min-width: 0; }

.pd-zone-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0 0 10px;
}

.pd-zone h4 {
  font-family: 'Synapse', 'Poppins', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.012em;
  margin: 0;
  text-align: center;
  color: var(--pd-ink);
}

.pd-zone--side {
  background: var(--pd-surface-2);
  border-left: 1px dashed var(--pd-line);
  position: relative;
}

.pd-zone--side h4 { margin-bottom: 10px; }

/* Small functional control — the only clickable expand/collapse trigger. */
.pd-plus {
  all: unset;
  cursor: pointer;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--pd-line);
  background: #fff;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pd-muted);
  flex: none;
  transition: background .15s, color .15s, border-color .15s, transform .2s;
}

.pd-plus:hover {
  background: var(--pd-accent);
  border-color: var(--pd-accent-deep);
  color: #1a1a12;
}

.pd-plus:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pd-teal); }

.pd-band.is-open .pd-plus {
  transform: rotate(45deg);
  background: var(--pd-accent);
  border-color: var(--pd-accent-deep);
  color: #1a1a12;
}

/* Big circle astride the divider — decorative only, echoing the original
   diagram's connector between a capability and its partner tools. Not a
   button: no hover state, no click behavior, always shows a plain plus. */
.pd-plus-deco {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pd-shell);
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pd-muted);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

/* ---------- tiles ---------- */
.pd-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.pd-tile {
  all: unset;
  box-sizing: border-box;
  cursor: default;
  width: 78px;
  padding: 6px 2px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: background .15s, transform .15s;
}

.pd-tile:hover,
.pd-tile:focus-visible { background: var(--pd-hover); transform: translateY(-1px); }
.pd-tile:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--pd-teal); }

/* Partner tiles have no tooltip/expanded description — keep them still on hover. */
.pd-tiles--partners .pd-tile:hover,
.pd-tiles--partners .pd-tile:focus-visible { background: transparent; transform: none; }

.pd-glyph { width: 28px; height: 28px; display: block; color: var(--pd-ink); flex: none; }
.pd-glyph svg { width: 100%; height: 100%; display: block; }
.pd-glyph svg [fill="var(--ic-a)"] { fill: var(--pd-ic-a); }

.pd-mark { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex: none; }
.pd-mark img { width: 100%; height: 100%; display: block; border-radius: 5px; }

.pd-lbl {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--pd-ink-2);
  display: block;
}

.pd-desc {
  display: none;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--pd-muted);
  text-wrap: balance;
  margin-top: 3px;
}

.pd-band.is-open .pd-tile { width: 132px; }
.pd-band.is-open .pd-desc { display: block; }

.pd-tiles--partners .pd-tile,
.pd-band.is-open .pd-tiles--partners .pd-tile { width: 54px; }
.pd-tiles--partners .pd-lbl { font-size: 10.5px; }

.pd-chip {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Synapse', 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: 1px dashed var(--pd-line);
  color: var(--pd-faint);
  background: transparent;
}

/* ---------- context layer ---------- */
.pd-flow {
  display: flex;
  justify-content: center;
  gap: min(34vw, 400px);
  padding: 0 14px;
}

.pd-flow svg { width: 13px; height: 26px; color: var(--pd-faint); }

.pd-context {
  margin: 0 14px 0 148px;
  border: 1.5px dashed var(--pd-line);
  border-radius: 16px;
  padding: 16px 18px 14px;
  background: var(--pd-surface);
  text-align: center;
}

.pd-context h3 {
  font-family: 'Synapse', 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 5px;
  color: var(--pd-ink);
}

.pd-context-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 0;
  margin-bottom: 10px;
}

.pd-context-sub span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--pd-ink-2);
  padding: 1px 9px;
  border-radius: 6px;
}

.pd-context-sub i { color: var(--pd-faint); font-style: normal; font-size: 11px; }

.pd-pii { margin: 10px 14px 0; text-align: center; font-size: 12.5px; font-weight: 500; color: var(--pd-faint); }

/* ---------- tooltip (appended to body) ---------- */
.pd-tip {
  position: fixed;
  z-index: 9999;
  max-width: 240px;
  pointer-events: none;
  background: #161514;
  color: #fbfaf9;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: 8px;
  box-shadow: 0 12px 16px -4px rgba(16, 24, 40, .16);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .13s, transform .13s;
}

.pd-tip.on { opacity: 1; transform: translateY(0); }
.pd-tip b { display: block; font-size: 12px; margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pdiagram *, .pd-tip { transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .pd-band {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "side";
  }
  .pd-zone--main { grid-area: main; }
  .pd-zone--side { grid-area: side; border-top: 1px dashed var(--pd-line); border-left: none; }
  .pd-plus-deco { display: none; }
}

@media (max-width: 640px) {
  .pd-grid { grid-template-columns: 1fr; padding: 14px; row-gap: 10px; }
  .pd-stage, .pd-stage-line, .pd-stage-line-tail { display: none; }
  .pd-band, .pd-shell, .pd-gold { grid-column: 1; }
  .pd-shell { grid-row: 1 / 5; margin: -8px; }
  .pd-gold { grid-row: 1 / 5; margin: -3px; }
  .pd-band, .pd-band--gov, .pd-band:last-of-type { border-radius: 11px; }
  .pd-band:not(.pd-band--gov) .pd-zone--main::before {
    content: attr(data-stage-label);
    display: block;
    font-family: 'Synapse', 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--pd-muted);
    text-align: center;
    margin-bottom: 7px;
  }
  .pd-tile { width: 82px; }
  .pd-band.is-open .pd-tile {
    width: 100%;
    max-width: 300px;
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    gap: 10px;
  }
  .pd-flow { gap: 110px; }
  .pd-context { margin: 0 14px; }
}
