/* ─────────────────────────────────────────────────────────────
   Elemental Leadership Assessment
   Dark gallery frame, warm paper and the element colour as the
   only strong chroma in the room.
   ───────────────────────────────────────────────────────────── */

:root {
  --frame: #11100e;
  --paper: #f3efe7;
  --surface: rgba(243, 239, 231, .94);
  --ink: #171512;
  --ink-soft: rgba(23, 21, 18, .68);
  --ink-faint: rgba(23, 21, 18, .44);
  --hair: rgba(23, 21, 18, .16);
  --hair-soft: rgba(23, 21, 18, .08);
  --gold: #FBAF3F;

  --display: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --text: 'Roboto', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* Driven from JS as answers come in. On white paper the bright element hues
     (lucht especially) are too pale to read, so --el carries each element's
     deep value for text and strokes, and --el-soft the bright one for washes. */
  --el: #111414;
  --el-soft: #111414;
  --atmo-primary-x: 50%;
  --atmo-primary-y: 50%;
  --atmo-secondary-x: 50%;
  --atmo-secondary-y: 50%;
  --atmo-primary-tint: transparent;
  --atmo-secondary-tint: transparent;
  --atmo-aperture-w: 46%;
  --atmo-aperture-h: 54%;

  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --slow: cubic-bezier(.65, .02, .18, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Several hidden elements are display:flex, which otherwise wins over the UA's
   [hidden] rule and leaves them on screen. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--frame);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 300;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--gold); color: var(--ink); }

/* The live backdrop, the WebGL stage and the element cursor come from
   shell.css — the same environment the landing page runs in. The element wash
   is no longer four CSS blobs: it is a tint bled into the backdrop shader from
   the dominant element's corner, driven by paintAmbient() in app.js. */

/* ── Top bar + progress rail ─────────────────────────────────────────── */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px var(--pad);
  background: linear-gradient(rgba(17,16,14,.92) 50%, rgba(17,16,14,0));
}

/* Deliberately larger than the hero's mark: this page has no big centrepiece,
   so the logo is what anchors the top-left corner. */
.brand img {
  height: clamp(38px, 3.4vw, 52px); display: block;
  filter: invert(1) sepia(.08);
}
.brand { opacity: .92; transition: opacity .4s var(--ease); }
.brand:hover { opacity: 1; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.locale-toggle {
  min-height: 36px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.3); border-radius: 999px;
  color: #fff; background: rgba(17,16,14,.42);
  backdrop-filter: blur(10px);
  font: 500 10px/1 var(--display);
  letter-spacing: .08em;
  cursor: pointer;
}
.locale-toggle:hover { border-color: var(--gold); }
.locale-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.locale-flag { font-size: 15px; line-height: 1; }

.rail { display: flex; align-items: center; gap: 4px; }

.rail-node { display: flex; align-items: center; gap: 7px; }
.rail-node i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.28); transition: all .5s var(--ease);
}
.rail-node em {
  font-style: normal; font-family: var(--display); font-size: .66rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
  max-width: 0; overflow: hidden; white-space: nowrap;
  color: rgba(255,255,255,.48);
  transition: max-width .55s var(--ease), color .4s, margin .55s var(--ease);
}
.rail-node + .rail-node { margin-left: 14px; }
.rail-node.is-done i { background: rgba(255,255,255,.48); }
.rail-node.is-now i { background: var(--el); width: 7px; height: 7px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--el) 14%, transparent); }
.rail-node.is-now em { max-width: 160px; color: rgba(255,255,255,.88); margin-right: 2px; }
.topbar .link-btn { color: rgba(255,255,255,.58); }
.topbar .link-btn:hover { color: #fff; }

/* The backdrop remains alive, but in the darker register of the main website.
   The reading surface above it carries the copy. */
#stage { filter: brightness(.4) saturate(.78) contrast(1.08); }

/* ── Screens ─────────────────────────────────────────────────────────── */

main { position: relative; z-index: 2; }

/* Arriving through the particle wipe: hold the copy back until the cloud has
   started to thin, so it resolves out of the cloud rather than sitting behind it. */
body.entering main, body.entering .topbar { opacity: 0; }
main, .topbar { transition: opacity .9s var(--ease); }

/* ── No WebGL ────────────────────────────────────────────────────────────
   The shader normally does the blur, the wash and the water window in one
   pass. Without it we still owe the page a backdrop, so the same footage is
   played as a plain DOM video with a CSS blur and a white wash over it. Two
   stacked layers instead of one quad — more expensive, but this path only runs
   on machines that couldn't do the cheap version anyway.

   The dead canvas and the untracked cursor ring go away. */
body.no-stage #stage { display: none; }

body.no-stage[data-screen="result"] {
  --atmo-aperture-w: 72%;
  --atmo-aperture-h: 78%;
}

body.no-stage .bd-video {
  width: 100%; height: 100%;
  opacity: 1;
  object-fit: cover;
  filter: blur(26px) saturate(.82) brightness(.62);
  transform: scale(1.1);          /* hides the soft edge the blur leaves */
}

body.no-stage .backdrop::before {
  content: ''; position: absolute; z-index: 1; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 50% at var(--atmo-primary-x) var(--atmo-primary-y),
      color-mix(in srgb, var(--atmo-primary-tint) 30%, transparent), transparent 68%),
    radial-gradient(42% 50% at var(--atmo-secondary-x) var(--atmo-secondary-y),
      color-mix(in srgb, var(--atmo-secondary-tint) 30%, transparent), transparent 68%);
}

/* The wash uses the same JS-driven corner positions as the shader. Its mask
   cuts one aperture by default and intersects a second mask for pressure pairs. */
