/* ROOTKey cinematic site: scene stories for inner pages (same model as the homepage's one pinned story).
   Load after rk.css; pair with assets/rk-scenes.js (chapter index + highlighted rows that follow a morph cycle).

   Markup
   - <section class="rk-story rk-ev" data-per="90"> > .rk-story__pin > .rk-step scenes (+ .rk-story__bar)
     .rk-step                 centred scene: the sculpture is lifted (data-lift), the copy sits underneath
     .rk-step.rk-step--split  text on the start side, sculpture on the end side (data-side)
     .rk-step--wide           wider text column (lists, stats)
     data-index="Label"       starts a chapter in the left index
     .rk-ev__text > .rk-step__num + h1/h2 + .rk-lead.rk-step__body + .rk-row.rk-ev__cta
   - <section class="rk-section rk-files">  the shared "any file" section on pages without a scene story
   - <section class="rk-section rk-evid">   the shared exhibit section (what changed, then restored) */

.rk-ev .rk-story__pin { padding: 0; }
.rk-ev .rk-story__counter { display: none; }
.rk-ev .rk-step { top: calc(var(--header-h) + 20px); bottom: 64px; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.rk-ev .rk-step--split { justify-content: center; text-align: start; padding-inline-start: 190px; }
.rk-ev__text { width: 100%; max-width: 860px; margin: 0 auto; }
.rk-ev .rk-step--split .rk-ev__text { margin: 0; max-width: min(520px, 42%); }
.rk-ev .rk-step--wide .rk-ev__text { max-width: min(780px, 58%); }
.rk-ev .rk-step__num { justify-content: center; margin-bottom: 16px; }
.rk-ev .rk-step--split .rk-step__num { justify-content: flex-start; }
.rk-ev .rk-h2 { font-size: clamp(30px, 3.2vw, 54px); }
.rk-ev__h1 { font-size: clamp(40px, 4.6vw, 80px); }
.rk-ev .rk-lead { max-width: 640px; margin: 18px auto 0; }
.rk-ev .rk-step--split .rk-lead { margin: 18px 0 0; }
.rk-ev__cta { justify-content: center; margin-top: 28px; }
.rk-ev .rk-step--split .rk-ev__cta { justify-content: flex-start; }
.rk-ev__crumb { justify-content: center; margin-bottom: 18px; }
.rk-ev .rk-step--split .rk-ev__crumb { justify-content: flex-start; }
.rk-ev__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.rk-ev .rk-step--split .rk-ev__chips { justify-content: flex-start; }
.rk-ev__more { margin-top: 18px; }
.rk-ev__more a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
/* HUD chips: l = start side, r = end side (rk-chrome mirrors them on RTL pages) */
.rk-ev__hud-l1 { left: 6%; top: 10%; }
.rk-ev__hud-l2 { left: 4%; top: 26%; --d: .9s; }
.rk-ev__hud-r1 { right: 6%; top: 10%; --d: .75s; }
.rk-ev__hud-r2 { right: 4%; top: 26%; --d: 1s; }
.rk-ev__hud-r3 { right: 6%; top: 42%; --d: 1.15s; }

/* option rows: the highlighted row follows the stage's morph cycle (rk:cycle) */
.rk-ev-opts { list-style: none; max-width: 470px; margin-top: 26px; border-top: 1px solid var(--line); text-align: start; }
.rk-ev-opts li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
[data-cycle-list] li { opacity: .5; transition: opacity .5s var(--ease); }
[data-cycle-list] li.is-on { opacity: 1; }
/* no row matches the current shape (the closed symbol of the layers cycle, or reduced motion): show every row */
[data-cycle-list]:not(:has(li.is-on)) li { opacity: 1; }
.rk-ev-opts b { font-weight: 400; font-size: 18px; color: var(--fg); }
.rk-ev-opts span { grid-column: 1 / -1; font-size: 14px; font-weight: 300; color: var(--ink-2); }
.rk-ev-opts .rk-mono { font-size: 11px; color: var(--ink-3); }
.rk-ev-opts i { font: 500 10px/1.8 var(--mono); font-style: normal; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); }
.rk-ev-opts i.is-red { color: var(--tag-red); }
.rk-ev-opts i.is-green { color: var(--tag-green); }
.rk-ev-run { display: grid; gap: 6px; margin-top: 18px; font: 400 12px/1.5 var(--mono); color: var(--ink-3); }

/* linked rows (regulations, sectors, related pages) */
.rk-ev-links { border-top: 1px solid var(--line); margin-top: 26px; text-align: start; }
.rk-ev-links a { display: grid; grid-template-columns: minmax(70px, auto) 1fr auto; gap: 20px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); transition: padding .4s var(--ease); }
.rk-ev-links a:hover { padding-inline-start: 10px; }
.rk-ev-links strong { font-weight: 400; font-size: 18px; color: var(--fg); }
.rk-ev-links span { color: var(--ink-2); font-weight: 300; }
.rk-ev-links i { font-style: normal; color: var(--ink-3); }

