/* Dashboard anatomy: a real dashboard capture with numbered parts, and what each part is for.
   Uses the v5 tokens from archive.css. Readable without JS: the markers are links to a numbered list under the
   picture. anatomy.js adds .armed, then shows one part at a time and outlines it on the picture. */

.an { margin: 40px 0 48px; padding-top: 14px; border-top: 1px solid var(--hair); }
.an-kicker { font: 500 12px/1.35 var(--mono); letter-spacing: .02em; color: var(--muted); }
.an-hint { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.an-stage { position: relative; margin-top: 14px; border-radius: 10px; overflow: hidden; background: var(--sheet); box-shadow: var(--lift); }
.an-stage img { width: 100%; height: auto; }

/* the outlined part, and a soft veil over the rest */
.an-area { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: calc(var(--w) * 1%); height: calc(var(--h) * 1%); border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease); }
.an-area.on { opacity: 1; box-shadow: 0 0 0 2px var(--red), 0 0 0 100vmax rgba(246, 246, 243, .55); }

.an-dot { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(-50%, -50%); width: clamp(22px, 3.2vw, 28px); height: clamp(22px, 3.2vw, 28px); border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font: 600 clamp(11px, 1.5vw, 13px)/1 var(--mono); text-decoration: none; box-shadow: 0 0 0 2px var(--sheet), 0 4px 10px -4px rgba(18, 20, 24, .5); transition: transform .2s var(--ease), background .2s; }
.an-dot:hover { transform: translate(-50%, -50%) scale(1.12); }
.an-dot[aria-current="true"] { background: var(--ink); }
.an-dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* the parts */
.an-parts { margin-top: 18px; display: grid; gap: 14px; }
.an-part { scroll-margin-top: 16px; padding: 16px 20px 18px; background: var(--sheet); border-radius: 10px; box-shadow: var(--lift); }
.an-part > h3 { display: flex; align-items: baseline; gap: 10px; margin: 0; font: 600 18px/1.3 var(--sans); }
.an-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font: 600 11.5px/1 var(--mono); transform: translateY(-2px); }
.an-kind { margin: 4px 0 0 32px; font: 500 12px/1.4 var(--mono); color: var(--muted); }
.an-part code { font: 500 .86em/1 var(--mono); padding: 2px 5px 3px; border-radius: 5px; background: rgba(18, 20, 24, .06); overflow-wrap: anywhere; }

