/* Vision Pouya — GUIDE EXPERIENCE ("field manual" design layer).
   Loaded ONLY for items with "design": "guide". Everything is scoped under
   .guide-page / .guide-* so no other page changes. Mobile-first, RTL-aware
   (logical properties), transform/opacity motion only, reduced-motion safe.
   Art direction: a night-operations edition of Obsidian & Gold — cinematic
   full-bleed hero, editorial chapters with ghost numerals, a reading HUD
   (progress filament + chapter rail), and instrument-grade data components. */

/* ------------------------------------------------------------ reading HUD -- */
.guide-progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 150;
  background: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .12)); pointer-events: none;
}
.guide-progress i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright) 60%, var(--neon));
  transform: scaleX(0); transform-origin: left;
  box-shadow: 0 0 12px rgb(var(--gold-rgb) / calc(var(--glow-k) * .55));
}
[dir="rtl"] .guide-progress i { transform-origin: right;
  background: linear-gradient(-90deg, var(--gold), var(--gold-bright) 60%, var(--neon)); }

/* ------------------------------------------------------------------- hero -- */
.guide-page { padding-top: 0; }
.guide-hero {
  /* A permanently dark stage, in BOTH editions. The cover photo is graded down
     to brightness .6 and the veil is built for light type on top of it — flip
     the palette here and the day edition puts dark text on a dark image. The
     `stage-dark` class (set in the layout) re-declares the night palette on
     this element; these scalars finish the job, because they live on :root and
     would otherwise still carry the day edition's values. Only the veil's last
     gradient stop reads --page-bg, which stitches the hero into the page. */
  --ring-k: 1; --wash-k: 1; --glow-k: 1; --sh-k: 1; --sh-rgb: 0 0 0;
  position: relative; overflow: hidden;
  /* full-bleed breakout from the 760px prose column */
  width: 100vw; margin-inline-start: calc(50% - 50vw);
  min-height: min(88svh, 780px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--topbar-h) + 48px) var(--gutter) clamp(56px, 9vh, 96px);
  margin-bottom: clamp(28px, 6vw, 56px);
  isolation: isolate;
}
.guide-hero-media { position: absolute; inset: 0; z-index: -3; }
.guide-hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.82) contrast(1.06) brightness(.6);
  transform: scale(1.06);            /* parallax headroom (JS drifts it) */
  will-change: transform;
}
.guide-hero-veil {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 90% at 50% 108%, rgb(var(--bg-rgb) / .2) 30%, transparent 70%),
    linear-gradient(180deg, rgb(var(--bg-rgb) / .78) 0%, rgb(var(--bg-rgb) / .25) 34%,
      rgb(var(--bg-rgb) / .58) 68%, var(--page-bg) 99%);
}
/* slow-breathing gold aurora — pure decoration, killed for reduced motion */
.guide-hero-aurora {
  position: absolute; z-index: -1; inset-inline-start: -18%; bottom: -32%;
  width: 68%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 40deg,
    rgb(var(--gold-rgb) / calc(var(--wash-k) * .30)), rgb(var(--neon-rgb) / calc(var(--glow-k) * .10)), transparent 62%, rgb(var(--gold-rgb) / calc(var(--wash-k) * .22)));
  filter: blur(72px); opacity: .5;
  animation: guide-aurora 14s ease-in-out infinite alternate;
}
@keyframes guide-aurora {
  from { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  to   { transform: translate3d(6%, -7%, 0) rotate(38deg) scale(1.14); }
}
.guide-hero-inner { max-width: 880px; margin-inline: auto; width: 100%; text-align: center; }
.guide-kicker {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: .8rem; font-weight: 700; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-bright);
}
.guide-kicker::before, .guide-kicker::after {
  content: ""; height: 1px; width: clamp(28px, 8vw, 74px); flex: none;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.guide-kicker::after { background: linear-gradient(-90deg, transparent, var(--gold)); }
.guide-title {
  margin-top: 18px;
  font-size: clamp(2.3rem, 8.5vw, 4.4rem); font-weight: 800; line-height: 1.18;
  letter-spacing: -.015em;
  background: linear-gradient(100deg,
    var(--ink) 20%, var(--gold-bright) 42%, var(--ink) 60%, var(--ink) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: guide-sheen 7s var(--ease-out) infinite;
}
@keyframes guide-sheen {
  0%, 55%, 100% { background-position: 0% 0; }
  25% { background-position: 100% 0; }
}
.guide-excerpt {
  color: rgb(var(--ink-rgb) / .8); font-size: clamp(1.02rem, 2.6vw, 1.24rem);
  max-width: 40em; margin: 18px auto 0; text-wrap: balance;
}
.guide-chips { list-style: none; padding: 0; margin: 26px 0 0;
  display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.guide-chips li {
  padding: 8px 16px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  color: var(--ink); border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .38));
  background: rgb(var(--bg-elev-rgb) / .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.guide-meta { margin-top: 22px; color: rgb(var(--ink-dim-rgb) / .85); font-size: .84rem; }
.guide-cue {
  position: absolute; bottom: 14px; inset-inline-start: 50%;
  translate: -50% 0; width: 1px; height: 42px; overflow: hidden;
  background: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .2));
}
[dir="rtl"] .guide-cue { translate: 50% 0; }
/* The scroll cue sits at the hero's bottom edge, where the veil has already
   faded to the page background. On parchment that means night-gold at .2 alpha
   over near-white — invisible. It is pure decoration and the hero-to-page seam
   reads as its own boundary by day, so it simply steps out. */
:root[data-theme="light"] .guide-cue { display: none; }
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .guide-cue { display: none; }
}
.guide-cue span {
  position: absolute; top: -14px; inset-inline-start: -1.5px;
  width: 4px; height: 14px; border-radius: 2px; background: var(--gold-bright);
  animation: guide-cue 2.2s var(--ease-out) infinite;
}
@keyframes guide-cue { 0% { top: -14px; opacity: 0; } 30% { opacity: 1; }
  100% { top: 42px; opacity: 0; } }

