/* ==========================================================================
   Vitamin Horgoš — motion.css  (Orbis Premium 2: one motion system)
   Reveal, hover/focus, state transitions. Owned by the motion agent;
   see _tools/premium2/AGENT_BRIEF.md.

   Rules: hover and keyboard focus (:focus-visible) always look the same; only transform, opacity and clip-path move
   things (colours, borders and shadows may fade); nothing bounces or overshoots; durations: 200 / 350 / 500ms, reveals 700ms.
   Reduced motion keeps colour changes and plain fades only – the static state is always complete.
   The scroll reveals live in css/animations.css; the API in js/motion.js.
   ========================================================================== */

:root {
  --ease-reveal: cubic-bezier(0.2, 0.7, 0.2, 1);  /* one easing for reveals, hovers and state changes */
  --reveal-rise: 24px;
  --reveal-dur: 700ms;
  --reveal-step: 90ms;
  --dur-card: 500ms;      /* card lift, gold border, image 1.03 */
  --dur-link: 350ms;      /* gold underline draws left → right */
  --dur-btn: 350ms;       /* buttons: colour, lift, arrow */
  --dur-state: 350ms;     /* open / close, swaps, drawers */
  --red-bright: #E2222A;  /* primary hover: one step brighter than --red, white text still 4.6:1 */
  --gold-bright: #DDBB6E;
  --link-draw: var(--gold-ink);
}
:is(.on-dark, .section--black, .section--dark, .section--burgundy, .hdr, .mnav, .ftr, .ppanel, .toast, .asst) { --link-draw: var(--gold); }
:is(.on-dark, .section--black, .section--dark, .section--burgundy) :is(.pcard, .rcard, .ncard, .bcard--cream, .modal__dialog, .cart__panel) { --link-draw: var(--gold-ink); }

/* ---------- Baseline: every interactive element fades its colours (audit: _tools/qa/motion-audit.mjs) ----------
   Zero specificity, so every component's own transition replaces it. */
:where(a, button, [role="button"], [role="tab"], [role="switch"], summary, input, select, textarea, label) {
  transition-property: color, background-color, border-color, text-decoration-color, outline-color, box-shadow;
  transition-duration: var(--dur-link);
  transition-timing-function: var(--ease-reveal);
}

/* ---------- Keyboard focus never lands on something still waiting to reveal: it shows at once ---------- */
.js [data-reveal]:not(.is-in):focus-within,
.route.is-rail .route__step:focus-within .route__step-body { opacity: 1; transform: none; transition: none; }

/* ---------- Cards: lift 3px, gold border, image 1.03 – hover and keyboard focus alike (500ms) ---------- */
:is(.pcard, .rcard, .ccard, .ecard, .ncard, .kres__card, .sz-item, .sz-other, .kq__opt) {
  transition: transform var(--dur-card) var(--ease-reveal), border-color var(--dur-card) var(--ease-reveal),
    box-shadow var(--dur-card) var(--ease-reveal), background-color var(--dur-card) var(--ease-reveal);
}
:is(.pcard, .rcard, .ncard, .kres__card):is(:hover, :has(:focus-visible)),
:is(.ccard, .ecard, .sz-item, .sz-other, .kq__opt):is(:hover, :focus-visible, :has(:focus-visible)) {
  border-color: var(--gold);
  transform: translate3d(0, -3px, 0);
  box-shadow: var(--shadow-soft);
}
.section--cream .ecard:is(:hover, :focus-visible, :has(:focus-visible)),
.section--white .ecard:is(:hover, :focus-visible, :has(:focus-visible)) { border-color: var(--gold-ink); }
.pmq__plate { transition: transform var(--dur-card) var(--ease-reveal), border-color var(--dur-card) var(--ease-reveal); }
.pmq__card:is(:hover, :focus-visible) .pmq__plate { border-color: var(--gold-ink); transform: translate3d(0, -3px, 0); }
.mwall__media { transition: border-color var(--dur-card) var(--ease-reveal); }
.mwall__card:is(:hover, :has(:focus-visible)) .mwall__media { border-color: var(--gold-ink); }