body.no-stage .backdrop::after {
  content: ''; position: absolute; z-index: 2; inset: 0;
  pointer-events: none;
  background: rgba(17,16,14,.78);
  -webkit-mask-image: radial-gradient(var(--atmo-aperture-w) var(--atmo-aperture-h) at var(--atmo-primary-x) var(--atmo-primary-y),
    transparent 0%, rgba(0,0,0,.42) 52%, #000 100%);
  mask-image: radial-gradient(var(--atmo-aperture-w) var(--atmo-aperture-h) at var(--atmo-primary-x) var(--atmo-primary-y),
    transparent 0%, rgba(0,0,0,.42) 52%, #000 100%);
}

body.no-stage[data-atmosphere-secondary] .backdrop::after {
  -webkit-mask-image:
    radial-gradient(var(--atmo-aperture-w) var(--atmo-aperture-h) at var(--atmo-primary-x) var(--atmo-primary-y),
      transparent 0%, rgba(0,0,0,.42) 52%, #000 100%),
    radial-gradient(var(--atmo-aperture-w) var(--atmo-aperture-h) at var(--atmo-secondary-x) var(--atmo-secondary-y),
      transparent 0%, rgba(0,0,0,.42) 52%, #000 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(var(--atmo-aperture-w) var(--atmo-aperture-h) at var(--atmo-primary-x) var(--atmo-primary-y),
      transparent 0%, rgba(0,0,0,.42) 52%, #000 100%),
    radial-gradient(var(--atmo-aperture-w) var(--atmo-aperture-h) at var(--atmo-secondary-x) var(--atmo-secondary-y),
      transparent 0%, rgba(0,0,0,.42) 52%, #000 100%);
  mask-composite: intersect;
}

body.no-stage[data-atmosphere-mode="questionnaire"] .backdrop::before {
  background: none;
}

body.no-stage[data-atmosphere-mode="questionnaire"] .backdrop::after {
  background: radial-gradient(ellipse at 50% 50%,
    rgba(17,16,14,.58) 0 36%,
    rgba(17,16,14,.72) 68%,
    rgba(17,16,14,.84) 100%);
  -webkit-mask-image: none;
  mask-image: none;
}

body.no-stage[data-atmosphere-mode="overview"] .backdrop::after {
  background: rgba(17,16,14,.72);
  -webkit-mask-image: radial-gradient(44% 50% at 50% 50%,
    transparent 0%, rgba(0,0,0,.5) 58%, #000 100%);
  mask-image: radial-gradient(44% 50% at 50% 50%,
    transparent 0%, rgba(0,0,0,.5) 58%, #000 100%);
}

.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 84px var(--pad) 40px;
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden;
  transform: translateY(12px);
  /* Leaving: fade straight out. */
  transition: opacity .28s var(--ease), transform .28s var(--ease), visibility 0s .28s;
}
/* Arriving: wait for the outgoing screen to clear, then come in. Without the
   delay both screens are painted on top of each other mid-transition. */
.screen.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .5s var(--ease) .26s, transform .5s var(--ease) .26s, visibility 0s;
}

.screen-quiz,
.screen[data-screen="phase2"] {
  padding-block: 84px;
}

/* margin:auto rather than justify-content:center — centred when it fits, and
   never clipped at the top when it doesn't. */
.wrap { width: 100%; max-width: 860px; margin: auto 0; }
.screen:not(.screen-result) .wrap {
  padding: clamp(28px, 4.5vw, 52px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 32px 90px rgba(0,0,0,.32);
  backdrop-filter: blur(18px) saturate(.9);
}
.screen-result .wrap { margin-top: 0; }
.screen-result .wrap {
  max-width: 960px;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 32px 100px rgba(0,0,0,.34);
  backdrop-filter: blur(18px) saturate(.9);
}
.wrap-narrow { max-width: 620px; }
.wrap-q { max-width: 780px; }
.center { text-align: center; }
.center :is(.display, .ask, .sub) { margin-inline: auto; }
.center :is(.display, .ask) { text-wrap: balance; }
.screen-quiz .wrap-q { text-align: center; }
.screen-quiz :is(.q-text, .q-lead, .meter, .meter-legend) { margin-inline: auto; }

/* Children of an entering screen arrive one after the other. */
/* Delays start after the screen handoff above, not at class-add time. */
.screen.is-active .wrap > * { animation: rise .7s var(--ease) both; }
.screen.is-active .wrap > *:nth-child(1) { animation-delay: .30s }
.screen.is-active .wrap > *:nth-child(2) { animation-delay: .36s }
.screen.is-active .wrap > *:nth-child(3) { animation-delay: .42s }
.screen.is-active .wrap > *:nth-child(4) { animation-delay: .48s }
.screen.is-active .wrap > *:nth-child(5) { animation-delay: .54s }
.screen.is-active .wrap > *:nth-child(6) { animation-delay: .60s }
.screen.is-active .wrap > *:nth-child(n+7) { animation-delay: .65s }

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

/* ── Type ────────────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--display); font-weight: 500; font-size: .7rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 22px;
}

.display {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.04; letter-spacing: -.035em;
  max-width: 15ch;
}
.display-sm { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 18ch; }

.ask {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  line-height: 1.16; letter-spacing: -.028em;
  max-width: 22ch;
}

.lede { margin-top: 26px; max-width: 58ch; }
.lede p + p { margin-top: 14px; }
.lede p, .sub { color: var(--ink-soft); font-size: 1.02rem; }

.sub { margin-top: 14px; max-width: 54ch; }

.pull {
  margin: 34px 0 0; padding-left: 22px;
  border-left: 2px solid var(--gold);
  font-family: var(--display); font-weight: 400; font-style: italic;
  font-size: clamp(1.1rem, 2.1vw, 1.35rem); line-height: 1.44;
  max-width: 40ch;
}

.meta-row {
  display: flex; flex-wrap: wrap; gap: 0 22px;
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--hair);
  font-family: var(--display); font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.meta-row span + span { position: relative; padding-left: 22px; }
.meta-row span + span::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 4px; height: 1px; background: var(--hair);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 24px; border: 0; border-radius: 6px;
  background: var(--ink); color: var(--paper);
  font-family: var(--display); font-weight: 500; font-size: .92rem;
  letter-spacing: -.01em; cursor: pointer;
  transition: background .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.btn i { font-style: normal; transition: transform .4s var(--ease); }
.btn:hover { background: var(--el); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(17,20,20,.14); }
.btn:hover i { transform: translateX(4px); }
.btn:disabled { opacity: .28; pointer-events: none; }
.btn-sm { padding: 11px 22px; font-size: .85rem; }

.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.btn-ghost:hover { background: transparent; color: var(--el); box-shadow: inset 0 0 0 1px var(--el); }

.link-btn {
  border: 0; background: none; padding: 4px 0; cursor: pointer;
  font-family: var(--display); font-size: .8rem; color: var(--ink-faint);
  transition: color .3s;
}
.link-btn:hover { color: var(--ink); }
.link-btn:disabled { opacity: .3; pointer-events: none; }

.cta-row { margin-top: 34px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.center-row { justify-content: center; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ── Intro extras ────────────────────────────────────────────────────── */

.resume {
  margin-top: 28px; padding: 20px 22px 20px 26px;
  border: 1px solid color-mix(in srgb, var(--gold) 46%, var(--hair));
  border-left: 4px solid var(--gold); border-radius: 8px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 14px 34px rgba(17,20,20,.08);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.resume p {
  font-family: var(--display); font-size: 1rem; font-weight: 500; color: var(--ink);
}
.resume em {
  display: inline-block; margin-left: 8px; padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 18%, white);
  font-style: normal; font-size: .76rem; font-weight: 500; color: var(--ink);
}

.disclosure { margin-top: 36px; border-top: 1px solid var(--hair); padding-top: 18px; max-width: 62ch; }
.disclosure summary {
  cursor: pointer; list-style: none;
  font-family: var(--display); font-size: .82rem; color: var(--ink-faint);
  transition: color .3s;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before { content: '+ '; }
.disclosure[open] summary::before { content: '– '; }
.disclosure summary:hover { color: var(--ink); }
.disclosure p { margin-top: 14px; font-size: .88rem; color: var(--ink-soft); }

.demo-row { margin-top: 34px; display: flex; gap: 8px; flex-wrap: wrap; }
.demo-btn {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px dashed var(--hair); background: none;
  font-family: var(--display); font-size: .72rem; color: var(--ink-faint);
}
.demo-btn:hover { border-color: var(--el); color: var(--el); }

/* ── Fields ──────────────────────────────────────────────────────────── */

.field { display: block; margin-top: 24px; }
.field span {
  display: block; margin-bottom: 8px;
  font-family: var(--display); font-size: .78rem; letter-spacing: .02em;
}
.field span em { font-style: normal; color: var(--ink-faint); }

input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 15px 18px;
  border: 1px solid var(--hair); border-radius: 6px;
  background: rgba(255,255,255,.72);
  font-family: var(--text); font-size: 1rem; font-weight: 300; color: var(--ink);
  transition: border-color .3s, box-shadow .3s, background .3s;
}
input:focus, textarea:focus {
  outline: none; background: #fff;
  border-color: var(--el);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--el) 12%, transparent);
}
::placeholder { color: var(--ink-faint); }

textarea {
  margin-top: 26px; min-height: 120px; resize: none; line-height: 1.6;
  font-size: 1.06rem;
}

/* ── Assessment access ───────────────────────────────────────────────── */

.access-dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; overflow: auto;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--hair));
  border-radius: 12px; background: var(--paper); color: var(--ink);
  box-shadow: 0 34px 90px rgba(8,9,9,.28);
}
.access-dialog::backdrop { background: rgba(17,16,14,.58); backdrop-filter: blur(7px); }
.access-dialog[open] { animation: rise .4s var(--ease) both; }
.access-dialog form { position: relative; padding: clamp(32px, 6vw, 54px); }
.access-dialog h2 {
  max-width: 10ch; margin-top: 14px;
  font-family: var(--display); font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1; letter-spacing: -.055em; text-wrap: balance;
}
.access-copy { margin-top: 22px; color: var(--ink-soft); line-height: 1.7; }
.access-dialog .field { margin-top: 28px; }
.access-dialog .btn { width: 100%; justify-content: center; margin-top: 8px; }
.access-close {
  position: absolute; top: 18px; right: 18px;
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--hair); border-radius: 50%;
  background: transparent; color: var(--ink-faint); cursor: pointer;
}
.access-close:hover,
.access-close:focus-visible { border-color: var(--ink); color: var(--ink); }
.access-error {
  min-height: 2.8em; margin-top: 12px;
  color: #9b3428; font: 500 .78rem/1.4 var(--display);
}

