:root {
  --bg: #0c1016;
  --panel: #141a22;
  --ink: #e7edf5;
  --muted: #a8b3c4;
  --line: #2a3544;
  --blue: #38bdf8;
  --blue-ink: #041018;
  --ok: #6ee7b7;
  --warn: #fcd34d;
  --hot: #fda4af;
  --violet: #c4b5fd;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Schibsted Grotesk", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
.skip {
  position: absolute; left: 0.5rem; top: -4rem; background: var(--blue); color: var(--blue-ink);
  padding: 0.45rem 0.7rem; z-index: 20; font-weight: 700;
}
.skip:focus { top: 0.5rem; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--blue); color: var(--blue-ink); }
[id] { scroll-margin-top: 4.5rem; }
kbd {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  border: 1px solid #3a4758;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05rem 0.32rem;
  background: #0c1016;
  color: var(--ink);
}

.app { min-height: 100vh; }
.side {
  background: #10151c;
  color: #d5deea;
  display: flex;
  gap: 0.35rem 0.75rem;
  align-items: center;
  overflow-x: auto;
  padding: 0.65rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 6;
  border-bottom: 1px solid var(--line);
}
.logo { color: white; font-weight: 700; text-decoration: none; white-space: nowrap; letter-spacing: -0.03em; }
.person { margin: 0; font-size: 0.82rem; display: none; }
.person span { color: var(--muted); }
.side nav { display: flex; gap: 0.25rem; }
.side nav a, .text-btn {
  color: #cbd5e1;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.side nav a:hover, .side nav a[aria-current="true"], .text-btn:hover { background: rgba(255, 255, 255, 0.06); color: white; }
.side kbd { display: none; }
.avail { display: none; margin: 0; color: var(--ok); font-size: 0.85rem; }
.avail i, .pulse {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #34d399; display: inline-block;
}
.pulse { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); animation: ping 2.4s ease-out infinite; }