/* card images: 1.03 (the `scale` property composes with each image's own transform / translate) */
:is(.pcard__plate img, .pcard__pack img, .rcard__media img, .ccard__media img, .ncard__media img, .pmq__plate img, .mwall__media img, .kres__card img, .sz-item img, .mcard img) {
  transition: opacity 500ms var(--ease-reveal), scale var(--dur-card) var(--ease-reveal), transform var(--dur-card) var(--ease-reveal);
}
:is(.pcard, .rcard, .ccard, .ncard, .kres__card, .sz-item):is(:hover, :has(:focus-visible)) :is(.pcard__plate img, .rcard__media img, .ccard__media img, .ncard__media img, .kres__card img, .sz-item img),
.ccard:focus-visible .ccard__media img,
.pmq__card:is(:hover, :focus-visible) .pmq__plate img { scale: 1.03; }
/* content photos (.is-framed: .mcard, .mwall__media, .tada__frame, photo recipe / news cards) scale 1.04 – see „Photo frames“ below */

/* ---------- Links: a gold underline draws left → right (350ms) ----------
   Running-text links keep their resting underline (it fades as the gold line draws over it). */
:is(main, .ftr, .mnav, .modal, .cart, .toast, .asst) :is(p, li, dd, td, figcaption, .lead, .eyebrow, .field__hint, .form__status) a:not([class]),
.crumbs a, .link-more, .ftr__links a, .ftr__linkbtn, .ftr__contact a, .ftr__legal a, .mnav__sub a, .mnav__minor, .goldlist a, .dirlist a, .home-wtb__val,
.home-assort__links a, .pcards__more a, .cmp-catlink, .cmp-links a, .cmp-name, .ing-foot__names a, .pcard__title a, .rcard__title a,
.kres__name a, .cart__name, .rprod__title a, .bcard__lines a, .toast__link, .success a, .msg a, .results-note__clear, .sz-now {
  background-image: linear-gradient(var(--link-draw), var(--link-draw));
  background-repeat: no-repeat;
  background-position: 0 calc(100% - var(--link-y, 0px));
  background-size: 0% 2px;
  transition: background-size var(--dur-link) var(--ease-reveal), color var(--dur-link) var(--ease-reveal),
    text-decoration-color var(--dur-link) var(--ease-reveal);
}
:is(main, .ftr, .mnav, .modal, .cart, .toast, .asst) :is(p, li, dd, td, figcaption, .lead, .eyebrow, .field__hint, .form__status) a:not([class]):is(:hover, :focus-visible),
:is(.crumbs a, .link-more, .ftr__links a, .ftr__linkbtn, .ftr__contact a, .ftr__legal a, .mnav__sub a, .mnav__minor, .goldlist a, .dirlist a, .home-wtb__val,
.home-assort__links a, .pcards__more a, .cmp-catlink, .cmp-links a, .cmp-name, .ing-foot__names a, .pcard__title a, .rcard__title a,
.kres__name a, .cart__name, .rprod__title a, .bcard__lines a, .toast__link, .success a, .msg a, .results-note__clear, .sz-now):is(:hover, :focus-visible) {
  background-size: 100% 2px;
  text-decoration-color: transparent;
}
/* titles that used to underline on hover now draw instead */
:is(.pcard__title a, .rcard__title a, .kres__name a, .cart__name, .rprod__title a, .cmp-name):hover { text-decoration: none; }
/* flex links: the line sits under the text, not at the bottom of the 40–48px tap area */
.crumbs a, .ftr__links a, .ftr__linkbtn { --link-y: 9px; }
.link-more, .dirlist a, .mnav__minor, .mnav__sub a { --link-y: 12px; }
.link-more { text-decoration-color: transparent; }
.mnav__sub a, .mnav__minor { --link-draw: var(--gold); }
/* header nav: same draw, now also on keyboard focus */
.hdr__link { transition: background-size var(--dur-link) var(--ease-reveal), color var(--dur-link) var(--ease-reveal); }
.hdr__link:is(:hover, :focus-visible) { background-size: 100% 1px; }
.link-more .icon { transition: transform var(--dur-link) var(--ease-reveal); }
.link-more:is(:hover, :focus-visible) .icon { transform: translate3d(3px, 0, 0); }