/* ── Element cards ───────────────────────────────────────────────────── */

.ecards {
  margin-top: 34px;
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ecard {
  position: relative; overflow: hidden;
  text-align: left; cursor: pointer;
  padding: 24px 22px 20px;
  border: 1px solid var(--hair); border-radius: 8px;
  background: rgba(255,255,255,.62);
  font-family: var(--text); color: var(--ink);
  transition: border-color .45s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease);
}
.screen-elements .ecard {
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(9px);
}
.ecard::before {
  content: ''; position: absolute; inset: auto -30% -60% -30%; height: 120%;
  background: radial-gradient(circle at 50% 100%, var(--cw), transparent 68%);
  opacity: 0; transition: opacity .5s var(--ease);
}
.ecard > * { position: relative; }
.ecard:hover,
.ecard:focus-visible { transform: translateY(-3px); border-color: var(--c); box-shadow: 0 12px 30px rgba(17,20,20,.07); }
.ecard:hover::before,
.ecard:focus-visible::before { opacity: .13; }

/* The water icon's path touches its viewBox edge exactly, so its stroke
   overflows by half its width — clipped unless overflow is opened up. */
.ecard-icon { width: 26px; height: 26px; color: var(--c); display: block; overflow: visible; }
.ecard h3 {
  margin-top: 16px; font-family: var(--display); font-weight: 600;
  font-size: 1.16rem; letter-spacing: -.02em;
}
.ecard-tag { margin-top: 3px; font-size: .82rem; color: var(--c); font-weight: 400; }
.ecard-body { margin-top: 12px; font-size: .88rem; color: var(--ink-soft); }
.ecard-more {
  display: inline-block; margin-top: 14px;
  font-family: var(--display); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint);
}
.ecard:hover .ecard-more,
.ecard:focus-visible .ecard-more { color: var(--c); }

