/* Scene 03. Qualitative dimensions use the radar; actual portfolio weights
   appear separately below it so relative levels aren't mistaken for percentages. */
.pd-diagnosis {
  --pd-paper: var(--snow, #fff);
  --pd-navy: var(--navy, #003366);
  --pd-brass: #785a22;
  --pd-pad: clamp(12px, min(4.2cqw, 3.9cqh), 38px);
  --pd-small: clamp(11.5px, min(2.8cqw, 2.45cqh), 16px);
  width: min(93cqw, 156cqh, 62rem);
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(13px, min(3.4cqw, 3cqh), 28px);
  background: var(--pd-paper);
  box-shadow: 0 1px 2px #09254419, 0 16px 40px -24px #00244869;
  color: var(--pd-navy);
  font: 500 var(--pd-small)/1.35 var(--sans, system-ui, sans-serif);
  font-variant-numeric: lining-nums tabular-nums;
  text-align: start;
}
.pd-diagnosis :where(figure, h4, h5, p) { margin: 0; }
.pd-instrument {
  padding: var(--pd-pad);
  background: var(--pd-paper);
  color: var(--pd-navy);
}
.pd-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55em 1em;
}
.pd-heading h4 {
  color: inherit;
  font: 610 clamp(19px, min(5cqw, 4.6cqh), 39px)/1.12 var(--sans, system-ui, sans-serif);
  letter-spacing: -.045em;
}
.pd-key, .pd-key span { display: inline-flex; align-items: center; }
.pd-key { gap: .9em; }
.pd-key span { gap: .36em; font-weight: 620; }
.pd-key span::before { content: ""; width: 1.3em; border-top: 2px solid currentColor; }
.pd-key span + span { color: var(--pd-brass); }
.pd-key span + span::before { border-top-style: dashed; }

.pd-radar { display: block; width: 100%; height: clamp(145px, min(52cqw, 35cqh), 365px); margin-block: .65em .12em; }
.pd-web { fill: none; stroke: #d8e1e8; stroke-width: .85; }
.pd-radar [data-pd-trace] { stroke-linejoin: round; stroke-width: 2; }
.pd-radar [data-pd-trace="actual"] { stroke: var(--navy); fill: var(--navy); fill-opacity: .075; }
.pd-radar [data-pd-trace="simulada"] { stroke: var(--gold-deep); stroke-dasharray: 4 3; fill: var(--gold); fill-opacity: .12; }
.pd-axis-labels { fill: #334155; font: 540 14.5px var(--sans); letter-spacing: -.025em; }
.pd-focus-label { fill: var(--pd-brass); font-weight: 700; }
.pd-focus { fill: var(--navy); }
.pd-focus circle:first-child { fill-opacity: .12; }
.pd-period {
  text-align: center;
  color: var(--graphite);
  font-size: var(--pd-small);
}

.pd-reading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(10px, 3cqw, 32px);
  padding: var(--pd-pad);
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.pd-finding h5, .pd-scenario strong {
  font: 650 var(--pd-small)/1.25 var(--sans, system-ui, sans-serif);
  letter-spacing: -.012em;
}
.pd-values, .pd-change { display: flex; align-items: baseline; gap: .17em; }
.pd-values {
  margin-top: .08em;
  font: 400 clamp(35px, min(10.6cqw, 9.8cqh), 83px)/1 var(--editorial, Georgia, serif);
  letter-spacing: -.03em;
  white-space: nowrap;
}
.pd-values b { font-weight: 400; }
.pd-values small { margin-left: .04em; font-size: .55em; }
.pd-change { color: var(--pd-brass); }
.pd-arrow { align-self: center; color: #77879a; font: 400 .47em/1 var(--sans, system-ui, sans-serif); }
.pd-scenario {
  padding-left: clamp(10px, 2.8cqw, 25px);
  border-left: 1px solid #d6dee6;
  color: #46566a;
  font-size: clamp(12px, min(3.2cqw, 2.75cqh), 20px);
  line-height: 1.38;
}
.pd-scenario strong { display: block; margin-bottom: .25em; color: var(--pd-brass); }
.pd-scenario b { font-weight: 680; color: var(--pd-navy); }

@container (max-width: 480px) {
  .pd-reading { grid-template-columns: minmax(0, 1fr); gap: .35em; }
  .pd-finding { display: flex; align-items: center; justify-content: space-between; gap: .5em; }
  .pd-values { flex: none; margin: 0; }
  .pd-scenario { padding: 0; border: 0; }
  .pd-scenario strong { display: inline; margin: 0; }
  .pd-scenario strong::after { content: " · "; }
}
@container (max-width: 365px) {
  .pd-diagnosis { --pd-pad: 10px; width: 94cqw; }
  .pd-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
  .pd-heading h4 { font-size: 18px; }
  .pd-key { display: grid; gap: 1px; line-height: 1.15; }
}
@container (max-height: 335px) {
  .pd-radar { margin-block: .3em; }
  .pd-period { display: none; }
}
@container (max-width: 300px) {
  .pd-values { font-size: 33px; }
}
/* Use the desktop leaf for the plot; on short pinned leaves recover space
   from the header and reading, not from the five directly labeled axes. */
@container (min-width: 535px) and (min-height: 620px) {
  .pd-radar { height: min(47cqw, 43cqh, 430px); }
}
@container (max-height: 375px) {
  .pd-diagnosis { --pd-pad: 8px; width: 95cqw; }
  .pd-instrument { padding-block: 5px 4px; }
  .pd-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
  .pd-heading h4 { font-size: clamp(17px, 4.6cqw, 21px); }
  .pd-key { display: grid; gap: 0; line-height: 1.13; }
  .pd-radar { height: clamp(145px, 44cqh, 165px); margin: 0; }
  .pd-period { margin: 0; line-height: 1.17; }
  .pd-reading { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 5px var(--pd-pad) 6px; }
  .pd-finding { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
  .pd-values { margin: 0; font-size: 32px; }
  .pd-scenario { padding: 0; border: 0; font-size: 12px; line-height: 1.25; }
  .pd-scenario strong { display: inline; margin: 0; }
  .pd-scenario strong::after { content: " · "; }
}
@container (max-height: 300px) {
  .pd-instrument { padding-block: 3px 2px; }
  .pd-reading { gap: 1px; padding-block: 3px 4px; }
  .pd-values { font-size: 30px; }
}
@container (max-width: 450px) {
  .pd-axis-labels { font-size: 16px; }
}
@media (max-height: 31.99rem) and (orientation: landscape) {
  .pd-diagnosis { --pd-pad: clamp(8px, 2.6svh, 13px); }
  [data-product-story]:not([data-story-mode]) .product-story-screen[data-story-screen="2"] { container-type: inline-size; }
}

/* Final values and both traces are the default (no JS, reduced motion,
   short landscape windows, print). One pass on entry, no timers or loop. */
@media screen and (prefers-reduced-motion: no-preference) {
  [data-story-mode] [data-story-screen="2"].active [data-pd-trace="actual"] {
    animation: pd-read-profile .92s .12s ease-in-out backwards;
  }
  [data-story-mode] [data-story-screen="2"].active :is(.pd-focus, .pd-finding h5, .pd-values > b) {
    animation: pd-show .42s 1.1s ease-out backwards;
  }
  [data-story-mode] [data-story-screen="2"].active .pd-focus-label {
    animation: pd-emphasize .42s 1.1s ease-out backwards;
  }
  [data-story-mode] [data-story-screen="2"].active :is(.pd-scenario, .pd-key span + span) {
    animation: pd-show .3s 2.05s ease-out backwards;
  }
  [data-story-mode] [data-story-screen="2"].active [data-pd-trace="simulada"] {
    animation: pd-read-profile .76s 2.2s ease-in-out backwards;
  }
  [data-story-mode] [data-story-screen="2"].active .pd-change {
    animation: pd-show .4s 2.5s ease-out backwards;
  }
}
@keyframes pd-read-profile { from { clip-path: inset(-5% 100% -5% 0); } to { clip-path: inset(-5% 0 -5% 0); } }
@keyframes pd-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes pd-emphasize { from { fill: #334155; } to { fill: var(--pd-brass); } }