/* a card reads top to bottom: the question, what's on the chart, why this chart, then short notes */
.an-ask { margin: 12px 0 0; font: italic 400 20px/1.35 var(--serif); color: var(--ink); text-wrap: balance; }
.an-lede { margin: 6px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--muted); }
.an-spec { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.an-spec th { width: 7.5em; padding: 7px 12px 7px 0; text-align: left; vertical-align: top; font: 500 12px/1.6 var(--mono); color: var(--muted); white-space: nowrap; }
.an-spec td { padding: 7px 0; vertical-align: top; }
.an-spec td > b { font-weight: 600; }
.an-spec td > span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.an-spec tr + tr > * { border-top: 1px solid var(--hair-2); }
.an-spec-wide th { width: 10em; }
.an-spec-wide td > b { color: var(--red-ink); }

.an-why { margin-top: 14px; padding: 12px 14px 13px; border-radius: 8px; background: rgba(224, 48, 30, .06); box-shadow: inset 3px 0 0 var(--red); }
.an-rule { margin: 0; font: 600 16px/1.4 var(--sans); }
.an-rule > span, .an-note > span { display: block; margin-bottom: 3px; font: 500 11.5px/1.35 var(--mono); letter-spacing: .02em; color: var(--red-ink); }
.an-why ul { margin: 8px 0 0; display: grid; gap: 4px; }
.an-why li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.45; }
.an-why li::before { position: absolute; left: 0; top: 0; font: 700 14px/1.45 var(--sans); }
.an-why li.pro::before { content: "✓"; color: var(--teal); }
.an-why li.con::before { content: "✗"; color: var(--red); }
.an-here { margin: 10px 0 0; font-size: 15px; line-height: 1.5; }
.an-here > span { font: 600 11.5px/1 var(--mono); color: var(--red-ink); margin-right: 6px; }
.an-else { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

.an-note { margin: 12px 0 0; font-size: 15px; line-height: 1.5; }
.an-note > span { color: var(--muted); }
.an-limit { color: var(--muted); }
.an-code { margin: 8px 0 0; padding: 9px 12px; border-radius: 8px; background: rgba(18, 20, 24, .04); box-shadow: inset 0 0 0 1px var(--hair-2); overflow-x: auto; font: 12.5px/1.55 var(--mono); }
.an-code code { padding: 0; background: none; }

/* the terms table before the figure */
.an-terms { margin: 22px 0 8px; border-radius: 10px; background: var(--sheet); box-shadow: var(--lift); overflow-x: auto; }
.an-terms table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.an-terms thead th { padding: 11px 14px 9px; text-align: left; font: 500 12px/1.35 var(--mono); color: var(--muted); border-bottom: 1px solid var(--hair); }
.an-terms tbody th { width: 9.5em; padding: 9px 14px; text-align: left; vertical-align: top; font-weight: 600; white-space: nowrap; }
.an-terms td { padding: 9px 14px 9px 0; vertical-align: top; }
.an-terms tbody tr + tr > * { border-top: 1px solid var(--hair-2); }
@media (max-width: 520px) { .an-terms tbody th { width: auto; white-space: normal; } .an-spec th { width: 6em; } .an-spec-wide th { width: 7.5em; white-space: normal; } }
.an-nav { display: none; }
.an figcaption { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--dash); font-size: 15px; line-height: 1.6; color: var(--muted); }

/* with anatomy.js: one part at a time, with previous / next */
.an.armed .an-part:not(.on) { display: none; }
.an.armed .an-part { animation: an-in .25s var(--ease); }
.an.armed .an-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--hair-2); }
.an-nav button { font: 500 13px/1 var(--mono); padding: 9px 12px; border: 0; border-radius: 8px; background: rgba(18, 20, 24, .06); color: var(--ink); cursor: pointer; }
.an-nav button:hover { background: rgba(18, 20, 24, .1); }
.an-nav button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.an-nav span { font: 500 12px/1 var(--mono); color: var(--muted); }
@keyframes an-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .an-area, .an-dot { transition: none; } .an.armed .an-part { animation: none; } }

/* the short answer at the top of the article */
.an-short { margin: 32px 0 8px; padding: 18px 22px 20px; max-width: 40em; background: var(--sheet); border-radius: 10px; box-shadow: var(--lift); font: 400 16.5px/1.55 var(--sans); }
.an-short ol { margin-top: 10px; counter-reset: ans; display: grid; gap: 10px; }
.an-short li { counter-increment: ans; position: relative; padding-left: 30px; color: var(--muted); }
.an-short li::before { content: counter(ans); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff; font: 600 11.5px/20px var(--mono); text-align: center; }
.an-short li > span { color: var(--ink); font-weight: 600; }

/* the chart-choice table under the figure */
.an-table { margin: 22px 0 30px; overflow-x: auto; border-radius: 10px; background: var(--sheet); box-shadow: var(--lift); }
.an-table table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.an-table th { text-align: left; font: 500 12px/1.35 var(--mono); letter-spacing: .02em; color: var(--muted); padding: 12px 14px 10px; border-bottom: 1px solid var(--hair); }
.an-table td { vertical-align: top; padding: 11px 14px; border-top: 1px solid var(--hair-2); }
.an-table td:nth-child(2) { font-weight: 600; }
.an-table td:last-child { font: 500 12.5px/1.45 var(--mono); color: var(--red-ink); white-space: nowrap; }
