/* Labs design system — executive console (F500 posture) */
:root {
  --bg-0: #070b12;
  --bg-1: #0c1220;
  --bg-2: #111a2c;
  --panel: rgba(14, 22, 38, 0.92);
  --panel-solid: #0e1626;
  --ink: #e8eef8;
  --muted: #8b9bb0;
  --faint: #5c6b80;
  --line: rgba(140, 170, 210, 0.14);
  --line-strong: rgba(140, 170, 210, 0.28);
  --accent: #3db8b0;
  --accent-dim: rgba(61, 184, 176, 0.14);
  --gold: #c4a35a;
  --gold-dim: rgba(196, 163, 90, 0.14);
  --danger: #e05a52;
  --danger-dim: rgba(224, 90, 82, 0.14);
  --warn: #d4a017;
  --warn-dim: rgba(212, 160, 23, 0.14);
  --ok: #3da86a;
  --ok-dim: rgba(61, 168, 106, 0.14);
  --info: #4a8fd4;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", "DM Sans", system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" 1;
}

.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 8% -8%, rgba(61, 184, 176, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 35% at 96% 4%, rgba(196, 163, 90, 0.08), transparent 50%),
    linear-gradient(180deg, #0a1220 0%, #070b12 55%, #080c14 100%);
}
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(140, 170, 210, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 170, 210, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%);
}

/* ——— Top bar ——— */
.top {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 20, 0.72);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 40;
}
.brand, .gh {
  color: var(--accent); text-decoration: none;
  font-weight: 600; font-size: 0.875rem; letter-spacing: 0.01em;
}
.brand:hover, .gh:hover { color: #6ad4cc; }
.who {
  margin: 0; color: var(--muted); flex: 1;
  font-size: 0.8rem; font-family: var(--mono); letter-spacing: 0.02em;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok);
  display: inline-block; margin-right: 0.4rem;
}

/* ——— Layout ——— */
.hub, .demo { max-width: 1080px; margin: 0 auto; padding: 2.25rem 1.5rem 4.5rem; }

.kicker {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--gold); margin: 0 0 0.65rem;
}
h1 {
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  letter-spacing: -0.035em; font-weight: 600;
  margin: 0 0 0.55rem; line-height: 1.15;
}
h2 {
  font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--gold);
  margin: 2.25rem 0 0.9rem; font-weight: 600;
}
.lede {
  color: var(--muted); max-width: 58ch;
  margin: 0 0 1.75rem; font-size: 1.05rem; line-height: 1.55;
}
.meta { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.95rem; }

