/* Anatomy component (illustration + hotspots). Loaded only on pages that use it.
   Accent: --c-icon (page accent) → falls back to the theme accent. */

.anatomy { --an: var(--c-icon, var(--c-accent)); display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.anatomy__stage { position: relative; }
.anatomy__svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Illustration palette (theme neutrals + accent) */
.an-frame { fill: var(--c-surface-2); stroke: var(--c-border-strong); stroke-width: 1.5; }
.an-bar { fill: var(--c-surface); }
.an-dot { fill: var(--c-border-strong); }
.an-dot--1 { fill: var(--c-accent); opacity: 0.7; }
.an-address { fill: var(--c-bg); }
.an-line-icon { fill: none; stroke: var(--c-muted); stroke-width: 1.6; stroke-linecap: round; }
.an-text { fill: var(--c-text); opacity: 0.85; }
.an-text--soft { opacity: 0.22; }
.an-text--light { fill: var(--c-white); opacity: 0.35; }
.an-logo { fill: var(--c-text); }
.an-pill { fill: var(--c-text); }
.an-block { fill: var(--c-surface); }
.an-cta { fill: var(--c-accent); }
.an-media { fill: color-mix(in srgb, var(--an) 16%, var(--c-surface-2)); }
.an-media--small { fill: var(--c-surface); }
.an-media-sun { fill: color-mix(in srgb, var(--c-accent) 70%, white); }
.an-media-hill { fill: color-mix(in srgb, var(--an) 45%, var(--c-surface-2)); }
.an-card { fill: var(--c-white); stroke: var(--c-border-strong); stroke-width: 1.2; }
.an-card--float { filter: drop-shadow(0 16px 24px rgba(30, 30, 30, 0.12)); }
.an-price { fill: var(--c-accent); }
.an-cart { fill: none; stroke: var(--an); stroke-width: 1.6; }
.an-footer { fill: var(--c-text); }
.an-chat { fill: var(--an); }
.an-chat-mark { stroke: var(--c-white); stroke-width: 2; stroke-linecap: round; }
.an-code { fill: var(--c-text); filter: drop-shadow(0 18px 28px rgba(30, 30, 30, 0.22)); }
.an-code-line { fill: var(--c-white); opacity: 0.28; }
.an-code-line--a { fill: var(--an); opacity: 1; }
.an-code-line--b { fill: var(--c-accent); opacity: 0.9; }
.an-bar-chart { fill: color-mix(in srgb, var(--an) 35%, var(--c-surface-2)); }
.an-bar-chart--hi { fill: var(--an); }
.an-ring-chart { fill: none; stroke: var(--an); stroke-width: 6; stroke-dasharray: 80 33; transform: rotate(-90deg); transform-origin: 848px 458px; }
.an-wire { fill: none; stroke: var(--an); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: 0.6; }
.an-tile { fill: color-mix(in srgb, var(--an) 18%, var(--c-surface-2)); stroke: var(--an); stroke-width: 1.2; }
.an-tile--alt { fill: color-mix(in srgb, var(--c-accent) 14%, var(--c-surface-2)); stroke: var(--c-accent); }
.an-tile-mark { fill: var(--an); }
.an-tile-mark-line { stroke: var(--c-text); stroke-width: 2; stroke-linecap: round; opacity: 0.7; }

/* Highlight of the active area */
.an-ring { fill: color-mix(in srgb, var(--an) 7%, transparent); stroke: var(--an); stroke-width: 2; stroke-dasharray: 6 6; opacity: 0; transition: opacity 250ms var(--ease-out); pointer-events: none; }
.an-ring.is-active { opacity: 1; }

/* Hotspots */
.anatomy__spots { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0; pointer-events: none; }
.anatomy__spot {
	position: absolute; left: var(--x); top: var(--y); width: 36px; height: 36px; margin: -18px 0 0 -18px;
	display: grid; place-items: center; border-radius: 50%; cursor: pointer; pointer-events: auto;
}
.anatomy__dot { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--an); border: 3px solid var(--c-white); box-shadow: 0 2px 8px rgba(30, 30, 30, 0.25); transition: transform 250ms var(--ease-out); }
.anatomy__dot::after {
	content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--an); opacity: 0;
	animation: an-pulse 2.6s var(--ease-out) 4; /* A few gentle pulses, then rest. */
}
.anatomy__dot::after { animation-delay: calc(var(--d, 0) * 1ms); } /* Staggered per hotspot (set by anatomy.js). */
.anatomy__spot:hover .anatomy__dot, .anatomy__spot:focus-visible .anatomy__dot { transform: scale(1.2); }
.anatomy__spot.is-active .anatomy__dot { transform: scale(1.3); background: var(--c-blue); }
.anatomy__spot.is-active .anatomy__dot::after { animation: none; opacity: 0.6; inset: -6px; border-color: var(--c-blue); }
.anatomy__spot:focus-visible { outline: 2px solid var(--c-text); outline-offset: 2px; }
@keyframes an-pulse { 0% { transform: scale(0.7); opacity: 0.6; } 100% { transform: scale(1.9); opacity: 0; } }

/* Panel */
.anatomy__panels { position: relative; display: grid; align-content: center; min-height: 260px; padding: 28px; border-radius: var(--radius-lg); background: var(--c-surface); border: 1px solid var(--c-border); }
.anatomy__panel { display: grid; gap: 12px; align-content: start; }
.anatomy__count { font-family: var(--f-number); font-size: 14px; color: var(--c-muted); letter-spacing: 0.04em; }
.anatomy__count span { color: var(--an); font-weight: 700; }
.anatomy__title { font-size: 30px; }
.anatomy__text { line-height: 1.65; }
.anatomy__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 600; color: var(--c-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; } /* links are orange */
.anatomy__more .icon { width: 16px; height: 16px; color: currentColor; transition: transform var(--t-hover) var(--ease-out); }
.anatomy__more:hover .icon { transform: translateX(3px); }
.anatomy__nav { display: flex; gap: 8px; margin-top: 20px; }
.anatomy__nav[hidden] { display: none; }
.anatomy__step { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c-white); border: 1px solid var(--c-border-strong); }
.anatomy__step:hover { border-color: var(--an); color: var(--an); }
.anatomy__step .icon { width: 18px; height: 18px; }

/* With JS: one panel at a time, gentle swap. Without JS: all listed. */
.js .anatomy__panel[data-inactive] { display: none; }
.js .anatomy__panel { animation: an-in 300ms var(--ease-out); }
@keyframes an-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html:not(.js) .anatomy__panel + .anatomy__panel { padding-top: 18px; border-top: 1px solid var(--c-border-strong); }

@media (max-width: 1023px) {
	.anatomy { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.anatomy__panels { min-height: 0; padding: 22px; }
	.anatomy__title { font-size: 26px; }
}
@media (max-width: 767px) {
	.anatomy__spot { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
	.anatomy__dot { width: 13px; height: 13px; border-width: 2px; }
	.an-text--soft { opacity: 0.15; }
}
@media (prefers-reduced-motion: reduce) {
	.anatomy__dot::after { animation: none; }
	.js .anatomy__panel { animation: none; }
	.an-ring, .anatomy__dot { transition: none; }
}
