@import url("https://fonts.bunny.net/css?family=space-grotesk:400,500,700|jetbrains-mono:400,500");

:root {
  --bg: #101c3a;
  --bg-2: #162443;
  --bg-3: #1d2f57;
  --line: #2b3d66;
  --ink: #eaeff9;
  --ink-2: #a9b5d1;
  --ice: #6fe3ff;
  --ice-dim: #3aa9c8;
  --amber: #ffb84d;
  --font: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 66ch;
  --wide: 72rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ice); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

/* --- structuur --- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li + li { margin-top: .35em; }
main { padding-bottom: 4rem; }
section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--line); }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.015em; font-weight: 700; margin: 0 0 .6em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); margin-top: 0; }
h3 { font-size: 1.25rem; margin-top: 2em; }
.lede { font-size: 1.25rem; color: var(--ink-2); max-width: 58ch; }
small, .muted { color: var(--ink-2); }
code { font-family: var(--mono); font-size: .92em; background: var(--bg-2); padding: .1em .4em; border-radius: 4px; }
pre {
  font-family: var(--mono); font-size: .88rem; line-height: 1.55;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 1.1rem 1.25rem; overflow-x: auto; margin: 1.25rem 0;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* --- navigatie --- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: baseline; gap: .55rem; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand span { color: var(--amber); font-weight: 500; }
.top nav { display: flex; gap: .25rem 1.4rem; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ice); }

/* --- stage (animatie + intro) --- */
.stage { position: relative; min-height: 80vh; display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, rgba(16,28,58,.92) 0%, rgba(16,28,58,.7) 32%, rgba(16,28,58,0) 55%); }
.stage-copy { position: relative; z-index: 1; width: 100%; max-width: var(--wide); margin: 0 auto; padding: 4.5rem 1.5rem; }
.stage-copy > div { max-width: 34rem; }
.stage h1 { margin-bottom: .5em; }
.stage p { max-width: 50ch; }
.actions { display: flex; gap: .75rem 1.5rem; flex-wrap: wrap; align-items: center; margin-top: 1.75rem; }
.btn {
  display: inline-block; padding: .7rem 1.2rem; border-radius: 6px; text-decoration: none; font-weight: 500;
  background: var(--ice); color: #06131f; border: 1px solid var(--ice);
}
.btn:hover { background: #fff; border-color: #fff; color: #06131f; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--ink-2); }

.session .trace { max-width: 42rem; margin-top: 1.5rem; }

/* protocol-trace */
.trace {
  font-family: var(--mono); font-size: .82rem; line-height: 1.7;
  background: #0b1530; border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.15rem 1.15rem; box-shadow: 0 0 0 1px rgba(111,227,255,.06), 0 30px 60px -30px rgba(0,0,0,.8);
}
.trace-head { display: flex; justify-content: space-between; color: var(--ink-2); font-size: .74rem; margin-bottom: .75rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.trace ol { list-style: none; margin: 0; padding: 0; }
.trace { min-width: 0; }
.trace li { display: grid; grid-template-columns: 1.3rem 6.5rem minmax(0, 1fr); gap: .5rem; opacity: 0; }
.trace .v { overflow-wrap: anywhere; }
.trace li.on { opacity: 1; transition: opacity .25s ease; }
.trace .dir { color: var(--ink-2); }
.trace .req .dir { color: var(--amber); }
.trace .res .dir { color: var(--ice); }
.trace .m { color: var(--ink-2); }
.trace .v { color: var(--ink); }
.trace .ok { color: #8fe3b1; }
.trace .note { color: var(--ink-2); margin-top: .5rem; white-space: normal; grid-template-columns: 1fr; }
@media (prefers-reduced-motion: reduce) {
  .trace li { opacity: 1; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- inhoudsblokken --- */
.figure { margin: 1.75rem 0 2rem; }
.figure figcaption { color: var(--ink-2); font-size: .9rem; margin-top: .6rem; max-width: var(--measure); }
.flow { width: 100%; height: auto; display: block; }

table { border-collapse: collapse; width: 100%; font-size: .96rem; margin: 1.25rem 0 1.75rem; }
th, td { text-align: left; vertical-align: top; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
th { color: var(--ink-2); font-weight: 500; }
tbody th { color: var(--ink); font-weight: 700; }
td code { white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2rem 3rem; }

.toc { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.25rem; max-width: var(--measure); }
.toc li { padding-left: 1.25rem; border-left: 2px solid var(--line); }
.toc a { font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc p { margin: .2rem 0 0; color: var(--ink-2); }

.scenario { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.scenario:first-of-type { border-top: 0; padding-top: 0; }
.scenario h3 { margin-top: 0; }
.prompt { font-style: italic; color: var(--ink); border-left: 3px solid var(--amber); padding: .2rem 0 .2rem 1rem; margin: 1rem 0; max-width: var(--measure); }

.callout { border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; margin: 1.5rem 0; max-width: var(--measure); background: var(--bg-2); }
.callout p:last-child { margin-bottom: 0; }

.status { display: inline-block; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }

/* --- footer --- */
footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--ink-2); font-size: .92rem; }
footer p { margin: 0 0 .5em; max-width: var(--measure); }

@media (max-width: 52rem) {
  .stage { display: flex; flex-direction: column; min-height: 0; }
  .stage::after { content: none; }
  .stage canvas { order: 2; position: relative; height: 60vh; min-height: 24rem; }
  .stage-copy { padding: 2.5rem 1.5rem 1rem; }
  .trace { font-size: .76rem; }
  .trace li { grid-template-columns: 1.1rem minmax(0, 1fr); row-gap: 0; }
  .trace .v { grid-column: 2 / -1; padding-left: .1rem; }
  .trace li.note { grid-template-columns: 1fr; }
  section { padding: 2.5rem 0; }
}
