/* site.css: the tokens, type, controls and the gold frame every page shares.
   One theme: black lacquer with gold, the values of ITCA's Palekh theme (ITCARPG assets/css/core.css),
   so a visitor moving between this site and itcarpg.com stays on the same ground. */
:root{
  color-scheme:dark;
  --field:#0a0705;      /* the black of the lid */
  --lac:#0a0705;
  --card:#150e09;       /* a painted reserve on the lid */
  --ink:#f2e6cc;        /* ivory, 16.9:1 on the field */
  --ink2:#c4a878;       /* burnished gold-brown, 8.4:1 */
  --ink3:#8c8170;       /* grey, for what is not up yet, 5.2:1 */
  --gold:#ddb04f;       /* leaf gold, 10.1:1 */
  --gold-hi:#efcb78;
  --rule:#8a6a2e;       /* old gold hairline, 4.1:1 */
  --rule-soft:rgba(221,176,79,.28);
  /* older names, kept so the dice page reads the same tokens */
  --paint-gold:var(--gold); --paint-ink:var(--ink); --gold-ink:var(--gold);
  --disc-shadow:0 1.4rem 2.4rem -1rem #000;
  --pad:clamp(1rem,4.5vw,4.5rem);
  --display:"Ruslan Display","Old Standard TT",Georgia,serif;
  --text:"Old Standard TT",Georgia,"Times New Roman",serif;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--field)}