/* ---------- Buttons (§2): filled brighten + lift 2px + soft shadow; outlined fill with cream, burgundy text;
   both show a → that slides in from the left (350ms). The arrow sits in the right padding (js/motion.js tags
   [data-arrow="add"] only where the padding has room), so the label never moves and never overflows. ---------- */
.btn {
  position: relative;
  transition: background-color var(--dur-btn) var(--ease-reveal), border-color var(--dur-btn) var(--ease-reveal),
    color var(--dur-btn) var(--ease-reveal), box-shadow var(--dur-btn) var(--ease-reveal), transform var(--dur-btn) var(--ease-reveal);
}
.btn[data-arrow="add"]::after {
  content: "\2192";
  content: "\2192" / "";
  position: absolute;
  top: 50%;
  right: max(4px, calc(var(--btn-px, 32px) / 2 - 0.5em));
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0;
  opacity: 0;
  transform: translate3d(-10px, -50%, 0);
  transition: opacity var(--dur-btn) var(--ease-reveal), transform var(--dur-btn) var(--ease-reveal);
  pointer-events: none;
}
.btn[data-arrow="add"]:is(:hover, :focus-visible):not([disabled], [aria-disabled="true"])::after { opacity: 1; transform: translate3d(0, -50%, 0); }
/* filled */
.btn.btn:is(.btn--primary, .btn--red):is(:hover, :focus-visible):not([disabled], [aria-disabled="true"]) {
  background: var(--red-bright); border-color: var(--red-bright); color: #fff;
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 2px 4px rgba(21, 17, 15, 0.12), 0 14px 28px -14px rgba(215, 25, 32, 0.6);
}
.btn.btn.btn--gold:is(:hover, :focus-visible):not([disabled], [aria-disabled="true"]) {
  background: var(--gold-bright); border-color: var(--gold-bright); color: var(--ink);
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 2px 4px rgba(21, 17, 15, 0.12), 0 14px 28px -14px rgba(101, 74, 18, 0.55);
}
.btn.btn:is(.btn--cream, .btn--light):is(:hover, :focus-visible):not([disabled], [aria-disabled="true"]) {
  background: #FFFCF6; border-color: #FFFCF6; color: var(--ground-burgundy);
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 2px 4px rgba(21, 17, 15, 0.16), 0 14px 28px -14px rgba(0, 0, 0, 0.55);
}
/* outlined */
.btn.btn:is(.btn--outline, .btn--glass, .btn--ghost-light, .btn--line, .btn--ghost):is(:hover, :focus-visible):not([disabled], [aria-disabled="true"]) {
  background: var(--cream); border-color: var(--cream); color: var(--ground-burgundy);
}
/* on light grounds the cream would vanish into the page: a deeper cream plate with a burgundy edge */
:is(.section--cream, .section--white, .section--light, .on-light, .pcard, .rcard, .modal__dialog, .cart__panel, .form-panel, .acct, .cmp, .kq) .btn.btn:is(.btn--line, .btn--ghost):is(:hover, :focus-visible):not([disabled], [aria-disabled="true"]) {
  background: var(--plate); border-color: var(--ground-burgundy); color: var(--ground-burgundy);
}
.btn.btn:active:not([disabled], [aria-disabled="true"]) { transform: translate3d(0, 0, 0); box-shadow: none; }