/* --------------------------------------------------- chapter rail / TOC ---- */
/* One element, two presentations: in-flow contents card on phones,
   fixed side rail with dots from 1180px up. */
.guide-rail { margin: 0 0 30px; }
.guide-rail[hidden] { display: none; }
.guide-rail-head {
  font-size: .76rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-bright); margin-bottom: 10px;
}
.guide-rail a {
  display: flex; align-items: center; gap: 12px; padding: 9px 4px;
  text-decoration: none; color: var(--ink-dim); border-radius: 10px;
  transition: color .2s var(--ease-out);
}
.guide-rail a:hover { color: var(--ink); }
.guide-rail a[aria-current="true"] { color: var(--gold-bright); }
.guide-rail .gr-dot {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .35));
  transition: background-color .2s, box-shadow .2s, transform .2s var(--ease-out);
}
.guide-rail a[aria-current="true"] .gr-dot {
  background: var(--gold-bright); transform: scale(1.35);
  box-shadow: 0 0 10px rgb(var(--gold-rgb) / calc(var(--glow-k) * .7));
}
.guide-rail .gr-no { font-size: .74rem; font-weight: 700; color: var(--gold);
  min-width: 1.4em; text-align: center; }
.guide-rail .gr-t { font-size: .9rem; font-weight: 600; line-height: 1.35; }
/* a rail entry that lives on its own page — same shape, honest marker */
.guide-rail a.gr-out { margin-block-start: 6px; padding-block-start: 12px;
  border-block-start: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .18)); }
.guide-rail a.gr-out .gr-dot { background: transparent;
  box-shadow: inset 0 0 0 1.5px rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .55)); }
