/* DeclaratieKompas story v3 — native scroll, tactile dossier */
.hero-proof {
  display: inline-flex;
  width: fit-content;
  margin: 1.15rem 0 .65rem;
  padding: .58rem .86rem;
  border: 1px solid rgba(223, 150, 98, .52);
  border-radius: 999px;
  background: rgba(18, 16, 14, .5);
  color: #f3c49f;
  font-size: clamp(.78rem, 1vw, .92rem);
  font-weight: 750;
  letter-spacing: .035em;
  backdrop-filter: blur(12px);
}

.hero-proof + .hero-mechanism { margin-top: 0; }

.story-v3 {
  --story-p: 0;
  --copper: #b85d37;
  --copper-light: #e9a26d;
  --paper: #eee7dc;
  --ink: #161512;
  position: relative;
  padding: 0;
  overflow: clip;
  background:
    radial-gradient(circle at 73% 42%, rgba(196, 94, 50, .18), transparent 31%),
    linear-gradient(145deg, #0b0b0a 8%, #17130f 55%, #0d0c0a 100%);
}

.story-track { height: 220vh; min-height: 1040px; }

.story-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 650px;
  overflow: clip;
  display: grid;
  align-items: center;
}

.story-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 8, 7, .92) 0 31%, rgba(8, 8, 7, .18) 62%, rgba(8, 8, 7, .45)),
    radial-gradient(ellipse at 68% 110%, rgba(224, 120, 65, .25), transparent 45%);
}

.story-ambient::before {
  content: "";
  position: absolute;
  width: min(52vw, 740px);
  aspect-ratio: 1;
  right: -10%;
  bottom: -47%;
  border-radius: 50%;
  border: 1px solid rgba(227, 157, 108, .14);
  box-shadow: 0 0 0 70px rgba(180, 86, 47, .035), 0 0 0 140px rgba(180, 86, 47, .025);
}

.story-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(250px, .75fr) minmax(340px, 1.05fr) minmax(250px, .72fr);
  align-items: center;
  gap: clamp(1.5rem, 3vw, 4rem);
  min-width: 0;
}

.story-copy { max-width: 390px; color: #f5f1ea; }
.story-copy h2 {
  margin: .75rem 0 1.15rem;
  font-size: clamp(2.5rem, 4.5vw, 4.9rem);
  line-height: .96;
  letter-spacing: -.055em;
}
.story-copy h2 em { color: var(--copper-light); }
.story-copy > p:not(.eyebrow) { max-width: 33ch; color: rgba(244, 239, 231, .7); line-height: 1.65; }

.story-progress {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .3rem;
  max-width: 280px;
}

.story-progress button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: .65rem;
  padding: .45rem .8rem .45rem .45rem;
  border: 0;
  border-radius: 4px;
  color: rgba(245, 241, 234, .56);
  background: transparent;
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.story-progress button span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 32px;
  border: 1px solid rgba(245, 241, 234, .17);
  border-radius: 2px;
  color: rgba(245, 241, 234, .65);
  font-size: .7rem;
  letter-spacing: .08em;
}

