/* A deep link paints the black terminal shell while the workspace code starts. */
html[data-workspace-boot] body { background: var(--ws-background,#121019); }
html[data-workspace-boot] #home,
html[data-workspace-boot] :is(.mast-center,#mast-workspace,.skip) { display: none; }

#mast, #mast.mast-home, #mast:not(.mast-home) {
  background: #000;
  border-color: #303037;
  box-shadow: none;
  backdrop-filter: none;
}
#mast .brand { color: #faf7ff; }
#mast.mast-home .brand img { box-shadow: none; }
#mast:not(.mast-home) .tools-menu summary,
#mast:not(.mast-home) .mast-work-tools > :is(a,button),
#mast.mast-home .mast-right .mast-cta {
  background: #08080a;
  color: #f3ecff;
  border-color: #373139;
  box-shadow: none;
}
#mast:not(.mast-home) .tools-menu summary:hover,
#mast:not(.mast-home) .tools-menu[open] summary,
#mast:not(.mast-home) .mast-work-tools > :is(a,button):hover,
#mast.mast-home .mast-right .mast-cta:hover {
  background: #17141c;
  color: #fff;
  border-color: #76658e;
}
#mast:not(.mast-home) :is(.mast-icon,.tools-menu .mast-icon) { color: #d8ccfa; }
#mast:not(.mast-home) #tools-menu > summary {
  background: #271e36;
  border-color: #675381;
  color: #ebdeff;
}
#mast:not(.mast-home) #tools-menu > summary:is(:hover,:focus-visible),
#mast:not(.mast-home) #tools-menu[open] > summary {
  background: var(--ws-button);
  color: var(--ws-button-ink);
}