.guide-rail a.gr-out .gr-t::after { content: " ↗"; color: var(--gold); font-size: .8em; }
@media (max-width: 1179.98px) {
  .guide-rail {
    border: var(--ring); border-radius: var(--radius); background: var(--bg-elev);
    padding: 18px clamp(14px, 3.5vw, 22px);
  }
  .guide-rail a { border-inline-start: 2px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .18));
    border-radius: 0; padding-inline-start: 14px; margin-inline-start: 2px; }
  .guide-rail a[aria-current="true"] { border-inline-start-color: var(--gold); }
  .guide-rail .gr-dot { display: none; }
}
@media (min-width: 1180px) {
  .guide-rail {
    position: fixed; z-index: 90; top: 50%; inset-inline-end: 26px;
    transform: translateY(-50%); margin: 0; max-width: 210px;
  }
  .guide-rail-head { display: none; }
  .guide-rail a { padding: 7px 6px; }
  .guide-rail .gr-no { display: none; }
  .guide-rail .gr-t {
    font-size: .8rem; opacity: 0; translate: 8px 0;
    transition: opacity .22s var(--ease-out), translate .22s var(--ease-out);
  }
  [dir="rtl"] .guide-rail .gr-t { translate: -8px 0; }
  .guide-rail:hover .gr-t, .guide-rail a[aria-current="true"] .gr-t,
  .guide-rail a:focus-visible .gr-t { opacity: 1; translate: 0 0; }
}

/* ------------------------------------------------------- editorial chapters -- */
/* "## گام N — …" step-cards lose the toy box and become magazine chapters:
   a huge outlined ghost numeral, a hairline rule, and generous air. */
.guide-body { font-size: 1.1rem; }
.guide-body > .step-card:first-child {
  margin-top: 0;
}
.guide-body .step-card {
  position: relative; border: 0; border-radius: 0; background: none;
  padding: 0; margin-top: clamp(56px, 10vw, 88px);
}
.guide-body .step-card::before {
  content: ""; position: absolute; top: -28px; inset-inline: 0; height: 1px;
  background: linear-gradient(90deg, var(--gold) 0, rgb(var(--gold-rgb) / calc(var(--wash-k) * .06)) 70%, transparent);
}
[dir="rtl"] .guide-body .step-card::before {
  background: linear-gradient(-90deg, var(--gold) 0, rgb(var(--gold-rgb) / calc(var(--wash-k) * .06)) 70%, transparent);
}
.guide-body .step-card + .step-card { margin-top: clamp(56px, 10vw, 88px); }
.guide-body h2.step-h {
  display: block; font-size: clamp(1.45rem, 4.5vw, 1.9rem); line-height: 1.3;
  margin: 0; padding: 0; border: 0;
}
.guide-body .step-no {
  display: block; width: auto; height: auto; margin-bottom: -0.34em;
  background: none; box-shadow: none; border-radius: 0;
  font-size: clamp(3.6rem, 11vw, 5.4rem); font-weight: 800; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .5));
  text-shadow: 0 0 34px rgb(var(--gold-rgb) / calc(var(--glow-k) * .18));
  user-select: none;
}
@supports not (-webkit-text-stroke: 1px black) {
  .guide-body .step-no {
    color: transparent;
    text-shadow:
      -1px -1px 0 rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .5)),
       1px -1px 0 rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .5)),
      -1px  1px 0 rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .5)),
       1px  1px 0 rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .5)),
       0 0 20px rgb(var(--gold-rgb) / calc(var(--glow-k) * .18));
  }
}
.guide-body .step-t { display: block; }
.guide-body .step-card > * + * { margin-top: 1.05em; }
.guide-body .step-card .prose-figure { background: var(--bg-elev); }

/* plain ## sections (non-step) — quieter chapter heads in the same key */
.guide-body > h2:not(.step-h) {
  border-top: 0; padding-top: 0; margin-top: clamp(56px, 10vw, 80px);
  font-size: clamp(1.4rem, 4.2vw, 1.75rem);
}
.guide-body > h2:not(.step-h)::before {
  width: 56px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  box-shadow: none;
}
[dir="rtl"] .guide-body > h2:not(.step-h)::before {
  background: linear-gradient(-90deg, var(--gold), transparent);
}