/* ---------- Chips, toggles, segmented controls, small buttons ---------- */
:is(button.chip, a.chip) { transition: border-color var(--dur-link) var(--ease-reveal), background-color var(--dur-link) var(--ease-reveal), color var(--dur-link) var(--ease-reveal); }
:is(button.chip, a.chip):focus-visible { border-color: var(--gold-ink); }
:is(.pmq__btn, .rail__btn, .modal__close, .cart__close, .tgl, .trust__pause, .mcard__play):focus-visible { border-color: var(--ink); }
.seg > button:focus-visible { color: var(--gold-ink); }
.sub-toggle .icon, .mnav__toggle .icon { transition: transform var(--dur-btn) var(--ease-reveal); }

/* ---------- Form fields: a gold focus ring that grows from the bottom line ---------- */
@keyframes field-ring {
  0% { box-shadow: inset 0 -1px 0 0 var(--ring-c, var(--gold-ink)), 0 0 0 0 rgba(201, 162, 77, 0); }
  45% { box-shadow: inset 0 -2px 0 0 var(--ring-c, var(--gold-ink)), 0 3px 0 0 rgba(201, 162, 77, 0.45); }
  100% { box-shadow: inset 0 -2px 0 0 var(--ring-c, var(--gold-ink)), 0 0 0 3px rgba(201, 162, 77, 0.45); }
}
:is(.input, .fl__input, .select, .textarea) { transition: border-color var(--dur-link) var(--ease-reveal), box-shadow var(--dur-link) var(--ease-reveal), background-color var(--dur-link) var(--ease-reveal); }
:is(.input, .fl__input, .select, .textarea):focus {
  border-color: var(--gold-ink);
  box-shadow: inset 0 -2px 0 0 var(--ring-c, var(--gold-ink)), 0 0 0 3px rgba(201, 162, 77, 0.45);
  animation: field-ring 350ms var(--ease-reveal) both;
}
:is(.on-dark, .section--black, .section--burgundy, .ftr) :is(.input, .fl__input, .select, .textarea) { --ring-c: var(--gold); }
.field.is-invalid :is(.input, .fl__input):focus { --ring-c: #A3141A; }

/* ---------- Product marquee: slows to 30 % on hover, pauses on focus (main.js) ---------- */

/* ---------- Mobile menu: a 350ms curtain slide, items step in 50ms apart; closing plays it back ---------- */
.mnav {
  opacity: 1;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 350ms var(--ease-reveal), visibility 0s linear 350ms;
}
.mnav.is-open { opacity: 1; clip-path: inset(0 0 0 0); transition: clip-path 350ms var(--ease-reveal), visibility 0s linear 0s; }
.mnav :is(.mnav__list > li, .mnav__more > li, .mnav__foot) {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 200ms var(--ease-reveal), transform 200ms var(--ease-reveal);
}
.mnav.is-open :is(.mnav__list > li, .mnav__more > li, .mnav__foot) {
  opacity: 1;
  transform: none;
  transition: opacity 350ms var(--ease-reveal), transform 350ms var(--ease-reveal);
  transition-delay: calc(140ms + var(--mi, 0) * 50ms);
}
.mnav__list > li:nth-child(2) { --mi: 1; } .mnav__list > li:nth-child(3) { --mi: 2; } .mnav__list > li:nth-child(4) { --mi: 3; }
.mnav__list > li:nth-child(5) { --mi: 4; } .mnav__list > li:nth-child(6) { --mi: 5; } .mnav__list > li:nth-child(n+7) { --mi: 6; }
.mnav__more > li { --mi: 7; } .mnav__foot { --mi: 8; }
.mnav__sub:not([hidden]) { animation: mo-enter var(--dur-state) var(--ease-reveal) backwards; }
.burger .icon, .burger__label { animation: mo-fade 200ms var(--ease-reveal) backwards; }

/* ---------- State changes: whatever appears fades up (CSS animations run whenever an element starts rendering,
   so a block shown by removing [hidden] or re-rendered by a page script never just pops in) ---------- */
@keyframes mo-enter { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@keyframes mo-fade { from { opacity: 0; } to { opacity: 1; } }
:is([role="tabpanel"], .order__body, [data-company], .field__error, .form__status, .results-note, .empty, .success, .cmp-banner,
    .acct__hello, .steps-bar, .ppanel .ppanel__grid, .kres, .pol-empty, .cmp-empty, .cart__empty, .order-box__note, .qv):not([hidden]) {
  animation: mo-enter var(--dur-state) var(--ease-reveal) backwards;
}
.form-panel > form, .form-panel > .success, .cart__list > li:not(.is-kept), .cart__foot-total > *, .cmp-table tbody tr { animation: mo-fade var(--dur-state) var(--ease-reveal) backwards; }
.mo-ghost { animation: none !important; }
/* the cart badge and counts change with a fade, never a jump */
[data-cart-count], [data-fav-count], [data-compare-count], .seg__n, .kq__count b { animation: mo-fade 350ms var(--ease-reveal) backwards; }

/* drawers and dialogs: a little longer and calmer than the old 250ms */
.modal__backdrop { transition: opacity var(--dur-state) var(--ease-reveal); }
.modal__dialog { transition: clip-path var(--dur-state) var(--ease-reveal), transform var(--dur-state) var(--ease-reveal); }
.modal { transition: visibility 0s linear var(--dur-state); }
.modal.is-open { transition-delay: 0s; }
.cart__backdrop { transition: opacity 350ms var(--ease-reveal); }
.cart__panel { transition: transform 500ms var(--ease-reveal); }
.cart { transition: visibility 0s linear 500ms; }
.cart.is-open { transition-delay: 0s; }
.toast { transition: opacity var(--dur-state) var(--ease-reveal), transform var(--dur-state) var(--ease-reveal); }

/* ---------- Reduced motion: colour changes and plain fades only, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  :is(.pcard, .rcard, .ccard, .ecard, .ncard, .kres__card, .sz-item, .sz-other, .kq__opt, .pmq__plate, .btn),
  :is(.pcard, .rcard, .ccard, .ecard, .ncard, .kres__card, .sz-item, .sz-other, .kq__opt, .btn):is(:hover, :focus-visible, :has(:focus-visible)),
  .pmq__card:is(:hover, :focus-visible) .pmq__plate, .btn.btn:is(:hover, :focus-visible, :active) { transform: none !important; }
  .btn[data-arrow]::after { display: none; }
  :is(.pcard__plate img, .pcard__pack img, .rcard__media img, .ccard__media img, .ncard__media img, .pmq__plate img, .mwall__media img, .kres__card img, .sz-item img, .mcard img) { scale: none !important; }
  .mnav { clip-path: none; opacity: 0; transition: opacity 200ms linear, visibility 0s linear 200ms; }
  .mnav.is-open { opacity: 1; transition: opacity 200ms linear, visibility 0s; }
  .mnav :is(.mnav__list > li, .mnav__more > li, .mnav__foot), .mnav.is-open :is(.mnav__list > li, .mnav__more > li, .mnav__foot) { opacity: 1; transform: none; transition: none; }
  :is(.input, .fl__input, .select, .textarea):focus { animation: none; }
  @keyframes mo-enter { from { opacity: 0; } to { opacity: 1; } }
  .link-more:is(:hover, :focus-visible) .icon { transform: none; }
}

/* kompas: its panel height morph sits on the 350ms state-change step */
.kq.is-sizing { transition: height 350ms var(--ease-reveal); }
@media (prefers-reduced-motion: reduce) { .kq.is-sizing { transition: none; } }

/* ==========================================================================
   Premium 3 (motion agent): photo frames, blur-up previews, section index, gold sheen, header progress.
   ========================================================================== */

/* ---------- Photo frames: every content photo (main.js marks it .is-framed and adds .mframe) gets one frame style –
   a 1px gold inner frame inset 10px (opacity .35 → .8), the photo scales 1.04 inside the fixed frame and the caption
   line draws on; hover and keyboard focus (focus-within) alike, 500ms. Captions are always visible; only decoration moves. */
.is-framed { isolation: isolate; overflow: hidden; }
.mframe {
  position: absolute;
  inset: 10px;
  z-index: 1;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  opacity: 0.35;
  pointer-events: none;
  transition: opacity var(--dur-card) var(--ease-reveal);
}
.is-framed :is(img, video) { transition: opacity 500ms var(--ease-reveal), scale var(--dur-card) var(--ease-reveal), transform var(--dur-card) var(--ease-reveal); }
.is-framed.is-framed:is(:hover, :focus-within) > .mframe,
:is(.mwall__card, .tada, .rcard, .ncard, .msplit__media, .split__media):is(:hover, :focus-within) .is-framed > .mframe { opacity: 0.8; }
.is-framed.is-framed:is(:hover, :focus-within) :is(img, video),
:is(.mwall__card, .tada, .rcard, .ncard):is(:hover, :focus-within) .is-framed :is(img, video) { scale: 1.04; }
/* caption lines: the overlay caption gets a gold underline, the wall caption rule doubles, the tada caption line turns gold */
.mcard__cap::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-card) var(--ease-reveal);
  pointer-events: none;
}
.mcard:is(:hover, :focus-within) .mcard__cap::after { transform: scaleX(1); }
.mwall__card .mwall__rule { transform-origin: 0 50%; }
.mwall__item.is-done .mwall__rule { transition: transform var(--dur-card) var(--ease-reveal); }
.mwall__card:is(:hover, :focus-within) .mwall__rule { transform: scaleX(2); }
.tada__cap { position: relative; }
.tada__cap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: var(--gold-ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-card) var(--ease-reveal);
  pointer-events: none;
}
.tada:is(:hover, :focus-within) .tada__cap::before { transform: scaleX(1); }

