/* The scroll of learning (tech tree): a painted handscroll unrolled one age at a time. Four brush-stroke tabs hang above it; the paper shows that age's whole
   tree (lacquer crests on daubs of paper, brush lines between them, a torii at the end that leads to the next age); a hanging scroll for the selected
   technique, a lacquer tray for the study queue, the study crest in the HUD, and the herald of a new age.
   States come from data-st (done | active | queued | open | locked | barred | obsolete) written by view/ui/screens/research.js; geometry from CSS variables it
   sets on .paper; the tint and the picture of the paper from data-era on the screen. Nothing here is a rectangle with a border. */
.screen.research { z-index: 30; display: flex; flex-direction: column; place-items: stretch; padding: 12px 20px 10px; box-sizing: border-box; gap: 10px; color: var(--paper-text);
  --era: #4d8566; --era-hi: #a9dbb9; --paper-a: #e9e6d2; --paper-b: #cfd3b6; --rule: rgba(29, 59, 51, .2);
  background: radial-gradient(ellipse at 42% 38%, rgba(34, 24, 18, .93), rgba(9, 6, 5, .975)); }
.screen.research[data-era="2"] { --era: #5f7396; --era-hi: #b9c8ea; --paper-a: #eee8d8; --paper-b: #d3ccba; --rule: rgba(32, 36, 44, .2); }
.screen.research[data-era="3"] { --era: #b8452f; --era-hi: #f3a48d; --paper-a: #efdfc8; --paper-b: #dabb9c; --rule: rgba(92, 30, 18, .22); }
.screen.research[data-era="4"] { --era: #c9a24a; --era-hi: #f6e0a0; --paper-a: #e4c981; --paper-b: #c3a055; --rule: rgba(92, 60, 14, .26); }
.research .rfx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.research .relseal { display: grid; place-items: center; color: #fbeee0; border-radius: 4px 5px 3px 6px; line-height: 1;
  -webkit-mask: url("img/seal-grain.svg") center / cover; mask: url("img/seal-grain.svg") center / cover; }

/* ---------------------------------------------------------------------------------------------- header: title, the four ages as tabs, the purse */
.rhead { display: flex; align-items: center; gap: 22px; height: 64px; flex: none; }
.rtitle { display: flex; align-items: center; gap: 14px; flex: none; }
.rtitle h2 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.rtitle p { margin: 2px 0 0; font-size: 12.5px; color: var(--paper-dim); white-space: nowrap; }
.screen.research.shown .rtitle { animation: rise .7s var(--ease-ink) backwards; }
.eratabs { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: clamp(2px, 1.4vw, 22px); min-width: 0; align-self: stretch; padding-bottom: 2px; }
.eratab { --tc: #4d8566; position: relative; z-index: 0; display: flex; align-items: center; gap: 10px; padding: 7px 26px 9px 10px; text-align: left; min-width: 0;
  transition: transform .25s var(--ease-ink), filter .3s; }
.eratab[data-tab="2"] { --tc: #5f7396; } .eratab[data-tab="3"] { --tc: #b8452f; } .eratab[data-tab="4"] { --tc: #b89238; }
.screen.research.shown .eratab { animation: rise .6s var(--ease-ink) backwards; animation-delay: var(--d); }
/* the tab itself is one stroke of the brush: pale and dry when closed, loaded with the age's colour when its scroll is unrolled */
.eratab::before { content: ""; position: absolute; z-index: -1; inset: -1px -4px; background: rgba(243, 232, 210, .085); transition: background .35s, transform .35s var(--ease-ink);
  -webkit-mask: var(--ink) center / 100% 100% no-repeat; mask: var(--ink) center / 100% 100% no-repeat; }
.eratab:hover::before { background: rgba(243, 232, 210, .16); }
.eratab.on::before { background: linear-gradient(100deg, var(--tc), color-mix(in srgb, var(--tc) 62%, #120d0b)); transform: scale(1.03, 1.12); }
.eratab.on { transform: translateY(2px); }
/* a cord and a bead tie the open tab to its scroll */
.eratab::after { content: ""; position: absolute; left: 50%; bottom: -13px; width: 9px; height: 15px; margin-left: -4.5px; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .35s var(--ease-ink);
  background: radial-gradient(circle at 50% 72%, var(--kin-hi) 0 3.4px, transparent 3.9px), linear-gradient(90deg, transparent 3.5px, var(--kin-lo) 3.5px 5.5px, transparent 5.5px); }
.eratab.on::after { opacity: 1; transform: none; }
.emon { position: relative; width: 42px; height: 42px; border-radius: 50% 47% 52% 48% / 48% 52% 47% 51%; display: grid; place-items: center; flex: none; color: var(--paper-dim);
  background: radial-gradient(circle at 35% 30%, #3d2e25, #120d0b 70%); box-shadow: 0 0 0 1.5px rgba(201, 162, 74, .4), 0 4px 10px rgba(0, 0, 0, .5); transition: transform .25s var(--ease-ink), box-shadow .3s, color .3s; }
.emon .kanji { font-size: 22px; }
.emon svg, .mon svg, .qmon svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.emon circle, .mon circle, .qmon circle { fill: none; stroke: var(--kin-hi); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: calc(var(--p, 0) * 113.1px) 113.1px; transition: stroke-dasharray .25s linear; filter: drop-shadow(0 0 3px rgba(236, 208, 138, .8)); }
.ename { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ename b { font-size: 14.5px; font-weight: 800; letter-spacing: .03em; color: var(--paper-dim); white-space: nowrap; transition: color .3s; }
.ename i { font-style: normal; font-size: 11px; color: rgba(243, 232, 210, .42); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ecount { position: absolute; left: 30px; bottom: 1px; padding: 1px 6px 2px; border-radius: 9px; font-style: normal; font-size: 9.5px; font-weight: 800; line-height: 1.1; color: var(--paper-text); background: rgba(18, 13, 11, .9); box-shadow: 0 0 0 1px rgba(201, 162, 74, .45); font-variant-numeric: tabular-nums; white-space: nowrap; }
.elock { position: absolute; left: 2px; top: 0; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: var(--paper-text); background: #4a4039; box-shadow: 0 0 0 1.5px var(--sumi); transition: transform .3s var(--ease-ink), opacity .3s; }
.eratab:hover .emon { transform: scale(1.08) rotate(-6deg); }
.eratab.on .ename b { color: #fff8e6; } .eratab.on .ename i { color: rgba(255, 248, 230, .78); }
.eratab[data-st="past"] .emon, .eratab[data-st="now"] .emon { color: #fbeee0; background: radial-gradient(circle at 35% 30%, #d8503e, var(--shu) 55%, var(--shu-deep)); box-shadow: inset 0 0 0 2px rgba(255, 230, 210, .3), 0 4px 10px rgba(0, 0, 0, .5); }
.eratab[data-st="past"] .ename b, .eratab[data-st="now"] .ename b { color: var(--paper-text); }
.eratab[data-st="now"] .emon { box-shadow: inset 0 0 0 2px rgba(255, 230, 210, .3), 0 0 0 2px var(--kin-hi), 0 0 18px rgba(236, 208, 138, .55); }
.eratab[data-st="past"] .elock, .eratab[data-st="now"] .elock { opacity: 0; transform: scale(.3); }
.eratab[data-st="coming"] .emon { color: var(--kin-hi); animation: breathe 2.2s ease-in-out infinite; }
.eratab[data-st="coming"] .elock { background: var(--kin-lo); }
.eratab[data-st="veiled"]:not(.on) { filter: saturate(.5); }
.eratab.stamped .emon { animation: stamp .62s cubic-bezier(.2, 1.5, .4, 1) both; }
.rpurse { display: flex; align-items: baseline; gap: 8px; font-size: 19px; flex: none; }
.rpurse .icon { width: 22px; height: 22px; color: var(--kin-hi); align-self: center; filter: drop-shadow(0 0 4px rgba(236, 208, 138, .35)); }
.rpurse b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2.6em; }
.rpurse i { font-style: normal; font-size: 12.5px; color: var(--matsuba); filter: brightness(1.5); font-variant-numeric: tabular-nums; }
.rhead .crest.close { flex: none; }

/* ---------------------------------------------------------------------------------------------- the handscroll: two rollers, torn paper, the age's picture */
.rbody { flex: 1; min-height: 0; display: flex; gap: 20px; align-items: stretch; }
.emaki { position: relative; flex: 1; min-width: 0; display: flex; align-items: stretch; --dir: 1; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .55)); }
.jiku { position: relative; z-index: 2; flex: none; width: 20px; margin: -7px 0; border-radius: 10px;
  background: linear-gradient(90deg, #170d08, #5d3a25 30%, #8a5d3d 48%, #4a2b1a 72%, #130a06); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45), 0 0 12px rgba(0, 0, 0, .5); }
.jiku::before, .jiku::after { content: ""; position: absolute; left: -4px; width: 28px; height: 15px; border-radius: 7px; background: linear-gradient(90deg, var(--kin-lo), var(--kin-hi) 45%, var(--kin-lo)); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.jiku::before { top: -5px; } .jiku::after { bottom: -5px; }
.jiku i { position: absolute; top: 12px; bottom: 12px; width: 11px; border-radius: 5px; background: linear-gradient(90deg, rgba(0, 0, 0, .34), var(--paper-b) 40%, var(--paper-a) 70%, rgba(0, 0, 0, .25)); transition: background .6s; }   /* the paper still wound on the roller */
.jiku.l i { right: -8px; } .jiku.r i { left: -8px; }
.paper { position: relative; flex: 1; min-width: 0; margin: 0 -2px; }
.paper .sheet { position: absolute; inset: 0; background: url("img/washi.svg") 0 0 / 260px, radial-gradient(120% 90% at 30% 10%, var(--paper-a), var(--paper-b) 85%);
  -webkit-mask: var(--shape) 0 0 / 100% 100% no-repeat; mask: var(--shape) 0 0 / 100% 100% no-repeat; }
.paper .sheet::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(40, 22, 6, .2), transparent 4%, transparent 96%, rgba(40, 22, 6, .2)), linear-gradient(180deg, rgba(40, 22, 6, .12), transparent 7%, transparent 93%, rgba(40, 22, 6, .14)); }
.paper .motif { position: absolute; inset: 8px 4px; background: center / 100% 100% no-repeat; pointer-events: none; }
.paper .wm { position: absolute; right: calc(var(--gr) + 3%); bottom: 4%; writing-mode: vertical-rl; font-size: clamp(90px, 19vh, 210px); letter-spacing: .04em; color: var(--rule); opacity: .5; pointer-events: none; user-select: none; }
.emaki.rolling .sheet { animation: paper-roll .8s var(--ease-ink) both; }
.emaki.rolling .motif, .emaki.rolling .wm { animation: ink-set 1.1s var(--ease-ink) both; }
.emaki.rolling .jiku { animation: jiku-turn .8s var(--ease-ink) both; }
.emaki.rolling .fold { animation: unroll .7s var(--ease-ink) both; }
@keyframes paper-roll { from { filter: brightness(.72) saturate(.7); } }
@keyframes ink-set { from { opacity: 0; filter: blur(4px); } }
@keyframes jiku-turn { 0% { filter: brightness(1.7); transform: scaleX(1.25); } 100% { filter: none; transform: none; } }
@keyframes unroll { from { opacity: 0; transform: translateX(calc(var(--dir) * 46px)); clip-path: inset(0 calc(50% - var(--dir) * 50%) 0 calc(50% + var(--dir) * 50%)); } to { opacity: 1; transform: none; clip-path: inset(-20px); } }

/* the six bands of knowledge: a seal and a name in the margin, a pale wash of ink across the paper under every other one */
.band { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; }
.band::before { content: ""; position: absolute; left: calc(var(--g) * .55); right: 8px; top: 5%; height: 90%; background: var(--rule); opacity: 0;
  -webkit-mask: var(--wash) 0 0 / 100% 100% no-repeat; mask: var(--wash) 0 0 / 100% 100% no-repeat; }
.band[data-band="0"]::before, .band[data-band="2"]::before, .band[data-band="4"]::before { opacity: .42; }
.band[data-band="1"]::before, .band[data-band="3"]::before, .band[data-band="5"]::before { opacity: .16; transform: scaleX(-1); }
.band .seal { position: absolute; left: 16px; top: 50%; transform: translateY(-50%) rotate(-5deg); --s: 34px; pointer-events: auto; }
.band:nth-child(even) .seal { transform: translateY(-50%) rotate(4deg); }
.band b { position: absolute; left: 58px; top: 50%; transform: translateY(-50%); width: calc(var(--g) - 64px); font-size: 12px; font-weight: 800; line-height: 1.18; color: rgba(42, 26, 12, .84); letter-spacing: .02em; }
.paper.tight .band b { display: none; } .paper.tight .band .seal { left: 12px; }

.fold { position: absolute; inset: 0; }
.fold[hidden] { display: none; }
/* brush lines: ink roughened by a filter (so no line is ruled), drawn from root to branch each time the paper is unrolled */
.links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.links path { fill: none; stroke-linecap: round; }
.lbase { stroke: rgba(36, 22, 10, .46); stroke-width: 2.2; stroke-dasharray: .05 .08; transition: stroke .4s, stroke-width .3s, opacity .4s; animation: line-fade .7s ease backwards; animation-delay: var(--ld); }
.lbase.any { stroke-dasharray: .02 .05; }
.lbase[data-st="near"] { stroke-dasharray: 1; stroke: rgba(36, 22, 10, .66); stroke-width: 2.6; animation-name: line-in; animation-duration: .9s; animation-timing-function: var(--ease-ink); }
.lbase[data-st="live"] { stroke-dasharray: 1; stroke: rgba(32, 20, 10, .88); stroke-width: 3; animation-name: line-in; animation-duration: .9s; animation-timing-function: var(--ease-ink); }
.lbase[data-st="done"] { stroke-dasharray: 1; stroke: var(--shu-deep); stroke-width: 3.4; animation-name: line-draw; animation-duration: .9s; animation-timing-function: var(--ease-ink); }
.lbase[data-st="dead"] { opacity: .2; }
.lbase.trace { stroke: #fff6d6; stroke-width: 4.6; }
.lbase.rival { stroke: var(--shu-deep); stroke-width: 2; stroke-dasharray: .035 .06; opacity: .75; }
.lbase.rival[data-st="chosen"] { opacity: .25; }
.lflow { stroke: none; }
.lflow[data-st="live"] { stroke: var(--kin-hi); stroke-width: 2; stroke-dasharray: .2 .8; animation: ink-flow 1.5s linear infinite; filter: drop-shadow(0 0 2px rgba(255, 240, 190, .9)); }
@keyframes ink-flow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes line-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes line-draw { from { stroke-dashoffset: 1; stroke: #fff2c8; } to { stroke-dashoffset: 0; } }
@keyframes line-fade { from { opacity: 0; } }

/* ---------------------------------------------------------------------------------------------- a technique: a lacquer crest on a daub of paper */
.tech { position: absolute; z-index: 3; width: var(--pw); height: var(--ph); text-align: left; filter: drop-shadow(0 2px 3px rgba(30, 16, 0, .4)); transition: transform .18s var(--ease-ink), opacity .25s, filter .25s;
  animation: crest-in .55s var(--ease-ink) backwards; animation-delay: var(--d); }
@keyframes crest-in { from { opacity: 0; transform: translateX(-14px) scale(.86); } }
.tech .daub { position: absolute; inset: 0 0 0 calc(var(--md) * -.12); box-sizing: border-box; padding: 0 14px 1px calc(var(--md) * .8); display: flex; flex-direction: column; justify-content: center; gap: 2.5px; color: var(--washi-ink); overflow: hidden;
  background: url("img/washi.svg") 0 0 / 200px, linear-gradient(180deg, #fcf5e2, #ecdcb8);
  -webkit-mask: var(--sv) 0 0 / 100% 100% no-repeat; mask: var(--sv) 0 0 / 100% 100% no-repeat; transition: background .3s; }
.tech .daub b { font-size: 12.5px; font-weight: 800; line-height: 1.12; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tech .sub { font-style: normal; display: flex; align-items: center; gap: 7px; font-size: 10.5px; line-height: 1; white-space: nowrap; min-width: 0; }
.tech .cost { display: inline-flex; align-items: center; gap: 3px; flex: none; font-weight: 700; color: var(--kin-lo); font-variant-numeric: tabular-nums; }
.tech .cost .icon { width: 10px; height: 10px; }
.tech .rel { display: inline-flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: #33477a; cursor: pointer; border-radius: 3px; transition: color .2s; }
.tech .rel em { font-style: normal; font-size: 10.5px; flex: none; }
.tech[data-rel="replace"] .rel { color: var(--shu-deep); }
.tech .rel:hover { text-decoration: underline; text-underline-offset: 2px; }
.tech .daub u { position: absolute; left: 0; bottom: 0; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, rgba(201, 162, 74, 0), rgba(201, 162, 74, .42)); border-right: 2px solid var(--kin); opacity: 0; mix-blend-mode: multiply; pointer-events: none; }
.paper.tight .tech .daub b { font-size: 11px; } .paper.tight .tech .cost { display: none; }
.tech .mon { position: absolute; left: calc(var(--md) * -.5); top: 50%; width: var(--md); height: var(--md); margin-top: calc(var(--md) * -.5); border-radius: 50% 47% 52% 48% / 48% 52% 47% 51%; display: grid; place-items: center; color: var(--paper-text);
  background: radial-gradient(circle at 35% 28%, #4a382c, #140e0b 66%); box-shadow: 0 0 0 1.5px var(--kin-lo), 0 0 0 3.5px rgba(18, 13, 11, .92), 0 3px 8px rgba(0, 0, 0, .45); transition: transform .22s var(--ease-ink), box-shadow .3s, background .3s, color .3s; }
.tech .mon .kanji { font-size: calc(var(--md) * .5); transform: translateY(1px); }
/* what it is to the past: a small square seal on the crest's shoulder (改 improves, 替 replaces) */
.tech .relseal { position: absolute; left: calc(var(--md) * -.66); top: calc(50% - var(--md) * .64); z-index: 2; width: 17px; height: 17px; font-size: 11px; background: var(--ai); transform: rotate(-9deg); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); transition: transform .25s var(--ease-ink); }
.tech[data-rel="replace"] .relseal { background: var(--shu); transform: rotate(7deg); }
.tech:hover .relseal { transform: rotate(0) scale(1.18); }
/* what it rests on in an earlier age: little crests hanging from it, each a way back to that scroll */
.tech .roots { position: absolute; left: calc(var(--md) * -.6); top: calc(50% + var(--md) * .24); z-index: 2; display: flex; gap: 2px; }
.tech .root { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: rgba(243, 232, 210, .8); background: #2e241e; box-shadow: 0 0 0 1px var(--kin-lo), 0 1px 3px rgba(0, 0, 0, .5); cursor: pointer; transition: transform .2s var(--ease-ink), background .3s; }
.tech .root[data-ok="true"] { color: #fbeee0; background: var(--shu); box-shadow: 0 0 0 1px rgba(255, 230, 210, .5), 0 1px 3px rgba(0, 0, 0, .5); }
.tech .root:hover { transform: scale(1.3) translateY(1px); }
.tech .qn { position: absolute; right: 2px; top: -8px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--ai); box-shadow: 0 0 0 1.5px var(--washi), 0 2px 4px rgba(0, 0, 0, .4); }
.tech .qn:empty { display: none; }
.tech:hover, .tech.hov { transform: translateY(-2px) scale(1.04); z-index: 5; }
.tech:hover .mon { transform: rotate(-8deg) scale(1.08); }
.tech:active { transform: scale(.98); }
.tech:focus-visible, .gate:focus-visible, .eratab:focus-visible { outline: none; }
.tech.sel .mon { box-shadow: 0 0 0 2px #fff6d8, 0 0 0 4.5px rgba(18, 13, 11, .92), 0 0 0 6px var(--kin-hi), 0 0 16px rgba(255, 240, 190, .8); }
.tech.sel .daub { background: url("img/washi.svg") 0 0 / 200px, linear-gradient(180deg, #fffdf4, #f6ebcc); }
.paper.tracing .tech:not(.trace):not(:hover) { opacity: .62; }
.paper.tracing .tech.trace { filter: drop-shadow(0 3px 4px rgba(30, 16, 0, .45)) drop-shadow(0 0 5px rgba(255, 244, 200, .7)); }

/* sealed: prerequisites or the age are missing */
.tech[data-st="locked"] .daub { background: url("img/washi.svg") 0 0 / 200px, linear-gradient(180deg, #d9cba8, #c4b28c); color: rgba(42, 31, 24, .78); }
.tech[data-st="locked"] .cost { color: rgba(42, 31, 24, .55); }
.tech[data-st="locked"] .mon { color: rgba(243, 232, 210, .45); background: radial-gradient(circle at 35% 28%, #3a332d, #171310 66%); box-shadow: 0 0 0 1.5px rgba(90, 80, 66, .8), 0 0 0 3.5px rgba(18, 13, 11, .9), 0 3px 8px rgba(0, 0, 0, .4); }
/* open: gold rim that breathes; red price when the treasury is short */
.tech[data-st="open"] .mon { color: var(--kin-hi); box-shadow: 0 0 0 2px var(--kin-hi), 0 0 0 4px rgba(18, 13, 11, .92), 0 0 12px rgba(255, 236, 170, .75); animation: breathe 2.4s ease-in-out infinite; }
.tech[data-st="open"].poor .mon { animation: none; box-shadow: 0 0 0 2px var(--kin), 0 0 0 4px rgba(18, 13, 11, .92); color: var(--washi-2); }
.tech[data-st="open"].poor .cost { color: var(--shu-deep); }
@keyframes breathe { 50% { filter: brightness(1.28) drop-shadow(0 0 5px rgba(255, 236, 170, .8)); } }
/* queued and in study */
.tech[data-st="queued"] .mon, .tech[data-st="active"] .mon { color: var(--kin-hi); box-shadow: 0 0 0 1.5px var(--kin), 0 0 0 3.5px rgba(18, 13, 11, .92), 0 0 14px rgba(236, 208, 138, .5); }
.tech[data-st="queued"] .daub { background: url("img/washi.svg") 0 0 / 200px, linear-gradient(180deg, #e9ebf2, #cfd6e6); }
.tech[data-st="active"] .daub u { opacity: 1; }
.tech[data-st="active"] .daub { background: url("img/washi.svg") 0 0 / 200px, linear-gradient(180deg, #fff6dc, #f1dfae); }
.tech[data-st="active"] .mon .kanji { animation: study-glow 1.6s ease-in-out infinite; }
@keyframes study-glow { 50% { text-shadow: 0 0 10px rgba(255, 220, 140, .95); color: #fff6d8; } }
/* mastered: the crest becomes a vermilion seal */
.tech[data-st="done"] .mon { color: #fbeee0; background: radial-gradient(circle at 35% 30%, #d8503e, var(--shu) 55%, var(--shu-deep)); box-shadow: inset 0 0 0 2px rgba(255, 230, 210, .32), 0 0 0 1.5px var(--shu-deep), 0 0 0 3.5px rgba(18, 13, 11, .9), 0 3px 8px rgba(0, 0, 0, .45); }
.tech[data-st="done"] .daub { background: url("img/washi.svg") 0 0 / 200px, linear-gradient(180deg, #f8ecd8, #eed6ba); }
.tech[data-st="done"] .cost { display: none; }
.tech[data-st="done"]:not([data-rel="upgrade"]):not([data-rel="replace"]) .sub::before { content: "済 mastered"; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--shu-deep); }
/* forsworn (the rival doctrine was chosen) and superseded (what replaces it is known): struck through with one dry stroke */
.tech[data-st="barred"], .tech[data-st="obsolete"] { filter: grayscale(.9) drop-shadow(0 2px 3px rgba(30, 16, 0, .35)); opacity: .56; }
.tech[data-st="barred"] .daub b, .tech[data-st="obsolete"] .daub b, .tech.superseded .daub b { text-decoration: line-through; text-decoration-color: var(--shu-deep); text-decoration-thickness: 1.5px; }
.tech[data-st="barred"] .daub::after, .tech[data-st="obsolete"] .daub::after { content: ""; position: absolute; left: 14%; right: 6%; top: 50%; height: 7px; margin-top: -3px; background: var(--shu-deep); opacity: .7; transform: rotate(-3deg); -webkit-mask: url("img/stroke.svg") 0 0 / 100% 100%; mask: url("img/stroke.svg") 0 0 / 100% 100%; }
.tech.superseded { opacity: .72; }
.tech.superseded .mon { filter: saturate(.45) brightness(.86); }
.tech.superseded .daub { background: url("img/washi.svg") 0 0 / 200px, linear-gradient(180deg, #e2d8c2, #cfc1a4); color: rgba(42, 31, 24, .7); }
.tech.superseded .sub::before { content: "替 superseded" !important; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: rgba(143, 34, 25, .8); }

/* moments */
.tech.stamped .mon, .gate.stamped .torii { animation: stamp .62s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes stamp { 0% { transform: scale(2.3) rotate(-22deg); opacity: 0; } 45% { transform: scale(.86) rotate(4deg); opacity: 1; } 70% { transform: scale(1.08) rotate(-2deg); } 100% { transform: none; } }
.tech.stamped .daub { animation: paper-jolt .5s ease-out .22s both; }
@keyframes paper-jolt { 0% { transform: translateY(3px); filter: brightness(1.35); } 100% { transform: none; filter: none; } }
.tech.awaken { animation: awaken .9s var(--ease-ink) both; }
@keyframes awaken { 0% { filter: brightness(2.4) drop-shadow(0 0 14px #fff2c0); transform: scale(1.1); } 100% { filter: drop-shadow(0 2px 3px rgba(30, 16, 0, .4)); transform: none; } }
.tech.deny, .gate.deny, .eratab.deny { animation: deny .38s ease-in-out both; }
@keyframes deny { 20% { transform: translateX(-6px) rotate(-1.5deg); } 45% { transform: translateX(5px) rotate(1deg); } 70% { transform: translateX(-3px); } }
.tech.dropped { animation: dropped .5s ease-out both; }
@keyframes dropped { 0% { transform: scale(.9); opacity: .4; } }
.tech.found .mon, .gate.found .torii { animation: found 1s var(--ease-ink) both; }      /* a lineage seal led here: the crest answers */
@keyframes found { 0% { box-shadow: 0 0 0 2px #fff, 0 0 0 16px rgba(255, 244, 200, .55), 0 0 40px 12px rgba(255, 236, 170, .9); transform: scale(1.35) rotate(-10deg); } }
.tech.fade { animation: fade-old 1s ease-out both; }
@keyframes fade-old { 0% { filter: brightness(1.6) drop-shadow(0 0 10px #fff2c0); transform: scale(1.06); } }
.mon.ghost, .gate .kanji.ghost { pointer-events: none; }

/* a doctrine choice: the 択 lozenge between two rival crests */
.versus { position: absolute; z-index: 4; width: 24px; height: 24px; margin: -12px 0 0 -12px; display: grid; place-items: center; font-size: 13px; color: #fbeee0; cursor: help;
  background: linear-gradient(135deg, var(--shu), var(--shu-deep)); border-radius: 5px; transform: rotate(45deg); box-shadow: 0 0 0 1.5px var(--washi), 0 2px 6px rgba(0, 0, 0, .5); transition: opacity .4s, filter .4s; }
.versus[data-st="open"] { animation: versus 1.8s ease-in-out infinite; }
.versus[data-st="far"] { filter: grayscale(.8); opacity: .7; }
.versus[data-st="chosen"] { filter: grayscale(1); opacity: .45; }
@keyframes versus { 50% { box-shadow: 0 0 0 1.5px var(--washi), 0 0 14px rgba(230, 80, 60, .95); transform: rotate(45deg) scale(1.14); } }

/* the gate at the end of the paper: the age to come stands behind a torii that fills with vermilion as the house learns */
.gate { position: absolute; z-index: 3; right: calc(var(--gr) * .5 - 44px); top: 50%; width: 88px; margin-top: -78px; display: flex; flex-direction: column; align-items: center; text-align: center; color: #2a1a0c;
  transition: transform .22s var(--ease-ink); animation: crest-in .7s var(--ease-ink) .7s backwards; }
.gate .torii { width: 78px; height: 78px; fill: rgba(58, 33, 20, .5); filter: drop-shadow(0 3px 4px rgba(30, 16, 0, .35)); transition: fill .4s; }
.gate .torii.lit { position: absolute; left: 5px; top: 0; fill: var(--shu); clip-path: inset(calc((1 - var(--p, 0)) * 100%) 0 0 0); transition: clip-path .5s var(--ease-ink); filter: none; }
.gate > .kanji { position: absolute; top: 37px; left: 0; right: 0; font-size: 22px; color: rgba(42, 26, 12, .7); transition: color .3s; }
.gate b { margin-top: 3px; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.gate .gpips { font-style: normal; font-size: 11px; font-weight: 700; color: rgba(42, 26, 12, .68); font-variant-numeric: tabular-nums; }
button.gate:hover, button.gate.hov { transform: translateY(-3px) scale(1.05); }
.gate.sel .torii:not(.lit) { filter: drop-shadow(0 0 2px #fff6d8) drop-shadow(0 0 10px rgba(255, 240, 190, .95)); }
.gate[data-st="open"] .torii.lit { animation: breathe 2.2s ease-in-out infinite; }
.gate[data-st="open"] > .kanji, .gate[data-st="active"] > .kanji, .gate[data-st="queued"] > .kanji { color: var(--shu-deep); }
.gate[data-st="open"].poor .torii.lit { animation: none; fill: var(--shu-deep); }
.gate[data-st="active"] .torii.lit, .gate[data-st="queued"] .torii.lit { fill: var(--kin); }
.gate[data-st="done"] .torii.lit { clip-path: none; fill: var(--shu-deep); }
.gate[data-st="done"] > .kanji { color: #fbeee0; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.gate.last .torii { fill: rgba(92, 60, 14, .55); } .gate.last > .kanji { color: rgba(60, 36, 8, .8); }

/* an age that has not come lies under mist: its tree can be read through it, not studied. A ribbon on the lower edge of the paper says what is missing. */
.veil { position: absolute; inset: 6px 2px; z-index: 5; display: none; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(246, 240, 226, .26), rgba(30, 22, 16, .16) 70%, rgba(20, 14, 10, .3)); }
.fold[data-st="veiled"] .veil, .fold[data-st="coming"] .veil, .veil.unveil { display: block; }
.veil > .kanji { display: none; }
.veil p { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); margin: 0; padding: 5px 12px 6px 30px; display: flex; align-items: center; gap: 12px; white-space: nowrap; color: var(--paper-text); pointer-events: auto;
  background: rgba(18, 13, 11, .93); border-radius: 22px 30px 24px 34px / 26px 22px 30px 24px; box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(201, 162, 74, .3); }
.veil p b { font-size: 13.5px; letter-spacing: .04em; } .veil p span { font-size: 12.5px; color: var(--paper-dim); }
.veil .inkbtn { --bg: var(--shu-deep); margin-left: 8px; padding: 6px 20px 7px; font-size: 12.5px; }
.veil .inkbtn:hover { --bg: var(--shu); }
.fold[data-st="veiled"] .tech, .fold[data-st="veiled"] .gate, .fold[data-st="veiled"] .links, .fold[data-st="veiled"] .versus { filter: grayscale(.7) brightness(.94); opacity: .74; }
.fold[data-st="coming"] .veil { animation: mist-drift 2.6s ease-in-out infinite; }
.veil.unveil { animation: mist-lift 1.7s var(--ease-ink) both; }
.veil.unveil p { display: none; }
@keyframes mist-drift { 50% { background-color: rgba(236, 208, 138, .16); } }
@keyframes mist-lift { 0% { opacity: 1; clip-path: inset(0 0 0 0); background-color: rgba(236, 208, 138, .5); } 100% { opacity: 0; clip-path: inset(0 0 0 100%); } }

@media (prefers-reduced-motion: reduce) {
  .research *, .research *::before, .research *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------------------------------------- the hanging scroll: one study in full */
.kakejiku.rdetail { width: clamp(292px, 25vw, 350px); flex: none; align-self: flex-start; max-height: 100%; display: flex; flex-direction: column; margin: 0 16px 0 4px; }
.rdetail .rod { flex: none; }
.rdetail .sheet { padding: 26px 26px 24px; text-align: left; overflow-y: auto; min-height: 0; scrollbar-width: none; color: var(--washi-ink); }
.rdetail .sheet::-webkit-scrollbar { display: none; }
.dbody.fresh { animation: ink-in .3s var(--ease-ink) backwards; }        /* a different study is shown: the ink sets. A refresh of the same one does not blink. */
@keyframes ink-in { from { opacity: 0; transform: translateY(5px); filter: blur(2px); } }
.dhead { display: flex; align-items: center; gap: 16px; }
.dmon { width: 66px; height: 66px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--paper-text); background: radial-gradient(circle at 35% 28%, #4a382c, #140e0b 66%);
  box-shadow: 0 0 0 2px var(--kin), 0 0 0 4.5px rgba(18, 13, 11, .9), 0 6px 12px rgba(0, 0, 0, .35); }
.dmon .kanji { font-size: 35px; transform: translateY(1px); }
.dmon[data-st="done"] { background: radial-gradient(circle at 35% 30%, #d8503e, var(--shu) 55%, var(--shu-deep)); box-shadow: inset 0 0 0 2.5px rgba(255, 230, 210, .32), 0 0 0 2px var(--shu-deep), 0 0 0 4.5px rgba(18, 13, 11, .9), 0 6px 12px rgba(0, 0, 0, .35); }
.dmon[data-st="locked"], .dmon[data-st="barred"] { filter: grayscale(.8) brightness(.9); }
.dhead h3 { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.12; }
.djp { margin: 3px 0 0; font-size: 13px; color: var(--washi-faint); }
.djp .kanji { font-size: 17px; color: var(--shu-deep); }
.dchips { display: flex; flex-wrap: wrap; gap: 5px; margin: 13px 0 0; }
.dchips span { padding: 2px 9px 3px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--washi-faint); box-shadow: inset 0 0 0 1px rgba(109, 90, 73, .5); }
.dchips .doc { color: #fbeee0; background: var(--shu-deep); box-shadow: none; }
.dlore { margin: 12px 0 0; padding-left: 12px; font-size: 13px; line-height: 1.5; color: #4a392c; border-left: 3px solid rgba(143, 34, 25, .45); font-style: italic; }
.rdetail h4 { margin: 14px 0 5px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--shu-deep); font-weight: 800; }
.dfx { margin: 0; padding: 0; list-style: none; }
.dfx li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 0 3px 15px; position: relative; font-size: 13.5px; border-bottom: 1px dotted rgba(109, 90, 73, .35); }
.dfx li::before { content: ""; position: absolute; left: 1px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--matsuba); box-shadow: 0 0 0 1.5px rgba(94, 138, 60, .3); }
.dfx b { font-weight: 800; } .dfx i { font-style: normal; font-size: 12px; color: var(--washi-faint); white-space: nowrap; }
.dnone, .dopens { margin: 6px 0 0; font-size: 12.5px; color: var(--washi-faint); }
.dreqs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dreq { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 4px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--washi-ink); background: rgba(42, 31, 24, .09); transition: background .2s, transform .2s var(--ease-ink); }
.dreq .kanji { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--paper-text); background: var(--sumi-3); }
.dreq[data-ok="true"] .kanji { background: var(--shu); }
.dreq[data-ok="false"] { box-shadow: inset 0 0 0 1px rgba(143, 34, 25, .5); }
.dreq:hover, .dexcl button:hover { background: rgba(193, 57, 43, .16); transform: translateY(-1px); }
.dany { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--washi-faint); font-weight: 800; }
.dexcl { display: flex; gap: 10px; margin: 13px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--shu-deep); }
.dexcl > .kanji { flex: none; width: 22px; height: 22px; display: grid; place-items: center; color: #fbeee0; background: var(--shu-deep); border-radius: 4px; font-size: 12px; transform: rotate(45deg) scale(.86); margin-top: 3px; }
.dexcl button { font-weight: 800; text-decoration: underline; text-underline-offset: 2px; border-radius: 4px; }
.dpips { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; }
.dpips i { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--shu-deep); } .dpips i.on { background: var(--shu); } .dpips span { margin-left: 6px; }
.dprice { display: flex; gap: 20px; margin: 15px 0 0; padding-top: 11px; font-size: 14px; background: url("img/stroke.svg") 0 0 / 100% 5px no-repeat; }
.dprice span { display: inline-flex; align-items: center; gap: 6px; } .dprice b { font-weight: 800; font-variant-numeric: tabular-nums; }
.dprice .icon { width: 17px; height: 17px; color: var(--kin-lo); }
.dprog { height: 11px; margin-top: 10px; background: rgba(42, 31, 24, .2); -webkit-mask: url("img/stroke.svg") 0 0 / 100% 100%; mask: url("img/stroke.svg") 0 0 / 100% 100%; }
.dprog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--kin-lo), var(--kin)); transition: width .25s linear; }
.dwhy { margin: 9px 0 0; min-height: 1.3em; font-size: 12.5px; font-weight: 700; color: var(--washi-faint); }
.dwhy.bad { color: var(--shu-deep); }
.dact { display: flex; align-items: center; min-height: 44px; margin: 4px 0 0 6px; }
.dact .inkbtn { --bg: var(--shu-deep); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); padding: 13px 34px 14px; }
.dact .inkbtn::before { inset: -3px -10px; } .dact .inkbtn:hover:not(:disabled) { --bg: var(--shu); }
.dact .inkbtn.danger { --bg: var(--sumi-3); } .dact .inkbtn.danger:hover { --bg: var(--shu-deep); }
.dact .inkbtn:disabled { --bg: rgba(42, 31, 24, .4); color: rgba(243, 232, 210, .72); cursor: default; transform: none; }
.dact .inkbtn.ghosted { opacity: .5; pointer-events: none; }
.dseal { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--shu-deep); }
.dseal .seal { --s: 38px; transform: rotate(-8deg); }
.dnote { margin: 4px 0 0; min-height: 1.2em; font-size: 12px; font-weight: 700; color: var(--matsuba); filter: brightness(.8); }
.dnote.bad { color: var(--shu-deep); filter: none; }
.dnote.flash, .dwhy.flash { animation: note-flash .5s var(--ease-ink) both; }
@keyframes note-flash { from { transform: translateX(-8px); opacity: 0; } }

/* lineage on the hanging scroll: what this improves or replaces, and what later does the same to it */
.dchips .drel[data-rel="upgrade"] { color: #f1f4ff; background: var(--ai); box-shadow: none; }
.dchips .drel[data-rel="replace"] { color: #fbeee0; background: var(--shu); box-shadow: none; }
.dlineage { display: flex; flex-direction: column; gap: 7px; margin: 13px 0 0; }
.dline { display: flex; align-items: flex-start; gap: 9px; margin: 0; font-size: 12.5px; line-height: 1.42; color: #3d2e22; }
.dline .relseal { flex: none; width: 21px; height: 21px; margin-top: 1px; font-size: 12.5px; background: var(--ai); transform: rotate(-7deg); }
.dline[data-rel="replace"] .relseal, .dline.gone .relseal { background: var(--shu); transform: rotate(6deg); }
.dline.later { color: var(--washi-faint); } .dline.later .relseal { background: rgba(42, 31, 24, .42); }
.dline.gone { color: var(--shu-deep); font-weight: 700; }
.dline button { font-weight: 800; color: inherit; text-decoration: underline; text-underline-offset: 2px; border-radius: 4px; transition: background .2s; }
.dline button:hover { background: rgba(193, 57, 43, .16); }
.dfx.dead li { opacity: .5; } .dfx.dead b { text-decoration: line-through; text-decoration-color: rgba(143, 34, 25, .7); } .dfx.dead li::before { background: rgba(42, 31, 24, .4); box-shadow: none; }
.dmon[data-st="obsolete"] { filter: grayscale(.8) brightness(.9); }

/* ---------------------------------------------------------------------------------------------- the queue tray */
.rqueue { flex: none; height: 62px; display: flex; align-items: center; gap: 18px; padding: 0 22px; border-radius: 31px;
  background: linear-gradient(180deg, #2c1a11, #140b07 60%, #0d0705); box-shadow: inset 0 1px 0 rgba(255, 210, 160, .16), inset 0 0 0 1px rgba(201, 162, 74, .28), 0 8px 18px rgba(0, 0, 0, .5); }
.qlbl { display: flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-dim); font-weight: 800; flex: none; }
.qlbl .kanji { font-size: 22px; color: var(--kin-hi); }
.qslots { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qtoken { position: relative; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 4px; border-radius: 22px; background: rgba(243, 232, 210, .06); cursor: pointer; transition: background .2s, transform .2s var(--ease-ink); min-width: 0; }
.qtoken:not(.free):not(.shut):hover { background: rgba(243, 232, 210, .13); }
.qmon { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--paper-text); background: radial-gradient(circle at 35% 28%, #4a382c, #140e0b 66%); box-shadow: 0 0 0 1.5px var(--kin-lo); }
.qmon .kanji { font-size: 18px; }
.qtoken:not(.active) .qmon svg { display: none; }
.qtext { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.qtext b { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.qtext i { font-style: normal; font-size: 11.5px; color: var(--paper-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qtoken.active { background: rgba(236, 208, 138, .12); box-shadow: inset 0 0 0 1px rgba(236, 208, 138, .35); padding-right: 12px; }
.qtoken.active .qmon { color: var(--kin-hi); } .qtoken.active .qtext i { color: var(--kin-hi); }
.qtoken.free, .qtoken.shut { cursor: default; background: none; padding-right: 6px; }
.qtoken.free .qmon { background: none; box-shadow: none; border: 1.5px dashed rgba(243, 232, 210, .3); box-sizing: border-box; }
.qtoken.free .qtext i { color: rgba(243, 232, 210, .4); font-style: italic; }
.qtoken.shut { padding: 0 2px; opacity: .4; } .qtoken.shut .qmon { background: none; box-shadow: inset 0 0 0 1px rgba(243, 232, 210, .3); color: var(--paper-dim); } .qtoken.shut .qmon .kanji { font-size: 14px; }
.qx { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--paper-dim); opacity: 0; transition: opacity .2s, background .2s, color .2s; flex: none; }
.qx .icon { width: 11px; height: 11px; }
.qtoken:hover .qx { opacity: 1; } .qx:hover { background: var(--shu-deep); color: #fff; }
.qtoken.landed .qmon { animation: stamp .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.rhint { margin: 0 0 0 auto; font-size: 12px; color: rgba(243, 232, 210, .5); white-space: nowrap; }
@media (max-width: 1280px) { .rhint { display: none; } .ename i { display: none; } }
@media (max-width: 1180px) { .eratab { padding-right: 18px; } }
@media (max-width: 1080px) { .rtitle p, .ename { display: none; } .eratab { padding-right: 12px; } }
@media (max-width: 1100px) { .kakejiku.rdetail { width: 258px; margin: 0 12px 0 0; } .rdetail .sheet { padding: 20px 18px 18px; } .rbody { gap: 14px; } }

/* ---------------------------------------------------------------------------------------------- HUD: the study crest and its tag */
.crest.study { position: relative; }
.crest.study .kanji { font-size: 25px; transform: translateY(1px); }
.crest.study svg.sring { position: absolute; inset: -6px; width: 60px; height: 60px; transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.crest.study .sring circle { fill: none; stroke: #fff0c0; stroke-width: 3; stroke-linecap: round; stroke-dasharray: calc(var(--p, 0) * 169.6px) 169.6px; filter: drop-shadow(0 0 4px rgba(255, 230, 160, .9)); transition: stroke-dasharray .3s linear; }
.crest.study .sdot { position: absolute; right: -2px; top: -2px; width: 13px; height: 13px; border-radius: 50%; background: var(--shu); box-shadow: 0 0 0 2px var(--sumi), 0 0 10px rgba(230, 80, 60, .9); transform: scale(0); transition: transform .3s var(--ease-ink); }
.crest.study.idle .sdot { transform: scale(1); animation: sdot 1.6s ease-in-out infinite; }
@keyframes sdot { 50% { box-shadow: 0 0 0 2px var(--sumi), 0 0 16px 3px rgba(240, 100, 70, 1); } }
.crest.study.busy { color: #fff3d0; }
.crest.study.ding { animation: study-ding .9s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes study-ding { 0% { transform: scale(1.7) rotate(-18deg); box-shadow: 0 0 0 2px #fff, 0 0 40px 12px rgba(255, 236, 170, .95); } 100% { transform: none; } }
.studytag { top: 21px; right: 200px; padding: 5px 20px 6px 16px; font-size: 12.5px; color: var(--paper-text); white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s var(--ease-ink); }
.studytag.on { opacity: 1; transform: none; }
@media (max-width: 1320px) { .studytag { display: none; } }             /* the crest's ring still tells the progress */
.studytag b { font-weight: 600; } .studytag i { font-style: normal; color: var(--kin-hi); margin-left: 7px; font-variant-numeric: tabular-nums; }
/* a unit the house has not yet learned to field */
.crestbtn.sealed { filter: grayscale(.9) brightness(.6); }
.crestbtn.sealed::after { content: "封"; position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 400 13px/1 var(--brush); color: #fbeee0; background: var(--shu-deep); box-shadow: 0 0 0 1.5px var(--kin-lo); }

/* ---------------------------------------------------------------------------------------------- the herald of a new age */
.eraherald { position: fixed; inset: 0; z-index: 45; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--paper-text);
  background: radial-gradient(ellipse at 50% 42%, rgba(14, 10, 8, .5), rgba(14, 10, 8, .9)); animation: herald-veil .5s ease both; transition: opacity .8s ease; padding-bottom: 6vh; }
.eraherald.out { opacity: 0; }
.eraherald canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hmark { position: relative; width: 340px; height: 340px; }
.henso { position: absolute; inset: 0; animation: enso-in 1.3s var(--ease-ink) .15s both; }
.hmark .kanji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 190px; color: var(--kin-hi); text-shadow: 0 0 40px rgba(236, 208, 138, .45), 0 8px 30px rgba(0, 0, 0, .7); animation: herald-kanji .9s cubic-bezier(.2, 1.3, .4, 1) .45s both; }
.eraherald .hpre { margin: 0; font-size: 12.5px; letter-spacing: .5em; padding-left: .5em; text-transform: uppercase; color: var(--paper-dim); animation: rise .8s var(--ease-ink) 1s both; }
.eraherald h1 { margin: 4px 0 0; font-size: 54px; font-weight: 800; letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; animation: rise .9s var(--ease-ink) 1.1s both; }
.eraherald .hsub { margin: 8px 0 0; font-size: 16px; color: var(--kin-hi); animation: rise .9s var(--ease-ink) 1.3s both; }
.eraherald .hsub .kanji { font-size: 21px; }
@keyframes herald-veil { from { opacity: 0; } }
@keyframes herald-kanji { from { transform: scale(2.6); opacity: 0; filter: blur(12px); } }

/* ---------------------------------------------------------------------------------------------- paintings (assets/art: view/ui/artindex.js)
   the age's panorama lies faint along the foot of its scroll, under the techniques; a study's own scene heads its hanging scroll */
.paper .eraart { position: absolute; left: 3%; right: 3%; bottom: 2%; height: 46%; background: var(--era-art, none) 50% 62% / cover no-repeat; opacity: .3; mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 42%, #000 82%, transparent 100%), linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 0, #000 42%, #000 82%, transparent 100%), linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%); mask-composite: intersect; transition: opacity .5s; }
.emaki.rolling .eraart { animation: ink-set 1.1s var(--ease-ink) both; }
.rdetail .dart { margin: -26px -26px 14px; position: relative; overflow: hidden; }
.rdetail .dart img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 68%, transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 68%, transparent 100%); }
.rdetail .dart.era img { aspect-ratio: 21 / 11; object-position: 50% 50%; }
.rdetail .dart + .dhead { margin-top: -30px; position: relative; }
@media (max-width: 1100px) { .rdetail .dart { margin: -20px -18px 12px; } }