/* deep-lit figures */
.guide-body .prose-figure {
  border-color: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .3));
  box-shadow: 0 24px 70px rgb(var(--sh-rgb) / calc(var(--sh-k) * .5)), 0 0 0 1px rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .06));
}

/* ------------------------------------------------------------- components -- */
/* feature-card grid — :::features around "- **Title** — description" */
.guide-body .md-features ul { list-style: none; padding: 0; margin: 0;
  display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .guide-body .md-features ul { grid-template-columns: 1fr 1fr; } }
.guide-body .md-features li {
  position: relative; margin: 0; padding: 20px 20px 22px;
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .2)); border-radius: var(--radius);
  background: linear-gradient(165deg, var(--bg-elev), rgb(var(--bg-elev-rgb) / .4));
  overflow: hidden;
  transition: transform .22s var(--ease-out), border-color .22s, box-shadow .22s;
}
.guide-body .md-features li::before {
  content: ""; position: absolute; top: 0; inset-inline-start: 20px;
  width: 34px; height: 2.5px; border-radius: 0 0 3px 3px;
  background: var(--gold); box-shadow: 0 0 12px rgb(var(--gold-rgb) / calc(var(--glow-k) * .5));
}
@media (hover: hover) {
  .guide-body .md-features li:hover {
    transform: translateY(-3px); border-color: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .5));
    box-shadow: 0 14px 44px rgb(var(--sh-rgb) / calc(var(--sh-k) * .45));
  }
}
.guide-body .md-features li strong {
  display: block; font-size: 1.06rem; color: var(--gold-bright); margin-bottom: 6px;
}
.guide-body .md-features li { color: var(--ink-dim); font-size: .96rem; line-height: 1.75; }

/* download vault — :::vault around "- [Label](url) — note". The WHOLE row is
   the link (owner 2026-08-23): the anchor fills the card, so a click anywhere
   on the row opens the target — the label, the note, the empty space. */
.guide-body .md-vault ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.guide-body .md-vault li {
  margin: 0; padding: 0;
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .26)); border-radius: 14px;
  background: var(--bg-elev);
  transition: border-color .22s, background-color .22s;
}
.guide-body .md-vault li:hover { border-color: var(--gold); background: var(--bg-elev2); }
.guide-body .md-vault li > a {
  display: block; padding: 16px 18px;
  color: var(--ink-dim); font-size: .92rem; line-height: 1.7;
  text-decoration: none;
}
.guide-body .md-vault li > a:hover { color: var(--ink); }
.guide-body .md-vault li > a .vault-label {
  display: inline-block; font-weight: 700; font-size: 1.04rem;
  color: var(--gold-bright); text-decoration: none;
}
.guide-body .md-vault li > a::after {
  content: "↗"; margin-inline-start: 7px; font-size: .85em;
  display: inline-block; transition: translate .2s var(--ease-out);
}
.guide-body .md-vault li:hover > a::after { translate: 2px -2px; }
.guide-body .md-vault li > a:hover .vault-label { text-decoration: underline; text-underline-offset: 4px; }
.guide-body .md-vault li > a .vault-note { color: var(--ink-dim); }

/* figure-text card — :::figcard around an image + a paragraph (owner 2026-08-23).
   One horizontal card: image and text side by side. In RTL the natural flex
   order puts the FIRST child (the text) on the right and the image on the
   LEFT — exactly the Persian layout requested. Token-only, both editions. */