/* ---------- Blur-up: a 20px preview of the same photo, blurred, behind it until it has loaded (js/motion.js) ---------- */
.lqip {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: center / cover no-repeat;
  filter: blur(12px);
  transform: scale(1.12); /* allow-scale: static, keeps the blurred edges out of the frame (not motion) */
  pointer-events: none;
  transition: opacity 500ms var(--ease-reveal);
}
.lqip.is-gone { opacity: 0; }
.is-framed img.lqip-wait { opacity: 0; }

/* ---------- Section index (home, o-nama, za-partnere; js/motion.js): 01–07 on a hairline in the right gutter ----------
   Shown from 1300px wide (and ≥ 560px tall, so it never meets the back-to-top button): each link is a 48 × 48px target,
   and only from 1300px is the container gutter ≥ 50px, so the column never covers content (hidden below 1200 as asked,
   and 1200–1299 too). Final polish §3.8: 12px gold numbers at 60 % opacity, the active one at 100 % with a 16px hairline. */
.sidx { display: none; }
@media (min-width: 1300px) and (min-height: 560px) {
  .sidx {
    --sidx-on: var(--gold);
    position: fixed;
    top: 50%;
    right: var(--safe-r, 0px);
    z-index: calc(var(--z-fab, 90) - 2);
    display: block;
    transform: translate3d(0, -50%, 0);
  }
  .sidx[data-tone="light"] { --sidx-on: var(--gold-ink); }
  .sidx__list { position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
  .sidx__list::before { content: ""; position: absolute; top: 14px; bottom: 14px; right: 1px; width: 1px; background: var(--sidx-on); opacity: 0.4; transition: background-color var(--dur-btn) var(--ease-reveal); }
  .sidx__link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    padding-right: 22px;
    color: var(--sidx-on);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums lining-nums;
    text-decoration: none;
    transition: color var(--dur-btn) var(--ease-reveal);
  }
  .sidx__no { display: inline-block; opacity: 0.6; transition: opacity var(--dur-btn) var(--ease-reveal); }
  .sidx__link::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 16px;
    height: 1px;
    background: var(--sidx-on);
    transform: scaleX(0);
    transform-origin: 100% 50%;
    transition: transform var(--dur-btn) var(--ease-reveal), background-color var(--dur-btn) var(--ease-reveal);
  }
  .sidx__link[aria-current="true"], .sidx__link:is(:hover, :focus-visible) { color: var(--sidx-on); }
  .sidx__link[aria-current="true"] .sidx__no, .sidx__link:is(:hover, :focus-visible) .sidx__no { opacity: 1; } /* the active number: full gold */
  .sidx__link[aria-current="true"]::after { transform: scaleX(1); }
  .sidx__link:focus-visible { outline: 3px solid var(--gold); outline-offset: -1px; box-shadow: 0 0 0 4px var(--ground-black); }
  /* the section name slides in beside the number on hover / focus (the headings on the page always show it too) */
  .sidx__label {
    position: absolute;
    top: 50%;
    right: calc(100% + 8px);
    padding: 7px 12px;
    border: 1px solid rgba(212, 175, 94, 0.5);
    border-radius: var(--radius, 6px);
    background: var(--ground-black);
    color: var(--on-dark);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transform: translate3d(8px, -50%, 0);
    transition: opacity var(--dur-btn) var(--ease-reveal), transform var(--dur-btn) var(--ease-reveal);
    pointer-events: none;
  }
  .sidx__link:is(:hover, :focus-visible) .sidx__label { opacity: 1; transform: translate3d(0, -50%, 0); }
  html:is(.modal-open, .drawer-open) .sidx { visibility: hidden; }
}
/* while the index glides to a section, every section is laid out for real (no content-visibility estimates) */
.sidx-jump main > section { content-visibility: visible !important; }
@media print { .sidx, .hdr__progress { display: none !important; } }

