/* NAI-fnet page: what style.css does not have. The same paper and ink; the law's colour marks the model. */

.fnet-hero { padding-bottom: 48px; }
.fnet-code { margin: 0; padding: 18px 18px 20px; font: 12.5px/1.6 var(--mono); color: var(--ink); white-space: pre; overflow-x: auto;
  background: none; }
.fnet-neuron { min-height: 0; }

.fnet-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .fnet-steps { grid-template-columns: minmax(0, 1fr); } }

/* the simulator: a window with the scene, a side panel, the torque plot, the controls */
.sim { border: 1px solid var(--ink); border-radius: var(--radius); background: var(--card);
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.sim .win-bar .sim-status { font: 11.5px var(--mono); opacity: 0.85; }
.sim-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); border-bottom: 1px solid var(--line2); }
.sim-stage { position: relative; aspect-ratio: 4 / 3; min-height: 320px; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 50% 38%, var(--card), var(--paper2)); }
.sim-stage:active { cursor: grabbing; }
.sim-stage canvas { display: block; }
.sim-panel { padding: 18px 20px; border-left: 1px solid var(--line2); overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  max-height: 100%; min-height: 0; }
.sim-panel h3 { margin: 0; font-size: 22px; }
.sim-panel p { margin: 0; font-size: 14px; color: var(--ink2); }
.sim-count { font: 12px var(--mono); }
.sim-count b { color: var(--ink); font-weight: 500; }
.sim-table { overflow: hidden; border: 1px solid var(--line); border-radius: 3px; }
.sim-table table { width: 100%; border-collapse: collapse; font: 10.5px/1.5 var(--mono); }
.sim-table th { text-align: right; padding: 3px 5px; color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--line); }
.sim-table td { text-align: right; padding: 1px 5px; color: var(--ink2); }
.sim-table td:last-child, .sim-table th:last-child { color: var(--law); }
.sim-table tr:last-child td { color: var(--ink); }
.sim-curve { width: 100%; height: auto; }
.sim-curve .ax { stroke: var(--line2); stroke-width: 1; }
.sim-curve .lab { fill: var(--muted); font: 9px var(--mono); }
.sim-curve .err { fill: none; stroke: var(--law); stroke-width: 2; }
.sim-neurons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sim-neurons li code { display: block; background: var(--paper2); padding: 3px 7px; font-size: 11px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
.sim-neurons li.new code { color: var(--law); box-shadow: inset 2px 0 0 var(--law); }
.sim-code { margin: 0; padding: 8px 10px; height: 13.5em; overflow: hidden; background: var(--paper2); border-radius: 3px;
  font: 10.5px/1.45 var(--mono); color: var(--ink2); white-space: pre; }
.sim-bar { height: 6px; border-radius: 3px; background: var(--paper2); overflow: hidden; border: 1px solid var(--line); }
.sim-bar span { display: block; height: 100%; width: 0; background: var(--g1); }
.sim-read { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 4px 0 0; }
.sim-read div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line2); padding-bottom: 6px; }
.sim-read dt { font: 12px var(--mono); color: var(--muted); }
.sim-read dd { margin: 0; font: 500 13px var(--mono); color: var(--ink); }
.sim-read dd.hit { color: var(--bad); }
.sim-plot { height: 150px; }
.sim-legend.sim-plot-key { border-bottom: 0; border-top: 1px solid var(--line2); }
.sim-legend.sim-plot-key[hidden] { display: none; }
.sim-plot canvas { display: block; width: 100%; height: 100%; }
.sim-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px;
  border-bottom: 1px solid var(--line2); }
.sim-steps button { appearance: none; border: 0; border-right: 1px solid var(--line); background: none; color: var(--ink);
  padding: 6px 14px; font: 12.5px var(--mono); cursor: pointer; }
.sim-steps button:last-child { border-right: 0; }
.sim-steps button.on { background: var(--ink); color: var(--paper); }
.sim-steps button:focus-visible { outline: 2px solid var(--law); outline-offset: -2px; }
.sim-controls .btn.small { cursor: pointer; }
@media (max-width: 860px) {
  .sim-grid { grid-template-columns: minmax(0, 1fr); }
  .sim-panel { border-left: 0; border-top: 1px solid var(--line2); }
}

/* results and comparison tables */
.fnet-table-wrap { overflow-x: auto; }
.fnet-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border: 1px solid var(--line2); }
.fnet-table caption { text-align: left; font: 400 19px/1.3 var(--serif); padding: 0 0 10px; }
.fnet-table th, .fnet-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.fnet-table thead th { font: 500 11.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.fnet-table tbody th { font: 12.5px var(--mono); color: var(--ink2); font-weight: 400; white-space: nowrap; }
.fnet-table td:nth-child(n+2) { font-family: var(--mono); font-size: 13px; }
.fnet-table tr.me td { color: var(--law); font-weight: 500; }
.fnet-table.wide td:nth-child(2) { color: var(--law); }
.fnet-table.wide td, .fnet-table.wide th { min-width: 140px; }
.fnet-table.wide td:nth-child(n+2) { font-family: var(--sans); font-size: 13.5px; }
.fnet-fit { margin: 0 0 8px; }
.foot-credits { margin-top: 12px; font-size: 11.5px; line-height: 1.6; }
.fnet-robot-stats { margin-top: 28px; }

/* the teardown view: callouts over the scene */
.sim-callouts { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.sim-callouts svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sim-callouts line { stroke: var(--ink); stroke-width: 1; opacity: 0.7; }
.sim-callouts circle { fill: var(--card); stroke: var(--ink); stroke-width: 1.2; }
.sim-callout { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 4px 8px; white-space: nowrap;
  background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--line2); border-radius: 3px;
  font: 11px/1.3 var(--mono); color: var(--ink2); }
.sim-callout b { font-weight: 500; color: var(--ink); }
.sim-callout span { font-size: 10px; color: var(--muted); }
.sim-callout.key { border-color: var(--law); }
.sim-callout.key b { color: var(--law); }
.sim-controls .btn.small.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* the legend of the links: a colour for every kind of link on screen */
.sim-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 14px; border-bottom: 1px solid var(--line2);
  font: 11.5px var(--mono); color: var(--ink2); }
.sim-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sim-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.sim-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font: 12px var(--mono); color: var(--muted); }

/* the examples page: a results heading under each simulator */
.fnet-results-head { margin: 46px 0 8px; font-size: 26px; }
.fnet-overview th a { text-decoration: none; }
.sim-controls [hidden] { display: none !important; }   /* .btn's inline-flex would override the hidden attribute */

/* the hero: the code window level with the headline, not centred on the column */
.fnet-hero .hero-grid { align-items: start; }
.fnet-hero .fnet-neuron { margin-top: 34px; }
@media (max-width: 920px) { .fnet-hero .fnet-neuron { margin-top: 0; } }
.fnet-source { margin-top: 10px; }

/* the examples' switcher: one example shown at a time */
.fnet-tabs-wrap { margin-bottom: 34px; }
.fnet-example { scroll-margin-top: 72px; }
.fnet-tabs button { appearance: none; border: 0; border-right: 1px solid var(--line); background: none; color: var(--ink);
  padding: 9px 20px; font: 13px var(--mono); cursor: pointer; }
.fnet-tabs button:last-child { border-right: 0; }
.fnet-tabs button.on { background: var(--ink); color: var(--paper); }
.fnet-tabs button:focus-visible { outline: 2px solid var(--law); outline-offset: -2px; }
.fnet-example[hidden] { display: none; }