.guide-body .md-figcard {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 26px);
  margin: clamp(28px, 6vw, 44px) 0;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .28));
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--bg-elev), rgb(var(--bg-elev-rgb) / .4));
  box-shadow: 0 24px 70px rgb(var(--sh-rgb) / calc(var(--sh-k) * .35)),
              0 0 0 1px rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .05));
}
.guide-body .md-figcard .prose-figure {
  flex: 0 1 42%; min-width: 0; margin: 0;
  border: 0; box-shadow: none; background: none;
}
.guide-body .md-figcard .prose-figure img {
  display: block; width: 100%; height: auto;
  border-radius: 10px;
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .22));
}
.guide-body .md-figcard > p { flex: 1 1 58%; min-width: 0; margin: 0; }
.guide-body .md-figcard .prose-figure figcaption { margin-top: 8px; }
@media (max-width: 480px) {
  .guide-body .md-figcard { gap: 12px; padding: 12px; }
  .guide-body .md-figcard .prose-figure { flex-basis: 40%; }
}

/* ------------------------------------------------- memorial card — :::memorial
   (owner 2026-08-23). A crafted memorial: the FIRST photo leads large, the
   other four sit in one row beneath; slow gold light only — a breathing
   candle glow behind the lead, a 46s ken-burns drift on it, and a calm sheen
   sweeping the glass. Clicking any photo opens the existing gallery lightbox
   (the fence renders a figure-row; display:contents lets the card grid own
   the figures). Reduced-motion kills every animation. */
.guide-body .md-memorial {
  position: relative; overflow: hidden;
  margin: clamp(36px, 8vw, 64px) 0;
  padding: clamp(12px, 3vw, 20px);
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .3));
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(120% 90% at 50% 0%, rgb(var(--gold-rgb) / calc(var(--wash-k) * .10)), transparent 55%),
    linear-gradient(170deg, var(--bg-elev), rgb(var(--bg-elev-rgb) / .45));
  box-shadow: 0 30px 80px rgb(var(--sh-rgb) / calc(var(--sh-k) * .45)),
              0 0 0 1px rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .04)),
              inset 0 1px 0 rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .10));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 2vw, 16px);
  align-items: start;
}
/* the renderer's figure-row is layout-only here — the card grid owns the figures */
.guide-body .md-memorial .figure-row { display: contents; }
.guide-body .md-memorial .prose-figure { margin: 0; border: 0; box-shadow: none; background: none; }
/* lead photo — full width, breathing glow */
.guide-body .md-memorial .prose-figure:first-child {
  grid-column: 1 / -1;
  animation: memorial-breathe 6s var(--ease-out) infinite alternate;
}
.guide-body .md-memorial .prose-figure:first-child img {
  display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .35));
  animation: memorial-drift 46s ease-in-out infinite alternate;
}
@keyframes memorial-breathe {
  from { filter: drop-shadow(0 0 8px rgb(var(--gold-rgb) / calc(var(--glow-k) * .05))); }
  to   { filter: drop-shadow(0 0 26px rgb(var(--gold-rgb) / calc(var(--glow-k) * .22))); }
}
@keyframes memorial-drift {
  from { transform: scale(1.03) translateY(0); }
  to   { transform: scale(1.10) translateY(-1.2%); }
}
/* the four companions — one line, quiet gold hairlines, gentle hover lift */
.guide-body .md-memorial .prose-figure:not(:first-child) { min-width: 0; }
.guide-body .md-memorial .prose-figure:not(:first-child) img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .28));
  transition: transform .35s var(--ease-out), border-color .35s, box-shadow .35s;
}
@media (hover: hover) {
  .guide-body .md-memorial .prose-figure:not(:first-child):hover img {
    transform: translateY(-3px);
    border-color: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .6));
    box-shadow: 0 10px 26px rgb(var(--sh-rgb) / calc(var(--sh-k) * .4)),
                0 0 14px rgb(var(--gold-rgb) / calc(var(--glow-k) * .18));
  }
}
.guide-body .md-memorial .prose-figure img:focus-visible {
  outline: 2px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .9));
  outline-offset: 2px;
}
/* calm light sweep across the glass — pure decoration */
.guide-body .md-memorial::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgb(var(--gold-rgb) / calc(var(--wash-k) * .05)) 50%, transparent 62%);
  background-size: 240% 100%;
  animation: memorial-sheen 11s ease-in-out infinite;
}
@keyframes memorial-sheen {
  0%, 55%, 100% { background-position: 130% 0; }
  25% { background-position: -30% 0; }
}
.guide-body .md-memorial figcaption {
  margin-top: 7px; font-size: .78rem; color: var(--ink-dim);
  text-align: center; line-height: 1.5;
}
.guide-body .md-memorial .gallery-hint { grid-column: 1 / -1; margin: 4px 0 0; }
@media (max-width: 480px) {
  .guide-body .md-memorial { gap: 8px; padding: 10px; }
  .guide-body .md-memorial .prose-figure:first-child img { aspect-ratio: 1 / 1; }
  .guide-body .md-memorial figcaption { font-size: .7rem; }
}
/* still and quiet when the reader asked for it — both triggers, as everywhere */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .guide-body .md-memorial .prose-figure:first-child,
  :root:not([data-motion="full"]) .guide-body .md-memorial .prose-figure:first-child img,
  :root:not([data-motion="full"]) .guide-body .md-memorial::after { animation: none; }
}
[data-motion="reduced"] .guide-body .md-memorial .prose-figure:first-child,
[data-motion="reduced"] .guide-body .md-memorial .prose-figure:first-child img,
[data-motion="reduced"] .guide-body .md-memorial::after { animation: none; }

