/* Engine look: the floor's blocks, links, pills and packets, using designed-to-scale's
 * published values (face gradients, 2:1 grid, packet colors, burst timings).
 * Loaded last; overrides palette.css and dts.css where they overlap. Our own CSS. */

/* face gradients per hue: top t0 -> t1, sides s0 -> s1 (light) */
.iso .hue-amber  { --t0: #fff3d6; --t1: #fee7b8; --s0: #fcdb9c; --s1: #f6cd82; }
.iso .hue-orange { --t0: #fee6cc; --t1: #fcd4ad; --s0: #f9c697; --s1: #f3b47f; }
.iso .hue-blue   { --t0: #dfebf9; --t1: #cde0f5; --s0: #bcd3ef; --s1: #a9c5e8; }
.iso .hue-violet { --t0: #f2eaf9; --t1: #e6dbf4; --s0: #d9cbef; --s1: #cbbae6; }
.iso .hue-green  { --t0: #e2f2d7; --t1: #d1e9c2; --s0: #c3e1b2; --s1: #b3d79f; }
.iso .hue-tan    { --t0: #f7f0e7; --t1: #f0e7dc; --s0: #ece2d5; --s1: #e3d7c8; }
/* dark: same families, built from the lowered triplets in palette.css */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .iso [class*="hue-"] { --t0: var(--ht); --t1: var(--hl); --s0: var(--hl); --s1: var(--hr); }
}
:root[data-theme="dark"] .iso [class*="hue-"] { --t0: var(--ht); --t1: var(--hl); --s0: var(--hl); --s1: var(--hr); }
.iso .g-t0 { stop-color: var(--t0); }
.iso .g-t1 { stop-color: var(--t1); }
.iso .g-s0 { stop-color: var(--s0); }
.iso .g-s1 { stop-color: var(--s1); }

/* block layers */
.iso .b-shadow { fill: #6b5236; opacity: .26; filter: url(#iso-blur-lg); }
.iso .b-shade { fill: #3a2a14; opacity: .05; }
.iso .b-top, .iso .b-side { opacity: 1; }
.iso .b-sheen { fill: #fff; opacity: .22; filter: url(#iso-blur-sm); }
.iso .b-bevel { fill: none; stroke: #fff; stroke-opacity: .75; stroke-width: 1.6; stroke-linecap: round; }
.iso .b-bevel-dark { fill: none; stroke: #5a4123; stroke-opacity: .07; stroke-width: 2.4; stroke-linecap: round; }
.iso .b-outline { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.iso .k-idle .b-outline { stroke: var(--muted); stroke-dasharray: 7 6; stroke-width: 2; }
.iso .c-lip { fill: none; stroke: #fff; stroke-opacity: .7; stroke-width: 1.4; }

/* the floor: his grid ink at 30% */
.iso .grid line { stroke: #a8916f; stroke-opacity: .3; stroke-width: .8; opacity: 1; }

/* links: 1.9 px at his scale, round caps; muted ship/report links are dashed 5 4.5 */
.iso .wire { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 1; }
.iso .wire.ship, .iso .wire.report { stroke: #b0a698; stroke-width: 2; stroke-dasharray: 6.5 6; opacity: 1; }
.iso .wire.gate { stroke: var(--rust); stroke-dasharray: 6.5 6; }
.iso .wire.lit { stroke-width: 2.6; }
.iso .arrow-head { fill: var(--ink); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.iso .arrow-head.rust { fill: var(--rust); stroke: var(--rust); }
.iso .arrow-head.soft { fill: #b0a698; stroke: #b0a698; }

/* pills: ink outline, solid dark copy 3 px below */
.iso .pill-bg { stroke: var(--ink); stroke-width: 1.8; }
.iso .pill-shadow { fill: #1c1a17; }
.iso .pill-t { font-weight: 700; }

/* packets */
.iso .pkt { transition: opacity .25s; }
.iso .pkt circle, .iso .pkt rect { fill: #f3b47f; stroke: var(--ink); stroke-width: 2; }
.iso .pkt--ping circle { fill: #f4fbef; stroke: #2f8a43; stroke-width: 2.6; }
.iso .pkt--write rect { fill: #5d5466; }
.iso .pkt--msg rect { fill: #efb041; }
.iso .pkt--gate rect { fill: var(--rust); }
.iso .pkt--heavy rect { fill: #e8834d; }
.iso .pkt--back circle, .iso .pkt--back rect { fill: #9fd28f; }
.iso .pkt--held circle, .iso .pkt--held rect { animation: .8s ease-in-out infinite pkt-held; }
@keyframes pkt-held { 0%, 100% { stroke-width: 2; } 50% { stroke-width: 4.4; } }
.iso .fx-ring, .iso .spot { transform-box: fill-box; transform-origin: 50% 50%; }
.iso .fx--ok .fx-ring { fill: none; stroke: #3fa456; stroke-width: 2; animation: .45s ease-out forwards fx-pop; }
@keyframes fx-pop { 0% { opacity: .9; transform: scale(.8); } 100% { opacity: 0; transform: scale(2); } }
.iso .spot { fill: rgba(95, 174, 87, .18); stroke: #5fae57; stroke-width: 2.4; animation: 1.5s ease-out forwards spot; }
@keyframes spot { 0% { opacity: 0; transform: scale(.75); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }

/* legend chips match the packets */
.lg.pk { background: #f3b47f; }
.lg.pk.ship { background: #9fd28f; }
.lg.pk.report { background: #f4fbef; border: 2px solid #2f8a43; }

/* dark theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .iso .b-shadow { fill: #000; opacity: .45; }
  :root:not([data-theme="light"]) .iso .b-sheen { opacity: .06; }
  :root:not([data-theme="light"]) .iso .b-bevel { stroke-opacity: .16; }
  :root:not([data-theme="light"]) .iso .c-lip { stroke-opacity: .2; }
  :root:not([data-theme="light"]) .iso .grid line { stroke: #6b5a44; stroke-opacity: .55; }
  :root:not([data-theme="light"]) .iso .pill-shadow { fill: #050403; }
}
:root[data-theme="dark"] .iso .b-shadow { fill: #000; opacity: .45; }
:root[data-theme="dark"] .iso .b-sheen { opacity: .06; }
:root[data-theme="dark"] .iso .b-bevel { stroke-opacity: .16; }
:root[data-theme="dark"] .iso .c-lip { stroke-opacity: .2; }
:root[data-theme="dark"] .iso .grid line { stroke: #6b5a44; stroke-opacity: .55; }
:root[data-theme="dark"] .iso .pill-shadow { fill: #050403; }

/* ---- transitions between stations: his exit 420 / move 820 / enter 680 / stagger 130 ms ---- */
.iso .blk { transition: transform .82s cubic-bezier(.2, .8, .2, 1), opacity .42s ease; }
.iso .overlay.enter > * { animation: iso-enter .68s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes iso-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.iso .overlay.exit { animation: iso-exit .42s ease forwards; pointer-events: none; }
@keyframes iso-exit { to { opacity: 0; transform: translateY(-6px); } }

/* ---- metric chips: a level stripe per kind ---- */
.mchip { border-left: 3px solid var(--lv, var(--line)); }
.mchip.lv-trip { --lv: #8fb26f; }
.mchip.lv-bell { --lv: #d8cbbb; }
.mchip.lv-ship { --lv: #8fb0dc; }
.mchip.lv-policy { --lv: #b79ce6; }
.mchip.lv-crank { --lv: #efb041; }
.mchip.warn { --lv: var(--rust); }
.mchip:first-child, .mchip.warn { border-left-color: var(--lv); }

/* ---- the line: a filled rail up to the current station ---- */
.lineup .step::before { border-top-width: 3px; top: 15.5px; transition: border-color .42s ease; }
.lineup .step.past::before, .lineup .step.on::before { border-top-color: var(--go-line); }
.lineup .step.past .ball { background: var(--go); }

/* ---- a little paper grain on the stage ---- */
.stage { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .32 0 0 0 0 .21 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E"); }

/* ---- guide-in: the side cards ease in on every station change ---- */
.ex-body > *, #done li, .stage-card > * { animation: guide-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.ex-body > :nth-child(2) { animation-delay: 60ms; }
.ex-body > :nth-child(3) { animation-delay: 120ms; }
.ex-body > :nth-child(4) { animation-delay: 180ms; }
.ex-body > :nth-child(5) { animation-delay: 240ms; }
.ex-body > :nth-child(n+6) { animation-delay: 300ms; }
#done li:nth-child(2) { animation-delay: 70ms; }
#done li:nth-child(3) { animation-delay: 140ms; }
#done li:nth-child(n+4) { animation-delay: 210ms; }
@keyframes guide-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .iso .blk, .lineup .step::before { transition: none; }
  .iso .overlay.enter > *, .iso .overlay.exit, .ex-body > *, #done li, .stage-card > * { animation: none; }
}
