/* Shadowfall site - W15 (creator 2026-10-12: manuscript, a letter with a quill and an old inkwell, a red wax seal with a
   signet ring's crest, torches on the castle wall). The props are drawn by tools/web_props.py; the flames are CSS.
   Loaded last, medieval / stone themes. */

/* ---- torches on the wall (fixed: the wall does not scroll, the torches stay on it) ---- */
.wall-torches { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.torch {
  position: absolute; top: 30vh; width: 70px; height: 210px;
  background: url("../img/orn/torch.svg") center bottom / contain no-repeat;
  left: max(6px, calc((100vw - 1180px) / 4 - 35px));
}
.torch.right { left: auto; right: max(6px, calc((100vw - 1180px) / 4 - 35px)); }
/* the light on the wall around it */
.torch::before {
  content: ""; position: absolute; left: 50%; top: -40px; width: 520px; height: 520px; margin-left: -260px; border-radius: 50%;
  background: radial-gradient(circle, #ff9a3c3d 0%, #ff7a1a1c 30%, transparent 62%); mix-blend-mode: screen;
  animation: torch-light 3.2s ease-in-out infinite;
}
.torch.right::before { animation-delay: -1.4s; }
@keyframes torch-light { 0%, 100% { opacity: .9; transform: scale(1); } 20% { opacity: .65; transform: scale(.96); }
  45% { opacity: 1; transform: scale(1.03); } 70% { opacity: .75; transform: scale(.98); } }
/* the flame: three tongues of fire, each flickering on its own */
.flame { position: absolute; left: 50%; top: -18px; width: 46px; height: 74px; margin-left: -23px; filter: blur(.6px); }
.flame i {
  position: absolute; left: 50%; bottom: 0; border-radius: 50% 50% 38% 38% / 64% 64% 36% 36%; transform-origin: 50% 100%;
  mix-blend-mode: screen;
}
.flame i:nth-child(1) { width: 40px; height: 66px; margin-left: -20px;
  background: radial-gradient(ellipse at 50% 82%, #ffd27a 0 18%, #ff8a1e 42%, #d2390a 62%, transparent 72%); animation: tongue 1.1s ease-in-out infinite alternate; }
.flame i:nth-child(2) { width: 28px; height: 52px; margin-left: -12px;
  background: radial-gradient(ellipse at 50% 80%, #fff4c8 0 22%, #ffc24a 46%, #ff7a1a 64%, transparent 74%); animation: tongue 0.8s ease-in-out -0.3s infinite alternate; }
.flame i:nth-child(3) { width: 16px; height: 30px; margin-left: -8px;
  background: radial-gradient(ellipse at 50% 80%, #ffffff 0 30%, #fff1b0 55%, transparent 75%); animation: tongue 0.6s ease-in-out -0.1s infinite alternate; }
@keyframes tongue {
  0% { transform: scale(1, 1) skewX(0deg); }
  30% { transform: scale(.94, 1.08) skewX(3deg); }
  60% { transform: scale(1.05, .93) skewX(-4deg); }
  100% { transform: scale(.97, 1.12) skewX(2deg); }
}
.sparks { position: absolute; left: 50%; top: -10px; }
.sparks b { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 6px #ff8a1e; opacity: 0;
  animation: spark 2.4s linear infinite; }
.sparks b:nth-child(2) { animation-delay: .6s; left: 6px; } .sparks b:nth-child(3) { animation-delay: 1.2s; left: -6px; } .sparks b:nth-child(4) { animation-delay: 1.8s; left: 2px; }
@keyframes spark { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(14px, -120px); opacity: 0; } }
@media (max-width: 1399px) { .wall-torches { display: none; } }

/* ---- the letter of summons (home page, replaces the final call) ---- */
.summons { padding: 70px 16px 90px; position: relative; }
.summons-in { position: relative; display: grid; justify-items: center; }
.letter {
  position: relative; width: min(720px, 100%); padding: 54px 64px 120px; color: #2b1a0c; transform: rotate(-.6deg);
  font: italic 1.22rem/1.7 var(--fell, Georgia, serif);
  background:
    linear-gradient(90deg, transparent 49.6%, #7a5a2a26 50%, transparent 50.4%),             /* the vertical fold */
    linear-gradient(0deg, transparent 32.9%, #7a5a2a22 33.3%, transparent 33.7%,
                    transparent 66.3%, #7a5a2a22 66.7%, transparent 67.1%),                   /* two horizontal folds */
    radial-gradient(ellipse 80% 75% at 50% 45%, #e6d4ad 0%, #dcc79c 60%, #c9ad7a 100%);
  box-shadow: 0 30px 60px #000d, inset 0 0 70px #6b4a1e77, inset 0 0 0 1px #8a6d3f88;
  clip-path: polygon(0 1.5%, 6% 0, 22% 1%, 38% 0, 55% 1.2%, 72% 0, 90% 1%, 100% 0, 99.4% 22%, 100% 48%, 99.2% 76%, 100% 100%,
                     82% 98.8%, 64% 100%, 45% 98.9%, 27% 100%, 9% 99%, 0 100%, .7% 74%, 0 50%, .8% 24%);
}
.letter p { margin: 0 0 .9em; color: #33200e; }
.letter-head { font: 400 1.9rem/1.2 "Uncial", var(--serif); color: #5a1d0a; margin-bottom: .7em !important; }
.letter-head::first-letter { color: #8f161c; font-size: 1.3em; }
.letter-sign { text-align: right; margin-top: 1.4em !important; }
.letter-sign span { font: 400 1.6rem "Uncial", var(--serif); color: #3a1d0a; }
.letter-seal { position: absolute; left: 50%; bottom: -96px; width: 170px; height: auto; margin-left: -85px; transform: rotate(-8deg);
  filter: drop-shadow(0 8px 10px #000a); }
.quill { position: absolute; left: max(0px, calc(50% - 560px)); bottom: -10px; width: 220px; height: auto; transform: rotate(-4deg);
  filter: drop-shadow(0 10px 14px #000c); z-index: 2; }
.summons-cta { margin-top: 120px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.summons-cta .muted { margin: 0; }
@media (max-width: 960px) {
  .letter { padding: 40px 28px 110px; font-size: 1.08rem; }
  .quill { position: static; width: 150px; margin: 0 0 -30px -180px; transform: rotate(-12deg); }
}

/* ---- the manuscript (World page): a vine down the margin, an illuminated initial ---- */
.theme-medieval .sheet.manuscript { padding-left: clamp(60px, 9vw, 104px); }
.theme-medieval .sheet.manuscript {
  background-image: url("../img/orn/vine.svg"), radial-gradient(ellipse 80% 75% at 50% 45%, #e2cfa8f2 0%, #dcc79ce0 55%, #dcc79c55 100%),
                    url("../img/tex/parchment.webp");
  background-size: 40px 134px, auto, 420px; background-repeat: repeat-y, no-repeat, repeat; background-position: 18px 0, 0 0, 0 0;
}
.theme-medieval .sheet.manuscript blockquote { background: none; box-shadow: none; border-left: 3px double #8f161c; color: #3a2210; padding-left: 1.6em; }
.theme-medieval .sheet.manuscript blockquote::before { content: none; }
/* illuminated initial: a gold letter on lapis with vines, in a gold frame (prose pages and the manuscript) */
.theme-medieval :is(section.prose.narrow, .sheet.manuscript) > p:first-of-type::first-letter,
.theme-medieval .sheet.manuscript h2 + p::first-letter {
  float: left; width: 1.32em; height: 1.32em; margin: .08em .18em 0 0; padding: 0; text-align: center;
  font: 400 2.9em/1.32 "Uncial", var(--serif); color: #f6d98c; text-shadow: 0 1px 0 #000, 0 0 8px #000;
  background: url("../img/orn/initial.svg") center / 100% 100% no-repeat;
}
.theme-medieval .sheet.manuscript > p:first-of-type::first-letter { content: normal; }
.theme-medieval :is(section.prose.narrow, .sheet.manuscript) p { min-height: 0; }

/* ---- the seal stamped at the end of every parchment page ---- */
.theme-medieval :is(section.prose.narrow, .sheet)::after { z-index: 0; }
.theme-medieval :is(section.prose.narrow, .sheet) > :last-child::after {
  content: ""; display: block; width: 110px; height: 120px; margin: 28px 0 -40px auto; transform: rotate(9deg);
  background: url("../img/orn/wax-seal.svg") center / contain no-repeat; filter: drop-shadow(0 4px 6px #0008);
}
.theme-medieval .faq > :last-child::after, .theme-medieval .sheet .faq details::after { content: none; }

/* fixes after the first screenshots */
.letter-wrap { position: relative; width: min(720px, 100%); }
.letter-wrap .letter { width: 100%; }
.letter-seal { bottom: -70px; z-index: 3; }
.theme-medieval :is(section.prose.narrow, .sheet.manuscript) > p:first-of-type::first-letter,
.theme-medieval .sheet.manuscript h2 + p::first-letter {
  font-size: 58px; line-height: 76px; width: 76px; height: 76px; margin: 6px 14px 0 0;
}
.theme-medieval section.sheet.manuscript.prose {
  background-image: url("../img/orn/vine.svg"), radial-gradient(ellipse 80% 75% at 50% 45%, #e2cfa8f2 0%, #dcc79ce0 55%, #dcc79c55 100%),
                    url("../img/tex/parchment.webp");
  background-size: 40px 134px, auto, 420px; background-repeat: repeat-y, no-repeat, repeat; background-position: 20px 0, 0 0, 0 0;
}
.theme-medieval :is(section.prose.narrow, .sheet) > :last-child::after { content: none; }
.theme-medieval :is(section.prose.narrow, .sheet) > :is(p, ul):last-child::after {
  content: ""; display: block; width: 110px; height: 120px; margin: 28px 0 -40px auto; transform: rotate(9deg);
  background: url("../img/orn/wax-seal.svg") center / contain no-repeat; filter: drop-shadow(0 4px 6px #0008);
}
.theme-medieval .sheet.manuscript blockquote::after {
  content: ""; display: block; width: 110px; height: 120px; margin: 18px -10px -30px auto; transform: rotate(9deg);
  background: url("../img/orn/wax-seal.svg") center / contain no-repeat; filter: drop-shadow(0 4px 6px #0008);
}
.theme-medieval .sheet.manuscript blockquote { border-left: 0; padding-left: 0; position: relative; }
.theme-medieval .sheet.manuscript blockquote p { border-left: 3px double #8f161c; padding-left: 1.4em; }
/* Chrome ignores width on ::first-letter: the frame is sized by padding around the glyph instead */
.theme-medieval :is(section.prose.narrow, .sheet.manuscript) > p:first-of-type::first-letter,
.theme-medieval .sheet.manuscript h2 + p::first-letter {
  width: auto; height: auto; line-height: 1; padding: 12px 16px 10px; margin: 4px 14px 0 0;
}

/* W16: the detailed torch (140 x 380 drawing), lit only once the page has scrolled past the top picture */
.torch { width: 84px; height: 228px; top: 26vh; background-size: contain; }
.flame { top: -40px; width: 56px; height: 86px; margin-left: -28px; }
.flame i:nth-child(1) { width: 50px; height: 80px; margin-left: -25px; }
.flame i:nth-child(2) { width: 34px; height: 62px; margin-left: -15px; }
.flame i:nth-child(3) { width: 18px; height: 36px; margin-left: -9px; }
.sparks { top: -30px; }
.smoke { position: absolute; left: 50%; top: -70px; }
.smoke i { position: absolute; left: -14px; width: 28px; height: 28px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #5a5550aa, transparent 70%); filter: blur(4px); animation: smoke 5s ease-out infinite; }
.smoke i:nth-child(2) { animation-delay: 1.7s; } .smoke i:nth-child(3) { animation-delay: 3.4s; }
@keyframes smoke { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: .5; }
  100% { transform: translate(18px, -150px) scale(2.6); opacity: 0; } }
.wall-torches { opacity: 0; transition: opacity 1.2s ease; }
body.torches-lit .wall-torches { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .smoke, .sparks { display: none; } }

/* W19: the torch is a Blender render (img/orn/torch-3d.png, 3x the shown size), the flame is layered CSS fire */
.torch { width: 120px; height: 327px; top: 22vh; background: url("../img/orn/torch-3d.png") center bottom / contain no-repeat; }
.flame { top: -54px; width: 70px; height: 112px; margin-left: -35px; filter: blur(1.4px) saturate(1.15); }
.flame i:nth-child(1) { width: 66px; height: 108px; margin-left: -33px;
  background: radial-gradient(ellipse 50% 60% at 50% 86%, #ffcf6e 0 14%, #ff8a1e 34%, #e2470c 52%, #8a1c04 64%, transparent 74%); }
.flame i:nth-child(2) { width: 44px; height: 84px; margin-left: -20px;
  background: radial-gradient(ellipse 50% 60% at 50% 84%, #fff6d6 0 18%, #ffd27a 40%, #ff8f24 58%, transparent 72%); }
.flame i:nth-child(3) { width: 22px; height: 44px; margin-left: -11px;
  background: radial-gradient(ellipse 50% 60% at 50% 80%, #ffffff 0 34%, #fff2c0 56%, transparent 76%); }
.flame::after {   /* a broad, soft heat bloom behind the flame */
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 150px; height: 150px; margin-left: -75px; border-radius: 50%;
  background: radial-gradient(circle, #ffb34766 0%, #ff7a1a22 40%, transparent 70%); filter: blur(6px); animation: torch-light 2.6s ease-in-out infinite;
}
.sparks { top: -50px; }
.smoke { top: -110px; }
/* the rendered torch is cropped to its own size (205 x 796, shown 82 x 318): the flame sits on the head */
.torch { width: 82px; height: 318px; top: 24vh; background-size: 100% 100%; }
.flame { top: -94px; }
.sparks { top: -92px; }
.smoke { top: -150px; }
.torch::before { top: -120px; }