/* comparison grid — :::vs with "= HeadA | HeadB" then "label: A | B" */
.guide-body .md-vs {
  border: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .24)); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-elev); font-size: .95rem;
}
.guide-body .md-vs .vs-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px;
  padding: 13px 16px; align-items: baseline;
}
.guide-body .md-vs .vs-row + .vs-row { border-top: 1px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .12)); }
.guide-body .md-vs .vs-label {
  grid-column: 1 / -1; font-size: .76rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim);
}
.guide-body .md-vs .vs-a, .guide-body .md-vs .vs-b { line-height: 1.65; }
.guide-body .md-vs .vs-b { color: var(--gold-bright); }
.guide-body .md-vs .vs-head {
  background: linear-gradient(180deg, rgb(var(--gold-rgb) / calc(var(--wash-k) * .14)), rgb(var(--gold-rgb) / calc(var(--wash-k) * .03)));
  padding-block: 11px;
}
.guide-body .md-vs .vs-head .vs-a, .guide-body .md-vs .vs-head .vs-b {
  font-weight: 800; font-size: 1rem; color: var(--ink);
}
.guide-body .md-vs .vs-head .vs-b { color: var(--gold-bright); }
@media (min-width: 680px) {
  .guide-body .md-vs .vs-row { grid-template-columns: 150px 1fr 1fr; }
  .guide-body .md-vs .vs-label { grid-column: auto; align-self: center; }
}

/* instrument params — copy-on-tap (guide.js) */
.guide-body .md-params .md-param { position: relative; cursor: copy;
  border-color: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .3));
  background: linear-gradient(180deg, var(--bg-elev), rgb(var(--bg-elev-rgb) / .5)); }
.guide-body .md-param dd { font-size: 1.55rem; letter-spacing: .02em; }
.guide-body .md-param::after {
  content: "⧉"; position: absolute; top: 7px; inset-inline-end: 9px;
  font-size: .72rem; color: rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .5));
}
.guide-body .md-param.copied::after { content: "✓"; color: var(--neon); }
.guide-body .md-param.copied { border-color: var(--neon); }

/* refined callouts */
.guide-body .md-callout {
  background: linear-gradient(165deg, var(--bg-elev), rgb(var(--bg-elev-rgb) / .35));
  border-radius: 14px;
}