/* ── Element dialog ──────────────────────────────────────────────────── */

.edlg {
  position: fixed; inset: 0; margin: auto;
  width: min(600px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: clamp(30px, 5vw, 38px) clamp(22px, 5vw, 36px) clamp(28px, 5vw, 34px);
  overflow: auto; overscroll-behavior: contain;
  border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 90px rgba(17,20,20,.22);
}
.edlg::backdrop { background: rgba(17,20,20,.42); backdrop-filter: blur(3px); }
.edlg[open] { animation: rise .45s var(--ease) both; }
.edlg > * { position: relative; z-index: 1; }

.edlg::before,
.edlg::after {
  content: ''; position: absolute; z-index: 0;
  pointer-events: none;
}

/* The element stays at the edge of the page: atmosphere, never wallpaper. */
.edlg[data-el="aarde"]::before {
  inset: auto 0 0; height: 92px;
  background:
    repeating-linear-gradient(176deg,
      transparent 0 12px,
      color-mix(in srgb, var(--dlg-accent) 16%, transparent) 13px 14px);
  opacity: .72;
  mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
  animation: earth-settle 6s var(--slow) infinite alternate;
}
.edlg[data-el="aarde"]::after {
  left: -36px; bottom: -48px; width: 154px; height: 112px; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--dlg-soft) 18%, transparent), transparent 68%);
}

.edlg[data-el="water"]::before,
.edlg[data-el="water"]::after {
  border-radius: 50%;
  background: repeating-radial-gradient(circle,
    transparent 0 18px,
    color-mix(in srgb, var(--dlg-soft) 20%, transparent) 19px 20px,
    transparent 21px 30px);
}
.edlg[data-el="water"]::before {
  right: -72px; bottom: -84px; width: 230px; height: 230px;
  animation: water-flow 8s var(--slow) infinite;
}
.edlg[data-el="water"]::after {
  left: -54px; top: -70px; width: 150px; height: 150px; opacity: .5;
  animation: water-flow 10s var(--slow) -3s infinite reverse;
}

.edlg[data-el="lucht"]::before {
  inset: 8% -72px auto auto; width: 210px; height: 150px;
  background:
    radial-gradient(ellipse at 0 100%, transparent 54%, color-mix(in srgb, var(--dlg-soft) 22%, transparent) 55% 55.8%, transparent 57%),
    radial-gradient(ellipse at 16% 92%, transparent 66%, color-mix(in srgb, var(--dlg-accent) 14%, transparent) 67% 67.7%, transparent 69%);
  animation: air-lift 7s var(--slow) infinite alternate;
}
.edlg[data-el="lucht"]::after {
  left: -52px; bottom: 12%; width: 166px; height: 90px;
  border-radius: 50%;
  border-top: 1px solid color-mix(in srgb, var(--dlg-soft) 22%, transparent);
  transform: rotate(-9deg);
  animation: air-lift 8s var(--slow) -2s infinite alternate-reverse;
}

.edlg[data-el="vuur"]::before {
  right: -54px; bottom: -74px; width: 190px; height: 210px;
  background:
    radial-gradient(ellipse at 50% 100%,
      color-mix(in srgb, var(--dlg-soft) 18%, transparent),
      transparent 68%);
  filter: blur(3px);
  transform-origin: 50% 100%;
  animation: fire-flicker 2.8s ease-in-out infinite alternate;
}
.edlg[data-el="vuur"]::after {
  right: 18px; bottom: 26px; width: 104px; height: 138px;
  background:
    radial-gradient(circle at 22% 82%, color-mix(in srgb, var(--dlg-accent) 34%, transparent) 0 1px, transparent 2px),
    radial-gradient(circle at 68% 64%, color-mix(in srgb, var(--dlg-soft) 38%, transparent) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 44% 28%, color-mix(in srgb, var(--dlg-accent) 24%, transparent) 0 1px, transparent 2px);
  animation: fire-rise 3.6s ease-out infinite;
}