/* figures (results, reliability) */
.rk-ev-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 26px; text-align: start; }
.rk-ev-stats--3 { grid-template-columns: repeat(3, 1fr); }
.rk-ev-stat { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(var(--panel-rgb), .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rk-ev-stat .rk-card__num { font-size: 10px; }
.rk-ev-stat b { font-size: 26px; font-weight: 300; line-height: 1.15; color: var(--fg); }
.rk-ev-stat p { font-size: 13px; line-height: 1.5; color: var(--ink-2); font-weight: 300; }
.rk-ev__quote { margin-top: 22px; font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; font-weight: 300; color: var(--fg); }
.rk-ev__quote cite { display: block; margin-top: 10px; font: 500 11px/1.5 var(--mono); font-style: normal; letter-spacing: 1px; color: var(--ink-3); }

/* short notice above a hero title (e.g. a regulation deadline) */
.rk-ev__alert { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; align-items: center; margin-bottom: 16px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.rk-ev__alert a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
/* customer cases: challenge, then result */
.rk-ev-case dl { display: grid; gap: 10px; }
.rk-ev-case dt { font: 500 10px/1.6 var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); }
.rk-ev-case dd { font-size: 14px; line-height: 1.5; font-weight: 300; color: var(--ink-2); }
.rk-ev-case dd.is-result { color: var(--fg); }
.rk-ev-case dd.is-result::before { content: '✓ '; color: var(--tag-green); font-family: var(--mono); }
.rk-ev-stats--2 { grid-template-columns: repeat(2, 1fr); }

/* chapter index (left edge, as on the homepage) */
.rk-ev-index { position: fixed; inset-inline-start: var(--shell); top: 50%; transform: translateY(-50%); z-index: 30; display: grid; gap: 12px; opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
.rk-ev-index.is-on { opacity: 1; pointer-events: auto; }
.rk-ev-index a { display: flex; align-items: center; gap: 10px; font: 500 10px/1 var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-3); transition: color .3s; }
.rk-ev-index a::before { content: ''; width: 6px; height: 6px; border: 1px solid currentColor; transition: background-color .3s, border-color .3s; }
.rk-ev-index a:hover, .rk-ev-index a.is-on { color: var(--fg); }
.rk-ev-index a.is-on::before { background: var(--rk-red); border-color: var(--rk-red); }
.rk-ev-index a:focus-visible { outline: 2px solid var(--rk-red); outline-offset: 4px; }

/* shared sections on pages without a scene story */
.rk-files .rk-ev-opts, .rk-evid .rk-ev-opts { max-width: 520px; }
.rk-evid__facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin-top: 22px; max-width: 520px; font-size: 14px; }
.rk-evid__facts dt { font: 500 10px/1.9 var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); }
.rk-evid__facts dd { color: var(--fg); font-weight: 300; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .rk-ev .rk-step--split { padding-inline-start: 0; }
  .rk-ev-index { display: none; }
  .rk-ev-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 801px) and (max-height: 780px) {
  /* short desktop screens (1280 x 720): tighter option rows so a scene with a list still fits */
  .rk-ev .rk-ev-opts { margin-top: 16px; }
  .rk-ev-opts li { padding: 8px 0; }
}
@media (max-width: 800px) {
  /* scenes flow as ordinary sections on phones (rk.css): no offsets, nothing hidden to make a scene fit */
  .rk-ev .rk-step, .rk-ev .rk-step--split { position: relative; top: auto; bottom: auto; justify-content: flex-start; text-align: center; }
  .rk-ev .rk-step--split .rk-ev__text, .rk-ev .rk-step--wide .rk-ev__text { max-width: none; margin: 0 auto; }
  .rk-ev .rk-step--split .rk-step__num, .rk-ev .rk-step--split .rk-ev__cta,
  .rk-ev .rk-step--split .rk-ev__crumb, .rk-ev .rk-step--split .rk-ev__chips { justify-content: center; }
  .rk-ev .rk-step--split .rk-lead { margin: 14px auto 0; }
  .rk-ev .rk-lead { font-size: 15px; }
  .rk-ev__h1 { font-size: 36px; }
  .rk-ev .rk-h2 { font-size: 28px; }
  .rk-ev .rk-ev-opts, .rk-ev .rk-ev-links, .rk-ev .rk-ev-stats { margin-top: 18px; }
  .rk-ev-opts li { padding: 10px 0; }
  .rk-ev-opts b { font-size: 16px; }
  /* title over description, the arrow centred beside both instead of left alone on a row of its own */
  .rk-ev-links a { grid-template-columns: 1fr auto; grid-template-areas: "t i" "d i"; align-items: center; padding: 11px 0; gap: 4px 12px; }
  .rk-ev-links strong { grid-area: t; }
  .rk-ev-links span { grid-area: d; }
  .rk-ev-links i { grid-area: i; }
  .rk-ev-links strong { font-size: 16px; }
  .rk-ev-stats { gap: 8px; }
  .rk-ev-stats--3 { grid-template-columns: repeat(3, 1fr); }
  .rk-ev-stats--3 .rk-ev-stat b { font-size: 17px; }
  .rk-ev-case dd { font-size: 13px; }
  .rk-ev-stat { padding: 12px; }
  .rk-ev-stat b { font-size: 20px; }
  .rk-ev__quote { font-size: 15px; margin-top: 14px; }
  .rk-ev__quote cite { margin-top: 6px; }
  .rk-evid__facts { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-cycle-list] li, .rk-ev-links a, .rk-ev-index, .rk-ev-index a { transition: none; }
}