/* ------------------------------------------------------------- reveals ----- */
.gv { opacity: 0; transform: translateY(18px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: var(--d, 0s); }
.gv.gv-in { opacity: 1; transform: none; }
.no-io .gv, .no-js .gv { opacity: 1; transform: none; }

/* Scoped to :not(=full) so the reader can override the OS setting for this site;
   see the three-state note in site.css. */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) :is(.guide-hero-aurora, .guide-cue) { display: none; }
  :root:not([data-motion="full"]) .guide-title { animation: none; }
  :root:not([data-motion="full"]) .guide-hero-media img { transform: none; }
  :root:not([data-motion="full"]) .gv { opacity: 1; transform: none; transition: none; }
}
/* …and the same, when the reader asked for it in the display panel. */
[data-motion="reduced"] :is(.guide-hero-aurora, .guide-cue) { display: none; }
[data-motion="reduced"] .guide-title { animation: none; }
[data-motion="reduced"] .guide-hero-media img { transform: none; }
[data-motion="reduced"] .gv { opacity: 1; transform: none; transition: none; }

/* --------------------------------------------------------- figure gallery
   Figure-rows (consecutive images) are a click-to-open gallery; single
   figures open a fullscreen view of themselves. All tokens, both editions,
   RTL-aware via logical properties. */
.guide-body .prose-figure { position: relative; }
.guide-body .prose-figure img { cursor: zoom-in; }
.guide-body .prose-figure img:focus-visible {
  outline: 2px solid rgb(var(--gold-rgb) / calc(var(--ring-k) * var(--hc-k) * .9));
  outline-offset: 2px;
}
.gallery-hint {
  display: block; margin-top: 8px; text-align: center;
  font-size: .78rem; letter-spacing: .01em;
  color: var(--ink-dim); opacity: .8;
}
.vp-lightbox {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  background: rgb(var(--bg-elev-rgb) / .93);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: max(14px, 4vw);
}
.vp-lightbox[hidden] { display: none; }
.vp-lb-frame {
  max-width: min(96vw, 1100px); max-height: 92vh;
  display: flex; flex-direction: column; gap: 12px;
}
.vp-lb-frame img {
  display: block; max-width: 100%; max-height: 78vh; margin-inline: auto;
  border-radius: var(--radius); border: var(--ring); background: var(--bg-elev);
  object-fit: contain;
}
.vp-lb-cap { text-align: center; color: var(--ink-dim); font-size: .9rem; line-height: 1.6; }
/* figure-card notes (owner 2026-08-23): when the lightbox item carries a note,
   the frame becomes TWO columns — image one side, caption + explanation the
   other. RTL: the note sits first (right) and the image last (left), the same
   arrangement as the Persian figcard. Without a note nothing changes. */
.vp-lb-frame.has-note {
  display: grid; width: 100%;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 40px); align-items: center;
}
.vp-lb-frame.has-note img { max-height: 72vh; margin-inline: 0; }
.vp-lb-frame.has-note .vp-lb-text { text-align: start; }
[dir="rtl"] .vp-lb-frame.has-note img { order: 2; }
[dir="rtl"] .vp-lb-frame.has-note .vp-lb-text { order: 1; }
.vp-lb-note {
  margin-top: 10px; font-size: 1.02rem; line-height: 1.8;
  color: var(--ink-dim); text-wrap: balance;
}
@media (max-width: 639.98px) {
  .vp-lb-frame.has-note { grid-template-columns: 1fr; gap: 12px; }
  .vp-lb-frame.has-note img { max-height: 42vh; }
  [dir="rtl"] .vp-lb-frame.has-note img { order: 0; }
  [dir="rtl"] .vp-lb-frame.has-note .vp-lb-text { order: 0; }
}
.vp-lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; border: var(--ring); cursor: pointer;
  background: var(--bg-elev); color: var(--gold-bright);
  font-size: 1.35rem; line-height: 1;
}
.vp-lb-btn:hover { color: var(--ink); }
.vp-lb-close { top: 18px; inset-inline-end: 18px; transform: none; font-size: 1.5rem; }
.vp-lb-prev { inset-inline-start: 14px; }
.vp-lb-next { inset-inline-end: 14px; }
@media (max-width: 640px) {
  .vp-lb-btn { width: 38px; height: 38px; font-size: 1.15rem; }
  .vp-lb-close { top: 12px; inset-inline-end: 12px; }
}
