/* Photon skills map (Atlas): the styles of /js/skills-atlas.js. Everything is scoped under .sa (the map) or .sa-pal
   (a container that only needs the palette, e.g. a legend); every class is prefixed sa-.
   Colours are tokens built from the page's own tokens (site-2026-app.css), so the map follows the page's theme.
   Topic colours are cool hues on purpose: green, amber and red belong to the verdicts. */
.sa, .sa-pal {
  --sa-surface: var(--white, #fff);
  --sa-ink: var(--ink, #0d1f3c);
  --sa-ink2: var(--ink2, #46526b);
  --sa-mute: var(--mute, #5b6780);
  --sa-line: var(--line, #dce2ea);
  --sa-faint: #b9c3d3;
  --sa-focus: var(--blue, #2e5bdb);
  --sa-font: var(--fu, "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --sa-display: var(--fd, Georgia, "Times New Roman", serif);
  --sa-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sa-k0: #2563c9; --sa-k1: #7a45c8; --sa-k2: #0e8a96; --sa-k3: #b83d86;
  --sa-k4: #3f4fb5; --sa-k5: #1d93c4; --sa-k6: #9a4fb0; --sa-k7: #4b5a75;
}
:is(.sa, .sa-pal) .sa-k0 { --sa-kc: var(--sa-k0); }
:is(.sa, .sa-pal) .sa-k1 { --sa-kc: var(--sa-k1); }
:is(.sa, .sa-pal) .sa-k2 { --sa-kc: var(--sa-k2); }
:is(.sa, .sa-pal) .sa-k3 { --sa-kc: var(--sa-k3); }
:is(.sa, .sa-pal) .sa-k4 { --sa-kc: var(--sa-k4); }
:is(.sa, .sa-pal) .sa-k5 { --sa-kc: var(--sa-k5); }
:is(.sa, .sa-pal) .sa-k6 { --sa-kc: var(--sa-k6); }
:is(.sa, .sa-pal) .sa-k7 { --sa-kc: var(--sa-k7); }

.sa { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 82vh; margin: 0 auto; color: var(--sa-ink); font-family: var(--sa-font); }
.sa .sa-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sa .sa-svg.sa-hot { cursor: pointer; }
.sa .sa-svg:focus, .sa .sa-svg:focus-visible { outline: none; }   /* focus lands here only on a click; the skills show focus */

/* rings, topic arcs, ladder lines */
.sa .sa-ring { fill: none; stroke: var(--sa-line); stroke-width: 1.2; stroke-dasharray: 1.5 5; }
.sa .sa-ring.sa-core { stroke-dasharray: none; opacity: .8; }
.sa .sa-ring.sa-faint { stroke: var(--sa-faint); stroke-width: 1.6; stroke-dasharray: 7 7; }
.sa .sa-arc { fill: none; stroke: var(--sa-kc); stroke-width: 7; stroke-linecap: round; cursor: pointer; transition: opacity .3s; }
.sa .sa-tlab { font: 600 11px var(--sa-font); letter-spacing: .02em; fill: var(--sa-ink2); cursor: pointer; transition: opacity .3s; }
.sa .sa-arc.sa-dim, .sa .sa-tlab.sa-dim { opacity: .22; }
.sa .sa-edge { fill: none; stroke: var(--sa-kc); stroke-width: 1.15; opacity: .32; transition: opacity .3s, stroke-width .3s; }
.sa .sa-edge.sa-faint { stroke-dasharray: 3 4; opacity: .2; }
.sa .sa-edge.sa-e1 { opacity: .05; }
.sa .sa-edge.sa-e3 { opacity: .95; stroke-width: 2.4; stroke-dasharray: 7 5; animation: sa-flow 1.4s linear infinite; }
/* a marked line (e.g. the part of a ladder where the skill broke): its colour comes from the page */
.sa .sa-edge.sa-marked { opacity: .75; stroke-width: 1.8; }
.sa .sa-edge.sa-marked.sa-e1 { opacity: .08; }
.sa .sa-edge.sa-marked.sa-e3 { opacity: 1; stroke-width: 2.8; }
@keyframes sa-flow { to { stroke-dashoffset: -24; } }

/* ring badges (T1, T2B, ...) and "not taken yet" */
.sa .sa-rb rect { fill: var(--sa-surface); stroke: var(--sa-ink2); stroke-width: 1.2; }
.sa .sa-rb text { font: 700 10.5px var(--sa-mono); fill: var(--sa-ink); }
.sa .sa-rb.sa-faint rect { stroke: var(--sa-faint); stroke-dasharray: 3 3; }
.sa .sa-rb.sa-faint text { fill: var(--sa-mute); }
.sa .sa-rnote { font: 600 calc(11.5px * var(--sa-ls, 1)) var(--sa-font); fill: var(--sa-mute); paint-order: stroke; stroke: var(--sa-surface); stroke-width: 4px; stroke-linejoin: round; }

/* question parts: the shape and colour come from the page (style attribute); here only defaults and emphasis */
.sa .sa-pt { transition: opacity .3s; }
.sa .sa-pt.sa-plain .sa-ps { fill: var(--sa-kc); stroke: var(--sa-surface); stroke-width: 1.4; }
.sa .sa-pt.sa-faint { opacity: .65; }
.sa .sa-pt.sa-e1 { opacity: .18; }
.sa .sa-pt.sa-faint.sa-e1 { opacity: .12; }
.sa .sa-pt.sa-sel { filter: drop-shadow(0 0 1.5px var(--sa-ink)) drop-shadow(0 0 1px var(--sa-ink)); }

/* skills: a topic-coloured ring round each verdict shape */
.sa .sa-sk { cursor: pointer; transition: opacity .3s; outline: none; }
.sa .sa-sk:focus, .sa .sa-sk:focus-visible { outline: none; }
.sa .sa-halo { fill: var(--sa-surface); stroke: var(--sa-kc); stroke-width: 1.6; }
.sa .sa-sk.sa-plain .sa-ss { fill: var(--sa-kc); }
.sa .sa-sk.sa-faint .sa-halo { stroke-opacity: .45; }
.sa .sa-sk.sa-e1 { opacity: .28; }
.sa .sa-sk.sa-sel .sa-halo { stroke: var(--sa-ink); stroke-width: 3; }
.sa .sa-sk:focus-visible .sa-halo { stroke: var(--sa-focus); stroke-width: 3.6; }

/* labels: skill codes always; part labels only along a traced ladder */
.sa .sa-slab, .sa .sa-plab { font-family: var(--sa-mono); font-weight: 600; pointer-events: none; paint-order: stroke; stroke: var(--sa-surface); stroke-width: 3px; stroke-linejoin: round; transition: opacity .3s; }
.sa .sa-slab { font-size: calc(10px * var(--sa-ls, 1)); fill: var(--sa-ink2); }
.sa .sa-slab.sa-e1 { opacity: .25; }
.sa .sa-slab.sa-e3 { fill: var(--sa-ink); }
.sa .sa-plab { font-size: calc(9.5px * var(--sa-ls, 1)); fill: var(--sa-ink); opacity: 0; }
.sa .sa-plab.sa-e3 { opacity: 1; }

/* the text in the middle */
.sa .sa-hub { position: absolute; left: 50%; top: 50%; width: calc(236px * var(--sa-k, .8)); transform: translate(-50%, -50%); text-align: center; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: calc(5px * var(--sa-k, .8)); }
.sa .sa-hub-k { font: 600 max(9px, calc(12px * var(--sa-k, .8)))/1.25 var(--sa-font); letter-spacing: .08em; text-transform: uppercase; color: var(--sa-mute); max-width: 100%; overflow-wrap: anywhere; }
.sa .sa-hub-n { font: 600 max(18px, calc(58px * var(--sa-k, .8)))/1 var(--sa-display); color: var(--sa-ink); max-width: 100%; overflow-wrap: anywhere; }
.sa .sa-hub-n.sa-code { font-family: var(--sa-mono); font-size: max(15px, calc(40px * var(--sa-k, .8))); }
.sa .sa-hub-n.sa-sm { font-size: max(13px, calc(23px * var(--sa-k, .8))); line-height: 1.1; }
.sa .sa-hub-s { font: 500 max(10px, calc(14px * var(--sa-k, .8)))/1.3 var(--sa-font); color: var(--sa-ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.sa.sa-small .sa-hub { width: max(92px, calc(236px * var(--sa-k, .8))); }
.sa.sa-small .sa-hub-k, .sa.sa-small .sa-tlab, .sa.sa-small .sa-slab.sa-quiet:not(.sa-e3) { display: none; }
.sa.sa-small .sa-hub-s { font-size: 10px; -webkit-line-clamp: 2; }

/* tooltip */
.sa .sa-tip { position: absolute; left: 0; top: 0; z-index: 6; max-width: min(300px, calc(100% - 16px)); padding: 10px 12px; border-radius: 6px; background: var(--sa-surface); border: 1px solid var(--sa-line); box-shadow: 0 10px 30px rgb(13 31 60 / .14); font: 400 13px/1.45 var(--sa-font); color: var(--sa-ink); pointer-events: none; }
.sa .sa-tip[hidden] { display: none; }
.sa .sa-tip b { font-weight: 600; }
.sa .sa-tip-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--sa-mute); font-size: 12.5px; }
.sa .sa-tip-h b { color: var(--sa-ink); font-family: var(--sa-mono); }
.sa .sa-tip-b { margin-top: 3px; }
.sa .sa-tip-m { margin-top: 4px; font-size: 12px; color: var(--sa-ink2); }

@media (prefers-reduced-motion: reduce) {
  .sa .sa-edge.sa-e3 { animation: none; stroke-dasharray: none; }
  .sa .sa-arc, .sa .sa-tlab, .sa .sa-edge, .sa .sa-pt, .sa .sa-sk, .sa .sa-slab, .sa .sa-plab { transition: none; }
}
