.whole-picture-grid {
  --plate-gold: var(--rocca-champagne-gold);
  --plate-ink: var(--rocca-cocoa-charcoal);
}

.whole-picture-grid.is-interactive {
  display: block;
}

.whole-picture-intro > p { max-width: 43ch; }
#whole-picture {
  padding-block: clamp(3rem, 5vw, 4.75rem);
  scroll-margin-top: 4.25rem;
  overflow: clip;
}
#whole-picture > .container {
  max-width: 1320px;
  padding-inline: clamp(17px, 3.4vw, 36px);
}
.whole-picture-grid.is-interactive .whole-picture-intro {
  max-width: 44rem;
  margin: 0 auto clamp(1.25rem, 3vw, 2rem);
  text-align: center;
}
.whole-picture-grid.is-interactive .whole-picture-intro > * { margin-inline: auto; }
.whole-picture-grid.is-interactive .whole-picture-intro h2 {
  margin-bottom: 0.4em;
  text-wrap: balance;
}
.whole-picture-grid.is-interactive .whole-picture-intro .rule-gold { margin-bottom: 1.15rem; }
.whole-picture-grid.is-interactive .whole-picture-intro > p {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}
.whole-picture-grid.is-interactive .whole-picture-link {
  display: table;
  margin: 1.5rem auto 0;
  text-align: center;
}
.whole-picture-grid.is-interactive .picture-list { display: none; }

.whole-picture-tour { --plate-step: clamp(7.5rem, 18svh, 10rem); }
.whole-picture-tour.is-scroll-driven::after {
  content: "";
  display: block;
  height: calc(var(--plate-step) * var(--plate-topic-count));
}
.is-scroll-driven .plate-stage {
  position: sticky;
  top: var(--plate-sticky-top);
}
.plate-stage { padding-block: 8px; }
.plate-canvas {
  --plate-size: min(100%, 22rem, 44svh);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
}
@media (max-width: 69.99rem) and (max-height: 720px) {
  .plate-canvas { --plate-size: min(100%, 22rem, 43svh); }
}
.whole-picture-visual,
.whole-picture-detail {
  width: min(100%, 25rem);
  min-width: 0;
}
.plate-leader { display: none; }

.plate {
  width: var(--plate-size);
  aspect-ratio: 1;
  margin-inline: auto;
  position: relative;
  isolation: isolate;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    #857568 0 46.5%, #b2a394 47%, #5e4d47 47.6%, #dacbb9 48.2%,
    #f1e8db 49%, #ece2d5 92.5%, #d8cabb 93.5%, #f7efe3 94.2%,
    #eee3d6 96.2%, #ac9580 100%);
  box-shadow:
    inset 0 2px 3px #fffaf0,
    inset 0 -5px 7px #80675774,
    0 24px 42px #1d10298c,
    0 5px 8px #20112e6b;
  container-type: inline-size;
}

