/* D64 journey map: the full map page (/katha/<journey>/, built by scripts/build_journey.py). On ds/scene.css (tokens, faces, the scene bar).
   One drawn sheet of Bharata (SVG), pinned; the chapters pass beside or below it and the road draws up to the chapter in view.
   Every length inside the sheet is given in screen pixels times --jm-u (sheet units per pixel, set by yatra.js as the camera moves),
   so lines, lamps and names keep their size at any zoom. Without script, or with reduced motion (no html.jm-on), the road is simply drawn. */
@view-transition{navigation:auto}
html.jm{scroll-behavior:auto;background:var(--l-bg)}
html.jm .hdr.hdr--scene{background:var(--l-bg);-webkit-backdrop-filter:none;backdrop-filter:none}
html.jm body{margin:0;background:var(--l-bg);color:var(--l-ink);font-family:var(--l-font-prose);-webkit-text-size-adjust:100%}
.jm-main{--jm-hdr:calc(var(--l-scene-h,48px) + 1px);--jm-stage:52svh;--jm-win:calc(100svh - var(--jm-hdr) - var(--jm-stage));display:block}

/* ---- the stage ---- */
.jm-stage{position:sticky;top:var(--jm-hdr);height:var(--jm-stage);z-index:5;overflow:hidden;background:radial-gradient(120% 90% at 50% 38%,#1E1711 0,var(--l-bg) 72%);border-bottom:1px solid var(--l-line)}
.jm-map{display:block;width:100%;height:100%;--jm-u:2.4;view-transition-name:d64-map;touch-action:pan-y}
.jm-shade{fill:none;stroke-linejoin:round}
.jm-shade--a{stroke:color-mix(in srgb,var(--l-ink-soft) 13%,transparent);stroke-width:calc(9px * var(--jm-u))}
.jm-shade--b{stroke:color-mix(in srgb,var(--l-ink-soft) 6%,transparent);stroke-width:calc(22px * var(--jm-u))}
.jm-land{fill:#241C14;stroke:color-mix(in srgb,var(--l-ink-soft) 78%,transparent);stroke-width:calc(1px * var(--jm-u));stroke-linejoin:round}
.jm-waves{fill:none;stroke:color-mix(in srgb,var(--l-ink-soft) 26%,transparent);stroke-width:calc(.8px * var(--jm-u));stroke-linecap:round}
.jm-riv{fill:none;stroke:color-mix(in srgb,#8DB4C8 58%,transparent);stroke-width:calc(1px * var(--jm-u));stroke-linecap:round;stroke-linejoin:round}
.jm-forest{fill:none;stroke:color-mix(in srgb,#9DB884 44%,transparent);stroke-width:calc(.8px * var(--jm-u));stroke-linecap:round}
.jm-peaks{fill:none;stroke:color-mix(in srgb,var(--l-ink-soft) 62%,transparent);stroke-width:calc(.9px * var(--jm-u));stroke-linecap:round;stroke-linejoin:round}
.jm-peaks--sh{stroke:color-mix(in srgb,var(--l-ink-soft) 34%,transparent)}
.jm-geo{font:500 calc(12.5px * var(--jm-u))/1 var(--l-font-ui);fill:color-mix(in srgb,var(--l-ink-soft) 78%,transparent);text-anchor:middle;letter-spacing:.02em;pointer-events:none}
html.jm[lang^="en"] .jm-geo{letter-spacing:.16em;text-transform:uppercase;font-size:calc(11px * var(--jm-u))}
.jm-geo--sea{font-style:italic}
.jm-geo{paint-order:stroke;stroke:#17120D;stroke-width:calc(3px * var(--jm-u));stroke-linejoin:round}
.jm-forest,.jm-peaks,.jm-geo{transition:opacity .5s ease}
html.jm-on .jm-map:not(.is-wide) .jm-forest,html.jm-on .jm-map:not(.is-wide) .jm-peaks{opacity:.5}
html.jm-on .jm-map:not(.is-wide) .jm-geo{opacity:.7}
.jm-shade{transition:opacity .5s ease}
html.jm-on .jm-map:not(.is-wide) .jm-shade--b{opacity:.35}
html.jm-on .jm-map:not(.is-wide) .jm-shade--a{opacity:.6}

/* the road */
.jm-leg{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:0}
.jm-leg--rama{stroke:var(--l-accent);stroke-width:calc(2.5px * var(--jm-u))}
.jm-leg--others{stroke:color-mix(in srgb,var(--l-accent) 62%,transparent);stroke-width:calc(1.5px * var(--jm-u))}
.jm-leg--air{stroke:color-mix(in srgb,var(--l-ink) 74%,transparent);stroke-width:calc(1.25px * var(--jm-u))}
.jm-leg--air.jm-leg--own{stroke:color-mix(in srgb,var(--l-accent) 88%,transparent)}
.jm-leg--bridge{stroke-width:calc(3.2px * var(--jm-u))}
html.jm-on .jm-leg{stroke-dashoffset:1;opacity:0}
html.jm-on .jm-leg.is-done{stroke-dashoffset:0;opacity:1}
html.jm-on .jm-leg.is-now{stroke-dashoffset:0;opacity:1;transition:stroke-dashoffset var(--jm-d,1.2s) cubic-bezier(.45,0,.2,1) var(--jm-w,0s)}
html.jm-on .jm-leg--rama.is-now{stroke:#FFDFA0}
html.jm-on .jm-leg--air.is-now{stroke:var(--l-ink)}
html.jm-on .jm-leg--air.jm-leg--own.is-now{stroke:#FFDFA0}

/* the halts */
.jm-stop{cursor:pointer;outline:none}
.jm-stop__in{transform:scale(var(--jm-u))}
.jm-hit{fill:transparent}
.jm-dot{fill:var(--l-accent);stroke:var(--l-bg);stroke-width:1.2px}
.jm-lit{opacity:0}
.jm-halo{fill:color-mix(in srgb,var(--l-accent) 24%,transparent)}
.jm-bowl{fill:var(--l-accent)}
.jm-flame{fill:#FFE9B4}
.jm-lab{font:600 13.5px/1 var(--l-font-ui);fill:var(--l-ink);paint-order:stroke;stroke:#17120D;stroke-width:3.6px;stroke-linejoin:round;opacity:0;pointer-events:none}
.jm-stop--r1 .jm-lab{opacity:1}
.jm-stop--r3 .jm-dot{r:2.2px}
.jm-stop:focus-visible .jm-hit{stroke:var(--l-focus,#E8B45A);stroke-width:2px}
.jm-stop:focus-visible .jm-lab,.jm-stop:hover .jm-lab{opacity:1}
html.jm-on .jm-dot{fill:var(--l-bg);stroke:var(--l-ink-mute);opacity:.85}
html.jm-on .jm-stop--r1 .jm-lab{opacity:0}
html.jm-on .jm-map.is-wide .jm-stop--r1 .jm-lab{opacity:.92}
html.jm-on .jm-map.is-wide .jm-stop--r3:not(.is-on):not(.is-at){visibility:hidden}
html.jm-on .jm-stop.is-seen .jm-dot{fill:var(--l-accent);stroke:var(--l-bg);opacity:1}
html.jm-on .jm-stop.is-on .jm-lab{opacity:1}
html.jm-js .jm-stop.is-at .jm-lit{opacity:1}
html.jm-js .jm-stop.is-at .jm-dot{opacity:0}
.jm-lab,.jm-lit,.jm-dot{transition:opacity .35s ease}
.jm-here{display:none}
html.jm-js .jm-here{display:block}
.jm-here__in{transform:scale(var(--jm-u))}
.jm-ring{fill:none;stroke:var(--l-accent);stroke-width:1.4px;transform-box:fill-box;transform-origin:center;opacity:.55}
html.jm-on .jm-ring{animation:jm-ring 3s cubic-bezier(.2,.6,.3,1) infinite}
html.jm-on .jm-ring--b{animation-delay:1.5s}
@keyframes jm-ring{from{transform:scale(.45);opacity:.85}to{transform:scale(1.55);opacity:0}}

/* the kandas, across the top of the map */
.jm-rail{position:absolute;inset:8px 0 auto 0;display:flex;gap:6px;padding:0 var(--l-gutter,16px);overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 14px,#000 calc(100% - 26px),transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 14px,#000 calc(100% - 26px),transparent 100%)}
.jm-rail::-webkit-scrollbar{display:none}
.jm-rail a{flex:none;display:inline-flex;align-items:center;min-height:40px;padding:0 13px;border:1px solid var(--l-line-strong);border-radius:999px;background:color-mix(in srgb,var(--l-bg) 86%,transparent);color:var(--l-ink);font:600 14px/1 var(--l-font-ui);text-decoration:none;white-space:nowrap}
html.jm[lang^="en"] .jm-rail a{font-size:13.5px}
.jm-rail a[aria-current]{background:var(--l-accent);border-color:var(--l-accent);color:var(--l-on-accent,#1A1208)}
.jm-rail a:focus-visible{outline:2px solid var(--l-focus,#E8B45A);outline-offset:2px}

/* ---- the chapters ---- */
.jm-flow{position:relative;padding:0 var(--l-gutter,16px)}
.jm-intro{min-height:var(--jm-win);box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding:20px 0 26px}
.jm-kick{margin:0;font:600 15px/1.4 var(--l-font-ui);color:var(--l-accent)}
.jm-intro h1{margin:6px 0 10px;font:400 clamp(38px,10.5vw,64px)/1.1 var(--l-font-display);color:var(--l-ink);letter-spacing:0}
.jm-dek{margin:0;max-width:34rem;font-size:clamp(17px,1rem + .3vw,20px);line-height:1.6;color:var(--l-ink)}
.jm-hint{margin:16px 0 0;font:500 15px/1.4 var(--l-font-ui);color:var(--l-ink-soft)}
.jm-leaves{list-style:none;margin:0;padding:0}
.jm-kanda{padding:30px 0 4px;border-top:1px solid var(--l-line);scroll-margin-top:calc(var(--jm-hdr) + var(--jm-stage))}
.jm-kanda h2{margin:0;font:400 clamp(26px,7vw,34px)/1.2 var(--l-font-display);color:var(--l-accent);letter-spacing:0}
.jm-kanda p{margin:4px 0 0;font:500 14.5px/1.4 var(--l-font-ui);color:var(--l-ink-soft)}
.jm-leaf{position:relative;box-sizing:border-box;min-height:var(--jm-win);display:grid;grid-template-columns:96px minmax(0,1fr);gap:16px;align-content:center;align-items:start;padding:18px 0;scroll-margin-top:calc(var(--jm-hdr) + var(--jm-stage))}
.jm-leaf__art{display:block;width:96px;aspect-ratio:2/3;border-radius:6px;overflow:hidden;background:var(--l-mat-fill,#26201A);box-shadow:0 0 0 1px var(--l-line)}
.jm-leaf__art img{display:block;width:100%;height:100%;object-fit:cover}
.jm-leaf__tx{min-width:0}
.jm-leaf__k{margin:0;font:600 14px/1.4 var(--l-font-ui);color:var(--l-accent)}
html.jm[lang^="en"] .jm-leaf__k{font-size:13.5px;letter-spacing:.02em}
.jm-leaf h3{margin:3px 0 6px;font:400 clamp(22px,5.9vw,28px)/1.24 var(--l-font-display);color:var(--l-ink);letter-spacing:0}
.jm-leaf h3 a{color:inherit;text-decoration:none}
.jm-leaf h3 a::after{content:'';position:absolute;inset:0}
.jm-leaf h3 a:focus-visible{outline:none}
.jm-leaf:focus-within{outline:2px solid var(--l-focus,#E8B45A);outline-offset:-2px;border-radius:8px}
.jm-leaf__d{margin:0;font-size:16px;line-height:1.55;color:var(--l-ink-soft)}
.jm-leaf__road{margin:8px 0 0;font:600 14px/1.6 var(--l-font-ui);color:var(--l-ink)}
html.jm[lang^="en"] .jm-leaf__road{font-size:13.5px}
.jm-leaf__road i{font-style:normal;color:var(--l-accent)}
.jm-leaf__road b{font-weight:600;color:var(--l-accent)}
.jm-leaf__road small{font-size:inherit;font-weight:500;color:var(--l-ink-soft)}
.jm-leaf::before{content:'';position:absolute;left:calc(-1 * var(--l-gutter,16px) + 4px);top:22px;bottom:22px;width:2px;border-radius:2px;background:var(--l-accent);opacity:0;transition:opacity .3s ease}
html.jm-js .jm-leaf.is-cur::before{opacity:1}
.jm-end{padding:34px 0 calc(72px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--l-line)}
.jm-note{margin:0 0 18px;font:500 14.5px/1.5 var(--l-font-ui);color:var(--l-ink-soft)}
.jm-links{display:flex;flex-wrap:wrap;gap:10px;margin:0}
.jm-btn{display:inline-flex;align-items:center;min-height:46px;padding:0 20px;border:1px solid var(--l-line-strong);border-radius:999px;color:var(--l-ink);font:600 16px/1.2 var(--l-font-ui);text-decoration:none}
.jm-btn:hover{border-color:var(--l-accent);color:var(--l-accent)}
.jm-btn:focus-visible{outline:2px solid var(--l-focus,#E8B45A);outline-offset:3px}

/* ---- wide screens, and a phone on its side: the map stands at the left, the chapters pass at the right ---- */
@media (min-width:900px),(orientation:landscape) and (min-width:560px) and (max-height:560px){
  .jm-main{display:grid;grid-template-columns:minmax(0,58fr) minmax(0,42fr);align-items:start;--jm-stage:calc(100svh - var(--jm-hdr));--jm-win:calc(100svh - var(--jm-hdr))}
  .jm-stage{border-bottom:0;border-right:1px solid var(--l-line)}
  .jm-map{--jm-u:1.5}
  .jm-rail{inset:14px 0 auto 0;padding:0 22px;flex-wrap:wrap;-webkit-mask-image:none;mask-image:none}
  .jm-flow{padding:0 clamp(22px,3.2vw,54px)}
  .jm-intro{min-height:calc(100svh - var(--jm-hdr))}
  .jm-kanda,.jm-leaf{scroll-margin-top:calc(var(--jm-hdr) + 16svh)}
  .jm-leaf{min-height:66svh;grid-template-columns:clamp(120px,13vw,200px) minmax(0,1fr);gap:clamp(18px,2vw,28px);padding:26px 0}
  .jm-leaf__art{width:auto}
  .jm-leaf__d{font-size:17px}
  .jm-leaf::before{left:calc(-1 * clamp(22px,3.2vw,54px) + 8px)}
}
/* a phone on its side: the kandas stay on one sliding row, so they cover no more of the short map than on a phone held upright */
@media (orientation:landscape) and (max-height:560px) and (max-width:1100px){
  .jm-rail{inset:8px 0 auto 0;padding:0 14px;flex-wrap:nowrap;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 14px,#000 calc(100% - 26px),transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 14px,#000 calc(100% - 26px),transparent 100%)}
}
@media (prefers-reduced-motion:reduce){
  .jm-lab,.jm-lit,.jm-dot,.jm-leaf::before{transition:none}
  .jm-map{view-transition-name:none}
}
@media print{.jm-stage{position:static;height:auto}.jm-rail{display:none}}
/* IT-RAM 11-15: a leaf whose painting was taken down keeps its text column; the empty mat is not drawn */
.jm-leaf__art:empty{background:none;box-shadow:none}
