/*
 * Animaties voor de site en de promo-bibliotheek (#4311). Eén stylesheet voor
 * rapport.html, keten.html en teller.html. Alles binnen .stage schaalt met de
 * breedte (cqw), zodat dezelfde animatie in een iframe, schermvullend en als
 * promo-screenshot klopt. De stage houdt een vaste huisstijl, los van licht/donker.
 */
@font-face {
  font-family: "Animatie Outfit";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/studio/outfit-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Animatie Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/studio/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  --display: "Animatie Outfit", "Greycliff CF", Arial, system-ui, sans-serif;
  --mono: "Animatie Mono", ui-monospace, Menlo, Consolas, monospace;
  --ink: #0e2a24;
  --muted: #5b726b;
  --line: #cfe0d8;
  --board: #f2f7f4;
  --brand: #28cc8b;
  --brand-text: #12875a;
}
html, body { margin: 0; overflow: hidden; background: var(--board); }
body.donker, body.donker .stage { background: #0d231d; }

.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: inline-size; overflow: hidden;
  background: var(--board); color: var(--ink); font-family: var(--display); }
.stage.sq { aspect-ratio: 1 / 1; max-width: 100vh; margin: 0 auto; background: #0d231d; color: #eaf5f0; }
.stage > * { position: absolute; }
.stage svg text { font-family: var(--mono); font-weight: 500; }

.knop { position: fixed; right: 10px; bottom: 10px; z-index: 5; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(14, 42, 36, 0.72); color: #fff; font: 600 13px/1 var(--display); cursor: pointer; }
body.donker .knop { background: rgba(255, 255, 255, 0.2); }
.knop:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
html.promo .knop { display: none; }

.fx { opacity: 0; }
.fx.on { animation: var(--fx, fx-rise) 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 110ms); }
[data-fx="fade"] { --fx: fx-fade; }
[data-fx="pop"] { --fx: fx-pop; }
[data-fx="grow"] { --fx: fx-grow; }
[data-fx="unfold"] { --fx: fx-unfold; }
.stage svg .fx { transform-box: fill-box; transform-origin: 50% 0; }
.draw { fill: none; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.draw.on { animation: fx-draw 1s ease-in-out both; animation-delay: calc(var(--i, 0) * 160ms); }
@keyframes fx-rise { from { opacity: 0; transform: translateY(1.4cqw); } to { opacity: 1; transform: none; } }
@keyframes fx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-pop { 0% { opacity: 0; transform: scale(0.4); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fx-grow { from { opacity: 1; transform: scaleY(0); } to { opacity: 1; transform: scaleY(1); } }
@keyframes fx-unfold { from { opacity: 0; transform: perspective(60cqw) rotateX(-72deg); } to { opacity: 1; transform: perspective(60cqw) rotateX(0); } }
@keyframes fx-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fx-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-1cqw); } }
.stage.is-paused *, .stage.is-paused *::before { animation-play-state: paused !important; }
.stage.static * { animation-duration: 1ms !important; animation-delay: 0ms !important; }
.stage.static .caret { display: none; }

.s-brand { left: 3.5cqw; top: 3cqw; display: flex; align-items: center; gap: 1cqw; font-size: 1.7cqw; font-weight: 600; }
.mark { width: 2.7cqw; height: 2.7cqw; border-radius: 0.6cqw; background: var(--brand); color: #06281b; display: grid; place-items: center; font-weight: 700; font-size: 1.6cqw; }
.s-tag { right: 3.5cqw; top: 3.1cqw; font: 500 1.15cqw/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 0.1cqw solid #bfd3c9; padding: 0.5cqw 0.9cqw; border-radius: 99px; }

/* rapport */
.s1-q { left: 0; right: 0; top: 14.5cqw; text-align: center; font-size: 3.6cqw; font-weight: 600; letter-spacing: -0.02em; }
.s1-q.on.out { animation: fx-out 0.4s ease both; }
.s1-wrap { left: 50%; top: 22cqw; width: 62cqw; transform: translateX(-50%); }
.s1-wrap.up { animation: s1up 0.8s cubic-bezier(0.6, 0, 0.2, 1) both; }
@keyframes s1up { from { top: 22cqw; transform: translateX(-50%) scale(1); } to { top: 7.2cqw; transform: translateX(-50%) scale(0.8); } }
.s1-search { display: flex; align-items: center; gap: 1.2cqw; height: 6cqw; padding: 0 0.8cqw 0 1.8cqw; background: #fff; border: 0.15cqw solid var(--line); border-radius: 1.4cqw; box-shadow: 0 1cqw 3cqw rgba(14, 42, 36, 0.08); font-size: 2.1cqw; font-weight: 500; }
.s1-search svg { width: 2.2cqw; height: 2.2cqw; flex: none; }
.s1-addr { white-space: nowrap; }
.s1-addr:empty::before { content: "Adres of postcode"; color: #8aa29a; }
.caret { width: 0.2cqw; height: 2.6cqw; margin-left: -1cqw; background: var(--ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.s1-btn { margin-left: auto; background: var(--brand); color: #06281b; font-weight: 600; font-size: 1.7cqw; height: 4.4cqw; padding: 0 2cqw; border-radius: 1cqw; display: grid; place-items: center; }
.s1-btn.press { animation: press 0.35s ease both; }
@keyframes press { 50% { transform: scale(0.92); filter: brightness(0.9); } }
.s1-scene { left: 5cqw; top: 16.5cqw; width: 41cqw; }
.s1-scene text { font-size: 13px; }
.s1-scale { left: 53cqw; top: 16.3cqw; width: 41cqw; }
.s1-scale .lbl { font: 500 1.15cqw/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.9cqw; }
.bar { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4cqw; }
.bar span { height: 3.8cqw; background: var(--c); color: var(--t); display: grid; place-items: center; font-weight: 700; font-size: 1.8cqw; border-radius: 0.5cqw; }
.bar span.hit { animation: hit 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; position: relative; z-index: 1; }
@keyframes hit { from { transform: scale(1); } to { transform: scale(1.2); box-shadow: 0 0 0 0.35cqw var(--board), 0 0 0 0.7cqw var(--c); } }
.ptr { position: absolute; z-index: 2; top: -2.1cqw; left: 10%; width: 0; height: 0; transform: translateX(-50%); border-left: 0.9cqw solid transparent; border-right: 0.9cqw solid transparent; border-top: 1.1cqw solid var(--ink); }
.s1-klasse { margin-top: 1.3cqw; font-size: 1.45cqw; font-weight: 600; }
.s1-card { left: 53cqw; top: 27.6cqw; width: 41cqw; box-sizing: border-box; background: #fff; border: 0.12cqw solid var(--line); border-radius: 1.2cqw; padding: 1.7cqw 2.2cqw 1cqw; box-shadow: 0 1.4cqw 3.4cqw rgba(14, 42, 36, 0.1); transform-origin: 50% 0; }
.s1-card .hd { font-size: 1.9cqw; font-weight: 600; letter-spacing: -0.01em; }
.s1-card .ad { font: 500 1.2cqw/1.4 var(--mono); color: var(--muted); margin: 0.3cqw 0 0.8cqw; }
.s1-row { display: flex; justify-content: space-between; align-items: center; border-top: 0.1cqw solid #e1ebe6; padding: 0.85cqw 0; font-size: 1.5cqw; }
.s1-row span { color: var(--muted); }
.s1-row b { font-weight: 600; }
.badge { display: inline-grid; place-items: center; min-width: 3cqw; height: 2.4cqw; border-radius: 0.45cqw; background: #f59e0b; color: #0f172a; font-weight: 700; }
.s1-end { left: 0; right: 0; top: 50.8cqw; text-align: center; font-size: 2.3cqw; font-weight: 600; letter-spacing: -0.01em; }
.s1-end em { font-style: normal; color: var(--brand-text); }

/* keten */
.s2-head { left: 4cqw; top: 3.4cqw; }
.eyebrow { font: 500 1.2cqw/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-text); }
.s2-head h1 { margin: 0.7cqw 0 0; font-size: 3.4cqw; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.links { inset: 0; width: 100%; height: 100%; }
.links .draw { stroke: #a9c7ba; stroke-width: 3; stroke-linecap: round; }
.node { top: 15.5cqw; width: 26cqw; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.3cqw; }
.disc { width: 11cqw; height: 11cqw; border-radius: 50%; background: #fff; border: 0.25cqw solid var(--brand); display: grid; place-items: center; box-shadow: 0 1cqw 2.6cqw rgba(14, 42, 36, 0.09); }
.disc svg { width: 6.6cqw; height: 6.6cqw; overflow: visible; }
.disc svg .fx { transform-origin: 50% 50%; }
.cap .num { display: block; font: 500 1.2cqw/1.4 var(--mono); color: var(--brand-text); }
.cap b { display: block; font-size: 1.95cqw; font-weight: 600; line-height: 1.25; }
.cap .sub { display: block; font-size: 1.45cqw; color: var(--muted); }
.chips { left: 3cqw; right: 3cqw; top: 40.5cqw; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3cqw; }
.chip { background: #fff; border: 0.15cqw solid var(--line); border-radius: 1cqw; padding: 1.1cqw 1cqw; text-align: center; }
.chip b { display: block; font-size: 1.75cqw; font-weight: 600; line-height: 1.3; }
.chip span { display: block; font: 500 1.15cqw/1.5 var(--mono); color: var(--muted); white-space: nowrap; }
.s2-foot { left: 4cqw; top: 50.6cqw; font-size: 1.95cqw; font-weight: 500; }
.s2-foot em { font-style: normal; color: var(--brand-text); font-weight: 600; }

/* teller */
.s3-dots { inset: 0; width: 100%; height: 100%; }
.s3-brand { left: 7cqw; top: 7cqw; font: 500 2.3cqw/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #7fd9b3; }
.s3-num { left: 6cqw; top: 28cqw; font: 500 14cqw/1 var(--mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: #fff; }
.s3-label { left: 7cqw; top: 47cqw; width: 80cqw; font-size: 5cqw; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.s3-date { left: 7cqw; top: 63cqw; font: 500 2.4cqw/1 var(--mono); color: #9fbdb1; }
.s3-end { left: 7cqw; bottom: 14cqw; font-size: 5.4cqw; font-weight: 600; color: var(--brand); letter-spacing: -0.015em; }
.s3-sig { left: 7cqw; bottom: 6.5cqw; font-size: 2.6cqw; font-weight: 600; color: #cfe5db; display: flex; align-items: center; gap: 1.4cqw; }
.s3-sig .mark { width: 4cqw; height: 4cqw; font-size: 2.4cqw; border-radius: 0.9cqw; }