.whole-picture-visual .plate-definitions { position: absolute; }
.plate-pieces, .plate-seams { position: absolute; inset: 0; }
.plate-seams { width: 100%; height: 100%; pointer-events: none; }
.plate-seams path {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.seam-shadow { stroke: #776758; stroke-opacity: 0.48; stroke-width: 1.25px; }
.seam-light { stroke: #fff9ec; stroke-opacity: 0.8; stroke-width: 0.65px; transform: translate(0.001px, 0.001px); }

.plate-piece {
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: var(--shape);
  background:
    radial-gradient(circle closest-side, #6250473d 47%, transparent 50.8% 88%, #fffdf0a6 93.2%),
    linear-gradient(137deg, #fff8eea6 12%, transparent 49%, #72564835 95%),
    var(--active-glaze, var(--glaze));
  color: #2f2136;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.plate-piece--food {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 46%;
  height: 46%;
  clip-path: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 3px 10px #3e2b25a8, 0 0 0 1px #86736692;
  transition: box-shadow 260ms ease-out;
}

.plate-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.plate-piece:not(.plate-piece--food)::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle closest-side, #301843 45%, #583871 74%, #3e2159 94%);
  transition: opacity 260ms ease-out;
}

.plate-piece:not(.plate-piece--food).is-current {
  color: #fff9ef;
}

.plate-piece.is-current::before { opacity: 1; }

.plate-piece--food.is-current {
  box-shadow: 0 3px 10px #3e2b25a8, 0 0 0 2px #bc9b61, 0 0 15px #eac17c9c;
}

.piece-label {
  position: absolute;
  top: var(--y);
  left: var(--x);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: clamp(0.18rem, 1cqi, 0.43rem);
  padding: 0.18em 0.21em;
  min-width: 2.5rem;
  border-radius: 4px;
  font-size: clamp(0.69rem, 2.8cqi, 0.98rem);
  font-weight: 600;
  line-height: 1.14;
  text-align: center;
  white-space: nowrap;
}

.piece-label svg {
  width: clamp(0.97rem, 4.65cqi, 1.7rem);
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plate-piece[data-topic="medications"] .piece-label {
  left: 72.5%;
  top: 73.8%;
  font-size: clamp(0.61rem, 2.48cqi, 0.9rem);
}

.plate-piece[data-topic="dna"] .piece-label {
  font-size: clamp(0.64rem, 2.58cqi, 0.93rem);
}

.whole-picture-visual .plate-piece--food:focus-visible {
  outline: 2px solid #3e2159;
  outline-offset: 3px;
}

.plate-piece:focus-visible .piece-label {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.plate-piece.is-current .piece-label > span {
  text-decoration: underline;
  text-decoration-color: #eed29a;
  text-underline-offset: 0.23em;
  text-decoration-thickness: 0.08em;
}

.plate-scroll-cue { display: none; }
.is-scroll-driven .plate-scroll-cue {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 14px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--pearl-on-dark);
}
.plate-progress { display: flex; align-items: center; gap: 0.23rem; }
.plate-progress > span { width: 0.72rem; height: 2px; background: #e9d9bf61; }
.plate-progress > .is-current { height: 3px; background: var(--plate-gold); }

.piece-detail {
  min-height: 198px;
  padding: 16px 18px;
  color: var(--plate-ink);
  background: #fbf4e9;
  border-radius: 12px;
  box-shadow: 0 12px 28px #20112b55;
}
.piece-detail__heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid #d1b889;
}
.piece-detail__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--rocca-violet);
  color: #fff4de;
}
.piece-detail__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.whole-picture-grid .piece-detail h3 {
  margin: 0;
  color: var(--rocca-violet);
  font-size: clamp(26px, 2.05vw, 32px);
  line-height: 1.08;
  text-wrap: pretty;
}

.piece-detail p { font-size: 16px; line-height: 1.5; margin: 0.45rem 0 0; }
.whole-picture-grid .piece-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 70rem) {
  .plate-canvas {
    --plate-size: min(570px, 46vw, calc(100svh - 175px));
    --plate-gap: clamp(28px, 2.8vw, 44px);
    --callout-y: 50%;
  }
  .whole-picture-visual { width: var(--plate-size); }
  .whole-picture-detail {
    position: absolute;
    z-index: 1;
    width: min(300px, calc((100% - var(--plate-size)) / 2 - var(--plate-gap)));
    top: clamp(6.15rem, var(--callout-y), calc(100% - 6.15rem));
    left: calc(50% + var(--plate-size) / 2 + var(--plate-gap));
    transform: translateY(-50%);
  }
  .plate-canvas[data-side="left"] .whole-picture-detail {
    left: auto;
    right: calc(50% + var(--plate-size) / 2 + var(--plate-gap));
  }
  .plate-canvas[data-topic="symptoms"] { --callout-y: 20%; }
  .plate-canvas:is([data-topic="history"], [data-topic="dna"]) { --callout-y: 28%; }
  .plate-canvas:is([data-topic="medications"], [data-topic="goals"]) { --callout-y: 72%; }
  .plate-canvas[data-topic="composition"] { --callout-y: 80%; }
  .plate-canvas .piece-detail { min-height: 0; }
  .plate-canvas .piece-detail p { font-size: 18px; }
  .plate-canvas .plate-leader {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    height: 1px;
    background: #dac18a;
    transform-origin: left center;
    pointer-events: none;
  }
  .plate-canvas .plate-leader::before {
    content: "";
    position: absolute;
    left: 0;
    top: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f0d9a7;
  }
  .plate-canvas[data-topic="food"] .plate-leader { display: none; }
}

@media (max-width: 22.5rem) {
  .piece-label { font-size: clamp(0.59rem, 3cqi, 0.69rem); }
  .plate-piece[data-topic="medications"] .piece-label { font-size: 0.55rem; }
  .plate-piece[data-topic="dna"] .piece-label { font-size: 0.56rem; }
}

@media (prefers-reduced-motion: reduce) {
  .plate-piece:not(.plate-piece--food)::before, .plate-piece--food { transition: none; }
}