@keyframes earth-settle {
  from { transform: translateY(-4px); opacity: .42 }
  to { transform: translateY(3px); opacity: .72 }
}
@keyframes water-flow {
  0%, 100% { transform: scale(.92); opacity: .34 }
  50% { transform: scale(1.06); opacity: .58 }
}
@keyframes air-lift {
  from { transform: translate3d(0, 8px, 0); opacity: .34 }
  to { transform: translate3d(-8px, -8px, 0); opacity: .58 }
}
@keyframes fire-flicker {
  from { transform: scale(.94, .9) rotate(-1deg); opacity: .48 }
  to { transform: scale(1.04, 1.06) rotate(1deg); opacity: .7 }
}
@keyframes fire-rise {
  from { transform: translateY(12px) scale(.92); opacity: 0 }
  32% { opacity: .6 }
  to { transform: translateY(-20px) scale(1.04); opacity: 0 }
}

.edlg-close {
  position: absolute; z-index: 2; top: 18px; right: 18px;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--hair); background: none; color: var(--ink-faint);
  font-size: .8rem; transition: all .3s;
}
.edlg-close:hover,
.edlg-close:focus-visible { border-color: var(--ink); color: var(--ink); }

.edlg-head { display: flex; align-items: center; gap: 16px; }
.edlg-head svg { width: 34px; height: 34px; color: var(--c); flex: none; overflow: visible; }
.edlg-head h2 { font-family: var(--display); font-weight: 600; font-size: 1.7rem; letter-spacing: -.03em; }
.edlg-head > div > p { color: var(--c); font-size: .9rem; }

.edlg p { margin-top: 14px; font-size: .95rem; color: var(--ink-soft); }
.edlg-copy { margin-top: 24px; }
.edlg-traits { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; list-style: none; }
.edlg-traits li {
  padding: 5px 13px; border-radius: 999px; border: 1px solid var(--hair);
  font-family: var(--display); font-size: .74rem; color: var(--ink-soft);
}
.edlg-sound {
  margin-top: 22px; padding: 9px 14px; border: 1px solid var(--hair);
  border-radius: 999px; background: rgba(255,255,255,.7); color: var(--ink);
  cursor: pointer;
  font: 500 .68rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.edlg-sound::before { content: '♪'; margin-right: 7px; color: var(--dlg-accent); }
.edlg-sound:hover,
.edlg-sound:focus-visible,
.edlg-sound[aria-pressed="true"] {
  border-color: var(--dlg-accent);
  background: color-mix(in srgb, var(--dlg-soft) 16%, white);
}
.edlg-sound:focus-visible { outline: 2px solid var(--dlg-accent); outline-offset: 3px; }

/* ── Quiz ────────────────────────────────────────────────────────────── */

.q-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--hair-soft); z-index: 21; }
.q-progress span {
  display: block; height: 100%; width: calc(var(--p, 0) * 100%);
  background: var(--el); transition: width .5s var(--ease);
}

.q-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--hair);
  font-family: var(--display); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
}
.q-phase { color: var(--el); transition: color .6s var(--ease); }
.q-count { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.q-mount { padding: clamp(30px, 6vh, 60px) 0; }
.q-in { animation: qin .55s var(--ease) both; }
@keyframes qin { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

.q-text {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  line-height: 1.18; letter-spacing: -.03em;
  max-width: 20ch;
}
.q-lead {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.35rem); letter-spacing: -.02em; color: var(--ink-soft);
}

.q-hint {
  margin-top: 22px; font-family: var(--display); font-size: .72rem;
  color: var(--ink-soft); letter-spacing: .04em;
}
kbd {
  display: inline-block; padding: 1px 6px; margin: 0 1px;
  border: 1px solid var(--hair); border-radius: 5px;
  font-family: var(--display); font-size: .68rem;
}

.q-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid var(--hair); }
.nav-right { display: flex; align-items: center; gap: 18px; }

/* The meter: five rising bars. Reads as "how much of this is you", which is
   what the scale actually asks — not five unrelated boxes. */
.meter {
  --qc: var(--gold);
  display: flex; align-items: flex-end; gap: 12px; margin-top: 44px; max-width: 460px;
}

.meter-step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 0; background: none; cursor: pointer; padding: 0;
}
.meter-bar {
  display: block; width: 100%; height: var(--h);
  border: 1px solid var(--hair); border-radius: 8px;
  background: rgba(255,255,255,.5);
  transition: background .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.meter-num {
  font-family: var(--display); font-size: .8rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; transition: color .3s;
}
.meter-step:hover .meter-bar { border-color: var(--qc); background: color-mix(in srgb, var(--qc) 12%, transparent); transform: translateY(-2px); }
.meter-step.is-lit .meter-bar { border-color: var(--qc); background: color-mix(in srgb, var(--qc) 26%, transparent); }
.meter-step.is-on .meter-bar { background: var(--qc); border-color: var(--qc); box-shadow: 0 6px 18px color-mix(in srgb, var(--qc) 34%, transparent); }
.meter-step.is-on .meter-num { color: var(--ink); font-weight: 500; }

.meter-legend {
  display: flex; justify-content: space-between; margin-top: 14px; max-width: 460px;
  font-family: var(--display); font-size: .72rem; color: var(--ink-soft);
}

/* The fork: two ways out of the same pressure. */
.fork { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 14px; margin-top: 36px; }

.fork-side {
  --c: var(--gold);
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  padding: 26px 24px; border: 1px solid var(--hair); border-radius: 8px;
  background: rgba(255,255,255,.66); color: var(--ink); font-family: var(--text);
  transition: border-color .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.fork-side::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--c), transparent 72%);
  opacity: 0; transition: opacity .45s var(--ease);
}
.fork-side > * { position: relative; }
.fork-side:hover,
.fork-side:focus-visible { border-color: var(--c); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(17,20,20,.08); }
.fork-side:hover::before,
.fork-side:focus-visible::before { opacity: .1; }
.fork-side.is-on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.fork-side.is-on::before { opacity: .16; }

