/* Runeforge's own pages: a manual, printed. Paper and ink, one blue for the rune, a book face for reading and
   a typewriter face for labels. Nothing borrowed from Tales of Wrath's look; the dark plates are the software itself. */
:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-2: #ebe5d8;
  --ink: #1c1a17;
  --ink-2: #4a453d;
  --dim: #7b7468;
  --rule: #d8d0c0;
  --blue: #1d5d8c;
  --blue-hi: #2a7bb6;
  --plate: #0d1013;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", "URW Palladio L", P052, Georgia, serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, "DejaVu Sans Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 19px/1.62 var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, p, ol, ul, dl, dd, figure { margin: 0; }
a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-hi); text-decoration-thickness: 2px; }
code { font: 400 .78em/1 var(--mono); padding: 2px 5px; border-radius: 2px; background: var(--paper-2); color: var(--ink); white-space: nowrap; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
[hidden] { display: none !important; }

/* ---------- the running head ---------- */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.name { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 400 21px/1 var(--serif); letter-spacing: .01em; }
.name:hover { color: var(--ink); }
.name svg, .foot svg { width: 22px; height: 22px; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { font: 400 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--blue); }
@media (max-width: 720px) { .top nav { display: none; } }

/* ---------- the title page ---------- */
.title { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px 48px; padding: clamp(48px, 8vw, 92px) 0 clamp(40px, 6vw, 64px); border-bottom: 1px solid var(--rule); }
.sigil { width: 200px; height: 200px; margin-top: 6px; }
.sigil .guide { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; }
.sigil .ink * { fill: none; stroke: var(--blue); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.sigil .ink * { animation: engrave 1.6s cubic-bezier(.6, .1, .2, 1) both; }
.sigil .ink circle:nth-child(2) { animation-delay: .35s; }
.sigil .ink path { animation-delay: .7s; }
@keyframes engrave { from { stroke-dashoffset: 1; } }
@media (prefers-reduced-motion: reduce) { .sigil .ink * { animation: none; } }
.kicker { font: 400 13px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.title h1 { margin: 10px 0 22px; font: 400 clamp(56px, 9vw, 104px)/.95 var(--serif); letter-spacing: -.02em; color: var(--ink); }
.intro { max-width: 36em; font-size: 21px; line-height: 1.6; color: var(--ink); }
.intro + .intro { margin-top: 14px; color: var(--ink-2); }
.toc { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 30px; padding: 16px 0 0; list-style: none; border-top: 1px dashed var(--rule); }
.toc a { display: inline-flex; gap: 8px; align-items: baseline; color: var(--ink-2); text-decoration: none; font-size: 17px; }
.toc a:hover { color: var(--blue); }
.toc b { font: 400 12px/1 var(--mono); color: var(--blue); }
/* on a phone the contents and the name are at least 32px tall, so a thumb finds them */
@media (max-width: 860px) { .toc a, .top .name { min-height: 32px; align-items: center; } }
@media (max-width: 860px) {
  .title { grid-template-columns: minmax(0, 1fr); }
  .sigil { width: 120px; height: 120px; }
  .toc { grid-column: 1; }
}

/* ---------- chapters: a number and a name in the margin, the text beside them ---------- */
.ch { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 48px; padding: clamp(48px, 7vw, 80px) 0; border-bottom: 1px solid var(--rule); }
.rail { position: sticky; top: 24px; align-self: start; display: grid; gap: 6px; font: 400 12.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.rail b { font: 400 54px/1 var(--serif); letter-spacing: 0; color: var(--blue); }
.body { display: grid; gap: 18px; max-width: 760px; }
.body > p { max-width: 36em; }
h2 { font: 400 clamp(30px, 3.6vw, 40px)/1.15 var(--serif); letter-spacing: -.01em; margin-bottom: 4px; }
@media (max-width: 860px) {
  .ch { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 12px; margin-bottom: 14px; }
  .rail b { font-size: 34px; }
}

/* figures: the software itself, as plates, with numbered captions */
figure { display: grid; gap: 10px; margin-top: 10px; }
figcaption { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); max-width: 44em; }
figcaption span { font: 400 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--blue); margin-right: 8px; }
.plate img { display: block; width: 100%; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px var(--ink), 6px 6px 0 var(--paper-2); }
.plate.wide { max-width: 640px; }
.plate.wide img { aspect-ratio: 785 / 760; object-fit: cover; object-position: top; }
.plate.crop img { aspect-ratio: 785 / 760; object-fit: cover; object-position: top; }
.pair { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 8px; }
.pair .spec { margin-top: 10px; grid-template-columns: 128px minmax(0, 1fr); }
@media (max-width: 760px) { .pair { grid-template-columns: minmax(0, 1fr); } }

/* the game's own tooltip, as the site shows it */
.tipfig { justify-items: start; }
.tip { display: grid; gap: 1px; width: 100%; max-width: 280px; padding: 9px 11px 10px; border-radius: 4px; font: 400 13.5px/1.32 "Segoe UI", Verdana, system-ui, sans-serif; color: #fff;
  background: rgba(8, 11, 30, .97); box-shadow: 0 0 0 1px #000, 0 0 0 2px #7b86a0, 0 0 0 3px #000, 6px 8px 0 var(--paper-2); }
.tip .name { font-size: 15px; margin-bottom: 2px; }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip .legendary { color: #ff8000; } .tip .epic { color: #a335ee; } .tip .rare { color: #0070dd; } .tip .uncommon, .tip .unc { color: #1eff00; } .tip .gold { color: #ffd100; } .tip .gray { color: #9d9d9d; }
.tip .socket { position: relative; padding-left: 15px; } .tip .socket::before { content: ""; position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 2px; background: #333; box-shadow: inset 0 0 0 1px #888; }
.tip .s2::before { background: #b3263a; } .tip .s4::before { background: #c9a227; } .tip .s8::before { background: #2a5fb8; }

.spec { display: grid; grid-template-columns: 170px minmax(0, 1fr); margin-top: 14px; border-top: 1px solid var(--ink); }
.spec dt, .spec dd { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.spec dt { font: 400 12px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding-top: 14px; }
.spec dd { font-size: 17px; }
@media (max-width: 560px) { .spec, .pair .spec { grid-template-columns: minmax(0, 1fr); } .spec dt { border-bottom: 0; padding-bottom: 0; } }

/* the character, in a dark case on the page */
.stagefig { max-width: 560px; }
.stage { position: relative; aspect-ratio: 4 / 5; border-radius: 2px; overflow: hidden;
  background: radial-gradient(ellipse 46% 9% at 50% 92%, rgba(0, 0, 0, .8), transparent 70%), radial-gradient(ellipse 80% 70% at 50% 35%, #2a2f35 0%, #15181c 55%, #0b0d0f 100%);
  box-shadow: 0 0 0 1px var(--ink), 6px 6px 0 var(--paper-2); }
.stage .mv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; outline: none; opacity: 0; transition: opacity .7s ease; }
.stage.ready .mv-canvas { opacity: 1; }
.stage.turning .mv-canvas { cursor: grabbing; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font: 400 13px/1.5 var(--mono); color: #9aa3ab; }

/* what the admin sends a realm */
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; border-radius: 2px; background: var(--plate); color: #e3ddd1; font: 400 14px/1.75 var(--mono); box-shadow: 0 0 0 1px var(--ink), 6px 6px 0 var(--paper-2); }
.code i { font-style: normal; color: #8cc6ec; }

.plain { display: grid; gap: 0; padding: 0; list-style: none; max-width: 40em; border-top: 1px solid var(--ink); }
.plain li { position: relative; padding: 13px 0 13px 30px; border-bottom: 1px solid var(--rule); }
.plain li::before { content: ""; position: absolute; left: 4px; top: 22px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--blue); box-shadow: inset 0 0 0 2.5px var(--paper), inset 0 0 0 6px var(--blue); }

/* a site running Runeforge, as a card */
.site { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin-top: 8px; color: var(--ink); text-decoration: none; border: 1px solid var(--ink); border-radius: 2px; background: #fbf9f4; box-shadow: 6px 6px 0 var(--paper-2); transition: box-shadow .2s, transform .2s; }
.site:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--paper-2); }
.site img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; border-right: 1px solid var(--ink); aspect-ratio: 785 / 560; }
.site-text { display: grid; align-content: center; gap: 8px; padding: 22px 24px; }
.site-k { font: 400 11.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.site-text b { font: 400 34px/1.05 var(--serif); }
.site-text > span:nth-child(3) { color: var(--ink-2); font-style: italic; }
.site-n { font: 400 12.5px/1.6 var(--mono); color: var(--dim); }
.site-go { margin-top: 6px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.site:hover .site-go { text-decoration-thickness: 2px; }
.note { font-size: 16px; color: var(--ink-2); }
@media (max-width: 640px) { .site { grid-template-columns: minmax(0, 1fr); } .site img { border-right: 0; border-bottom: 1px solid var(--ink); } }
@media (prefers-reduced-motion: reduce) { .site, .site:hover { transition: none; transform: none; } }

/* ---------- the foot ---------- */
.foot { padding: 34px 0 56px; color: var(--dim); font-size: 14px; }
.foot .wrap { display: grid; gap: 8px; }
.foot p:first-child { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); }
.foot p:first-child span { font: 400 12px/1 var(--mono); color: var(--dim); margin-left: 6px; }
@media (max-width: 560px) { body { font-size: 18px; } .intro { font-size: 19px; } .sigil { width: 96px; height: 96px; } }
