/* Schematic plates on project pages. Animations run only while the plate is on
   screen (instruments.js adds .is-live) and stop entirely with reduced motion
   or motion off, through the global rules in base.css. */
.plate,
.timing {
  margin: 34px 0 6px;
  border: 1px solid var(--line);
  background:
    radial-gradient(
      90% 70% at 85% 0%,
      color-mix(in srgb, var(--cyan) 8%, transparent),
      transparent 60%
    ),
    color-mix(in srgb, var(--surface) 70%, var(--bg));
}
.plate-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font:
    600 10.5px/1.5 Consolas,
    monospace;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.plate-tag {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--cyan) 50%, transparent);
  color: var(--cyan);
}
.plate-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.plate-art {
  display: block;
  width: 100%;
  height: auto;
}
.plate figcaption {
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
[data-plates-ready] :is(.plate, .timing):not(.is-live),
[data-plates-ready] :is(.plate, .timing):not(.is-live) * {
  animation-play-state: paused !important;
}
@media (max-width: 700px) {
  .plate-art {
    width: 780px;
    max-width: none;
  }
  .plate-bar > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Shared drawing vocabulary. */
.pl-gridline {
  fill: none;
  stroke: var(--line);
  stroke-width: 0.5;
  opacity: 0.45;
}
.pl-txt {
  font:
    600 15px Consolas,
    monospace;
  letter-spacing: 0.05em;
  fill: var(--muted);
}
.pl-strong {
  fill: var(--text);
}
.pl-dim {
  fill: color-mix(in srgb, var(--muted) 75%, transparent);
  font-weight: 400;
}
.pl-txt.pl-fault {
  fill: var(--fault);
}
.pl-num {
  font:
    italic 38px "Instrument Serif",
    Georgia,
    serif;
  fill: var(--accent);
}
.pl-num.pl-small {
  font-size: 30px;
}
.pl-sup {
  font-size: 20px;
}
.pl-box {
  fill: color-mix(in srgb, var(--bg) 75%, transparent);
  stroke: var(--line);
}
.pl-sep {
  stroke: var(--line);
}
.pl-wire,
.pl-line,
.pl-stem,
.pl-load,
.pl-pin,
.pl-antenna,
.pl-wave-arc,
.pl-axis,
.pl-dim-line,
.pl-walls,
.pl-gen circle,
.pl-gen path,
.pl-coil ellipse,
.pl-phasor-dial circle,
.pl-edge,
.pl-draft,
.pl-draft-box,
.pl-draft-c {
  fill: none;
  stroke: var(--control-line);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.pl-gen circle {
  fill: var(--bg);
  stroke: var(--accent);
}
.pl-gen path {
  stroke: var(--accent);
}
.pl-bus {
  stroke: var(--text);
  stroke-width: 6;
  stroke-linecap: square;
}
.pl-fill {
  fill: currentColor;
  stroke: none;
}
@keyframes pl-dash {
  to {
    stroke-dashoffset: -64;
  }
}
@keyframes pl-blink {
  50% {
    opacity: 0.15;
  }
}

/* swingbus */
.pl-flow {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-dasharray: 4 12;
  opacity: 0.75;
  animation: pl-dash var(--s, 1.6s) linear infinite;
}
.pl-breaker {
  opacity: 0;
}
.pl-breaker rect {
  fill: var(--bg);
  stroke: var(--fault);
  stroke-width: 1.6;
}
.pl-breaker path {
  stroke: var(--fault);
  stroke-width: 2;
}
.pl-logrow rect {
  fill: transparent;
}
.is-trip .pl-line,
.pl-breaker,
.pl-logrow rect,
.pl-logrow text,
.is-trip .pl-flow {
  animation-duration: calc(var(--step) * var(--n));
  animation-delay: calc(var(--step) * var(--k));
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.is-trip .pl-line {
  animation-name: pl-trip;
}
.is-trip .pl-flow {
  animation:
    pl-dash var(--s, 1.6s) linear infinite,
    pl-trip-flow calc(var(--step) * var(--n)) linear
      calc(var(--step) * var(--k)) infinite;
}
.pl-breaker {
  animation-name: pl-show;
}
.pl-logrow rect {
  animation-name: pl-row;
}
.pl-logrow text:first-of-type {
  animation-name: pl-row-text;
}
.pl-logrow text:last-of-type {
  animation: none;
}
@keyframes pl-trip {
  0%,
  11% {
    stroke: var(--fault);
    stroke-dasharray: 3 7;
  }
  12.5%,
  100% {
    stroke: var(--control-line);
    stroke-dasharray: none;
  }
}
@keyframes pl-trip-flow {
  0%,
  11% {
    opacity: 0;
  }
  12.5%,
  100% {
    opacity: 0.75;
  }
}
@keyframes pl-show {
  0%,
  11% {
    opacity: 1;
  }
  12.5%,
  100% {
    opacity: 0;
  }
}
@keyframes pl-row {
  0%,
  11% {
    fill: color-mix(in srgb, var(--fault) 16%, transparent);
  }
  12.5%,
  100% {
    fill: transparent;
  }
}
@keyframes pl-row-text {
  0%,
  11% {
    fill: var(--fault);
  }
}

/* With motion off the drawing still shows one moment of the story. */
.is-trip[style^="--k:0"] .pl-line {
  stroke: var(--fault);
  stroke-dasharray: 3 7;
}
.is-trip[style^="--k:0"] .pl-flow {
  opacity: 0;
}
.pl-breaker[style^="--k:0"] {
  opacity: 1;
}
.pl-logrow[style^="--k:0"] rect {
  fill: color-mix(in srgb, var(--fault) 16%, transparent);
}
.pl-logrow[style^="--k:0"] text:first-of-type {
  fill: var(--fault);
}

/* nabd */
.pl-analog {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 2 10;
  stroke-linecap: round;
  animation: pl-dash 1.4s linear infinite;
}
.pl-packets {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 7;
  stroke-dasharray: 10 22;
  animation: pl-dash 1.1s linear infinite;
}
.pl-xf {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.8;
}
.pl-barrier {
  stroke: var(--fault);
  stroke-width: 1.4;
  stroke-dasharray: 6 6;
}
.pl-chip {
  fill: color-mix(in srgb, var(--bg) 80%, transparent);
  stroke: var(--text);
  stroke-width: 1.8;
}
.pl-pin {
  stroke-width: 2.4;
}
.pl-wave-arc {
  stroke: var(--cyan);
  animation: pl-blink 1s steps(2) infinite;
}
.pl-pps {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.6;
  animation: pl-blink 1s steps(2) infinite;
}
.pl-dot {
  fill: var(--control-line);
}
.pl-code {
  stroke: var(--muted);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.55;
}
.pl-caret {
  stroke: var(--accent);
  stroke-width: 5;
  animation: pl-blink 1.1s steps(2) infinite;
}
.pl-map {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.4;
}
.pl-node {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
  animation: pl-ping 1.8s ease-out var(--o, 0s) infinite;
}
@keyframes pl-ping {
  0% {
    transform: scale(0.6);
  }
  30% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
.pl-phasor-dial circle {
  fill: var(--bg);
}
.pl-phasor {
  color: var(--cyan);
  transform-box: fill-box;
  transform-origin: 0 50%;
  animation: pl-spin 3s linear infinite;
}
.pl-phasor path:first-child {
  stroke: var(--cyan);
  stroke-width: 2.4;
}
@keyframes pl-spin {
  to {
    transform: rotate(-360deg);
  }
}

/* Wireless power */
.pl-coil ellipse {
  stroke: var(--text);
  stroke-width: 1.4;
}
.pl-field {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.4;
  stroke-dasharray: 3 9;
  opacity: 0.8;
  animation: pl-dash 2s linear var(--o, 0s) infinite;
}
.pl-f0 {
  stroke: var(--control-line);
  stroke-dasharray: 4 6;
}
.pl-curve {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-dasharray: 1;
  animation: pl-draw 2.6s cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes pl-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
.pl-sweep {
  fill: var(--cyan);
  offset-rotate: 0deg;
  offset-distance: 50%;
  animation: pl-sweep 7s ease-in-out 2.6s infinite alternate both;
}
@keyframes pl-sweep {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}

/* ariadne */
.pl-walls {
  stroke: var(--text);
  stroke-width: 3;
  stroke-linecap: square;
}
.pl-posts {
  fill: var(--text);
}
.pl-goal {
  fill: color-mix(in srgb, var(--accent) 18%, transparent);
  stroke: var(--accent);
  stroke-dasharray: 3 4;
}
.pl-route-ortho {
  fill: none;
  stroke: var(--control-line);
  stroke-width: 2;
  stroke-dasharray: 5 6;
}
.pl-route {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
  stroke-linecap: round;
}
.pl-mouse {
  offset-rotate: auto;
  offset-distance: 100%;
  color: var(--bg);
  animation: pl-run 9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.pl-mouse rect {
  fill: var(--cyan);
}
.pl-wheels {
  stroke: var(--text);
  stroke-width: 4;
  stroke-linecap: round;
}
.pl-mouse.pl-ghost {
  offset-distance: 42%;
  opacity: 0.55;
  animation: pl-run-ghost 9s linear infinite;
}
.pl-ghost rect {
  fill: var(--control-line);
}
@keyframes pl-run {
  0% {
    offset-distance: 0%;
  }
  41.7%,
  100% {
    offset-distance: 100%;
  }
}
@keyframes pl-run-ghost {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}
.pl-stop,
.pl-quick {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
}
.pl-stop,
.pl-key-stop {
  stroke: var(--control-line);
  stroke-dasharray: 5 5;
}
.pl-quick,
.pl-key-quick {
  stroke: var(--cyan);
}
.pl-key-stop,
.pl-key-quick {
  stroke-width: 3;
}

/* Cascade-GNN */
.pl-edge {
  stroke-width: 2;
}
.pl-vertex {
  fill: var(--bg);
  stroke: var(--text);
  stroke-width: 1.8;
}
.pl-edge.is-hit:is([style^="--d:0"], [style^="--d:1"], [style^="--d:2"]) {
  stroke: var(--fault);
  stroke-width: 3;
}
.pl-vertex.is-hit:is([style^="--d:0"], [style^="--d:1"], [style^="--d:2"]) {
  fill: var(--fault);
  stroke: var(--fault);
}
.pl-edge.is-hit,
.pl-vertex.is-hit {
  animation: 9s linear calc(var(--d) * 0.7s) infinite;
}
.pl-edge.is-hit {
  animation-name: pl-cascade-edge;
}
.pl-vertex.is-hit {
  animation-name: pl-cascade-node;
}
@keyframes pl-cascade-edge {
  0%,
  50% {
    stroke: var(--fault);
    stroke-width: 3;
  }
  56%,
  100% {
    stroke: var(--control-line);
    stroke-width: 2;
  }
}
@keyframes pl-cascade-node {
  0%,
  50% {
    fill: var(--fault);
    stroke: var(--fault);
  }
  56%,
  100% {
    fill: var(--bg);
    stroke: var(--text);
  }
}
.pl-bolt {
  fill: var(--fault);
  animation: pl-blink 9s steps(1) infinite;
}
.pl-fo {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
}

/* AtlasGrid */
.pl-draft,
.pl-draft-box,
.pl-draft-c {
  stroke: var(--cyan);
  stroke-width: 1.4;
  stroke-dasharray: 7 5;
  animation: pl-dash 6s linear infinite;
}
.pl-dashed-bus {
  stroke-dasharray: 18 8;
  stroke: var(--muted);
}
.pl-ems {
  fill: color-mix(in srgb, var(--cyan) 7%, transparent);
}
.pl-telemetry {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 2 7;
  animation: pl-dash 2.4s linear infinite;
}
.pl-milestone {
  fill: var(--bg);
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-dasharray: 3 3;
}
.pl-stamp rect {
  fill: color-mix(in srgb, var(--fault) 10%, transparent);
  stroke: var(--fault);
  stroke-width: 2;
}
.pl-stamp .pl-txt {
  fill: var(--fault);
}

/* Next and previous project. */
.project-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 50px;
}
.project-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.3s;
}
.project-pager a:hover,
.project-pager a:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}
.project-pager .pager-next {
  text-align: right;
  align-items: flex-end;
}
.project-pager small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font:
    600 10.5px/1.5 Consolas,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-pager small .icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}
.project-pager strong {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.project-pager span {
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 600px) {
  .project-pager {
    grid-template-columns: 1fr;
  }
  .project-pager .pager-next {
    text-align: left;
    align-items: flex-start;
  }
}
@media print {
  .plate,
  .project-pager {
    break-inside: avoid;
  }
}

/* Timing diagram on the profile page. */
.timing {
  margin: 0 0 40px;
}
.timing-art {
  display: block;
  width: 100%;
  height: auto;
}
.timing figcaption {
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.tm-ticks,
.tm-lane {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.tm-lane {
  stroke-dasharray: 2 6;
}
.tm-year,
.tm-ch,
.tm-name,
.tm-tag,
.tm-cursor text {
  font:
    600 14px Consolas,
    monospace;
  letter-spacing: 0.06em;
  fill: var(--muted);
}
.tm-ch {
  fill: var(--cyan);
}
.tm-name {
  fill: var(--text);
}
.tm-tag {
  font-weight: 400;
  font-size: 13px;
}
.tm-accent {
  fill: var(--accent);
  font-weight: 600;
}
.tm-bus {
  fill: color-mix(in srgb, var(--accent) 12%, var(--bg));
  stroke: var(--accent);
  stroke-width: 1.6;
}
.tm-future {
  fill: color-mix(in srgb, var(--bg) 58%, transparent);
}
.tm-val {
  font: 500 14px Manrope, sans-serif;
  fill: var(--text);
}
.tm-wave {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.tm-plan {
  stroke: var(--muted);
  stroke-dasharray: 6 6;
}
.tm-fade {
  stroke-dasharray: 3 5;
  opacity: 0.6;
}
.tm-cursor path {
  stroke: var(--cyan);
  stroke-width: 1.6;
}
.tm-cursor rect {
  fill: var(--cyan);
}
.tm-cursor text {
  fill: var(--bg);
}
.tm-signals {
  animation: tm-wipe 1.8s cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes tm-wipe {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@media (max-width: 700px) {
  .timing-art {
    width: 820px;
    max-width: none;
  }
}

/* 404: open circuit. */
.not-found {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px 60px;
  align-items: center;
}
.not-found button.text-link {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  min-height: 44px;
}
.open-circuit {
  margin: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
}
.open-circuit > svg {
  display: block;
  width: 100%;
  height: auto;
}
.oc-breaker circle {
  fill: var(--bg);
  stroke: var(--fault);
  stroke-width: 2;
}
.oc-blade {
  stroke: var(--fault);
  stroke-width: 3;
  stroke-linecap: round;
}
.oc-arc {
  fill: none;
  stroke: var(--fault);
  stroke-width: 1.6;
  animation: pl-blink 1.4s steps(2) infinite;
}
.oc-dead {
  stroke-dasharray: 4 6;
  opacity: 0.6;
}
.oc-lamp {
  fill: var(--bg);
  stroke: var(--control-line);
  stroke-width: 1.6;
}
.oc-lamp-x {
  stroke: var(--control-line);
  stroke-width: 1.6;
}
.oc-meter {
  fill: var(--screen);
  stroke: var(--line);
}
.oc-seg .sg.on {
  fill: var(--fault);
}
@media (max-width: 900px) {
  .not-found {
    grid-template-columns: 1fr;
  }
}

/* zouzou */
.pl-tape {
  fill: none;
  stroke: color-mix(in srgb, var(--text) 20%, transparent);
  stroke-width: 15;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.pl-dead,
.pl-key-dead {
  fill: none;
  stroke: var(--fault);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 1 10;
}
.pl-zz .pl-route {
  stroke-width: 4;
  stroke-linejoin: round;
}
.pl-exit {
  fill: color-mix(in srgb, var(--accent) 22%, transparent);
  stroke: var(--accent);
  stroke-width: 2.5;
}
.pl-start {
  fill: var(--accent);
}
.pl-zz .pl-mouse {
  animation-duration: 12s;
}
.pl-zz .pl-mouse.pl-ghost {
  offset-distance: 30%;
  animation-duration: 24s;
}
.pl-led {
  fill: color-mix(in srgb, var(--text) 9%, transparent);
}
.pl-led.on {
  fill: var(--cyan);
  animation: pl-wink 6s linear infinite;
}
@keyframes pl-wink {
  0%,
  91%,
  100% {
    opacity: 1;
  }
  94%,
  97% {
    opacity: 0.12;
  }
}
.pl-fine {
  font-size: 12.5px;
  font-weight: 400;
}