#terminal[data-view] .rail .recent-token[aria-current],
#terminal[data-view] button.pool-row[aria-pressed=true]:not(.cell-button) { box-shadow: none; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: start;
  min-width: 0;
}
.workbench > :is(#scan-stage,#workspace) { grid-area: 1 / 1; min-width: 0; }
.workbench[data-scan-phase="working"] #workspace { visibility: hidden; pointer-events: none; }
.workbench[data-scan-phase="settling"] #scan-stage { pointer-events: none; }
#scan-stage {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #fff7ee;
  border-color: #8f522e;
  background: #1a1512;
  box-shadow: inset 0 1px #fbc48954,0 13px 36px #0704056e;
}
#scan-stage:focus { outline: none; }
.scan-stage-orbit > img {
  border-color: #ffba763f;
  background: #2d2119;
  box-shadow: inset 0 1px #ffde9955,0 14px 38px #110805a6;
}
.scan-orbit-sweep {
  inset: 0;
  width: 100%;
  height: 100%;
  fill: #e99a5435;
}
.scan-orbit-sweep path + path { stroke: #ffb56f; stroke-width: 1.5; }
.scan-orbit-guide { stroke: #efad6a70; }
.scan-orbit-dot { fill: #ffd69b; stroke: #fff0d2; }
.scan-stage-body h2 { color: #ffcf9d; }
.scan-stage-body p { color: #e6c9af; }
.scan-stage-body li {
  color: #ffefe1;
  border-color: #f6ab6e3a;
  background: #ffe1c00d;
  box-shadow: inset 0 1px #ffd4a31c;
}
.scan-stage-body li svg { color: #fbc58c; }
.scan-stage-body li small { color: #ffc48d; }
.scan-stage-body li[data-state=ready] small { color: #94ecc2; }
.scan-stage-body li[data-state=missing] small { color: #d3c2b9; }
.scan-stage-body li[data-state=busy]::before { border-left: 1px solid #e59b60a1; }

#terminal :is(.rug-card,.risk-hero)[data-risk="lower"] {
  --risk-bg: #103d34;
  --risk-light: #1e654e;
  --risk-text: #f0fff8;
  --risk-signal: #a2f5c8;
}
#terminal :is(.rug-card,.risk-hero)[data-risk="elevated"] {
  --risk-bg: #ffc581;
  --risk-light: #ffe2b3;
  --risk-text: #482605;
  --risk-signal: #71380a;
}
#terminal :is(.rug-card,.risk-hero)[data-risk="high"] {
  --risk-bg: #741e35;
  --risk-light: #a43144;
  --risk-text: #fff2f4;
  --risk-signal: #ffc0c5;
}
#terminal :is(.rug-card,.risk-hero)[data-risk="unknown"] {
  --risk-bg: #34313b;
  --risk-light: #514c5c;
  --risk-text: #f2eef8;
  --risk-signal: #d7cced;
}
#terminal .rug-card :is(.rug-number strong,.rug-track progress) { color: var(--risk-signal); }
#terminal .rug-card .detections { background: color-mix(in srgb, var(--risk-text) 10%, transparent); }
#terminal .rug-card .detection-list li > b { border: 1px solid color-mix(in srgb, var(--risk-text) 23%, transparent); }

@media (prefers-reduced-motion: no-preference) {
  [data-interface-motion="on"] .workbench[data-scan-phase="working"] #scan-stage { animation: scan-enter .24s cubic-bezier(.22,.68,.3,1) both; }
  [data-interface-motion="on"] .workbench[data-scan-phase="settling"] #scan-stage { animation: scan-out .19s ease-out both; }
  [data-interface-motion="on"] .workbench[data-scan-phase="settling"] #workspace { animation: scan-result .32s .07s cubic-bezier(.16,.76,.24,1) both; }
  [data-interface-motion="on"] .workbench[data-scan-phase="settling"] .rug-track progress::-webkit-progress-value { animation: score-fill .32s .08s cubic-bezier(.2,.74,.25,1) both; }
  [data-interface-motion="on"] .workbench[data-scan-phase="settling"] .detection-list li { animation: detection-arrive .23s .16s ease-out both; }
  [data-interface-motion="on"] .workbench[data-scan-phase="settling"] .detection-list li:nth-child(2) { animation-delay: .20s; }
  [data-interface-motion="on"] .workbench[data-scan-phase="settling"] .detection-list li:nth-child(3) { animation-delay: .22s; }
}
@keyframes scan-enter { from { opacity: .42; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes scan-out { to { opacity: 0; transform: scale(.988); visibility: hidden; } }
@keyframes scan-result { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes score-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes detection-arrive {
  from { opacity: .38; transform: translateX(7px); }
  to { opacity: 1; transform: none; }
}
[data-interface-motion="off"] .workbench[data-scan-phase="settling"] #scan-stage { visibility: hidden; }

.hero-flight { position: absolute; z-index: 2; pointer-events: none; inset: 0; }
.hero-flight > svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #d7bbff; stroke-opacity: .38; stroke-width: .8; stroke-dasharray: 3 9; }
.flight-tile {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(32px,4.3vw,57px);
  aspect-ratio: 1;
  border: 1px solid #fffafeb0;
  border-radius: 14px;
  background: var(--tile);
  color: var(--tile-ink);
  box-shadow: inset 0 1px #fff,0 12px 24px #09050fc7;
}
.flight-tile svg { width: 60%; height: 60%; }
.flight-map { --tile:#d4b9ff; --tile-ink:#2a114f; top: 16%; left: 10%; rotate: -13deg; }
.flight-money { --tile:#a8d9ff; --tile-ink:#102a49; top: 28%; right: 7%; rotate: 14deg; }
.flight-safety { --tile:#ffda66; --tile-ink:#442900; bottom: 11%; right: 23%; rotate: -10deg; }

.story-navigation::after {
  content: '';
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: -1px;
  height: 2px;
  transform: scaleX(var(--story-progress,.333));
  transform-origin: left;
  border-radius: 5px;
  background: #d6baff;
}
.feature-shot { --feature-fill: #d1b4ff; --feature-ink:#2d1450; --feature-sweep:#8b52dc; }
.feature-money { --feature-fill:#b4e0ff; --feature-ink:#102942; --feature-sweep:#5e90d7; }
.feature-safety { --feature-fill:#ffdb66; --feature-ink:#492900; --feature-sweep:#ae6a25; }
.feature-shot .feature-copy .tool-mark {
  width: 66px;
  height: 66px;
  background: var(--feature-fill);
  color: var(--feature-ink);
  border: 1px solid #fff9;
  border-radius: 18px;
  box-shadow: inset 0 1px #fffdfb,0 8px 19px #08040c9c;
}
.feature-shot .feature-copy .tool-mark svg { width: 38px; height: 38px; }
.showcase-index > a .tool-mark {
  background: var(--index-fill,#dbc4ff);
  color: #2a1749;
  border-color: #ffffff9c;
  box-shadow: inset 0 1px #fff9,0 2px 10px #09061093;
}
.showcase-index > a:nth-child(2) { --index-fill:#ffc591; }
.showcase-index > a:nth-child(3) { --index-fill:#b4e0ff; }
.showcase-index > a:nth-child(4) { --index-fill:#e0c5ff; }
.showcase-index > a:nth-child(5) { --index-fill:#ffd585; }
.feature-shot[data-in-focus] {
  border-color: color-mix(in srgb,var(--feature-fill) 76%,#3b2a55);
  box-shadow: inset 0 1px #f6e9ff70,0 18px 52px #05030785,0 0 44px color-mix(in srgb,var(--feature-sweep) 31%,transparent);
}
.feature-shot[data-in-focus] .feature-visual { border-color: color-mix(in srgb,var(--feature-fill) 51%,#30223f); }
.feature-shot[data-in-focus] .feature-action {
  background: var(--feature-fill);
  color: var(--feature-ink);
  border-color: #fff8;
  box-shadow: inset 0 1px #fff9,0 7px 17px #07040d78;
}
.feature-shot[data-in-focus] .feature-action:hover { background: color-mix(in srgb,var(--feature-fill) 69%,white); }

@media (prefers-reduced-motion: no-preference) {
  [data-interface-motion="on"] .hero-flight > svg { animation: flight-route 14s linear infinite; }
  [data-interface-motion="on"] .flight-tile { animation: flight-tile 5.4s ease-in-out infinite; }
  [data-interface-motion="on"] .flight-money { animation-delay: -2.2s; animation-duration: 6.5s; }
  [data-interface-motion="on"] .flight-safety { animation-delay: -3.4s; animation-duration: 7s; }
  .showcase[data-motion] .story-navigation::after { transition: transform .43s cubic-bezier(.17,.76,.23,1); }
  .showcase[data-motion] .feature-shot[data-in-focus] .feature-copy .tool-mark { animation: mark-hit .62s cubic-bezier(.18,.72,.3,1.22) both; }
  .showcase[data-motion] .feature-shot[data-in-focus] .feature-visual { animation: evidence-hit .64s .08s cubic-bezier(.17,.74,.25,1) both; }
  .showcase[data-motion] .feature-shot[data-in-focus] .story-findings div { animation: finding-hit .54s .37s cubic-bezier(.17,.7,.23,1) both; }
  .showcase[data-motion] .feature-shot[data-in-focus] .story-findings div:nth-child(2) { animation-delay: .51s; }
  .showcase[data-motion] .feature-safety[data-in-focus] .safety-signals > div { animation: risk-hit .5s .22s both; }
  .showcase[data-motion] .feature-safety[data-in-focus] .safety-signals > div:nth-child(2) { animation-delay: .37s; }
  .showcase[data-motion] .feature-safety[data-in-focus] .safety-signals > div:nth-child(3) { animation-delay: .52s; }
}
@keyframes flight-route { to { stroke-dashoffset: -180; } }
@keyframes flight-tile {
  0%,100% { transform: translate(-9px,7px) rotate(-7deg); }
  34% { transform: translate(3px,-13px) rotate(8deg); }
  64% { transform: translate(13px,-2px) rotate(4deg); }
}
@keyframes mark-hit { from { opacity: .38; transform: translate(-18px,10px) rotate(-20deg) scale(.74); } to { opacity: 1; transform: none; } }
@keyframes evidence-hit { from { opacity: .4; transform: translate(22px,12px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes finding-hit {
  from { opacity: .26; transform: translateY(13px) scale(.94); }
  70% { border-color: #ebd7ffbf; }
  to { opacity: 1; transform: none; }
}
@keyframes risk-hit {
  from { opacity: .44; transform: translateX(18px); }
  65% { background:#ffce7c35; border-color:#ffe5a4aa; }
  to { opacity: 1; transform: none; }
}
@media (max-width: 530px) {
  .flight-tile { border-radius: 9px; width: 32px; }
  .flight-map { top: 13%; left: 8%; }
  .flight-money { right: 7%; }
  .flight-safety { bottom: 10%; right: 19%; }
  .feature-shot .feature-copy .tool-mark { width: 53px; height: 53px; border-radius: 14px; }
  .feature-shot .feature-copy .tool-mark svg { width: 31px; height: 31px; }
}
