/* The Demo University launchpad (docs/demo-enhancement-v2.spec.md §6). Phone first, quiet: greys, one navy accent for actions
   and Humifortis, and three small dots for the identity types (people, service accounts, AI agents). */

:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --bg: #f7f8fa;
  --card: #ffffff;
  --accent: #1e3a8a;
  --accent-soft: #eef2fb;
  --people: #3b5bdb;
  --service: #b7791f;
  --agent: #0f766e;
  --attack: #b42318;
  --ok: #15803d;
  --warn: #92400e;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.86em; padding: 1px 5px; border-radius: 4px; background: #f1f3f6; }
h1, h2, h3, h4 { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

/* ── the top bar: global actions, always in reach ── */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(6px);
}
.topbar-brand { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: var(--ink); font-weight: 600; }
.topbar-brand img { height: 36px; width: auto; flex-shrink: 0; }
.topbar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topbar-button {
  padding: 6px 10px; font: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; white-space: nowrap;
}
.topbar-button.strong { color: #fff; background: var(--accent); border-color: var(--accent); }
.topbar-button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.wide-only { display: none; }
.status {
  display: none; margin: 0; padding: 4px 10px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.8rem; border-radius: 999px; background: #f1f3f6; color: var(--muted);
}
.status::before { content: "●"; margin-right: 6px; }
.status.up { color: var(--ok); background: #ecf7ef; }
.status.down { color: var(--warn); background: #fdf3e2; }

.banner { padding: 12px 16px; text-align: center; color: #fff; background: var(--ok); font-size: 0.92rem; }

/* ── layout ── */
main { max-width: 1120px; margin: 0 auto; padding: 0 16px 24px; }
main > section { margin: 28px 0; }
.section-head { margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 1.25rem; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.section-head.row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.section-head.row a { font-weight: 600; font-size: 0.92rem; }

/* ── the line ── */
.hero { margin-top: 20px !important; }
.eyebrow { margin: 0 0 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.45rem, 5.4vw, 2.2rem); line-height: 1.2; text-wrap: balance; }
.lead { margin: 0 0 14px; max-width: 720px; color: var(--muted); font-size: 1rem; }
.track-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.track-chips a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; font-weight: 600; font-size: 0.9rem; text-decoration: none;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
.track-chips a:hover, .track-chips a:focus-visible { border-color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.people { background: var(--people); }
.dot.service { background: var(--service); }
.dot.agent { background: var(--agent); }

/* ── the map ── */
.map { margin: 0; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.map-svg { display: none; width: 100%; height: auto; }
.map-svg a { cursor: pointer; }
.map-svg a:hover .map-node, .map-svg a:focus .map-node { stroke: var(--accent); }
.map-node { fill: var(--card); stroke: #d1d5db; stroke-width: 1.2; }
.map-dir { fill: #f3f4f6; stroke: #d1d5db; stroke-width: 1; }
.map-core { fill: var(--accent); }
.map-svg a:hover .map-core { fill: #24479f; }
.map-title { font-size: 15px; font-weight: 650; fill: var(--ink); }
.map-title.small { font-size: 13.5px; }
.map-text { font-size: 12.5px; fill: var(--muted); }
.map-text.small { font-size: 11.5px; }
.map-text.strong { fill: var(--ink); font-weight: 600; }
.map-core-title { font-size: 15px; font-weight: 800; letter-spacing: 0.12em; fill: #fff; }
.map-core-text { font-size: 12.5px; fill: #dbe3f5; }
.map-link { stroke: #9ca3af; stroke-width: 1.4; }
.map-link.soft { stroke: #d1d5db; }
.map-link.dashed { stroke-dasharray: 4 4; }
.map-arrow { fill: #9ca3af; }
.map-note { font-size: 11.5px; fill: var(--muted); }
.lane { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; fill: var(--faint); }
.dot-people { fill: var(--people); }
.dot-service { fill: var(--service); }
.dot-agent { fill: var(--agent); }
.map-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.map-list li { padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.map-list li.core { color: #fff; background: var(--accent); }
.map-list li.core .lane { color: #c7d2ee; }
.map-list .lane { display: block; margin-bottom: 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.map-list p { margin: 2px 0; font-size: 0.92rem; overflow-wrap: anywhere; }
.map-list p .dot { margin-right: 6px; }

/* ── the stories ── */
.tracks { display: grid; gap: 14px; }
.track { display: flex; flex-direction: column; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.track-kind { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.track h3 { margin: 6px 0 6px; font-size: 1.05rem; line-height: 1.35; }
.track-lead { margin: 0 0 12px; color: var(--muted); font-size: 0.93rem; }
.track-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.track-state { margin: 8px 0 0; min-height: 1em; font-size: 0.86rem; color: var(--muted); }
.track-state.error { color: var(--warn); }

.button {
  display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; font: inherit; font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer; color: var(--accent); background: var(--card); border: 1px solid #c9d2e6; border-radius: 9px;
}
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.attack { color: var(--attack); background: #fff; border-color: #f2c4bf; }
.button.quiet { color: var(--muted); background: transparent; border-color: var(--line); font-weight: 500; }
.button:hover, .button:focus-visible { filter: brightness(1.06); }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }
.link { font-weight: 600; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.kpis div { padding: 8px 10px; background: var(--bg); border-radius: 9px; }
.kpis dt { font-size: 0.74rem; color: var(--muted); }
.kpis dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* folded details: "Show the steps", "Show more" */
details.more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more > summary {
  list-style: none; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--accent);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-block; width: 1.1em; font-weight: 700; }
details.more[open] > summary::before { content: "−"; }
details.more.nested { margin-top: 10px; padding-top: 8px; }
details.more.panel { margin: 0 0 10px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
details.more.panel > summary { font-size: 0.95rem; }

.story { margin-top: 12px; }
.story h4 { margin: 0 0 6px; font-size: 0.95rem; }
.steps { margin: 6px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 8px 0 8px 30px; font-size: 0.92rem; border-top: 1px dashed var(--line); counter-increment: step;
}
.steps > li:first-child { border-top: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 8px; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: var(--accent); background: var(--accent-soft);
}
.steps > li > span { flex: 1 1 200px; }
.fallback { color: var(--warn); }
.proof { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }

.otp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.otp-code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 1.02rem; }
.otp-left { font-size: 0.8rem; color: var(--muted); }
.copy, .otp-copy, .otp-next {
  padding: 2px 9px; font: inherit; font-size: 0.8rem; cursor: pointer; color: var(--accent); background: #fff;
  border: 1px solid var(--line); border-radius: 6px;
}
.story.unavailable { opacity: 0.55; }

.trace { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 0.84rem; }
.trace th { padding: 6px 8px; text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.trace td { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.trace .verdict-allow { color: var(--ok); font-weight: 600; }
.trace .verdict-deny { color: var(--attack); font-weight: 600; }

.console-account { margin: 14px 0 0; padding: 12px 14px; font-size: 0.92rem; background: var(--accent-soft); border-radius: var(--radius); }
.console-account p { margin: 0; }
.credentials { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px !important; }

/* ── latest findings ── */
.soc-card { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.soc-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.soc-table th { padding: 7px 8px; text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); }
.soc-table td { padding: 7px 8px; vertical-align: top; border-bottom: 1px solid var(--line); }
.soc-table tbody tr:last-child td { border-bottom: 0; }
.soc-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.soc-desc { overflow-wrap: anywhere; }
.soc-level, .soc-id { font-variant-numeric: tabular-nums; white-space: nowrap; }
.soc-level.critical { font-weight: 700; color: var(--attack); }
.soc-level.high { font-weight: 700; color: #c2410c; }
.soc-wide { display: none; }
.soc-state { margin: 0; padding: 10px; color: var(--muted); font-size: 0.88rem; }

/* ── measured live ── */
.live-frame { overflow: hidden; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.live-frame iframe { display: block; width: 100%; height: calc(270vw + 800px); border: 0; }

/* ── explore ── */
details.panel h3 { margin: 18px 0 4px; font-size: 1rem; }
.cards { display: grid; grid-template-columns: 1fr; gap: 8px; }
.card {
  display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.card img { grid-row: span 3; height: 26px; width: 26px; object-fit: contain; }
.card .name { font-weight: 650; }
.card .role, .card .url { font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.card:hover, .card:focus-visible { border-color: var(--accent); }
.table-scroll { overflow-x: auto; }
table.people { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.people th, .people td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.people th { color: var(--muted); font-weight: 600; }
.notes { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.notes li + li { margin-top: 5px; }

footer { padding: 20px 16px 28px; text-align: center; font-size: 0.8rem; color: var(--faint); }

/* ── wider screens ── */
@media (min-width: 560px) {
  .status { display: inline-block; }
  .status[hidden] { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .soc-wide { display: table-cell; }
  .soc-time { white-space: nowrap; }
}
@media (min-width: 760px) {
  body { font-size: 15.5px; }
  .topbar { padding: 10px 20px; }
  .topbar-brand img { height: 44px; }
  .topbar-brand span { font-size: 1.05rem; }
  .wide-only { display: inline; }
  .map { padding: 16px; }
  .map-svg { display: block; }
  .map-list { display: none; }
  .live-frame iframe { height: 980px; }
}
@media (min-width: 1000px) {
  .tracks { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .tracks .kpis { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 380px) {
  .topbar-brand span { display: none; }
}

/* the demo video (/video/, published by e2e/playwright/demo/production/compose.ts): the first thing a visitor can do */
.video-cta { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 14px 18px; border-radius: 14px; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, #0b2a5b, #183f80); border: 2px solid #d4a03a; box-shadow: 0 6px 20px rgba(11,42,91,.25); }
.video-cta:hover, .video-cta:focus-visible { border-color: #f0c062; }
.video-cta strong { display: block; font-size: 1.15rem; }
.video-cta-sub { display: block; font-size: 0.9rem; color: #cfd8ea; }
.video-cta-play { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: #d4a03a; color: #0b2a5b; display: grid; place-items: center; font-size: 1.3rem; padding-left: 4px; }
.topbar-button.video { color: #0b2a5b; background: #d4a03a; border-color: #d4a03a; font-weight: 600; }
