/* Arcane Library website. Hand-written; the pages themselves are generated by tools/gen_site.py */
:root {
  --bg: #0d0b14;
  --bg2: #141120;
  --panel: #1a1628;
  --panel2: #221c35;
  --line: #342b52;
  --ink: #e9e4f5;
  --dim: #a79fc2;
  --lumen: #f2c75c;
  --lumen2: #ffe39a;
  --violet: #8d6bff;
  --cyan: #5fe0e8;
  --red: #ff7a7a;
  --radius: 10px;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f2ea; --bg2: #efe9dc; --panel: #fffdf7; --panel2: #f1ead9; --line: #d8cdb2;
    --ink: #1e1a2b; --dim: #5d5670; --lumen: #a56d00; --lumen2: #7c5200; --violet: #5a3fd0; --cyan: #0b7f88; --red: #b32d2d;
  }
}
:root[data-theme="light"] {
  --bg: #f6f2ea; --bg2: #efe9dc; --panel: #fffdf7; --panel2: #f1ead9; --line: #d8cdb2;
  --ink: #1e1a2b; --dim: #5d5670; --lumen: #a56d00; --lumen2: #7c5200; --violet: #5a3fd0; --cyan: #0b7f88; --red: #b32d2d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--lumen); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lumen2); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.2em; }
h3 { font-size: 1.25rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.narrow { width: min(820px, 100% - 32px); margin: 0 auto; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--lumen); color: #000; padding: 6px 10px; z-index: 99; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.15rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--dim); text-decoration: none; padding: 6px 11px; border-radius: 7px; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--lumen); background: var(--panel); }
.menu-btn { display: none; margin-left: auto; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; flex-direction: column; }
  .nav.open { display: flex; }
}

/* hero */
.hero { position: relative; min-height: min(78vh, 680px); display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,11,20,.25) 0%, rgba(13,11,20,.55) 55%, var(--bg) 100%); }
.hero .wrap { position: relative; z-index: 2; padding: 90px 0 46px; }
.hero h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.7); margin-bottom: .25em; }
.hero p.lead { font-size: 1.2rem; max-width: 40em; color: #efeaff; text-shadow: 0 1px 10px rgba(0,0,0,.8); }
.pagehead { padding: 54px 0 26px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg2), var(--bg)); }
.pagehead p { color: var(--dim); max-width: 44em; font-size: 1.1rem; margin: 0; }
.eyebrow { color: var(--lumen); font: 600 .8rem var(--sans); letter-spacing: .14em; text-transform: uppercase; margin-bottom: .6em; }