.workspace { padding: 1rem 1rem 1.4rem; }
.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.55rem 1rem;
  align-items: center; margin-bottom: 1rem; color: var(--muted); font-size: 0.92rem;
}
.topbar span { color: #7f8b9c; }
.demo-clock { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }
.demo-clock strong { font-family: "IBM Plex Mono", ui-monospace, monospace; color: var(--ink); font-weight: 500; }
.certs { display: flex; gap: 0.35rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.certs li, .guards li {
  background: #1a222e; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.18rem 0.55rem; font-size: 0.78rem; color: var(--ink);
}
.kicker, .tag, .section-label, .fine, .mesh-label {
  color: var(--muted); font-size: 0.8rem;
}
.kicker { letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.45rem; }
.overview p, .section-head p, .panel p, .cycle p, .anode p { color: var(--muted); margin-top: 0.4rem; }
.row-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.btn {
  background: var(--blue); color: var(--blue-ink); text-decoration: none; border: 0; border-radius: 8px;
  min-height: 42px; padding: 0.55rem 0.85rem; display: inline-flex; align-items: center;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn.quiet { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.section-label { margin-top: 0.55rem; }

.kpi-grid, .slo-grid, .run-grid, .cases, .cycle { display: grid; gap: 0.65rem; margin-top: 0.8rem; }
.kpi-grid { grid-template-columns: 1fr 1fr; }
.kpi-grid article, .panel, .anode, .operator, .catalog {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.kpi-grid article { padding: 0.8rem; }
.kpi-grid p { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0; }
.kpi-grid strong, .figure {
  display: block; font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.55rem; letter-spacing: -0.04em; margin: 0.2rem 0; color: var(--ink); font-weight: 500;
}
.kpi-grid span { color: var(--muted); font-size: 0.82rem; }
.spark { width: 100%; height: 36px; margin-top: 0.45rem; }
.spark polyline { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark.ok polyline { stroke: var(--ok); }
.spark.warn polyline { stroke: var(--warn); }
.spark.hot polyline { stroke: var(--hot); }
.js .spark polyline { stroke-dasharray: 180; stroke-dashoffset: 180; animation: draw 1.4s ease forwards; }

section { margin-top: 1.35rem; }
.section-head { max-width: 46rem; }
.catalog { overflow: hidden; }
.tr { display: grid; gap: 0.25rem; padding: 0.75rem 0.85rem; border-top: 1px solid var(--line); }
.tr.head { display: none; }
.tr h3 { font-size: 1rem; }
.tr p { color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: fit-content; border-radius: 999px; padding: 0.12rem 0.5rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge.ok { background: var(--ok); color: #052e1c; }
.badge.watch { background: var(--warn); color: #3a2502; }
.badge.tune { background: var(--violet); color: #2e1065; }
.badge.demo { background: var(--blue); color: var(--blue-ink); }
.panel { padding: 0.85rem; }
.panel header, .sim-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.bar { height: 8px; border-radius: 999px; background: #243140; margin: 0.7rem 0 0.35rem; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.bar.warn span { background: var(--warn); }
.bar.ok span { background: var(--ok); }

.arch { display: grid; gap: 0.7rem; margin-top: 0.8rem; }
.arch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.anode { flex: 1 1 140px; padding: 0.7rem 0.75rem; }
.anode h3 { font-size: 0.98rem; }
.flow {
  position: relative; flex: 0 0 2.4rem; height: 2px;
  background: repeating-linear-gradient(90deg, var(--blue) 0 6px, transparent 6px 12px);
  background-size: 24px 2px;
  animation: march 0.9s linear infinite;
}
.flow::after {
  content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-left: 7px solid var(--blue);
}
.meshbox { border: 1px dashed #3d4e63; border-radius: 12px; padding: 0.7rem; }
.mesh-label { margin-bottom: 0.45rem; letter-spacing: 0.08em; text-transform: uppercase; }
.guards { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.2rem 0 0; }

.sim header, .ticket header { display: flex; justify-content: space-between; }
.ops { display: grid; gap: 0.75rem; margin-top: 0.8rem; }
.sim-label, .stats p, .lat { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.stats { display: grid; gap: 0.45rem; margin-top: 0.45rem; }
.stats p, .lat {
  margin: 0; background: #10161e; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.6rem;
}
.stats span, .sim-label label { color: var(--muted); font-size: 0.8rem; }
output, .stats strong, .lat strong, .badges strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace; color: var(--blue); font-size: 1.05rem; white-space: nowrap;
}
.stats p:has([data-status]) { grid-column: 1 / -1; }
.stats [data-status] { font-size: 0.92rem; line-height: 1.3; text-align: right; white-space: normal; color: var(--ok); }
.stats [data-status][data-level="warn"] { color: var(--warn); }
.stats [data-status][data-level="hot"] { color: var(--hot); }
input[type="range"] { width: 100%; height: 40px; accent-color: var(--blue); }
[data-status][data-level="warn"] { color: var(--warn); }
[data-status][data-level="hot"] { color: var(--hot); }
.badges { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.35rem; }
.badges li {
  display: flex; justify-content: space-between; gap: 0.5rem;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.55rem; color: var(--muted);
}
.sim-nodes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.4rem; }
.sim-node { background: #10161e; border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem; }
.sim-node.is-dim { opacity: 0.38; }
.sim-node-title { font-size: 0.72rem; color: var(--muted); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.sim-pods { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; margin-top: 0.3rem; }
.sim-pod { aspect-ratio: 1.15; border-radius: 4px; background: #243140; }
.sim-pod.is-on { background: linear-gradient(180deg, #e0f2fe, var(--blue) 55%, #0369a1); box-shadow: 0 0 10px rgba(56, 189, 248, 0.55); }
.session { width: 100%; height: 56px; background: #10161e; border: 1px solid var(--line); border-radius: 8px; margin: 0.35rem 0; color: var(--blue); }
.session polyline { fill: none; stroke: var(--blue); stroke-width: 2; }
.mesh { width: 100%; height: auto; margin-top: 0.35rem; }
.mesh .link { stroke-dasharray: 4 6; animation: flow 2.2s linear infinite; }
.mesh circle { fill: #10161e; stroke: var(--blue); stroke-width: 1.5; }
.mesh .rep { fill: var(--ink); font-size: 12px; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.mesh .lab { fill: var(--muted); font-size: 11px; font-family: "Schibsted Grotesk", sans-serif; }
.mesh.is-hot circle { stroke: var(--hot); }
.mesh.is-rise circle { stroke: var(--warn); }

.incident { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.55rem; }
.incident li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 0.85rem; }
.incident span { font-family: "IBM Plex Mono", ui-monospace, monospace; color: var(--blue); font-size: 0.78rem; }
.incident p, .run-grid li, .case li, .focus li { color: var(--muted); }
.run-grid ol, .run-grid ul, .case ul, .focus { margin: 0.45rem 0 0; padding-left: 1.1rem; }
.cycle { list-style: none; padding: 0; }
.cycle li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; }
.cycle span { font-family: "IBM Plex Mono", ui-monospace, monospace; color: var(--blue); font-size: 0.8rem; }
.operator { display: grid; gap: 0.8rem; padding: 0.75rem; margin-top: 0.8rem; }
.operator img { width: 100%; height: 240px; object-fit: cover; object-position: center 18%; border-radius: 10px; }
.tech { display: flex; flex-wrap: wrap; gap: 0.7rem; list-style: none; padding: 0.7rem 0 0; margin: 0; color: var(--muted); }
.tech li { display: flex; align-items: center; gap: 0.35rem; }
.tech img { width: 22px; height: 22px; background: white; border-radius: 4px; padding: 2px; }
.case { display: grid; gap: 0.7rem; overflow: hidden; }
.case img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin: 0.7rem 0; }
.metrics div { background: #10161e; border-radius: 8px; padding: 0.4rem 0.5rem; }
.metrics dt { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.metrics dd { margin: 0.1rem 0 0; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 1rem; }
.field { display: grid; gap: 0.25rem; margin: 0.7rem 0; }
label { font-size: 0.88rem; font-weight: 600; }
input, select {
  width: 100%; min-height: 42px; border-radius: 8px; border: 1px solid var(--line);
  background: #0c1016; color: var(--ink); font: inherit; padding: 0.45rem 0.6rem;
}
.split { display: grid; gap: 0.4rem; }
.form-note { min-height: 1.3em; color: var(--ok); font-size: 0.92rem; }
.hintbar {
  display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; align-items: center;
  margin-top: 1rem; padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); font-size: 0.78rem; background: rgba(12, 16, 22, 0.92);
}
.hint-full { display: none; }
footer { margin-top: 1.2rem; color: var(--muted); font-size: 0.9rem; }
.pager { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin-top: 0.45rem; }
.pager a { text-decoration: none; }
.pager ol { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; padding: 0; margin: 0; }
.pager ol a {
  width: 2rem; height: 2rem; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 6px; background: #10161e;
}
.pager [aria-current="page"] { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); font-weight: 700; }

dialog {
  padding: 1rem; border: 1px solid #334155; background: var(--panel); color: var(--ink);
  border-radius: 14px; width: min(460px, calc(100% - 1.5rem));
}
dialog::backdrop { background: rgba(2, 6, 12, 0.72); }
dialog h2 { margin-bottom: 0.35rem; }
dialog p { color: var(--muted); }
dialog ul { list-style: none; padding: 0.4rem 0 0.8rem; margin: 0; display: grid; gap: 0.35rem; }
dialog li { display: flex; gap: 0.35rem; align-items: center; }
#palette form { display: grid; gap: 0.3rem; }
#jump-list { list-style: none; margin: 0.45rem 0 0; padding: 0; max-height: 50vh; overflow: auto; }
#jump-list button {
  width: 100%; text-align: left; background: transparent; color: inherit; border: 0;
  min-height: 44px; padding: 0.35rem 0.6rem; border-radius: 8px; font: inherit; cursor: pointer;
  display: flex; justify-content: space-between; gap: 0.6rem;
}
#jump-list button.is-active, #jump-list button:hover { background: #1e293b; }
#jump-list .empty { color: var(--muted); padding: 0.6rem; }

.js [data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity 0.45s ease, transform 0.45s ease; }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .flow { display: none; }
}
@media (min-width: 800px) {
  .kpi-grid, .slo-grid { grid-template-columns: 1fr 1fr; }
  .incident { grid-template-columns: 1fr 1fr; }
  .run-grid, .cases { grid-template-columns: 1fr 1fr; }
  .cycle { grid-template-columns: repeat(5, 1fr); }
  .tr { grid-template-columns: 1.15fr 0.7fr 0.55fr 1.7fr; align-items: center; }
  .tr.head { display: grid; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
  .operator { grid-template-columns: 220px 1fr; }
  .operator img { height: 100%; min-height: 240px; }
  .case { grid-template-columns: 200px 1fr; align-items: center; }
  .case img { height: 100%; min-height: 150px; }
  .sim-nodes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr 1fr; }
  .ops { grid-template-columns: 1fr 1fr; }
  .ops-mesh { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .app { display: grid; grid-template-columns: 232px 1fr; }
  .side {
    position: sticky; top: 0; height: 100vh; flex-direction: column; align-items: stretch;
    overflow: auto; padding: 1.1rem 0.8rem; border-bottom: 0; border-right: 1px solid var(--line);
  }
  .person, .avail { display: block; }
  .side nav { flex-direction: column; margin-top: 1rem; }
  .side kbd { display: inline; margin-left: auto; }
  .side nav a { justify-content: space-between; }
  .avail { margin-top: auto; }
  .text-btn { justify-content: space-between; }
  .workspace { padding: 1.1rem 1.3rem 1.6rem; }
  .kpi-grid, .slo-grid { grid-template-columns: repeat(4, 1fr); }
  [id] { scroll-margin-top: 0.8rem; }
  .hint-full { display: inline; }
  .ops {
    grid-template-columns: 250px minmax(0, 1fr) 220px;
    grid-template-areas:
      "controls viz side"
      "mesh mesh side";
  }
  .ops-controls { grid-area: controls; }
  .ops-viz { grid-area: viz; }
  .ops-side { grid-area: side; }
  .ops-mesh { grid-area: mesh; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes march { to { background-position: 24px 0; } }
@keyframes flow { to { stroke-dashoffset: -40; } }
@keyframes ping {
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .spark polyline { stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}
