

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.nav-links a.active { color: var(--accent); }

.btn-sm { --pad-y: 8px; padding: var(--pad-y) 14px; font-size: 13px; }


.lab-hero { padding: clamp(28px, 5vw, 52px) 0 clamp(40px, 6vw, 72px); }
.lab-title {
  font-size: clamp(32px, 5.6vw, 66px);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.02;
  margin-top: 18px;
}
.lab-lead {
  margin-top: 26px; max-width: 720px;
  color: var(--muted); font-size: clamp(15.5px, 1.6vw, 17.5px); line-height: 1.75;
}

.lab-facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
  margin-top: clamp(32px, 4vw, 48px);
}
.fact { background: var(--panel); padding: 22px; }
.fact b {
  display: block;
  font-family: var(--disp); font-weight: 600;
  font-size: clamp(24px, 3vw, 36px); letter-spacing: -.02em;
  color: var(--accent);
}
.fact span {
  display: block; margin-top: 8px;
  font-family: var(--mono); font-size: 11px; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .04em; color: var(--faint);
}
.lab-hint { margin-top: 20px; color: var(--faint); }


.mod {
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: clamp(20px, 3vw, 34px);
}
.mod-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: clamp(18px, 2.2vw, 26px) clamp(18px, 2.4vw, 30px);
  border-bottom: 1px solid var(--line);
}
.mod-n { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.mod-head h3 { font-size: clamp(17px, 2vw, 22px); font-weight: 600; }
.mod-tech {
  margin-left: auto;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .05em;
}
.mod-body { padding: clamp(18px, 2.4vw, 30px); }
.mod-note {
  margin-top: 18px;
  font-size: 13.5px; line-height: 1.7; color: var(--muted);
  max-width: 760px;
}
.mod-note code {
  font-family: var(--mono); font-size: 12.5px;
  color: var(--accent); background: var(--bg-2);
  border: 1px solid var(--line); padding: 1px 6px;
}


.sh {
  border: 1px solid var(--line-2);
  background: #08080a;
  display: flex; flex-direction: column;
}
.sh-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.sh-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2c2c31; }
.sh-bar i:first-child { background: #3a3a40; }
.sh-bar span {
  margin-left: 10px;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.sh-out {
  height: clamp(240px, 34vh, 340px);
  overflow-y: auto;
  padding: 14px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  color: var(--muted);
  white-space: pre-wrap; word-break: break-word;
}
.sh-out .l-cmd { color: var(--text); }
.sh-out .l-ok { color: var(--accent); }
.sh-out .l-err { color: #ff6b6b; }
.sh-out .l-dim { color: var(--faint); }
.sh-out b { color: var(--text); font-weight: 600; }
.sh-in {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
}
.sh-prompt { font-family: var(--mono); color: var(--accent); font-size: 14px; }
.sh-in input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 13.5px;
}
.sh-in input::placeholder { color: #4a4a52; }


.ed { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ed-side, .ed-view { background: var(--bg-2); display: flex; flex-direction: column; min-width: 0; }
.ed-tabs { display: flex; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.ed-tabs button {
  flex: 1; padding: 11px 8px;
  background: var(--panel); border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  transition: color .15s ease, background-color .15s ease;
}
.ed-tabs button:hover { color: var(--text); }
.ed-tabs button[aria-selected="true"] { color: var(--accent-ink); background: var(--accent); }
#ed-code {
  flex: 1; min-height: 300px; resize: vertical;
  background: #08080a; border: 0; outline: none;
  color: #d6d6dc; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  padding: 14px 16px; tab-size: 2;
}
#ed-code:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.ed-status { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--faint); }
.ed-status.live { color: var(--accent); }
.ed-view { position: relative; }
.ed-view-tag {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  color: var(--faint); background: var(--panel);
}
.ed-view iframe { flex: 1; width: 100%; min-height: 300px; border: 0; background: #fff; }


.fx { position: relative; border: 1px solid var(--line); background: #08080a; }
.fx canvas { display: block; width: 100%; height: clamp(280px, 42vh, 420px); touch-action: none; }
.fx-hud {
  position: absolute; top: 12px; left: 14px;
  display: flex; gap: 16px;
  color: var(--faint); pointer-events: none;
}
.fx-hud b { color: var(--accent); font-weight: 600; }
.fx-ctl {
  display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}
.fx-ctl label, .alg-speed {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
}


input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: clamp(90px, 14vw, 150px); height: 2px;
  background: var(--line-2); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; background: var(--accent); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; background: var(--accent); border: 0; cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }


.alg { border: 1px solid var(--line); background: #08080a; }
.alg canvas { display: block; width: 100%; height: clamp(220px, 34vh, 330px); }
.alg-ctl {
  display: flex; align-items: center; gap: clamp(12px, 1.8vw, 22px); flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: 14px 16px;
}
.alg-algos { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.alg-algos button {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 14px;
  background: var(--panel); border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  transition: color .15s ease, background-color .15s ease;
}
.alg-algos button i { font-style: normal; font-size: 10px; color: var(--faint); }
.alg-algos button:hover { color: var(--text); }
.alg-algos button.on { background: var(--accent); color: var(--accent-ink); }
.alg-algos button.on i { color: rgba(10,10,11,.65); }
.alg-stat { display: flex; gap: 16px; color: var(--faint); }
.alg-stat b { color: var(--accent); font-weight: 600; }
.alg-ctl .btn { margin-left: auto; }
.alg-ctl .btn + .btn { margin-left: 0; }


.tg {
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  max-width: 560px;
}
.tg-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.tg-ava {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  color: var(--accent-ink); background: var(--accent);
}
.tg-who { display: flex; flex-direction: column; }
.tg-who b { font-size: 14px; }
.tg-who i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--accent); }
.tg-log {
  height: clamp(300px, 44vh, 400px);
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 84%;
  padding: 10px 14px;
  font-size: 14px; line-height: 1.55;
  white-space: pre-wrap;
  animation: msg-in .22s ease both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg-bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.msg-me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.msg-sys {
  align-self: center; max-width: 100%;
  background: none; border: 1px dashed var(--line-2);
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 12px;
}
.msg b { font-weight: 600; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.tg-keys {
  display: flex; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  min-height: 58px;
}
.tg-key {
  flex: 1 1 auto; min-width: 120px;
  padding: 10px 14px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); font-family: var(--font); font-size: 13.5px;
  cursor: pointer; text-align: center;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.tg-key:hover { border-color: var(--accent); color: var(--accent); }
.tg-key.pay { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.tg-key.pay:hover { background: #FF7A45; color: var(--accent-ink); }


.dash { border: 1px solid var(--line); background: #08080a; }
.dash-kpi {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line); border-bottom: 1px solid var(--line);
}
.kpi { background: var(--panel); padding: 16px 18px; }
.kpi span { display: block; color: var(--faint); }
.kpi b {
  display: block; margin-top: 8px;
  font-family: var(--disp); font-weight: 600; font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -.02em;
}
.kpi:nth-child(1) b { color: var(--accent); }
.dash canvas { display: block; width: 100%; height: clamp(160px, 24vh, 220px); }
.dash-feed {
  list-style: none;
  border-top: 1px solid var(--line);
  max-height: 168px; overflow-y: auto;
}
.dash-feed li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  animation: msg-in .25s ease both;
}
.dash-feed li:last-child { border-bottom: 0; }
.dash-feed time { color: var(--faint); flex: none; }
.dash-feed .tag {
  margin-left: auto; flex: none;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--line-2); padding: 2px 7px; color: var(--faint);
}
.dash-feed .tag.win { color: var(--accent); border-color: rgba(255, 90, 31,.4); }


.grid-skills {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
.sk { background: var(--panel); padding: clamp(22px, 2.6vw, 32px); }
.sk-h { color: var(--accent); margin-bottom: 20px; }
.sk-list { list-style: none; display: grid; gap: 16px; }
.sk-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline; }
.sk-list b { font-size: 14.5px; font-weight: 600; }
.sk-list span { grid-column: 1; font-size: 12.5px; color: var(--faint); }
.sk-bar { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 3px; align-self: center; }
.sk-bar i { width: 12px; height: 4px; background: var(--line-2); }
.sk-bar i.on { background: var(--accent); }
.sk-legend { margin-top: 22px; color: var(--faint); }


.code-box { border: 1px solid var(--line); background: var(--panel); }
.code-tabs { display: flex; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; }
.code-tabs button {
  padding: 13px 20px; white-space: nowrap;
  background: var(--panel); border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  transition: color .15s ease, background-color .15s ease;
}
.code-tabs button:hover { color: var(--text); }
.code-tabs button[aria-selected="true"] { color: var(--accent); background: var(--bg-2); }
.code-pane pre {
  margin: 0; padding: clamp(18px, 2.4vw, 28px);
  overflow-x: auto;
  background: #08080a;
}
.code-pane code {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.8;
  color: #cfcfd6; white-space: pre;
}
.c-com { color: #5d6b3f; font-style: italic; }
.c-str { color: #FF5A1F; }
.c-kw  { color: #7ec8ff; }
.c-num { color: #ffb86b; }
.c-fn  { color: #ededed; }

.rules-code {
  list-style: none;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-top: 0;
  margin-top: 0;
}
.rules-code li { background: var(--panel); padding: clamp(20px, 2.4vw, 28px); }
.rules-code b { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.rules-code span { font-size: 13.5px; color: var(--muted); line-height: 1.65; }


.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2vw, 24px); }
.gauge { position: relative; display: grid; place-items: center; text-align: center; }
.gauge svg { width: clamp(96px, 12vw, 132px); height: auto; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 5; }
.g-bg { stroke: var(--line); }
.g-fg {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1);
}
.gauge b {
  position: absolute; top: clamp(30px, 4vw, 44px);
  font-family: var(--disp); font-weight: 600;
  font-size: clamp(24px, 3vw, 34px); color: var(--text);
}
.gauge figcaption {
  margin-top: 14px;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .05em;
}
.gauges-note { margin-top: 20px; color: var(--faint); }

.checks {
  list-style: none;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
  margin-top: clamp(32px, 4vw, 48px);
}
.checks li { background: var(--panel); padding: clamp(20px, 2.4vw, 28px); }
.checks span {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-bottom: 12px;
  border: 1px solid rgba(255, 90, 31,.4);
  color: var(--accent); font-family: var(--mono); font-size: 12px;
}
.checks b { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.checks p { font-size: 13.5px; color: var(--muted); line-height: 1.65; }


@media (max-width: 940px) {
  .lab-facts { grid-template-columns: 1fr 1fr; }
  .ed { grid-template-columns: 1fr; }
  .grid-skills { grid-template-columns: 1fr; }
  .rules-code { grid-template-columns: 1fr; }
  .dash-kpi { grid-template-columns: 1fr 1fr; }
  .gauges { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .checks { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mod-tech { margin-left: 0; flex-basis: 100%; }
  .alg-ctl .btn { margin-left: 0; }
  .alg-algos { width: 100%; }
  .alg-algos button { flex: 1; align-items: center; }
  .fx-ctl label { flex: 1 1 100%; }
  .fx-ctl input[type="range"] { flex: 1; width: auto; }
  .sh-out { font-size: 12px; }
  .msg { max-width: 92%; }
}
@media (max-width: 420px) {
  .lab-facts { grid-template-columns: 1fr; }
  .dash-kpi { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .msg, .dash-feed li { animation: none; }
  .g-fg { transition: none; }
  .typing i { animation: none; opacity: .6; }
}


.stand {
  position: relative;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at 50% 42%, rgba(255, 90, 31,.05), transparent 70%),
    #08080a;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  aspect-ratio: 16 / 10;
}
.stand:active { cursor: grabbing; }
.stand-canvas {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.stand-hud {
  position: absolute; top: 12px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--faint); pointer-events: none;
}
.stand-hud b { color: var(--accent); font-weight: 600; }
.stand-load {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: var(--faint);
  border: 1px dashed var(--line-2);
  padding: 10px 16px;
  background: rgba(8,8,10,.8);
  transition: opacity .3s ease;
}
.stand-load.done { opacity: 0; }
.stand-hint {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  color: var(--faint); pointer-events: none;
  transition: opacity .4s ease;
}
.stand-hint.hide { opacity: 0; }

.stand-pick {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-top: 0;
}
.stand-pick button {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px;
  background: var(--panel); border: 0; cursor: pointer;
  text-align: left;
  transition: background-color .18s ease, color .18s ease;
}
.stand-pick button b { font-size: 14.5px; font-weight: 600; color: var(--text); }
.stand-pick button span {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.stand-pick button:hover { background: var(--panel-2); }
.stand-pick button.on { background: var(--accent); }
.stand-pick button.on b { color: var(--accent-ink); }
.stand-pick button.on span { color: rgba(10,10,11,.7); }

@media (max-width: 600px) {
  .stand { aspect-ratio: 1 / 1; }
  .stand-pick { grid-template-columns: 1fr; }
  .stand-pick button { flex-direction: row; align-items: baseline; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .stand-hint { display: none; }
}


.bootd {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9; min-height: 300px;
  border: 1px solid var(--line); background: var(--panel);
}

 
.bootd-under {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-content: center; gap: 8px; justify-items: center;
  background: var(--panel);
}
.bootd-under b {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(20px, 3.4vw, 32px); letter-spacing: .06em; color: var(--text);
}
.bootd-under span {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--faint);
}

.bootd-screen {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
}
.bootd-screen[hidden] { display: none; }

.bootd-grid {
  position: absolute; inset: 0; z-index: 1; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; background-position: center;
}
.bootd-core { position: relative; z-index: 2; width: min(400px, 78%); }
.bootd-title {
  font-family: var(--disp); font-weight: 700;
  font-size: 19px; letter-spacing: .02em; color: var(--text);
}
.bootd-title span { color: var(--accent); font-weight: 400; }
.bootd-log {
  margin-top: 14px; height: 90px; overflow: hidden;
  font-family: var(--mono); font-size: 11px; line-height: 1.75;
  color: var(--muted); white-space: pre-wrap;
}
.bootd-meter { height: 2px; margin-top: 14px; background: var(--line); }
.bootd-meter i { display: block; height: 100%; width: 0; background: var(--accent); }
.bootd-pct {
  margin-top: 10px;
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(28px, 4vw, 38px); line-height: 1; color: var(--text);
}
.bootd-note {
  margin-top: 6px; font-family: var(--mono);
  font-size: 10px; letter-spacing: .34em; color: var(--faint);
}

 
.bootd-cols { position: absolute; inset: 0; z-index: 0; display: flex; pointer-events: none; }
.bootd-cols i {
  flex: 1; background: var(--bg);
  transform: scaleY(1); transform-origin: top;
  transition: transform .55s cubic-bezier(.65, 0, .35, 1);
}
.bootd.out .bootd-grid,
.bootd.out .bootd-core { opacity: 0; transition: opacity .2s ease; }
.bootd.out .bootd-cols i { transform: scaleY(0); }
.bootd.out .bootd-cols i:nth-child(2) { transition-delay: .05s; }
.bootd.out .bootd-cols i:nth-child(3) { transition-delay: .10s; }
.bootd.out .bootd-cols i:nth-child(4) { transition-delay: .15s; }
.bootd.out .bootd-cols i:nth-child(5) { transition-delay: .20s; }

.bootd-ctl {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 14px;
}
.bootd-timer { color: var(--faint); }
.bootd-timer b {
  font-family: var(--mono); font-size: 15px;
  color: var(--accent); font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .bootd { aspect-ratio: 4 / 5; }
  .bootd-log { height: 74px; }
}
@media (prefers-reduced-motion: reduce) {
  .bootd-cols i { transition-duration: .01ms; }
}

.stand-controls{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:18px 0}.stand-canvas:focus-visible{outline:3px solid var(--accent);outline-offset:-4px}