.fork-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--hair);
  font-family: var(--display); font-size: .72rem; color: var(--ink-faint);
  transition: all .35s var(--ease);
}
.fork-side:hover .fork-key,
.fork-side:focus-visible .fork-key,
.fork-side.is-on .fork-key { background: var(--c); border-color: var(--c); color: var(--ink); }

.fork-text {
  display: block; margin-top: 16px;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1rem, 1.7vw, 1.16rem); line-height: 1.38; letter-spacing: -.015em;
}

.fork-or {
  align-self: center;
  font-family: var(--display); font-size: .72rem; color: var(--ink-faint);
  letter-spacing: .1em; text-transform: uppercase;
}

/* ── Element ranking ─────────────────────────────────────────────────── */

.rank-choices {
  width: 100%;
  margin-top: 30px;
  display: grid;
  gap: 10px;
}

.rank-choice {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--hair);
  border-radius: 7px;
  background: rgba(255,255,255,.78);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: var(--display);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.rank-choice:hover,
.rank-choice:focus-visible { border-color: var(--gold); transform: translateY(-1px); }
.rank-choice.is-picked {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, white);
}
.rank-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hair-soft);
  color: var(--ink-faint);
  font-size: .76rem;
}
.rank-choice.is-picked .rank-number { background: var(--gold); color: var(--ink); }
.rank-name { font-weight: 600; text-transform: capitalize; }
.rank-position { color: var(--ink-faint); font: 500 .66rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.rank-actions {
  width: 100%;
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.reflection-gate {
  min-height: 1.4em;
  margin-top: 12px;
  color: var(--ink-soft);
  font: 400 .78rem/1.45 var(--display);
}

/* ── Synthesis ───────────────────────────────────────────────────────── */

.synth { display: grid; place-items: center; gap: 40px; }

.synth-mark {
  --synth-progress: 0%;
  position: relative;
  width: clamp(112px, 18vw, 148px);
  aspect-ratio: 684.01 / 525;
}

.synth-mark::before,
.synth-mark span {
  position: absolute;
  inset: 0;
  -webkit-mask: url('../assets/icon.svg') center / contain no-repeat;
  mask: url('../assets/icon.svg') center / contain no-repeat;
}

.synth-mark::before {
  content: '';
  background: rgba(17, 20, 20, .09);
}

.synth-mark span {
  background:
    linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .34) 50%, transparent 62%),
    linear-gradient(
      to top,
      #B08655 0%,
      #B08655 20%,
      #5C9EA6 38%,
      #8FB6AA 64%,
      #E0693F 86%,
      #E0693F 100%
  );
  background-position: 140% 0, 0 0;
  background-size: 220% 100%, 100% 100%;
  -webkit-clip-path: inset(calc(100% - var(--synth-progress)) 0 0);
  clip-path: inset(calc(100% - var(--synth-progress)) 0 0);
  transition: clip-path var(--synth-duration, .68s) linear;
  animation: synth-shimmer 4.2s var(--slow) infinite alternate;
  filter: drop-shadow(0 8px 18px rgba(92, 158, 166, .14));
}

@keyframes synth-shimmer {
  from { background-position: 140% 0, 0 0; }
  to { background-position: -80% 0, 0 0; }
}

.synth-line {
  font-family: var(--display); font-size: clamp(1rem, 2vw, 1.22rem);
  letter-spacing: -.02em; color: var(--ink-soft); text-align: center; max-width: 30ch;
}
.synth-in { animation: qin .6s var(--ease) both; }

/* ── Result ──────────────────────────────────────────────────────────── */

.res-head { text-align: center; display: grid; justify-items: center; }
.res-head .display { max-width: none; }
.res-mark { width: 46px; height: 46px; color: var(--el); margin-bottom: 24px; }
/* The water icon's path touches the viewBox edge exactly; its stroke then
   overflows by half its width. Browsers clip <svg> overflow by default, so
   without this the stroke's tip gets cut off — most visible at print size. */
.res-mark svg { width: 100%; height: 100%; overflow: visible; }
.res-tag { margin-top: 10px; color: var(--el); font-family: var(--display); font-size: 1rem; letter-spacing: -.01em; }
.res-lead { margin-top: 22px; max-width: 52ch; color: var(--ink-soft); font-size: 1.04rem; }

.field-wrap { margin: 8px auto 0; max-width: 620px; }
#fieldCanvas { display: block; width: 100%; aspect-ratio: 1; }