/* ---------- Gold sheen: a light-gold copy of a big number sweeps across it once (js/motion.js) ----------
   The window (.sheen-g) moves left → right while its text moves right → left by the same amount, so the copy stays on
   the glyphs; a soft mask makes it a narrow band. Transform only; the number's own colour never changes. */
:where(.sheen-host) { position: relative; overflow: clip; overflow-clip-margin: 0.15em; } /* the moving window never widens the page */
.sheen-g {
  --sheen-hi: #B8913F;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  color: var(--sheen-hi);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 50%, transparent 70%);
  mask-image: linear-gradient(100deg, transparent 30%, #000 50%, transparent 70%);
  animation: sheen-win 800ms var(--ease-in-out, cubic-bezier(0.65, 0, 0.35, 1)) both; /* a sweep reads as one even glide: in-out */
}
.sheen-g > span { display: block; animation: sheen-txt 800ms var(--ease-in-out, cubic-bezier(0.65, 0, 0.35, 1)) both; }
.sheen-g > span::before { content: attr(data-t); }
/* the glint colour is set per number by motion.js (contrasting with the number’s own colour) */
@keyframes sheen-win { from { transform: translate3d(-100%, 0, 0); } to { transform: translate3d(100%, 0, 0); } }
@keyframes sheen-txt { from { transform: translate3d(100%, 0, 0); } to { transform: translate3d(-100%, 0, 0); } }

/* ---------- Header: a 1px gold line at the bottom shows how far the page is read (scaleX, js/motion.js) ---------- */
.hdr__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 2;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
.hdr.menu-open .hdr__progress { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .is-framed :is(img, video), .is-framed.is-framed:is(:hover, :focus-within) :is(img, video),
  :is(.mwall__card, .tada, .rcard, .ncard):is(:hover, :focus-within) .is-framed :is(img, video) { scale: none !important; }
  .mcard__cap::after, .tada__cap::before, .mwall__item.is-done .mwall__rule, .sidx__no, .sidx__link::after, .sidx__label { transition: none; }
  .mwall__card:is(:hover, :focus-within) .mwall__rule, .sidx__link[aria-current="true"] .sidx__no { transform: none; }
  .sheen-g { display: none; }
}
