@font-face { font-family: "Zha"; src: url("zha.woff") format("woff"); unicode-range: U+A565; font-display: swap; }
:root {
  --black: #000000;
  --ash: #d9d5cc;
  --text: #bdb9b0;
  --dim: #6f6c68;
  --pulse: 143, 138, 173;
  --gold: 208, 170, 84;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Zha", serif;
  --beat: 0;
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }
html { background: var(--black); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--ash);
  font-family: var(--serif);
  overflow-x: hidden;
}

#fog {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Kop ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 52rem; margin: 0 auto;
  padding: calc(1.2rem + env(safe-area-inset-top, 0px)) 1.5rem 0;
}
.seal { display: block; width: 2.6rem; height: 2.6rem; }
.seal .halo { opacity: calc(.2 + var(--beat) * .6); transform: scale(calc(.85 + var(--beat) * .5)); }
.seal .core { fill: #000; stroke: rgb(var(--gold)); stroke-width: calc(.9 + var(--beat) * 1.1); }
.top nav { display: flex; gap: 1.6rem; font-size: .95rem; }
a { color: var(--dim); text-decoration: none; transition: color .3s ease; }
a:hover, a:focus-visible { color: var(--ash); }
a[aria-current="page"] { color: var(--ash); }
a:focus-visible { outline: 1px solid rgba(var(--pulse), .8); outline-offset: 4px; }

/* ---------- Inhoud ---------- */
main {
  position: relative; z-index: 1;
  max-width: 36rem;
  margin: 0 auto;
  padding: 14vh 1.5rem 8vh;
}
h1 {
  margin: 0 0 1.4rem;
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 400;
  letter-spacing: .01em;
}
.intro {
  margin: 0 0 6rem;
  font-size: clamp(1rem, 3.4vw, 1.15rem);
  font-style: italic;
  line-height: 1.7;
  color: var(--dim);
}
.entry { margin: 0 0 7rem; }
.entry h2 {
  margin: 0 0 .5rem;
  font-size: clamp(1.4rem, 4.6vw, 1.9rem);
  font-weight: 400;
  letter-spacing: .01em;
}
.entry .meta {
  margin: 0 0 2.4rem;
  font-size: .85rem;
  font-style: italic;
  color: var(--dim);
}
.entry p {
  margin: 0 0 1.6rem;
  font-size: clamp(1.05rem, 3.6vw, 1.2rem);
  line-height: 1.85;
  color: var(--text);
}
.empty { font-style: italic; color: var(--dim); }

footer {
  position: relative; z-index: 1;
  padding: 3rem 1.5rem calc(3rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: .8rem;
  color: var(--dim);
}
footer nav { display: flex; justify-content: center; gap: 1.6rem; margin-bottom: 1.2rem; }

/* ---------- Cijfer ---------- */
.cipher {
  font-family: var(--serif), "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "Noto Sans Symbols";
}
.cipher .fb { color: #262428; }
.cw { display: inline-block; white-space: nowrap; }
.cipher .c {
  display: inline-block;
  height: 1.2em; line-height: 1.2em;
  text-align: center;
  color: rgba(var(--pulse), .62);
  text-shadow: 0 0 10px rgba(var(--pulse), .4);
  transition: color .5s ease;
}
.cipher .c.t { color: var(--ash); text-shadow: none; }
.cipher .p { color: var(--dim); }

/* ---------- Beweging ---------- */
.js .rv {
  opacity: 0; filter: blur(10px);
  transition: opacity 2.2s ease, filter 2.2s ease;
}
.js .rv.in { opacity: 1; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; filter: none; transition: none; }
  .cipher .c { transition: none; }
}

/* ---------- Uitwisseling ---------- */
footer nav { flex-wrap: wrap; }
.meter { display: grid; place-items: center; margin: 0 0 4.5rem; text-align: center; }
.meter svg { display: block; width: min(62vw, 13rem); height: auto; overflow: visible; }
.meter .track { fill: none; stroke: rgba(var(--gold), .16); stroke-width: 1.2; }
.meter .arc {
  fill: none; stroke: rgb(var(--gold)); stroke-width: 2; stroke-linecap: round;
  transition: stroke-dashoffset 3.2s cubic-bezier(.2, .6, .2, 1);
}
.meter .core { fill: #000; }
.meter .halo { opacity: calc(.2 + var(--beat) * .6); transform: scale(calc(.85 + var(--beat) * .5)); }
.meter .pct { fill: var(--ash); font-family: var(--serif); font-size: 11px; text-anchor: middle; }
.meter figcaption { margin-top: 1.6rem; font-size: .95rem; color: var(--dim); }

.give {
  display: inline-block;
  padding: .9rem 2.2rem;
  border: 1px solid rgba(var(--gold), .7);
  color: rgb(var(--gold));
  font-size: 1rem;
  letter-spacing: .04em;
  transition: background .4s ease, color .4s ease, box-shadow .4s ease;
}
.give:hover, .give:focus-visible {
  background: rgba(var(--gold), .12);
  color: var(--ash);
  box-shadow: 0 0 24px rgba(var(--gold), .25);
}
.give[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.tiers { list-style: none; margin: 1rem 0 3rem; padding: 0; }
.tiers li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: var(--text);
  font-size: clamp(1rem, 3.4vw, 1.1rem);
}
.tiers li:first-child { border-top: 1px solid rgba(255, 255, 255, .08); }
.tiers .a { color: var(--dim); }
.tiers li.open .a { color: rgb(var(--gold)); }
.note { font-size: .9rem; font-style: italic; color: var(--dim); }

/* ---------- Colofon ---------- */
.mark { width: min(50vw, 9rem); height: auto; margin: 0 0 3rem; }
.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.swatches li { font-size: .95rem; color: var(--text); }
.swatches i { display: block; height: 3rem; margin-bottom: .6rem; border: 1px solid rgba(255, 255, 255, .14); }
.swatches small { display: block; color: var(--dim); font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  .meter .arc { transition: none; }
  .give { transition: none; }
}

/* ---------- Werkgegevens ---------- */
.intro.has-context { margin-bottom: 1.4rem; }
.context { margin: 0 0 6rem; font-size: .82rem; line-height: 1.6; color: var(--dim); }
.facts {
  display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.2rem;
  margin: 0 0 2.4rem; font-size: .85rem; color: var(--dim);
}
.facts dt { font-style: italic; }
.facts dd { margin: 0; color: var(--text); }
.entry .cite { margin-top: 3rem; font-size: .82rem; line-height: 1.6; color: var(--dim); }

/* ---------- Handshake ---------- */
.zha { display: inline-block; width: .96em; height: 1em; vertical-align: -.14em; fill: currentColor; }
.handshake {
  font-family: var(--serif), "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "Noto Sans Math", "Noto Sans Symbols";
  text-align: center; letter-spacing: .5em; text-indent: .5em;
  color: var(--dim);
  text-shadow: 0 0 calc(var(--beat) * 12px) rgba(var(--pulse), calc(var(--beat) * .6));
}
.entry .handshake { margin: 0 0 1.6rem; font-size: clamp(1.1rem, 4vw, 1.4rem); }

/* ---------- Sleutelveld ---------- */
.key .row { display: flex; gap: .8rem; flex-wrap: wrap; }
.key input {
  flex: 1 1 14rem; min-width: 0;
  background: transparent; border: 1px solid rgba(255, 255, 255, .2); border-radius: 0;
  color: var(--ash); font: inherit; font-size: 1rem; padding: .8rem 1rem;
}
.key input::placeholder { color: var(--dim); }
.key input:focus-visible { outline: 1px solid rgba(var(--pulse), .9); outline-offset: 3px; border-color: rgba(var(--pulse), .7); }
.key button, .choices button {
  background: transparent; border: 1px solid rgba(var(--gold), .7); border-radius: 0;
  color: rgb(var(--gold)); font: inherit; font-size: .95rem; letter-spacing: .04em;
  padding: .8rem 1.6rem; cursor: pointer;
  transition: background .4s ease, color .4s ease, box-shadow .4s ease;
}
.key button:hover, .key button:focus-visible, .choices button:hover, .choices button:focus-visible {
  background: rgba(var(--gold), .12); color: var(--ash); box-shadow: 0 0 24px rgba(var(--gold), .25);
}
.key button:focus-visible, .choices button:focus-visible { outline: 1px solid rgba(var(--pulse), .9); outline-offset: 3px; }

/* ---------- Links in lopende tekst ---------- */
.note a, .context a, .entry p a, .thread a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.note a:hover, .context a:hover, .entry p a:hover, .thread a:hover { color: var(--ash); }

/* ---------- Vragen (keuzeboom) ---------- */
.thread { display: flex; flex-direction: column; gap: 1.4rem; margin: 0 0 2.4rem; }
.thread .bot {
  margin: 0; max-width: 32rem; padding-left: 1.1rem;
  border-left: 1px solid rgba(var(--gold), .5);
  font-size: clamp(1.05rem, 3.6vw, 1.2rem); line-height: 1.8; color: var(--text);
}
.thread .me { margin: 0; align-self: flex-end; font-size: .95rem; font-style: italic; color: var(--dim); }
.choices { display: flex; flex-wrap: wrap; gap: .7rem; }
@keyframes msg { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }
@media (prefers-reduced-motion: no-preference) {
  .thread > * { animation: msg 1.1s ease both; }
  @view-transition { navigation: auto; }
}
.sid { overflow-wrap: anywhere; word-break: break-all; font-size: clamp(.9rem, 3.2vw, 1.05rem) !important; line-height: 1.7 !important; }
/* ---------- Fragmenten ---------- */
.tracker { margin: 0 0 5rem; }
.slots { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0 0 1.1rem; min-height: .9rem; }
.slots i { width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid rgba(var(--gold), .6); transition: background .8s ease, box-shadow .8s ease; }
.slots i.on { background: rgb(var(--gold)); box-shadow: 0 0 12px rgba(var(--gold), .6); }
.tracker .count { margin: 0; font-size: 1rem; color: var(--text); }
.tracker .next { margin: .4rem 0 0; font-size: .9rem; font-style: italic; color: var(--dim); }
.fbody p { margin: 0 0 1.6rem; white-space: pre-line; }
.key { margin: 0 0 1rem; }
.key .msg { min-height: 1.4em; margin: .8rem 0 0; font-size: .85rem; font-style: italic; color: var(--dim); }
.fragment .empty { margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .slots i, .key button, .choices button { transition: none; }
}

/* ---------- Journals ---------- */
.entry h3 { margin: 3.2rem 0 1.1rem; font-size: clamp(1.05rem, 3.6vw, 1.2rem); font-weight: 400; letter-spacing: .02em; color: var(--ash); }
.entry p { overflow-wrap: break-word; }
main.j h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); }
main.j .intro { margin: 0 0 3.5rem; }
.voice { margin: 0 0 1rem; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.pager { display: flex; justify-content: space-between; gap: 1rem 1.4rem; flex-wrap: wrap; margin: 4rem 0 0; font-size: .95rem; }

/* een eigen uiterlijk per stem */
.v-nyxaur .voice { color: rgb(var(--gold)); }
.v-nyxaur .cipher .c { color: rgba(var(--gold), .62); text-shadow: 0 0 10px rgba(var(--gold), .3); }
.v-nyxaur .cipher .c.t { color: var(--ash); text-shadow: none; }

.v-fluxum .voice { color: #00f0ff; }
.v-fluxum h1 { text-shadow: -1px 0 rgba(255, 0, 144, .35), 1px 0 rgba(0, 240, 255, .35); }
.v-fluxum .entry { padding-left: 1.1rem; border-left: 1px solid rgba(226, 232, 240, .35); box-shadow: -16px 0 26px -20px rgba(113, 28, 145, .95); }
.v-fluxum .cipher .c { color: rgba(0, 240, 255, .62); text-shadow: 0 0 10px rgba(255, 0, 144, .4); }
.v-fluxum .cipher .c.t { color: var(--ash); text-shadow: none; }

.v-file .voice { color: #9aa4ad; }
.v-file h1, .v-file .intro, .v-file .entry { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace, "Zha"; }
.v-file h1 { font-size: clamp(1.3rem, 5vw, 2rem); letter-spacing: .08em; text-transform: uppercase; }
.v-file .entry { padding-left: 1.1rem; border-left: 1px dashed rgba(255, 255, 255, .2); }
.v-file .entry p { font-size: clamp(.92rem, 3.2vw, 1.02rem); line-height: 1.75; color: #aab3bb; }
.v-file .cipher .c { color: rgba(154, 164, 173, .6); text-shadow: 0 0 8px rgba(154, 164, 173, .3); }
.v-file .cipher .c.t { color: var(--ash); text-shadow: none; }

/* overzicht */
.jlist { list-style: none; margin: 1.6rem 0 0; padding: 0; }
.jlist li { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .15rem .9rem; align-items: baseline; padding: 1.05rem 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.jlist li:first-child { border-top: 1px solid rgba(255, 255, 255, .08); }
.jlist .n { font-size: .85rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.jlist .t { font-size: clamp(1.05rem, 3.6vw, 1.2rem); color: var(--ash); }
.jlist .t a { color: var(--ash); }
.jlist .t a:hover, .jlist .t a:focus-visible { color: rgb(var(--gold)); }
.jlist li.sealed .t, .jlist li.sealed .t a { color: var(--dim); }
.jlist .s { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.jlist li.open .s { color: rgb(var(--gold)); }
.jlist li.partly .s { color: var(--ash); }
.jlist .v { grid-column: 2 / -1; font-size: .85rem; font-style: italic; color: var(--dim); }

/* ---------- De draad (Fiction) ---------- */
.legend { display: flex; flex-wrap: wrap; gap: .6rem .7rem; margin: 0 0 3.2rem; padding: 0; list-style: none; }
.legend button {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px;
  color: var(--text); font: inherit; font-size: .85rem; padding: .45rem .95rem; cursor: pointer;
  transition: border-color .3s ease, color .3s ease, box-shadow .3s ease;
}
.legend button i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--c, var(--ash)); box-shadow: 0 0 8px var(--c, transparent); }
.legend button:hover, .legend button:focus-visible { border-color: var(--c, var(--ash)); }
.legend button[aria-pressed="true"] { border-color: var(--c, var(--ash)); color: var(--ash); box-shadow: 0 0 18px -6px var(--c, rgba(217, 213, 204, .5)); }
.legend button:focus-visible { outline: 1px solid rgba(var(--pulse), .9); outline-offset: 3px; }

.strands { list-style: none; margin: 0; padding: 0; }
.strands .node, .strands .join { position: relative; }
.strands .node { display: grid; grid-template-columns: 3.6rem 1fr; padding: 0 0 2.8rem; transition: opacity .5s ease; }
.strands .node::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3.6rem; pointer-events: none; }
.strands .node.lanes::before {
  background:
    linear-gradient(rgba(208, 170, 84, .8), rgba(208, 170, 84, .8)) .7rem 0 / 1px 100% no-repeat,
    linear-gradient(rgba(0, 240, 255, .7), rgba(0, 240, 255, .7)) 1.7rem 0 / 1px 100% no-repeat,
    linear-gradient(rgba(154, 164, 173, .65), rgba(154, 164, 173, .65)) 2.7rem 0 / 1px 100% no-repeat;
}
.strands .node.single::before { background: linear-gradient(rgba(217, 213, 204, .4), rgba(217, 213, 204, .4)) 1.7rem 0 / 1px 100% no-repeat; }
.strands .node:last-child::before { bottom: 2.4rem; }
.strands .join { height: 3.5rem; }
.strands .join svg { display: block; width: 3.6rem; height: 3.5rem; overflow: visible; }
.strands .join path { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }

.strands .node[data-voice="chron"]  { --c: rgb(217, 213, 204); --crgb: 217, 213, 204; --x: 1.7rem; }
.strands .node[data-voice="nyxaur"] { --c: rgb(208, 170, 84);  --crgb: 208, 170, 84;  --x: .7rem; }
.strands .node[data-voice="fluxum"] { --c: rgb(0, 240, 255);   --crgb: 0, 240, 255;   --x: 1.7rem; }
.strands .node[data-voice="system"] { --c: rgb(154, 164, 173); --crgb: 154, 164, 173; --x: 2.7rem; }
.strands .node[data-voice="sealed"] { --c: rgb(111, 108, 104); --crgb: 111, 108, 104; --x: 1.7rem; }

.strands .mark {
  position: absolute; top: .55rem; left: var(--x); width: .95rem; height: .95rem; margin-left: -.475rem;
  border-radius: 50%; border: 1px solid var(--c); background: #000;
  box-shadow: 0 0 calc(var(--beat) * 12px) rgba(var(--crgb), calc(var(--beat) * .75));
}
.strands .node.open .mark { background: var(--c); }
.strands .node.partly .mark { background: conic-gradient(var(--c) 0 50%, #000 50% 100%); }
.strands .node.sealed .mark { border-style: dashed; }

.strands .card, .seedcard > div { grid-column: 2; }
.strands .no { font-size: .72rem; letter-spacing: .22em; color: var(--dim); }
.strands h3, .seedcard h3 { margin: .25rem 0 .55rem; font-size: clamp(1.25rem, 4.8vw, 1.65rem); font-weight: 400; letter-spacing: .01em; color: var(--ash); }
.strands h3 a, .seedcard h3 a { color: var(--ash); }
.strands h3 a:hover, .strands h3 a:focus-visible, .seedcard h3 a:hover, .seedcard h3 a:focus-visible { color: rgb(var(--gold)); }
.strands .node.sealed h3, .strands .node.sealed h3 a { color: var(--dim); }
.strands .teaser, .seedcard .teaser { margin: 0 0 .85rem; max-width: 30rem; font-size: 1rem; line-height: 1.65; font-style: italic; color: #8c8880; }
.strands .tag, .seedcard .tag { margin: 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.strands .tag .vc, .seedcard .tag .vc { color: var(--c, var(--ash)); }

.strands[data-filter] .node { opacity: .2; }
.strands[data-filter="nyxaur"] .node[data-voice="nyxaur"],
.strands[data-filter="fluxum"] .node[data-voice="fluxum"],
.strands[data-filter="system"] .node[data-voice="system"] { opacity: 1; }

.later { margin-top: 3rem; }
.seedcard { display: grid; grid-template-columns: 3.6rem 1fr; align-items: start; gap: 0; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.seedcard .seal { width: 2.4rem; height: 2.4rem; margin-top: .2rem; }

@media (prefers-reduced-motion: reduce) {
  .strands .node, .legend button { transition: none; }
}
