/* LIGHT & DARK — character showcase. The page takes the colors of the selected character's nation. */
body.ld-cast{
  --c-text:#f3e8ec;--c-dim:#d3c4cb;--c-faint:#9d8e96;--c-accent:#f0a9bf;--c-gem:#ff7aa5;--c-orn:#b3233b;--c-line:rgba(240,169,191,.32);--c-page:#0b080d;
  background:var(--c-page);transition:background-color 1s}
body.ld-cast[data-nation="light"]{--c-text:#2b1c11;--c-dim:#56412d;--c-faint:#8b7458;--c-accent:#a26d2b;--c-gem:#c8963e;--c-orn:#8a6430;--c-line:rgba(162,109,43,.34);--c-page:#f6eedf}
body.ld-cast[data-nation="light"] .ld-foot{background:#efe4cf;color:#5a4632;border-top-color:rgba(162,109,43,.25)}
body.ld-cast[data-nation="light"] .ld-foot .ld-brand{color:#2b1c11}
body.ld-cast[data-nation="light"] .ld-credit{color:#7a6248}
body.ld-cast[data-nation="light"] .ld-credit strong{color:#56412d}
body.ld-cast[data-nation="light"] .ld-credit a{color:#a26d2b}

.cast{position:relative;height:100vh;height:100svh;min-height:680px;overflow:hidden;isolation:isolate;color:var(--c-text);--pr:calc(clamp(40px,9vw,150px) + min(470px,36vw))}
.cast-panel *,.cast-nations *,.cast-count,.cs-name,.cs-arrow{transition-property:color,border-color,background-color;transition-duration:.8s}
.cast-art{position:absolute;inset:0;z-index:-2;background:var(--c-page);container-type:size}
/* the frame overhangs the screen only as far as the mouse parallax moves the art (cast.js: up to 11 px across, 7 px
   up or down), so nearly all of the painting is in view; there is no slow zoom-in either */
.cast-frame{position:absolute;inset:-8px -12px;opacity:0;will-change:transform,opacity,clip-path}
/* in a window wider than the painting (16:9) the whole painting shows: the frame takes the painting's shape at the full
   height, standing at the right, and what is left over on the left lies under the solid shade behind the text (only a
   window so wide that more than the text column would be left over gets a wider frame, cut at top and bottom) */
@supports (width:1cqw){.cast-frame{left:auto;width:max(min(calc(100cqw + 24px),calc((100cqh + 16px) * 1.7712)),calc(100cqw + 24px - var(--pr)))}}
.cast-frame.is-current{opacity:1}
body.ld .cast-frame img{width:100%;height:100%;object-fit:cover;object-position:var(--pos,62% 28%)}
/* Avilon's warm glow in the top-right corner, 40% fainter than it was (the moving diagonal light bands that were here are
   gone, at the owner's wish). Above the pictures (z-index 3; a picture shown by switching characters has z-index 1 or 2), so it looks the
   same after switching as after a reload. */
.cast-rays{position:absolute;inset:0;z-index:3;pointer-events:none;mix-blend-mode:screen;opacity:0;background:radial-gradient(ellipse at 85% -10%,rgba(255,236,200,.27),transparent 55%);transition:opacity 1.2s}
body[data-nation="light"] .cast-rays{opacity:1}
/* the page's shade: solid page colour under the whole text column (--pr: the right edge of .cast-panel), then a fade
   into the painting (--fade), so no painting shows under the text, the same for every character and screen size */
.cast-shade{position:absolute;inset:0;z-index:-1;pointer-events:none;--fade:min(34vw,calc((100vw - var(--pr)) * .4))}
.cast-shade::before,.cast-shade::after{content:"";position:absolute;inset:0;transition:opacity 1.1s ease}
/* Avilon's fades at the bottom and top are weaker than Northorn's on purpose: a near-white wash hides a painting far more
   than a dark wash hides a dark painting. Their strengths (bottom .39/.28, top .38) leave the paintings as visible as
   Northorn's .95/.6 and .7 do (measured on all the pictures at 2560 x 1300, November 22). */
.cast-shade::before{background:linear-gradient(90deg,rgba(13,8,12,.99) 0,rgba(13,8,12,.97) var(--pr),rgba(13,8,12,.55) calc(var(--pr) + var(--fade) * .35),rgba(13,8,12,.2) calc(var(--pr) + var(--fade) * .7),rgba(13,8,12,0) calc(var(--pr) + var(--fade))),linear-gradient(0deg,rgba(10,6,9,.95) 0%,rgba(10,6,9,.6) 14%,rgba(10,6,9,0) 30%),linear-gradient(180deg,rgba(10,6,9,.7),transparent 16%);opacity:1}
.cast-shade::after{background:linear-gradient(90deg,rgba(251,245,234,.99) 0,rgba(250,242,228,.97) var(--pr),rgba(250,242,228,.55) calc(var(--pr) + var(--fade) * .35),rgba(250,242,228,.2) calc(var(--pr) + var(--fade) * .7),rgba(250,242,228,0) calc(var(--pr) + var(--fade))),linear-gradient(0deg,rgba(248,240,226,.39) 0%,rgba(248,240,226,.28) 14%,rgba(248,240,226,0) 30%),linear-gradient(180deg,rgba(248,240,226,.38),transparent 16%);opacity:0}
body[data-nation="light"] .cast-shade::before{opacity:0}
body[data-nation="light"] .cast-shade::after{opacity:1}

.cast-flora{position:absolute;inset:0;pointer-events:none}
.cast-flora img{position:absolute;opacity:0;transition:opacity 1.2s ease}
.fl-sakura{left:-3vw;top:-16px;width:clamp(220px,21vw,400px);mix-blend-mode:multiply;transform-origin:0 0;animation:fl-sway 9s ease-in-out infinite alternate}
body[data-nation="light"] .fl-sakura{opacity:.92}
@keyframes fl-sway{to{transform:rotate(1.6deg)}}

/* ---------- The panel ---------- */
.cast-panel{position:absolute;left:clamp(40px,9vw,150px);top:calc(var(--head-h) + clamp(10px,3vh,40px));display:flex;flex-direction:column;width:min(470px,36vw);outline:none}
.cast-eyebrow{display:flex;align-items:center;gap:1rem;margin:0 0 clamp(.6rem,1.8vh,1.3rem);font:600 .74rem/1 var(--display);letter-spacing:.46em;text-transform:uppercase;color:var(--c-text);text-indent:.46em}
.cast-eyebrow::before,.cast-eyebrow::after{content:"";width:46px;height:1px;background:var(--c-line)}
.cast-id{position:relative}
.cast-orn{display:inline-block;vertical-align:-.02em;margin-left:clamp(10px,1.1vw,20px);height:clamp(2.5rem,min(5vw,8.6vh),5rem);width:auto;aspect-ratio:200/260;color:var(--c-orn);opacity:.85;pointer-events:none;filter:drop-shadow(0 0 10px color-mix(in srgb,var(--c-orn) 40%,transparent))}
.cast-place{margin:0 0 .5rem;font:600 .8rem/1 var(--display);letter-spacing:.34em;text-transform:uppercase;color:var(--c-text)}
/* the name is as wide as its words (fit-content), so its gradient fill reaches the last letter of a long name such as
   MORDRATH, which at the largest size is a little wider than the 470 px column */
.cast-name{width:fit-content;margin:0;font-family:var(--display);font-weight:500;line-height:.9;text-transform:uppercase;color:var(--c-text);text-shadow:0 2px 30px color-mix(in srgb,var(--c-page) 70%,transparent)}
.cn-first{display:block;font-size:clamp(3rem,min(6.2vw,10.5vh),6.2rem);letter-spacing:.01em}
.cn-first::first-letter{font-size:1.14em}
.cast-name.is-long .cn-first{font-size:clamp(2.6rem,min(5.2vw,9vh),5.2rem)}
.cn-last{display:block;margin-top:.25rem;font-size:clamp(1.2rem,min(2.1vw,3.6vh),2.1rem);letter-spacing:.42em;font-weight:500}
.cn-last:empty{display:none}
body[data-nation="light"] .cast-name{background:linear-gradient(180deg,#3a2414,#6b4422 80%);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none}
body[data-nation="dark"] .cast-name{background:linear-gradient(180deg,#fff7f8 30%,#e9c7d2);-webkit-background-clip:text;background-clip:text;color:transparent}
.cast-epithet{margin:.5rem 0 0;font:italic 400 clamp(1.15rem,1.6vw,1.5rem)/1.3 var(--display);letter-spacing:.04em;color:var(--c-text)}
.cast-div{position:relative;display:block;width:min(360px,100%);height:14px;margin:clamp(.5rem,1.6vh,1rem) 0;color:var(--c-accent)}
.cast-div::before{content:"";position:absolute;left:0;right:0;top:50%;height:1px;background:linear-gradient(90deg,transparent,var(--c-line) 15%,var(--c-line) 85%,transparent)}
.cast-div svg{position:absolute;left:50%;top:0;width:14px;height:14px;margin-left:-7px;filter:drop-shadow(0 0 6px var(--c-gem))}
.cast-body{flex:none;height:clamp(150px,25vh,240px);overflow:auto;padding-right:.6rem;scrollbar-width:thin;scrollbar-color:var(--c-line) transparent;mask-image:linear-gradient(180deg,#000 85%,transparent);-webkit-mask-image:linear-gradient(180deg,#000 85%,transparent)}
.cast-body p{margin:0 0 .8em;font-size:clamp(.98rem,1.05vw,1.08rem);line-height:1.62;color:var(--c-text);letter-spacing:.01em}
.cast-body .lead{font-size:clamp(1.02rem,1.18vw,1.16rem)}
.facts{display:flex;flex-wrap:wrap;gap:.35rem 1.3rem;margin:.9rem 0 .2rem;padding:.7rem 0 0;border-top:1px solid var(--c-line)}
.facts div{display:flex;align-items:baseline;gap:.45rem}
.facts dt{font:600 .64rem/1 var(--display);letter-spacing:.26em;text-transform:uppercase;color:var(--c-faint)}
.facts dd{margin:0;font:500 1.02rem/1.3 var(--display);letter-spacing:.03em;color:var(--c-text)}
.bonds{display:grid;gap:.5rem;margin:0;padding:0;list-style:none}
.bond{display:grid;grid-template-columns:48px 1fr auto;align-items:center;gap:.9rem;width:100%;padding:.5rem .6rem .5rem .5rem;text-align:left;background:color-mix(in srgb,var(--c-page) 35%,transparent);border:1px solid var(--c-line);cursor:pointer;color:inherit;font:inherit}
.bond img{width:48px;height:48px;border-radius:50%;object-fit:cover;object-position:50% 18%;border:1px solid var(--c-accent)}
.bond b{display:block;font:500 1.2rem/1.1 var(--display);color:var(--c-text)}
.bond small{display:block;font-size:.9rem;color:var(--c-dim)}
.bond i{font-style:normal;color:var(--c-accent);transition:transform .4s}
.bond:hover,.bond:focus-visible{border-color:var(--c-accent);background:color-mix(in srgb,var(--c-accent) 10%,transparent)}
.bond:hover i{transform:translateX(4px)}
.bonds-empty{font-style:italic;color:var(--c-dim)}
.cast-tabs{position:relative;display:flex;align-items:center;gap:0;margin:clamp(.5rem,1.4vh,.9rem) 0 clamp(.8rem,2.2vh,1.4rem);padding-bottom:.9rem;border-bottom:1px solid var(--c-line);width:min(420px,100%)}
.cast-tabs button{flex:1;padding:.5rem 0;background:none;border:0;font:600 .76rem/1 var(--display);letter-spacing:.24em;text-transform:uppercase;color:var(--c-dim);cursor:pointer}
.cast-tabs button+button{border-left:1px solid var(--c-line)}
.cast-tabs button[aria-selected="true"]{color:var(--c-accent)}
.cast-tabs button:hover{color:var(--c-text)}
.ct-gem{position:absolute;left:0;bottom:-1px;width:var(--w,33%);height:2px;transform:translateX(var(--x,0));background:linear-gradient(90deg,transparent,var(--c-gem),transparent);box-shadow:0 0 8px var(--c-gem);transition:transform .6s var(--ease-out),width .6s var(--ease-out)}
.ct-gem::after{content:"";position:absolute;left:50%;top:50%;width:7px;height:7px;margin:-3.5px 0 0 -3.5px;rotate:45deg;background:var(--c-gem);box-shadow:0 0 10px var(--c-gem)}
.cast-actions{display:grid;justify-items:center;gap:.9rem;width:min(420px,100%)}
.cast-explore{width:100%;height:52px;font-size:.86rem;letter-spacing:.24em}
body[data-nation="light"] .cast-explore{--ld-ff:rgba(255,250,240,.7);--ld-fs:#a26d2b;color:#2b1c11}
body[data-nation="light"] .cast-explore:hover{--ld-ff:rgba(255,246,228,.95);--ld-fs:#7d5018;filter:drop-shadow(0 0 12px rgba(200,150,62,.35))}
.cast-gallery{font:600 .72rem/1 var(--display);letter-spacing:.26em;text-transform:uppercase;color:var(--c-text);text-decoration:none;padding:.4rem 0;border-bottom:1px solid var(--c-line)}
.cast-gallery:hover{color:var(--c-accent);border-color:var(--c-accent)}

/* ---------- The name banners ----------
   Each character's name in its own writing hangs at the top right of the picture (the owner's idea, November 27):
   Avilon's people on a hanging scroll (cream paper with the brush kanji, a dark red silk mounting with gold strips, two
   hanging bands, a wooden roller with pale knobs, a small red seal), Northorn's on a wine-red banner with a pointed hem,
   a star and a tassel, the runes standing one under the other. Yamiko has both: her old Avilon scroll, faded, hangs a
   little lower and behind her Northorn banner. cast.js builds them, keeps them clear of the count and the nation switch
   (a long name makes them a little smaller, never longer), and rolls them down when a character appears and up before
   the next one. On phones they hang beside the name and the text flows around them. Sizes are in em of --cb, the size
   of a kanji. */
@font-face{font-family:"LD Yuji";src:url(/home/fonts/yuji.woff2) format("woff2");font-display:swap}
@font-face{font-family:"LD Runic";src:url(/home/fonts/runic.woff2) format("woff2");font-display:swap}
.cast-banners{position:absolute;z-index:1;right:clamp(20px,4vw,64px);top:calc(var(--head-h) + 4px);display:flex;align-items:flex-start;pointer-events:none;user-select:none;--cb:clamp(26px,min(1.75vw,3.4vh),46px)}
.cast-banners:empty{display:none}
.cb{position:relative;flex:none;font-size:var(--cb);transform-origin:50% 0;animation:cb-sway 7s ease-in-out infinite alternate;animation-delay:calc(var(--i,0) * -2.6s)}
@keyframes cb-sway{from{rotate:-.45deg}to{rotate:.45deg}}
.cb-in{display:flex;flex-direction:column;align-items:center;transform-origin:50% 0}
.cb-cord{display:block;width:1.7em;height:.9em;overflow:visible}
.cb-cord path{fill:none;stroke:var(--cb-cord);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.cb-cord circle{fill:var(--cb-nail)}
.cb-rod{position:relative;z-index:2;display:block}
.cb-drop{position:relative;overflow:hidden}           /* cast.js animates its height: the cloth unrolls from the top */
.cb-cloth{position:relative;display:flex;flex-direction:column;align-items:center}
.cb-text{display:block;writing-mode:vertical-rl;text-orientation:upright;line-height:1;white-space:nowrap}
.cb-gap{display:inline-block;inline-size:.32em}
.cb-roll{position:relative;z-index:2;display:block;flex:none}
/* Avilon: the hanging scroll */
.cb.is-scroll{--cb-cord:#4a3322;--cb-nail:#8a6a48}
.is-scroll .cb-in{filter:drop-shadow(0 .2em .28em rgba(60,32,12,.34))}
.is-scroll .cb-rod{width:2.72em;height:.24em;border-radius:.05em;background:linear-gradient(#7d5838,#4a2f1c 55%,#2b1a0e)}
.is-scroll .cb-cloth{width:2.6em;padding:1.25em .3em .8em;
  background:repeating-linear-gradient(45deg,rgba(236,196,140,.08) 0 .06em,transparent .06em .28em),repeating-linear-gradient(-45deg,rgba(236,196,140,.08) 0 .06em,transparent .06em .28em),linear-gradient(90deg,#45201a,#64301f 50%,#45201a)}
.is-scroll .cb-cloth::before,.is-scroll .cb-cloth::after{content:"";position:absolute;top:0;width:.15em;height:1.08em;background:linear-gradient(90deg,#8a6638,#dcbc7c 50%,#8a6638);box-shadow:0 .03em .06em rgba(0,0,0,.35)}
.is-scroll .cb-cloth::before{left:.74em}
.is-scroll .cb-cloth::after{right:.74em}
.cb-paper{display:flex;flex-direction:column;align-items:center;width:100%;padding:.5em 0 .38em;border-block:.17em solid #c9a35a;
  background:radial-gradient(ellipse at 30% 18%,rgba(255,255,255,.55),transparent 60%),radial-gradient(ellipse at 70% 88%,rgba(190,150,100,.2),transparent 55%),#f3e8d2;
  box-shadow:inset 0 0 .35em rgba(120,80,40,.24)}
.is-scroll .cb-text{font-family:"LD Yuji","Yu Mincho","Hiragino Mincho ProN","Noto Serif JP",serif;letter-spacing:.06em;color:#22130a}
.cb-seal{display:block;width:.4em;height:.4em;margin-top:.42em;border-radius:.05em;background:#b23a2b;box-shadow:inset 0 0 0 .05em #f3e8d2,inset 0 0 0 .085em #b23a2b;opacity:.88}
.is-scroll .cb-roll{width:2.8em;height:.34em;margin-top:-.05em;border-radius:.17em;background:linear-gradient(#6d4729,#3a2414 55%,#1e1109)}
.is-scroll .cb-roll::before,.is-scroll .cb-roll::after{content:"";position:absolute;top:-.05em;width:.24em;height:.44em;border-radius:.08em;background:linear-gradient(#f2e6c8,#bb9c6a 60%,#86683f)}
.is-scroll .cb-roll::before{left:-.21em}
.is-scroll .cb-roll::after{right:-.21em}
/* Yamiko's old Avilon scroll: faded, a little smaller and lower, behind her Northorn banner */
.cb.is-old{font-size:calc(var(--cb) * .86);margin:.8em -.3em 0 0}
.cb.is-old .cb-in{filter:sepia(.55) saturate(.7) brightness(.66) drop-shadow(0 .2em .3em rgba(0,0,0,.55))}
/* Northorn: the banner */
.cb.is-north{z-index:1;--cb-cord:#a08070;--cb-nail:#d0a68e}
.is-north .cb-in{filter:drop-shadow(0 .25em .35em rgba(0,0,0,.6))}
.is-north .cb-rod{width:2.62em;height:.17em;border-radius:.085em;background:linear-gradient(#77606b,#2e2228 55%,#140d11)}
.is-north .cb-rod::before,.is-north .cb-rod::after{content:"";position:absolute;top:50%;width:.3em;height:.3em;margin-top:-.15em;rotate:45deg;background:linear-gradient(135deg,#ecc9a8,#8c6650 70%)}
.is-north .cb-rod::before{left:-.25em}
.is-north .cb-rod::after{right:-.25em}
.is-north .cb-cloth{--hem:.85em;width:2.3em;padding:.55em 0 1.3em;
  clip-path:polygon(0 0,100% 0,100% calc(100% - var(--hem)),50% 100%,0 calc(100% - var(--hem)));
  background:linear-gradient(90deg,rgba(0,0,0,.38),transparent 22%,rgba(255,190,210,.06) 50%,transparent 78%,rgba(0,0,0,.4)),linear-gradient(#4f1122,#2d0913 62%,#1d050c)}
.is-north .cb-cloth::before,.is-north .cb-cloth::after{content:"";position:absolute;clip-path:inherit}
.is-north .cb-cloth::before{inset:.16em;background:rgba(230,168,150,.6)}
.is-north .cb-cloth::after{inset:calc(.16em + 1.2px);background:linear-gradient(90deg,rgba(0,0,0,.3),transparent 25%,rgba(255,190,210,.05) 50%,transparent 75%,rgba(0,0,0,.32)),linear-gradient(#4b1020,#2b0812 62%,#1c050b)}
.is-north .cb-cloth>*{position:relative;z-index:1}
.cb-mark{display:block;width:.5em;height:.5em;margin-bottom:.36em;color:#f0a9bf;filter:drop-shadow(0 0 .18em rgba(255,122,165,.75))}
.is-north .cb-text{font-family:"LD Runic","Noto Sans Runic","Segoe UI Historic",sans-serif;font-size:.74em;letter-spacing:-.4em;color:#f6c4d1;text-shadow:0 0 .4em rgba(224,112,143,.8)}
.cb-tassel{position:relative;display:block;width:.32em;height:1.12em;margin:-.1em auto 0}   /* under the point, unrolled last */
.cb-tassel::before{content:"";position:absolute;left:50%;top:0;width:1px;height:.42em;margin-left:-.5px;background:#d0a68e}
.cb-tassel::after{content:"";position:absolute;left:0;right:0;top:.38em;bottom:0;border-radius:40% 40% 18% 18%/28% 28% 12% 12%;background:repeating-linear-gradient(90deg,#7e1729 0 .045em,#b3233b .045em .09em);box-shadow:inset 0 .07em 0 #d6a27c}
.is-north .cb-roll{width:2.42em;height:.36em;margin-top:-.36em;border-radius:.18em;background:linear-gradient(#5e1828,#300a14 55%,#1b050b);opacity:0}
.cs-room{display:none}

/* ---------- Nations, count ----------
   The switch between the nations stands in the bottom-right corner, in the darkened band at the foot of the picture
   (the owner's wish: at the top it was hard to see). On wide screens it is level with the character strip, the count
   above it; where the strip would reach it, it stands just above the frosted floor, again with the count above it. */
.cast-nations{position:absolute;z-index:1;right:clamp(20px,4vw,64px);bottom:calc(clamp(110px,15vh,150px) + 4px);display:flex;align-items:center;gap:1rem}
.cast-nations button{display:grid;justify-items:end;gap:.25rem;padding:.4rem .2rem;background:none;border:0;cursor:pointer;color:var(--c-dim)}
.cast-nations button:last-child{justify-items:start}
.cast-nations button span{font:600 .8rem/1 var(--display);letter-spacing:.3em;text-transform:uppercase}
.cast-nations button small{font:italic 400 .9rem/1 var(--display);letter-spacing:.04em}
.cast-nations button[aria-pressed="true"]{color:var(--c-accent)}
.cast-nations button:hover{color:var(--c-text)}
.cast-nations>span svg{width:26px;height:26px;color:var(--c-accent);animation:ld-spin 40s linear infinite}
body[data-nation="dark"] .cast-nations,body[data-nation="dark"] .cast-count{text-shadow:0 1px 8px rgba(0,0,0,.8)}
body[data-nation="light"] .cast-nations,body[data-nation="light"] .cast-count{text-shadow:0 1px 10px rgba(255,250,240,.9)}
.cast-count{position:absolute;right:clamp(20px,4vw,64px);bottom:calc(clamp(110px,15vh,150px) + 62px);margin:0;font:500 .9rem/1 var(--display);letter-spacing:.2em;color:var(--c-dim)}
.cast-count b{font-size:1.9rem;font-weight:500;color:var(--c-text)}
@media (min-width:1760px){
  .cast-nations{bottom:calc(clamp(16px,3.4vh,34px) + 9px)}
  .cast-count{bottom:clamp(118px,16.5vh,164px)}
}

/* ---------- Name strip ---------- */
.cast-floor{position:absolute;left:0;right:0;bottom:0;height:clamp(110px,15vh,150px);pointer-events:none;backdrop-filter:blur(14px) saturate(.9);-webkit-backdrop-filter:blur(14px) saturate(.9);background:linear-gradient(180deg,color-mix(in srgb,var(--c-page) 35%,transparent),color-mix(in srgb,var(--c-page) 88%,transparent));-webkit-mask-image:linear-gradient(180deg,transparent,#000 28%);mask-image:linear-gradient(180deg,transparent,#000 28%)}
.cast-strip{--nw:clamp(132px,12vw,186px);position:absolute;left:0;right:0;bottom:clamp(16px,3.4vh,34px);display:flex;align-items:center;justify-content:center;gap:1.2rem}
.cs-view{position:relative;flex:none;width:calc(var(--nw) * 5 + 5px);overflow:hidden;padding:.9rem 0 1.2rem;mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);-webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)}
.cs-view::before,.cs-view::after{content:"";position:absolute;left:0;right:0;height:1px;background:var(--c-line)}
.cs-view::before{top:0}
.cs-view::after{bottom:0}
.cs-list{display:flex;width:max-content;margin:0;padding:0;list-style:none;will-change:transform}
.cs-list li{position:relative;display:flex;align-items:center}
.cs-list li+li::before{content:"";width:1px;height:16px;background:var(--c-line)}
.cs-list li.is-border::before{width:4px;height:24px;background:none;border-left:1px solid var(--c-line);border-right:1px solid var(--c-line)}
/* each name has at least the strip's width (--nw); a longer one (Harunobu, Mordrath, Mordveyn on smaller screens) widens
   its own place, with room at each side, instead of running into the next name */
.cs-name{position:relative;display:block;min-width:var(--nw);padding:.35rem .8em;background:none;border:0;font:500 clamp(.92rem,1.05vw,1.08rem)/1 var(--display);letter-spacing:.24em;text-transform:uppercase;color:var(--c-dim);cursor:pointer;white-space:nowrap}
.cs-name::after{content:"";position:absolute;left:18%;right:18%;bottom:-.65rem;height:1px;background:linear-gradient(90deg,transparent,var(--c-gem),transparent);opacity:0;transform:scaleX(.3);transition:opacity .5s,transform .7s var(--ease-out)}
.cs-name:hover{color:var(--c-text)}
.cs-name[aria-current="true"]{color:var(--c-accent);text-shadow:0 0 14px color-mix(in srgb,var(--c-gem) 50%,transparent)}
.cs-name[aria-current="true"]::after{opacity:1;transform:none;box-shadow:0 0 8px var(--c-gem)}
body[data-nation="light"] .cs-name:not([aria-current="true"]){color:#4a3726}
body[data-nation="light"] .cs-name[aria-current="true"]{color:#8a5718;text-shadow:0 0 12px rgba(255,236,200,.9)}
.cs-arrow{display:grid;place-items:center;flex:none;width:44px;height:52px;padding:0;background:none;border:0;color:var(--c-text);cursor:pointer;opacity:.75;transition:opacity .3s,transform .4s var(--ease-out)}
.cs-arrow svg{width:14px;height:26px;fill:none;stroke:currentColor;stroke-width:1.4}
.cs-arrow:hover{opacity:1}
.cs-prev:hover{transform:translateX(-3px)}
.cs-next:hover{transform:translateX(3px)}
.cast-noscript{padding:30vh 2rem;text-align:center}

/* Light-nation header tone is handled by ld.css through data-tone. */
@media (max-width:1100px){
  .cast-panel{width:min(470px,48vw);left:clamp(70px,9vw,150px)}
  .cast{--pr:calc(clamp(70px,9vw,150px) + min(470px,48vw))}
}
@media (max-width:860px){
  .cast{height:auto;min-height:0;overflow:visible;padding-bottom:110px}
  .cast-art{position:relative;height:58svh;inset:auto;overflow:hidden}   /* the frame's overhang neither shows below the picture, under the text, nor widens the page */
  .cast .cast-frame{left:-12px;width:auto}   /* the text is below the picture: the frame spans the full width */
  body.ld .cast-frame img{object-position:var(--pos-m,68% 20%)}
  .cast-shade{inset:0 0 auto;height:58svh}
  .cast-shade::before{background:linear-gradient(0deg,var(--c-page) 0%,rgba(13,8,12,.97) 27%,rgba(13,8,12,.4) 37%,rgba(13,8,12,0) 48%),linear-gradient(180deg,rgba(10,6,9,.7),transparent 25%)}
  .cast-shade::after{background:linear-gradient(0deg,var(--c-page) 0%,rgba(250,242,228,.97) 27%,rgba(250,242,228,.4) 37%,rgba(250,242,228,0) 48%),linear-gradient(180deg,rgba(248,240,226,.38),transparent 25%)}
  .cast-panel{position:relative;left:auto;top:auto;bottom:auto;width:auto;margin:-14svh 18px 0;z-index:1}
  .cast-orn{height:2.3rem;opacity:.8}
  .cast-body{max-height:none;overflow:visible;mask-image:none;-webkit-mask-image:none}
  .cast-count{display:none}
  .cast-nations{display:none}
  .cast-banners{right:18px;--cb:25px}   /* beside the name (top set by cast.js); the text below flows around them */
  .cast-panel.has-banner .cast-epithet{margin-right:var(--cs-gutter)}
  .cast-panel.has-banner .cast-div{max-width:calc(100% - var(--cs-gutter))}
  .cast-panel.has-banner .cs-room{display:block;float:right;width:var(--cs-gutter);height:var(--cs-room,0px)}
  .cast-floor{display:none}
  .cast-flora{display:none}
  .cast-body{height:auto}
  .cs-view{flex:1;width:auto}
  .cast-strip{position:fixed;left:0;right:0;bottom:0;width:auto;margin:0;padding:.3rem .4rem;gap:.2rem;background:color-mix(in srgb,var(--c-page) 92%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);z-index:20}
  .cs-name{min-width:120px;font-size:.84rem;letter-spacing:.16em}
  .facts{grid-template-columns:1fr 1fr}
}

/* The showcase is the whole page: nothing below it, no page scroll on desktop */
@media (min-width:861px){
  html:has(body.ld-cast),body.ld-cast{height:100%;overflow:hidden;overscroll-behavior:none}
}
.cast-legal{position:absolute;z-index:6;left:50%;bottom:6px;translate:-50% 0;margin:0;white-space:nowrap;font:500 .66rem/1 var(--display);letter-spacing:.14em;color:var(--c-dim);opacity:.7;pointer-events:none}
@media (max-width:860px){.cast-legal{position:static;translate:none;margin:2rem 18px 1rem;white-space:normal;text-align:center}}
/* Dark red climbing roses in the bottom-left corner for the Dark Nation (drawn by cast-roses.js). They stand above the
   frosted floor so they stay sharp, under the character strip; hidden on phones, as the sakura is. */
.cast-roses{position:absolute;left:0;bottom:0;height:min(80vh,760px);aspect-ratio:400/720;pointer-events:none;opacity:0;transition:opacity .22s ease}
.cast-roses canvas{display:block;width:100%;height:100%;transform-origin:0 100%;animation:fl-rose-sway 11s ease-in-out infinite alternate}
body[data-nation="dark"] .cast-roses{opacity:1;transition:opacity .5s ease .15s}
body[data-nation="dark"] .cast-roses.is-swapping{opacity:0;transition:opacity .22s ease}
@keyframes fl-rose-sway{to{transform:rotate(.6deg)}}
.cast-roses.is-cramped{visibility:hidden}
@media (max-width:860px){.cast-roses{display:none}}
.cast-roses[hidden]{display:none}
/* Dark Nation: the owner's painted roses ("Gothic Crimson Rose Vine Flourish") in the bottom-left corner, about the size
   of the roses drawn before. cast-rose-art.js sizes them so no painted part reaches the text, the emblem beside the name
   or the strip's left arrow (the values here are only its fallback). Above the frosted floor so they stay sharp, under
   the character strip. They grow in from the bottom (a soft edge rising through the mask) when the page turns to a Dark
   Nation character, and fade for the Light Nation. Hidden on phones, as the sakura is. */
body.ld .fl-roses{position:absolute;left:-38px;bottom:0;width:250px;height:375px;max-width:none;pointer-events:none;opacity:0;transform-origin:0 100%;
  -webkit-mask-image:linear-gradient(0deg,#000 45%,transparent 55%);mask-image:linear-gradient(0deg,#000 45%,transparent 55%);
  -webkit-mask-size:100% 220%;mask-size:100% 220%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:0 0;mask-position:0 0;
  transition:opacity 1.2s ease,-webkit-mask-position 0s linear 1.2s,mask-position 0s linear 1.2s;
  animation:fl-rose-sway 12s ease-in-out infinite alternate}
body.ld[data-nation="dark"] .fl-roses{opacity:1;-webkit-mask-position:0 100%;mask-position:0 100%;
  transition:opacity .9s ease,-webkit-mask-position 2.8s cubic-bezier(.3,.6,.25,1),mask-position 2.8s cubic-bezier(.3,.6,.25,1)}
body.ld .fl-roses.is-cramped{visibility:hidden}
@media (max-width:860px){body.ld .fl-roses{display:none}}
/* Light Nation: the cherry branch drawn by cast-sakura.js in the top-left corner (it sizes itself to keep clear of the
   text and the menu). It replaces the sakura picture (.fl-sakura above, no longer on the page). */
.cast-sakura{position:absolute;left:0;top:0;width:680px;height:360px;pointer-events:none;opacity:0;transition:opacity .22s ease}
body[data-nation="light"] .cast-sakura{opacity:1;transition:opacity .5s ease .15s}
body[data-nation="light"] .cast-sakura.is-swapping{opacity:0;transition:opacity .22s ease}
.cast-sakura.is-cramped{visibility:hidden}
/* The header's pale band (Light Nation) would wash out the cherry branch along the top: on this page it clears the
   stretch the branch reaches (--sakura-reach, set by cast-sakura.js) and still backs the menu beyond it. */
body.ld-cast .ld-head[data-tone="light"]::before{
  -webkit-mask-image:linear-gradient(90deg,transparent 0,transparent var(--sakura-reach,0px),#000 calc(var(--sakura-reach,0px) + 60px));
  mask-image:linear-gradient(90deg,transparent 0,transparent var(--sakura-reach,0px),#000 calc(var(--sakura-reach,0px) + 60px))}
body[data-nation="light"] .cast-orn{opacity:1}