.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 9px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.btn:hover { border-color: var(--lumen); color: var(--ink); }
.btn.primary { background: linear-gradient(180deg, #f6d57a, #e2b03f); color: #2a1d00; border-color: #f6d57a; }
.btn.primary:hover { filter: brightness(1.08); color: #2a1d00; }

.dlnote { margin: 16px 0 0; max-width: 40em; padding: 10px 14px; border-left: 4px solid var(--lumen); background: rgba(13,11,20,.72); color: #fff; border-radius: 0 8px 8px 0; font-size: .95rem; }
.pagehead + .narrow .dlnote, main .narrow .dlnote { background: var(--panel); color: var(--ink); }

/* sections and cards */
main section { padding: 10px 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.feature .ico { width: 40px; height: 40px; image-rendering: pixelated; margin-bottom: 10px; }
.stat { text-align: center; }
.stat b { display: block; font: 700 2.2rem var(--serif); color: var(--lumen); }
.stat span { color: var(--dim); font-size: .9rem; }
.callout { border-left: 4px solid var(--lumen); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 18px; margin: 1.2em 0; }
.callout.warn { border-color: var(--red); }
.callout p:last-child { margin: 0; }
.tag { display: inline-block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--dim); margin-right: 4px; }
.tag.gold { color: var(--lumen); border-color: color-mix(in srgb, var(--lumen) 50%, var(--line)); }
.tag.red { color: var(--red); }
.tag.cyan { color: var(--cyan); }

table { width: 100%; border-collapse: collapse; margin: 1em 0 1.6em; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel2); font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* steps */
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 1em 0; display: grid; gap: 12px; }
ol.steps li { counter-increment: s; position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 14px 62px; }
ol.steps li::before { content: counter(s); position: absolute; left: 16px; top: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--lumen); color: var(--lumen); display: grid; place-items: center; font: 700 1rem var(--serif); }

/* gallery */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 18px; }
.chip { background: var(--panel); color: var(--dim); border: 1px solid var(--line); border-radius: 99px; padding: 6px 15px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: #2a1d00; background: var(--lumen); border-color: var(--lumen); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.gallery a.shot { position: relative; display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16/9; }
.gallery a.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.gallery a.shot:hover img { transform: scale(1.04); }
.gallery a.shot span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 8px; font-size: .88rem; color: #fff; background: linear-gradient(0deg, rgba(0,0,0,.8), transparent); }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.strip a.shot { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: block; }
.strip a.shot img { width: 100%; height: 100%; object-fit: cover; }
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(5,4,10,.94); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 16px; }
.lb.open { display: flex; }
.lb img { max-height: calc(100vh - 110px); max-width: 100%; border-radius: 6px; box-shadow: 0 8px 50px #000; }
.lb .cap { color: #ddd; text-align: center; }
.lb button { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 22px; cursor: pointer; }
.lb button:hover { background: rgba(255,255,255,.25); }
.lb .x { top: 14px; right: 14px; } .lb .p { left: 14px; top: 50%; } .lb .n { right: 14px; top: 50%; }

/* bestiary */
.mob { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 22px 0; }
.mob:nth-of-type(even) { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.mob:nth-of-type(even) > img { order: 2; }
.mob > img { width: 100%; height: 100%; object-fit: cover; min-height: 240px; }
.mob .body { padding: 20px 24px; }
.mob h3 { margin-top: 0; font-size: 1.5rem; }
.mob .lore { color: var(--dim); font-style: italic; margin-bottom: 14px; }
.variants { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.variants li { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: .95rem; }
.variants b { color: var(--lumen); }
.tip { margin-top: 12px; font-size: .93rem; color: var(--cyan); }
.tip::before { content: "Tip: "; font-weight: 700; }
@media (max-width: 760px) { .mob, .mob:nth-of-type(even) { grid-template-columns: 1fr; } .mob:nth-of-type(even) > img { order: 0; } }
.bossbar { height: 10px; border-radius: 99px; background: #3a1230; overflow: hidden; margin: 10px 0 4px; } .bossbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #a02060, #ff6a9c); }

/* recipes */
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.recipe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.rhead { display: flex; align-items: center; gap: 14px; }
.rhead > img { width: 44px; height: 44px; image-rendering: pixelated; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.rhead h3 { margin: 0 0 4px; font-size: 1.15rem; }
.craft { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; justify-content: center; }
.cgrid { display: grid; gap: 4px; background: #2b2b2b; padding: 6px; border-radius: 4px; border: 2px solid #000; }
.slot { width: 48px; height: 48px; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; display: grid; place-items: center; position: relative; }
.slot img { width: 36px; height: 36px; image-rendering: pixelated; }
.slot[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 10; white-space: nowrap; background: #100010; color: #fff; border: 2px solid #2d0a63; border-radius: 3px; padding: 3px 8px; font: 600 .82rem var(--sans); pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.6); }
.arrow { font-size: 1.8rem; color: var(--lumen); line-height: 1; }
.out .slot { width: 60px; height: 60px; background: #7a7a7a; box-shadow: 0 0 18px color-mix(in srgb, var(--lumen) 45%, transparent); }
.out .slot img { width: 46px; height: 46px; }
.out .n { position: absolute; right: 3px; bottom: 0; font: 700 .9rem var(--mono); color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.ings { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; }
.ings li { display: flex; align-items: center; gap: 6px; }
.ings img { width: 22px; height: 22px; image-rendering: pixelated; }
.recipe .txt { margin: 0; font-size: .92rem; color: var(--dim); }
.pagehead + .wrap h2:first-child { margin-top: 1.4em; }

/* calculator */
.calc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 1.2em 0; }
.calc .row { display: flex; flex-wrap: wrap; gap: 18px; align-items: end; margin-bottom: 16px; }
.calc label { display: grid; gap: 4px; font-size: .85rem; color: var(--dim); }
.calc select, .calc input[type=number] { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; min-width: 130px; }
.calc .chk { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); padding-bottom: 8px; }
.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 70px 1fr 56px; gap: 10px; align-items: center; font-size: .92rem; }
.bar .track { height: 20px; background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: linear-gradient(90deg, #7b57ff, #f2c75c); transition: width .25s; }
.calc .out { margin-top: 14px; color: var(--dim); font-size: .95rem; }
.calc .out b { color: var(--lumen); }

/* toc layout for guides */
.with-toc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 80px; font-size: .92rem; padding-top: 24px; }
.toc a { display: block; padding: 5px 10px; border-left: 2px solid var(--line); color: var(--dim); text-decoration: none; }
.toc a:hover, .toc a.on { color: var(--lumen); border-left-color: var(--lumen); }
@media (max-width: 900px) { .with-toc { grid-template-columns: 1fr; } .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 16px; } .toc a { border: 1px solid var(--line); border-radius: 99px; } }

details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; margin: 10px 0; }
summary { cursor: pointer; padding: 13px 0; font-weight: 600; }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

footer { margin-top: 70px; border-top: 1px solid var(--line); background: var(--bg2); padding: 34px 0 44px; color: var(--dim); font-size: .92rem; }
footer .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
footer a { color: var(--dim); } footer a:hover { color: var(--lumen); }
footer ul { list-style: none; padding: 0; margin: 0; } footer li { margin: 3px 0; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