body{margin:0;background:var(--field);color:var(--ink);font:400 1.14rem/1.6 var(--text);overflow-x:hidden}
img,svg{max-width:100%;display:block}
a{color:inherit}
h1,h2,h3{font-weight:400;margin:0;line-height:1.05}
h1{font-family:var(--display);color:var(--gold)}
p{margin:0 0 1em;max-width:62ch}
button{font:inherit;color:inherit;cursor:pointer}
:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* controls: gold hairline ovals */
.btn{display:inline-block;border:1px solid currentColor;border-radius:999px;padding:.62em 1.5em .58em;background:none;font-style:italic;text-decoration:none;color:var(--gold);transition:background-color .2s,color .2s}
.btn:hover{background:var(--gold);color:#140e0a;border-color:var(--gold)}
.link{text-decoration:underline;text-decoration-color:var(--rule);text-underline-offset:.22em}
.link:hover{text-decoration-color:currentColor;color:var(--gold-hi)}
.skip{position:absolute;left:var(--pad);top:-4rem;z-index:20;background:var(--gold);color:#140e0a;padding:.5rem 1rem;text-decoration:none}
.skip:focus{top:.6rem}

/* the lid: a double gold rule round the page, with scrollwork in the corners */
.lid{position:relative;min-height:100svh;padding:clamp(1.6rem,4vw,3.4rem) clamp(1.4rem,5vw,4.6rem);display:flex;flex-direction:column}
.lid::before,.lid::after{content:"";position:absolute;pointer-events:none}
.lid::before{inset:clamp(.45rem,1.2vw,.9rem);border:1px solid var(--gold)}
.lid::after{inset:calc(clamp(.45rem,1.2vw,.9rem) + 5px);border:1px solid var(--rule)}
.corner{position:absolute;width:clamp(3.2rem,7vw,5.4rem);height:auto;pointer-events:none;z-index:1}
.corner.tl{top:clamp(.45rem,1.2vw,.9rem);left:clamp(.45rem,1.2vw,.9rem)}
.corner.tr{top:clamp(.45rem,1.2vw,.9rem);right:clamp(.45rem,1.2vw,.9rem);transform:scaleX(-1)}
.corner.bl{bottom:clamp(.45rem,1.2vw,.9rem);left:clamp(.45rem,1.2vw,.9rem);transform:scaleY(-1)}
.corner.br{bottom:clamp(.45rem,1.2vw,.9rem);right:clamp(.45rem,1.2vw,.9rem);transform:scale(-1,-1)}

/* the bar along the top of an inner page */
.bar{display:flex;justify-content:space-between;align-items:baseline;gap:.6rem 2rem;flex-wrap:wrap;position:relative;z-index:2;padding-bottom:1rem;border-bottom:1px solid var(--rule-soft)}
.mark{font-family:var(--display);font-size:1.2rem;color:var(--gold);text-decoration:none}

footer{position:relative;z-index:2;margin-top:auto;padding-top:2.4rem;display:flex;justify-content:space-between;gap:.6rem 2rem;flex-wrap:wrap;color:var(--ink2);font-size:1rem}
.foot-links{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem}

/* painted things: gold hairline on lacquer */
.g{fill:none;stroke:var(--gold);stroke-width:.6;stroke-linecap:round;stroke-linejoin:round}
.g.dim{stroke-opacity:.5}
.gf{fill:var(--gold-hi)}
.fe{stroke:var(--gold);stroke-width:.5;stroke-linejoin:round}
.sway{transform-box:fill-box;transform-origin:0% 50%;animation:sway 6s ease-in-out infinite alternate;animation-delay:var(--d,0s)}
.tw{animation:tw 4s ease-in-out infinite;animation-delay:var(--d,0s)}
.spark{transform-box:fill-box;transform-origin:50% 50%;transform:scale(0);animation:spark 7s ease-in-out infinite;animation-delay:var(--d,0s)}
.row:hover .spark,.work-card:hover .spark{animation:spark-now 1.1s ease-out both;animation-delay:var(--h,0s)}
@keyframes spark{0%,86%,100%{transform:scale(0) rotate(0)}93%{transform:scale(1) rotate(45deg)}}
@keyframes spark-now{0%{transform:scale(0) rotate(0)}40%{transform:scale(1.15) rotate(45deg)}100%{transform:scale(0) rotate(90deg)}}
@keyframes sway{from{transform:rotate(-1.6deg)}to{transform:rotate(1.6deg)}}
@keyframes tw{0%,100%{opacity:1}50%{opacity:.25}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}
@media (max-width:40rem){
  body{font-size:1.06rem}
}

/* ---------- works: the card, the section page and the work page (assets/works.js draws them) ---------- */
/* A work's card is a painted reserve on the lid: the --card ground inside a gold rule, a fainter rule
   inside that, the picture set into the middle like a miniature in its border. */
.works{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,16.5rem),1fr));gap:clamp(1.2rem,2.6vw,2rem)}
.work-card{position:relative;display:flex;flex-direction:column;height:100%;padding:.6rem;background:var(--card);border:1px solid var(--rule);text-decoration:none;transition:border-color .2s,background-color .2s}
.work-card::after{content:"";position:absolute;inset:4px;border:1px solid var(--rule-soft);pointer-events:none}
.work-card:hover{border-color:var(--gold);background:#1b120b}
.work-card:hover .wc-title{text-decoration:underline;text-decoration-color:var(--gold);text-underline-offset:.2em}
.wc-pic{display:grid;place-items:center;aspect-ratio:4/3;overflow:hidden;background:var(--lac)}
.wc-pic img{width:100%;height:100%;object-fit:cover}
.wc-pic .disc{width:56%;filter:drop-shadow(0 .5rem .8rem #000);transition:transform .3s cubic-bezier(.2,.7,.2,1)}
.work-card:hover .wc-pic .disc{transform:rotate(-6deg) scale(1.03)}
.wc-body{display:flex;flex-direction:column;gap:.3rem;flex:1;padding:.85rem .55rem .45rem}
.wc-title{font:700 1.24rem/1.25 var(--text);color:var(--ink);margin:0}
.wc-sum{color:var(--ink2);font-size:1.02rem;line-height:1.4}
.wc-meta{margin-top:auto;padding-top:.5rem;color:var(--ink2);font-size:.95rem}
.status{display:flex;align-items:center;gap:.45rem;color:var(--gold);font-style:italic;font-size:.98rem;line-height:1.2}
.mark-v{width:1.4rem;height:.7rem;flex:none;overflow:visible}

.shelf{position:relative;z-index:2;display:grid;grid-template-columns:minmax(0,7fr) minmax(0,4fr);gap:clamp(2rem,6vw,6rem);align-items:center;margin:clamp(2rem,5vw,3.6rem) 0 clamp(1.6rem,4vw,2.6rem)}
.shelf h1{font-size:clamp(2.6rem,6vw,4.6rem);margin:0 0 1.2rem}
.shelf .lede{font-size:clamp(1.15rem,1.8vw,1.3rem);font-style:italic}
.plate{width:min(100%,19rem);margin:0 auto;filter:drop-shadow(0 1.2rem 1.6rem #000)}
.plate svg{width:100%;height:auto}
.listing{position:relative;z-index:2}
.empty{border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);padding:1.1rem 0;margin:0 0 1.6rem;color:var(--ink2);max-width:none}
.empty p{font-style:italic}
.empty p:last-child{margin-bottom:0}
.filter{border:0;margin:0 0 1.4rem;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem 1.4rem;min-width:0}
.filter legend{float:left;margin-right:.4rem;padding:0;font-style:italic;color:var(--gold)}
.filter label{display:inline-flex;align-items:center;gap:.4rem;min-height:2rem;cursor:pointer}
.filter input{width:1.05rem;height:1.05rem;margin:0;accent-color:var(--gold)}

.work{position:relative;z-index:2;max-width:56rem;margin-top:clamp(2rem,5vw,3.6rem)}
.work h1{font-size:clamp(2.3rem,5.6vw,4.2rem);margin:.7rem 0 1rem}
.work .lede{font-size:clamp(1.15rem,1.8vw,1.3rem);font-style:italic}
.work-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.3rem 1.2rem;color:var(--ink2)}
.work-out{margin:.4rem 0 1.4rem}
.part h2,.progress h2{font:italic 400 1.35rem/1.2 var(--text);color:var(--gold);margin:2.6rem 0 1rem;padding-bottom:.45rem;border-bottom:1px solid var(--rule)}
.pic{margin:1.6rem 0}
.pic a{display:block;width:fit-content;max-width:100%}
.pic img{max-height:80svh;width:auto;border:1px solid var(--rule)}
.pic figcaption{margin-top:.5rem;color:var(--ink2);font-style:italic;font-size:1rem;max-width:62ch}
.pics{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,15rem),1fr));gap:1.2rem 1.4rem;margin:1.4rem 0}
.pics .pic{margin:0}
.pics .pic img{width:100%;height:auto;max-height:none}
.cover img{max-height:70svh}
@media (max-width:52rem){
  .shelf{grid-template-columns:1fr}
  .plate{order:-1;width:min(60%,14rem)}
}