/* ——— Hub tiles ——— */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.tile {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1.1rem 1.15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s;
  position: relative; overflow: hidden;
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); opacity: 0; transition: opacity 0.2s;
}
.tile:hover {
  border-color: var(--line-strong);
  background: rgba(18, 28, 46, 0.95);
  transform: translateY(-1px);
}
.tile:hover::before { opacity: 1; }
.tile .tag {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase;
}
.tile strong { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.tile span:last-child { color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.tile .arrow {
  margin-top: auto; padding-top: 0.5rem;
  font-family: var(--mono); font-size: 0.7rem; color: var(--faint);
}
.tile:hover .arrow { color: var(--accent); }

.hub-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem; margin: 0 0 2rem;
}
.stat {
  padding: 0.85rem 1rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.stat .n {
  font-family: var(--mono); font-size: 1.35rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.02em;
}
.stat .l {
  font-size: 0.7rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-top: 0.15rem;
}

.foot {
  margin-top: 2.75rem; color: var(--muted); font-size: 0.85rem;
  padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ——— Demo console chrome ——— */
.demo-head {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start;
  justify-content: space-between; margin-bottom: 1.5rem;
}
.demo-head .meta { margin: 0; max-width: 48ch; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }

.console-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 760px) {
  .console-grid { grid-template-columns: 1fr; }
}
.console-grid.stack { grid-template-columns: 1fr; }
.console-grid .span-2 { grid-column: 1 / -1; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 0;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s var(--ease) both;
}
.panel + .panel { margin-top: 0; }
.panel-title {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin: 0 0 0.85rem;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600;
}
.panel h2 { margin: 0 0 0.85rem; }

label {
  display: block; font-size: 0.72rem; color: var(--muted);
  margin: 0.7rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 500;
}
label:first-of-type { margin-top: 0; }

input, select, textarea, button {
  font: inherit; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-1); color: var(--ink);
  padding: 0.6rem 0.75rem; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(61, 184, 176, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
textarea {
  min-height: 110px; resize: vertical;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.45;
}
button {
  width: auto; cursor: pointer;
  background: linear-gradient(180deg, #1a4544, #123538);
  border-color: rgba(61, 184, 176, 0.4);
  color: #dffaf6; font-weight: 600; margin-top: 0.85rem;
  letter-spacing: 0.01em; font-size: 0.875rem;
}
button:hover { border-color: var(--accent); background: linear-gradient(180deg, #1f5552, #154040); }
button:active { transform: translateY(1px); }
button.secondary {
  background: transparent; font-weight: 500; color: var(--muted);
  border-color: var(--line);
}
button.secondary:hover { color: var(--ink); border-color: var(--line-strong); }
button.ghost { background: transparent; border-color: transparent; color: var(--accent); margin-top: 0; padding: 0.35rem 0.5rem; }
.row { display: flex; gap: 0.55rem; flex-wrap: wrap; align-items: center; }

.out {
  font-family: var(--mono); font-size: 0.75rem; white-space: pre-wrap;
  background: #060a12; border-radius: 8px; padding: 0.9rem;
  border: 1px solid var(--line); min-height: 4rem; color: #c5d0e0;
  line-height: 1.5;
}
.empty {
  color: var(--faint); font-family: var(--sans); font-size: 0.9rem;
  padding: 1.5rem 0.5rem; text-align: center;
}
.empty strong { display: block; color: var(--muted); margin-bottom: 0.25rem; font-size: 0.95rem; }

/* ——— Status badges ——— */
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.55rem; border-radius: 6px;
  font-size: 0.7rem; font-family: var(--mono); font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.pill.ok { background: var(--ok-dim); color: var(--ok); }
.pill.bad { background: var(--danger-dim); color: var(--danger); }
.pill.warn { background: var(--warn-dim); color: var(--warn); }
.pill.info { background: rgba(74, 143, 212, 0.14); color: var(--info); }
.pill.neutral { background: rgba(140, 170, 210, 0.1); color: var(--muted); }
.pill.gold { background: var(--gold-dim); color: var(--gold); }

/* ——— Metric strip ——— */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem; margin-bottom: 0.85rem;
}
.metric {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.65rem 0.75rem;
}
.metric .v {
  font-family: var(--mono); font-size: 1.15rem; font-weight: 600;
  letter-spacing: -0.02em;
}
.metric .k {
  font-size: 0.65rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-top: 0.1rem;
}

/* ——— Score gauge ——— */
.gauge-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.gauge {
  --p: 0;
  width: 88px; height: 88px; border-radius: 50%;
  background: conic-gradient(var(--g-color, var(--accent)) calc(var(--p) * 1%), #1a2438 0);
  display: grid; place-items: center; position: relative;
}
.gauge::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background: var(--panel-solid);
}
.gauge span {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: 1.1rem; font-weight: 600;
}

/* ——— Checklist / chain / graph ——— */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist input { width: auto; margin-top: 0.2rem; accent-color: var(--accent); }
.checklist code {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--accent); background: var(--accent-dim);
  padding: 0.1rem 0.35rem; border-radius: 4px; margin-left: 0.35rem;
}

.chain { display: flex; flex-direction: column; gap: 0.4rem; max-height: 320px; overflow-y: auto; }
.chain .block {
  font-family: var(--mono); font-size: 0.7rem;
  padding: 0.6rem 0.75rem; border-left: 3px solid var(--accent);
  background: #060a12; border-radius: 0 8px 8px 0; line-height: 1.45;
}
.chain .block.tamper { border-left-color: var(--danger); }
.hash { word-break: break-all; color: var(--gold); }

.graph-sketch {
  display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
  font-family: var(--mono); font-size: 0.72rem; padding: 0.5rem 0;
}
.graph-node {
  padding: 0.35rem 0.55rem; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  color: var(--ink);
}
.graph-node.hot { border-color: var(--warn); color: var(--warn); background: var(--warn-dim); }
.graph-edge { color: var(--faint); }

.links {
  display: flex; gap: 1.15rem; flex-wrap: wrap;
  margin-top: 1.5rem; font-size: 0.875rem;
}
.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }

.disclaimer {
  margin-top: 1rem; padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(196, 163, 90, 0.06);
  font-size: 0.8rem; color: var(--muted);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .tile { animation: none; }
  .tile:hover { transform: none; }
}