.story-progress button[aria-current="step"] {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}
.story-progress button[aria-current="step"] span { border-color: var(--copper-light); color: var(--copper-light); }
.story-progress button:hover { color: #fff; }
.story-progress button:focus-visible { outline: 2px solid #f2ad78; outline-offset: 3px; }

.story-object {
  --dossier-y: 170px;
  --dossier-rotate: 4deg;
  --dossier-scale: .92;
  position: relative;
  justify-self: center;
  width: min(30vw, 405px);
  aspect-ratio: .77;
  transform: translate3d(0, var(--dossier-y), 0) rotate(var(--dossier-rotate)) scale(var(--dossier-scale));
  transform-origin: 50% 92%;
  filter: drop-shadow(0 38px 42px rgba(0, 0, 0, .44));
}

.is-story-active .story-object,
.is-story-active .story-step { will-change: transform, opacity; }

.dossier-shadow {
  position: absolute;
  z-index: 0;
  width: 94%;
  height: 15%;
  left: 5%;
  bottom: -5%;
  border-radius: 50%;
  background: rgba(0, 0, 0, .7);
  filter: blur(20px);
  transform: rotate(-3deg);
}

.dossier-sheet,
.story-dossier {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(48, 37, 28, .28);
}

.dossier-sheet-back {
  background: #3b2419;
  transform: translate(19px, 13px) rotate(5.2deg);
  box-shadow: inset -10px 0 18px rgba(0, 0, 0, .28);
}

.dossier-sheet-mid {
  background: #d7caba;
  transform: translate(10px, 5px) rotate(1.9deg);
  box-shadow: inset 0 0 28px rgba(58, 42, 28, .13);
}

.story-dossier {
  z-index: 3;
  padding: clamp(1.35rem, 2.8vw, 2.25rem);
  background:
    linear-gradient(90deg, rgba(73, 49, 32, .08) 1px, transparent 1px) 1.5rem 0 / 22px 100%,
    linear-gradient(175deg, #f5f0e7, #ded2c2);
  color: var(--ink);
  box-shadow: inset 7px 0 0 #a55231, inset 13px 0 0 rgba(153, 76, 45, .15), 0 2px 0 #fff;
}

.dossier-tab,
.demo-folder-tab {
  position: absolute;
  top: -28px;
  left: 7px;
  min-width: 42%;
  height: 29px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-radius: 4px 12px 0 0;
  background: #a55231;
  color: #fff4e9;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dossier-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 2.1rem;
  border-bottom: 2px solid rgba(39, 31, 24, .8);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.dossier-header b { color: #8a482e; }
.story-dossier > strong { display: block; margin-bottom: .8rem; font-size: clamp(.9rem, 1.3vw, 1.05rem); }
.dossier-rule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  padding: 1rem;
  border: 1px solid rgba(48, 37, 28, .2);
  background: rgba(255, 255, 255, .34);
  font-size: clamp(.75rem, 1vw, .9rem);
}
.dossier-rule b { grid-column: 1 / -1; color: #a64f30; font-size: clamp(1.3rem, 2.5vw, 2rem); }
.dossier-lines { display: grid; gap: .8rem; margin: 1.8rem 0; }
.dossier-lines i { display: block; height: 1px; background: rgba(49, 37, 28, .2); }
.dossier-lines i:nth-child(2) { width: 84%; }
.dossier-lines i:nth-child(3) { width: 62%; }
.story-dossier > p { position: absolute; left: clamp(1.35rem, 2.8vw, 2.25rem); bottom: 1.3rem; margin: 0; font-size: .68rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }

.dossier-seal {
  position: absolute;
  right: 9%;
  bottom: 8%;
  width: 82px;
  aspect-ratio: 1;
  border: 1px solid rgba(149, 74, 43, .54);
  border-radius: 50%;
  color: #9b4c30;
  transform: rotate(-9deg);
}
.dossier-seal::before,
.dossier-seal::after { content: ""; position: absolute; inset: 12%; border: 1px solid rgba(149, 74, 43, .32); border-radius: inherit; }
.dossier-seal::after { inset: 35%; background: #a55231; clip-path: polygon(50% 0, 66% 39%, 100% 50%, 61% 64%, 50% 100%, 37% 61%, 0 50%, 39% 37%); border: 0; }
.dossier-seal span { position: absolute; font-size: .5rem; font-weight: 850; }
.dossier-seal span:nth-child(1) { top: 3px; left: 50%; transform: translateX(-50%); }
.dossier-seal span:nth-child(2) { right: 5px; top: 50%; transform: translateY(-50%); }
.dossier-seal span:nth-child(3) { bottom: 3px; left: 50%; transform: translateX(-50%); }
.dossier-seal span:nth-child(4) { left: 5px; top: 50%; transform: translateY(-50%); }

.story-steps { position: relative; align-self: stretch; min-width: 0; }
.story-step {
  --reveal: 1;
  --reveal-y: 0px;
  position: absolute;
  width: min(100%, 300px);
  padding: 1.2rem 1.25rem 1.3rem;
  border: 1px solid rgba(244, 223, 207, .16);
  border-radius: 4px;
  background: rgba(26, 22, 18, .79);
  color: #f6f0e8;
  box-shadow: 0 24px 45px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
  opacity: var(--reveal);
  transform: translate3d(0, var(--reveal-y), 0) rotate(var(--card-rotate, 0deg));
}
.story-step-one { top: 9%; left: -11%; --card-rotate: -2deg; }
.story-step-two { top: 40%; right: -3%; --card-rotate: 1.5deg; }
.story-step-three { bottom: 6%; left: -5%; --card-rotate: -1deg; }
.story-step-icon { width: 42px; height: 42px; display: grid; place-items: center; float: right; margin-left: .75rem; border: 1px solid rgba(232, 157, 104, .45); color: #e99a65; }
.story-step-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.story-step > span { color: #d78958; font-size: .66rem; font-weight: 800; letter-spacing: .13em; }
.story-step h3 { margin: .55rem 0 .35rem; font-size: clamp(1rem, 1.4vw, 1.25rem); line-height: 1.15; }
.story-step p { margin: 0; color: rgba(246, 240, 232, .66); font-size: .84rem; line-height: 1.45; }

.story-curve {
  position: absolute;
  z-index: 1;
  left: -4%;
  right: -4%;
  bottom: -1px;
  height: clamp(34px, 6vw, 82px);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: #d7a36f;
}

.why-v3 {
  position: relative;
  min-height: 1120px;
  padding: clamp(7rem, 11vw, 10rem) 0;
  overflow: clip;
  background: linear-gradient(135deg, #dfa86e 0%, #c07a4b 48%, #985232 100%);
  color: #211711;
}
.why-shape {
  position: absolute;
  width: min(55vw, 760px);
  aspect-ratio: 1;
  left: -21%;
  bottom: -35%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 0 0 90px rgba(255,255,255,.03), 0 0 0 180px rgba(59,27,13,.035);
}
.why-layout { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(430px, 1fr); gap: clamp(4rem, 9vw, 10rem); align-items: start; }
.why-copy { position: sticky; top: 120px; max-width: 480px; }
.why-copy h2 { margin: .8rem 0 1.3rem; font-size: clamp(3rem, 5.6vw, 6.5rem); line-height: .88; letter-spacing: -.065em; }
.why-copy h2 em { color: #f7e7d5; }
.why-copy > p:last-child { max-width: 36ch; font-weight: 550; line-height: 1.65; }
.why-cards { display: grid; gap: 24px; }
.why-card {
  position: relative;
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: space-between;
  gap: 2rem;
  padding: clamp(1.7rem, 3vw, 2.7rem);
  border-radius: 5px;
  box-shadow: 0 28px 70px rgba(60, 25, 8, .18);
}
.why-card::before { content: ""; position: absolute; inset: 12px -7px -7px 12px; z-index: -1; border: 1px solid rgba(47, 28, 17, .18); background: rgba(107, 55, 29, .17); }
.why-number { align-self: start; font-size: clamp(5rem, 8vw, 7rem); font-weight: 800; line-height: .76; letter-spacing: -.085em; }
.why-number sup { margin-right: .05em; font-size: .36em; vertical-align: .9em; }
.why-card h3 { margin: 0 0 .65rem; font-size: clamp(1.25rem, 2vw, 1.8rem); line-height: 1; }
.why-card p { margin: 0; max-width: 34ch; line-height: 1.5; font-size: .92rem; }
.why-card a { display: inline-flex; min-height: 44px; align-items: center; margin-top: .85rem; color: inherit; font-weight: 750; text-underline-offset: 4px; }
.why-card a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.why-card-paper { background: linear-gradient(150deg, #f2eadf, #d9cbbb); }
.why-card-paper::after { content: ""; position: absolute; inset: 0 auto 0 18px; width: 2px; background: rgba(169, 76, 40, .45); box-shadow: 6px 0 rgba(169, 76, 40, .12); }
.why-card-copper { margin-left: 6%; background: linear-gradient(145deg, #bb603b, #8b4028); color: #fff5eb; }
.why-card-dark { margin-left: 1.5%; background: linear-gradient(145deg, #24201c, #0e0d0c); color: #f6eee5; }
.why-card-dark p { color: rgba(246, 238, 229, .72); }

/* Turn the existing deterministic example into a physical working dossier. */
.example { position: relative; isolation: isolate; overflow: clip; }
.example .demo {
  position: relative;
  isolation: auto;
  overflow: visible;
  border-radius: 3px;
  border-color: rgba(65, 45, 31, .25);
  background:
    linear-gradient(90deg, rgba(164, 79, 46, .1) 1px, transparent 1px) 1.4rem 0 / 22px 100%,
    linear-gradient(165deg, #f8f3ea, #e6dacb);
  box-shadow: inset 8px 0 #ad5635, inset 14px 0 rgba(173, 86, 53, .12), 0 34px 75px rgba(36, 24, 17, .18);
}
.example .demo::before,
.example .demo::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(66, 45, 31, .2);
}
.example .demo::before { z-index: -1; inset: 7px -12px -10px 10px; background: #d6c7b7; transform: rotate(1.25deg); }
.example .demo::after { z-index: -2; inset: 15px -20px -17px 18px; background: #4a2c20; transform: rotate(2.3deg); box-shadow: 12px 18px 30px rgba(40, 24, 16, .2); }
.example .demo > :not(.sr-only):not(.demo-folder-tab) { position: relative; z-index: 2; }
.example .demo-folder-tab { position: absolute; top: -30px; left: 4px; width: 190px; min-width: 0; z-index: 1; }
.example .demo-head { border-bottom-color: rgba(62, 44, 31, .24); }
.example .issue-switch { border-radius: 2px; }
.example .line-card,
.example .source-columns article,
.example .result-card { border-radius: 2px; box-shadow: 0 9px 22px rgba(48, 31, 20, .07); }

@media (max-width: 1080px) {
  .story-shell { grid-template-columns: minmax(230px, .7fr) minmax(300px, .95fr) minmax(215px, .62fr); gap: 1.25rem; }
  .story-object { width: min(33vw, 360px); }
  .story-step { padding: 1rem; }
  .why-layout { gap: 4rem; }
}

@media (min-width: 981px) and (max-height: 780px) {
  .story-copy h2 { font-size: clamp(2.5rem, 3.4vw, 3.5rem); }
  .story-copy > p:not(.eyebrow) { font-size: .9rem; }
  .story-progress { margin-top: 1rem; }
  .story-object { width: min(28vw, 320px); }
  .story-steps { display: grid; align-self: center; gap: 14px; }
  .story-step { position: relative; inset: auto; width: 100%; padding: 1rem; }
  .story-step h3 { font-size: 1.08rem; }
}

@media (max-width: 980px) {
  .hero-proof { margin-top: .85rem; }
  .story-v3 { overflow: hidden; }
  .story-track { height: auto; min-height: 0; }
  .story-stage { position: relative; height: auto; min-height: 0; overflow: visible; padding: 6.5rem 0 6rem; }
  .story-ambient { background: radial-gradient(circle at 58% 34%, rgba(196, 94, 50, .2), transparent 33%), linear-gradient(#0b0b0a, #17120e 75%, #0d0c0a); }
  .story-shell { grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
  .story-copy { max-width: 100%; }
  .story-copy h2 { font-size: clamp(2.75rem, 13vw, 4.2rem); }
  .story-copy > p:not(.eyebrow) { max-width: 42ch; }
  .story-progress { max-width: 100%; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
  .story-progress button { grid-template-columns: 1fr; justify-items: center; padding: .5rem .25rem; text-align: center; font-size: .72rem; }
  .story-progress button span { height: 28px; }
  .story-object { width: min(82vw, 360px); justify-self: center; transform: none; }
  .story-steps { display: grid; gap: .75rem; }
  .story-step { position: relative; inset: auto; width: 100%; opacity: 1; transform: none; }
  .story-mobile-motion .story-object { transform: translateY(var(--dossier-y, 0px)); }
  .story-mobile-motion .story-step { opacity: var(--reveal, 1); transform: translateY(var(--reveal-y, 0px)); }
  .story-curve { height: 36px; }
  .why-v3 { min-height: 0; padding: 6rem 0; }
  .why-layout { grid-template-columns: 1fr; gap: 3.5rem; }
  .why-copy { position: relative; top: auto; }
  .why-copy h2 { font-size: clamp(3.2rem, 15vw, 5rem); }
  .why-card { min-height: 240px; grid-template-columns: 1fr; gap: 2rem; }
  .why-card-copper, .why-card-dark { margin-left: 0; }
  .why-number { font-size: clamp(5rem, 24vw, 7rem); }
  .example .demo::before { inset: 7px -5px -9px 5px; transform: rotate(.7deg); }
  .example .demo::after { inset: 13px -8px -14px 9px; transform: rotate(1.2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .story-track { height: auto; min-height: 0; }
  .story-stage { position: relative; height: auto; min-height: 0; overflow: visible; padding: 7rem 0; }
  .story-shell { align-items: center; }
  .story-object { --dossier-y: 0px !important; --dossier-rotate: 0deg !important; --dossier-scale: 1 !important; transform: none; }
  .story-step { --reveal: 1 !important; --reveal-y: 0px !important; opacity: 1; transform: rotate(var(--card-rotate, 0deg)); }
  .story-progress button { transition: none; }
}

[data-motion-reduced="true"] .story-track { height: auto; min-height: 0; }
[data-motion-reduced="true"] .story-stage { position: relative; height: auto; min-height: 0; overflow: visible; padding: 7rem 0; }
[data-motion-reduced="true"] .story-object { transform: none; }
[data-motion-reduced="true"] .story-step { opacity: 1; transform: rotate(var(--card-rotate, 0deg)); }

@media (prefers-contrast: more) {
  .story-step { background: #161310; border-color: #f0a36f; }
  .story-copy > p:not(.eyebrow), .story-step p { color: #fff; }
}