.field-guide {
  margin-top: 22px; padding: 24px;
  border: 1px solid var(--hair); border-radius: 8px;
  background: rgba(255,255,255,.74); backdrop-filter: blur(10px);
}
.field-guide h3 {
  font: 600 1rem/1.2 var(--display);
  letter-spacing: -.02em; color: var(--ink);
}
.field-guide-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 26px;
  margin-top: 18px;
}
.field-guide-item {
  display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
  color: var(--ink-soft); font-size: .78rem; line-height: 1.5;
}
.field-guide-item > i { margin: 6px auto 0; flex: none; }
.field-guide-item strong {
  display: block; margin-bottom: 3px;
  font: 500 .76rem/1.35 var(--display); color: var(--ink);
}
.key-shape {
  position: relative; display: block; width: 22px; height: 22px;
  background: rgba(224,105,63,.16);
  border: 1px solid rgba(224,105,63,.56);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.key-shape b {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink);
}
.key-shape b:nth-child(1) { left: 9px; top: 0; background: #5C9EA6; }
.key-shape b:nth-child(2) { right: 0; top: 9px; background: #B64027; }
.key-shape b:nth-child(3) { left: 9px; bottom: 0; background: #7B5938; }
.key-shape b:nth-child(4) { left: 0; top: 9px; background: #39727A; }
.key-dot {
  display: block; width: 11px; height: 11px; border-radius: 50%;
  background: var(--el); box-shadow: 0 0 0 2px var(--gold);
}
.key-ring {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  border: 1.6px solid var(--ink); background: #fff;
}
.key-line { display: block; width: 22px; height: 0; border-top: 1.6px dashed var(--ink-faint); }

.score-guide {
  margin-top: 56px;
  text-align: center;
}
.score-guide h3 {
  font: 600 1rem/1.2 var(--display);
  letter-spacing: -.02em;
}
.score-guide > p {
  max-width: 64ch;
  margin: 10px auto 0;
  color: var(--ink-soft);
  font-size: .8rem;
  line-height: 1.6;
}
.score-key {
  margin-top: 18px; display: flex; justify-content: center; gap: 22px;
  list-style: none; color: var(--ink-faint);
  font: 500 .7rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
}
.score-key li { display: inline-flex; align-items: center; gap: 8px; }
.score-key-fill {
  display: block; width: 28px; height: 6px; border-radius: 999px;
  background: var(--el);
}
.score-key-mark {
  display: block; width: 2px; height: 16px; border-radius: 2px;
  background: var(--ink); opacity: .55;
}

.bars { margin-top: 22px; display: grid; gap: 14px; }

.bar-row {
  display: grid; grid-template-columns: 76px 1fr 72px;
  align-items: center; gap: 16px;
}
.bar-name { font-family: var(--display); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.bar-track { position: relative; height: 6px; border-radius: 999px; background: var(--hair-soft); }
.bar-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 999px;
  background: var(--c); animation: grow 1.1s var(--ease) both .3s;
}
@keyframes grow { from { width: 0 } }
.bar-mark {
  position: absolute; top: -5px; width: 2px; height: 16px; border-radius: 2px;
  background: var(--ink); opacity: .55; transform: translateX(-1px);
}
.bar-val {
  display: inline-flex; justify-content: flex-end; align-items: center; gap: 5px;
  font-family: var(--display); font-size: .76rem; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right;
}
.bar-val i { color: var(--ink-soft); font-style: normal; }

/* Chapters */
#chapters { margin-top: 72px; }

.chapter {
  display: grid; grid-template-columns: 150px 1fr; gap: 28px;
  padding: 40px 0; border-top: 1px solid var(--hair);
  --c: var(--el);
}
.chapter-side { position: sticky; top: 92px; align-self: start; }
.chapter-num {
  display: block; font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  letter-spacing: -.03em; color: var(--c);
}
.chapter-eyebrow {
  display: block; margin-top: 6px;
  font-family: var(--display); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
}
.chapter-body h3 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.2; letter-spacing: -.028em;
  margin-bottom: 18px;
}
.chapter-body p { color: var(--ink-soft); max-width: 62ch; }
.chapter-body p + p { margin-top: 14px; }

.niek-grid {
  margin-top: 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.niek-grid > div {
  padding: 18px 20px;
  border: 1px solid var(--hair); border-radius: 6px;
  background: rgba(255,255,255,.68);
}
.niek-grid span {
  font: 500 .68rem/1.4 var(--display);
  letter-spacing: .1em; text-transform: uppercase; color: var(--c);
}
.niek-grid p { margin-top: 8px; font-size: .92rem; }
.chapter-body .niek-note {
  margin-top: 18px; padding-left: 16px;
  border-left: 2px solid var(--gold);
  font-size: .78rem; color: var(--ink-faint);
}

.rels { margin-top: 26px; display: grid; gap: 12px; }
.rel { padding: 20px 22px; border-radius: 6px; background: color-mix(in srgb, var(--c) 6%, transparent); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.rel-name {
  font-family: var(--display); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--c);
}
.rel p { margin-top: 8px; font-size: .94rem; }

.own {
  margin-top: 16px; padding-left: 20px; border-left: 2px solid var(--gold);
  font-family: var(--display); font-weight: 400; font-size: 1.06rem;
  line-height: 1.5; letter-spacing: -.015em;
}
.own span {
  display: block; margin-bottom: 8px;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500;
}

.practice { padding: 34px 0; border-top: 1px solid var(--hair); }
.practice h3 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: -.025em; }
.practice-sub { margin-top: 6px; font-size: .9rem; color: var(--ink-faint); }
.practice ol { margin-top: 22px; list-style: none; counter-reset: p; display: grid; gap: 12px; }
.practice li {
  counter-increment: p; position: relative; padding-left: 42px;
  color: var(--ink-soft); max-width: 62ch;
}
.practice li::before {
  content: counter(p, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  font-family: var(--display); font-size: .74rem; color: var(--el); letter-spacing: .04em;
}
.practice-x li::before { color: var(--ink-faint); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.shown, .shown { opacity: 1; transform: none; }

.res-actions { margin-top: 56px; display: flex; gap: 12px; flex-wrap: wrap; }
.res-note { margin: 14px 0 0; font-size: .86rem; color: var(--muted); }
.field-note { display: block; margin-top: 8px; font-size: .78rem; line-height: 1.5; color: var(--muted); }

.demo-closing {
  margin-top: 72px; padding: clamp(38px, 6vw, 72px) clamp(24px, 7vw, 88px);
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--hair));
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,.72), color-mix(in srgb, var(--gold) 9%, white));
  text-align: center;
}
.demo-closing h3 {
  margin-top: 14px; font-family: var(--display); font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1; letter-spacing: -.055em; text-wrap: balance;
}
.demo-closing > p:not(.eyebrow) {
  max-width: 58ch; margin: 24px auto 0; color: var(--ink-soft); line-height: 1.75;
}
.demo-closing .btn { margin: 30px auto 0; }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .topbar {
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: 14px;
  }
  .screen {
    padding-top: calc(88px + env(safe-area-inset-top));
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .meta-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    text-align: center;
  }
  .meta-row span + span { padding-left: 0; }
  .meta-row span + span::before { display: none; }
  .topbar-actions { gap: 8px; }
  .locale-toggle { min-height: 34px; padding: 6px 9px; }
  .rail-node em { display: none; }
  .rail-node + .rail-node { margin-left: 10px; }
  .fork { grid-template-columns: 1fr; }
  .fork-or { justify-self: center; padding: 2px 0; }
  .chapter { grid-template-columns: 1fr; gap: 14px; }
  .chapter-side { position: static; display: flex; align-items: baseline; gap: 12px; }
  .chapter-num { font-size: 1.1rem; }
  .chapter-eyebrow { margin-top: 0; }
  .niek-grid { grid-template-columns: 1fr; }
  .ecards { grid-template-columns: 1fr; }
  .meter { gap: 6px; }
  .meter-bar { border-radius: 6px; }
  .bar-row { grid-template-columns: 58px 1fr 66px; gap: 9px; }
  .field-guide { padding: 20px 18px; }
  .field-guide-grid { grid-template-columns: 1fr; gap: 16px; }
  .res-actions .btn { flex: 1 1 100%; justify-content: center; }
}

@media (max-width: 560px) {
  .intro-actions { align-items: stretch; }
  .intro-actions .btn { width: 100%; justify-content: center; }
  .demo-closing .btn { width: 100%; justify-content: center; }
}

/* No keyboard to hint at on a touch device. */
@media (pointer: coarse) { .q-hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .screen { transform: none; }
  .edlg::before, .edlg::after { animation: none !important; }
  .synth-mark span { animation: none !important; }
}

/* ── Print: the report only ──────────────────────────────────────────── */

.print-brand { display: none; }

@media print {
  @page { size: A4; margin: 30mm 16mm 18mm; }

  .backdrop, #stage, .cursor, .topbar, .res-actions, .res-note, .cta-row, .q-progress,
  .demo-closing, dialog, #resume, #restart { display: none !important; }

  /* position: fixed repeats on every printed page in Chrome/Safari — the
     closest thing to a letterhead without CSS Paged Media running elements.
     The logo already carries the wordmark, so it prints alone. A hairline
     under it — spanning the full text width, not just the logo — reads as
     a deliberate masthead rather than a stray icon in the corner. */
  .print-brand {
    display: flex !important; align-items: flex-end;
    position: fixed; top: 10mm; left: 16mm; right: 16mm; z-index: 10;
    padding-bottom: 6mm; border-bottom: 1px solid #ddd6c8;
  }
  .print-brand img { height: 24px; width: auto; display: block; }

  .screen { position: static; opacity: 1; visibility: visible; transform: none; display: block; padding: 0; overflow: visible; }
  .screen:not(.screen-result) { display: none !important; }
  .reveal, .chapter { opacity: 1 !important; transform: none !important; }

  html, body {
    background: #fff !important;
    color: #1d1a17 !important;
    font-size: 10.5pt;
    /* Bars and element accents carry meaning here, so keep them printing. */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* This card (rounded corners, drop shadow, blurred translucent paper tone)
     is a screen affordance for sitting on top of the video backdrop. Printed
     on white paper it just reads as a floating box with a visible seam at
     every edge — including wherever a page break happens to cut it. Print
     drops the box chrome entirely and lets the report flow as a plain page. */
  .screen-result .wrap {
    /* A little air above the first element (the icon) keeps it from reading
       as flush-clipped against the page's top margin. */
    max-width: none; margin: 0; padding: 6mm 0 0;
    border: none; border-radius: 0; box-shadow: none; backdrop-filter: none;
    background: none;
  }

  /* Chrome's print-to-PDF pipeline mis-renders the "fi"/"fl" ligature glyph
     in this font as a stray "@" (e.g. "profiel" → "pro@el"). Disabling
     ligatures for print sidesteps the bug — ff/fi/fl print as plain letters. */
  * {
    font-variant-ligatures: none !important;
    -webkit-font-feature-settings: "liga" 0, "clig" 0 !important;
    font-feature-settings: "liga" 0, "clig" 0 !important;
  }

  /* The two-column chapter grid (a 150px number rail beside the prose) only
     makes sense on the page where a chapter starts. On a page break the
     empty rail re-opens as a blank left gutter on every continuation page,
     which is the "spacing is off" look. Print flattens it to a single
     running column with the number and eyebrow inline above the heading. */
  .chapter {
    display: block; padding: 22pt 0; border-top: 1px solid #ddd6c8; margin-bottom: 0;
  }
  .chapter-side {
    position: static; display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 8pt;
  }
  .chapter-num { font-size: 13pt; }
  .chapter-eyebrow { margin-top: 0; }
  .chapter-body { max-width: none; }
  .chapter-body p { max-width: none; }

  /* A chapter that splits across a page break loses its heading; an orphaned
     line loses nothing. So pin the headings and let long prose flow. */
  .chapter h2, .chapter h3, .chapter-side { break-after: avoid; page-break-after: avoid; }
  .bar-row, blockquote.own, .rel, .practice, .niek-grid > div {
    break-inside: avoid; page-break-inside: avoid;
  }
  p, li { orphans: 3; widows: 3; }

  /* The canvas renders blank in most print pipelines — the numeric bars below
     already say the same thing, so drop it rather than print an empty box. */
  #fieldCanvas, .field-wrap { display: none !important; }

  a[href]::after { content: ''; }
}
