/* Layout: a lantern-lit field guide. Slate plates from the game's own HUD, every page opens on a lit
   "stage" holding the engine render, reference tables sit below on ruled plates. Light theme is the
   game's surveyor's chart: parchment, iron-gall ink, lamp brass. */
:root {
  color-scheme: dark;
  --bg: #131a22;            /* slate */
  --bg-deep: #0d1218;
  --plate: #1a2430;         /* plate-solid */
  --plate-2: #213041;
  --rule: #33455a;
  --rule-soft: #26364a;
  --ink: #ece4d0;           /* bone */
  --dim: #9eabb4;
  --lamp: #f1bf55;
  --lamp-deep: #a87a22;
  --link: #f0c96e;
  --moss: #93c26b;
  --ember: #e5774e;
  --tide: #5fd0c4;
  --stage-glow: rgb(241 191 85 / .16);
  --stage-floor: rgb(0 0 0 / .32);
  --shadow: 0 10px 28px rgb(0 0 0 / .38);
  --band-home: #93c26b; --band-middle: #e2c25a; --band-outer: #ee9455; --band-frontier: #ef7b6b; --band-reserved: #b3a3c4;
  --r-common: #9eabb4; --r-uncommon: #93c26b; --r-rare: #78aef0; --r-very_rare: #c79af2; --r-shared: #78aef0; --r-always: #ece4d0;
  --good: #93c26b; --warn: #e2c25a; --bad: #ef7b6b; --hi: #3b3418;
  --f-display: "Alegreya SC", "Palatino Linotype", Palatino, Georgia, serif;
  --f-body: "Alegreya Sans", "Gill Sans", "Trebuchet MS", system-ui, sans-serif;
  --f-num: "Alegreya Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ece2c8; --bg-deep: #e2d6b6; --plate: #f6efdc; --plate-2: #efe4c8; --rule: #c7b38a; --rule-soft: #dccca4;
    --ink: #2b2214; --dim: #6a5b42; --lamp: #a87a22; --lamp-deep: #8a6214; --link: #7c5212; --moss: #4f7a2e; --ember: #b5492a; --tide: #1f7f78;
    --stage-glow: rgb(255 246 214 / .9); --stage-floor: rgb(75 58 34 / .2); --shadow: 0 8px 22px rgb(75 58 34 / .16);
    --band-home: #4f7a2e; --band-middle: #8a6a00; --band-outer: #b25a1c; --band-frontier: #a8322a; --band-reserved: #6a5a8a;
    --r-common: #6a5b42; --r-uncommon: #3f7a24; --r-rare: #1f5fb0; --r-very_rare: #7a35b8; --r-shared: #1f5fb0; --r-always: #2b2214;
    --good: #3f7a24; --warn: #8a6a00; --bad: #a8322a; --hi: #f5e3a8;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ece2c8; --bg-deep: #e2d6b6; --plate: #f6efdc; --plate-2: #efe4c8; --rule: #c7b38a; --rule-soft: #dccca4;
  --ink: #2b2214; --dim: #6a5b42; --lamp: #a87a22; --lamp-deep: #8a6214; --link: #7c5212; --moss: #4f7a2e; --ember: #b5492a; --tide: #1f7f78;
  --stage-glow: rgb(255 246 214 / .9); --stage-floor: rgb(75 58 34 / .2); --shadow: 0 8px 22px rgb(75 58 34 / .16);
  --band-home: #4f7a2e; --band-middle: #8a6a00; --band-outer: #b25a1c; --band-frontier: #a8322a; --band-reserved: #6a5a8a;
  --r-common: #6a5b42; --r-uncommon: #3f7a24; --r-rare: #1f5fb0; --r-very_rare: #7a35b8; --r-shared: #1f5fb0; --r-always: #2b2214;
  --good: #3f7a24; --warn: #8a6a00; --bad: #a8322a; --hi: #f5e3a8;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.55 var(--f-body); -webkit-font-smoothing: antialiased;
  padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px));
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: .01em; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .84em; color: var(--dim); }
img, svg { max-width: 100%; }
.num, td.n { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- top bar ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg-deep); }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 14px; height: 62px;
  padding-block: 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg-deep) 94%, transparent); border-bottom: 1px solid var(--rule); backdrop-filter: blur(8px);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--lamp-deep) 30%, var(--lamp) 50%, var(--lamp-deep) 70%, transparent); opacity: .55; }
.menu-btn { display: none; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand b { font: 700 24px/1 var(--f-display); letter-spacing: .05em; color: var(--lamp); display: block; }
.brand small { font: 500 12.5px/1 var(--f-body); color: var(--dim); display: block; margin-top: 4px; letter-spacing: .02em; }
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--rule); border-radius: 8px; background: var(--plate); color: var(--ink); font: inherit; font-size: 15.5px; }
.search::before { content: ""; position: absolute; left: 13px; top: 12px; width: 13px; height: 13px; border: 2px solid var(--dim); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 25px; top: 25px; width: 6px; height: 2px; background: var(--dim); transform: rotate(45deg); }
.search kbd { position: absolute; right: 10px; top: 10px; font: 600 12px/18px var(--f-body); color: var(--dim); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; pointer-events: none; }
.search input:focus + kbd { display: none; }
.search .results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--plate); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); max-height: 72vh; overflow: auto; padding: 6px; }
.search .results a { display: flex; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 6px; color: var(--ink); }
.search .results a:hover, .search .results a.sel { background: var(--plate-2); text-decoration: none; }
.search .results .th { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--bg-deep); overflow: hidden; }
.search .results .th img { width: 34px; height: 34px; object-fit: contain; }
.search .results .t { margin-left: auto; font-size: 13px; color: var(--dim); }
.icon-btn { height: 40px; min-width: 40px; display: inline-grid; place-items: center; background: var(--plate); border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); padding: 0 10px; font: inherit; cursor: pointer; }
.icon-btn:hover { border-color: var(--lamp-deep); color: var(--lamp); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
.nav { position: sticky; top: calc(62px + env(safe-area-inset-top, 0px)); align-self: start; max-height: calc(100vh - 62px); overflow: auto; padding: 18px 10px 40px max(14px, env(safe-area-inset-left, 0px)); scrollbar-width: thin; }
.nav details { margin: 0 0 6px; }
.nav summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 8px; font: 700 15px var(--f-display); color: var(--lamp); letter-spacing: .04em; border-radius: 6px; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(45deg); transition: transform .15s; }
.nav details:not([open]) summary::after { transform: rotate(-45deg); }
.nav summary:hover { background: var(--plate); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 10px; border-radius: 6px; color: var(--ink); font-size: 15px; border-left: 2px solid transparent; }
.nav a:hover { background: var(--plate); text-decoration: none; }
.nav a.on { background: var(--plate-2); border-left-color: var(--lamp); color: var(--lamp); }
.nav .ni { width: 22px; height: 22px; flex: none; display: grid; place-items: center; color: var(--dim); }
.nav .ni img { width: 24px; height: 24px; object-fit: contain; }
.nav .ni svg { width: 17px; height: 17px; }
.nav a.on .ni { color: var(--lamp); }
main { padding-block: 22px 0; padding-left: 30px; padding-right: max(20px, env(safe-area-inset-right, 0px)); min-width: 0; }
.page { max-width: 1120px; }
.page.wide { max-width: 1240px; }

/* ---------- crumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--dim); margin: 0 0 12px; }
.crumbs a { color: var(--dim); }
.crumbs a:hover { color: var(--link); }
.crumbs .sep { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); opacity: .6; }
.crumbs span:last-child { color: var(--ink); }

/* ---------- typography in pages ---------- */
h1.title { font-size: 44px; margin: 0 0 14px; color: var(--ink); }
.page h2 { font-size: 28px; margin: 38px 0 14px; color: var(--ink); display: flex; align-items: baseline; gap: 12px; }
.page h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rule), transparent); align-self: center; }
.page h3 { font-size: 20px; margin: 24px 0 8px; color: var(--lamp); }
.page p { margin: 0 0 12px; max-width: 72ch; }
.page ul, .page ol { margin: 0 0 14px; padding-left: 22px; max-width: 72ch; }
.page li { margin-bottom: 4px; }
.page li::marker { color: var(--lamp-deep); }
.lead { font-size: 19px; line-height: 1.5; color: var(--ink); }
.muted { color: var(--dim); }
.sub { font-size: 14px; color: var(--dim); }
.clear { clear: both; }

/* ---------- the stage: where engine renders stand ---------- */
.stage { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 12px;
  background: radial-gradient(60% 55% at 50% 42%, var(--stage-glow), transparent 72%), linear-gradient(180deg, var(--plate-2), var(--plate)); }
.stage::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 9%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, var(--stage-floor), transparent); z-index: 0; }
.stage img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.stage.water { background: radial-gradient(60% 55% at 50% 50%, color-mix(in srgb, var(--tide) 24%, transparent), transparent 75%), linear-gradient(180deg, var(--plate-2), var(--plate)); }
.stage.water::after { display: none; }

/* ---------- entity hero ---------- */
.hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: center; margin: 0 0 26px; padding: 18px; border: 1px solid var(--rule); border-radius: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tint, var(--lamp)) 14%, var(--plate)) 0%, var(--plate) 60%); box-shadow: var(--shadow); }
.hero .stage { aspect-ratio: 1; width: 100%; }
.hero .stage.sm img { width: 72%; height: 72%; }
.hero-tx { min-width: 0; display: flex; flex-direction: column; gap: 12px; padding-right: 8px; }
.hero .kind { font: 600 15px var(--f-body); color: var(--lamp); letter-spacing: .03em; }
.hero h1 { font-size: 52px; line-height: 1; color: var(--ink); }
.hero .lead { margin: 0; max-width: 60ch; font-size: 18px; color: var(--ink); opacity: .92; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; }
.facts > div { display: flex; flex-direction: column; min-width: 92px; padding: 7px 12px 8px; border-radius: 8px; background: var(--bg-deep); border: 1px solid var(--rule-soft); }
.facts dt { font-size: 12.5px; color: var(--dim); }
.facts dd { margin: 0; font: 700 19px/1.2 var(--f-display); color: var(--ink); font-variant-numeric: lining-nums; }
.facts dd.good { color: var(--good); } .facts dd.bad { color: var(--bad); }
.related { display: flex; gap: 10px; flex-wrap: wrap; }
.related a { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--bg-deep); border: 1px solid var(--rule-soft); color: var(--ink); font-size: 14.5px; }
.related a:hover { border-color: var(--lamp-deep); text-decoration: none; color: var(--lamp); }
.related img, .related .ico { width: 32px; height: 32px; object-fit: contain; }
.related a.here { border-color: var(--lamp-deep); }

/* ---------- skill hero ---------- */
.shero { position: relative; margin: 0 0 18px; border-radius: 18px; overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow);
  background: radial-gradient(70% 90% at 80% 10%, color-mix(in srgb, var(--tint) 24%, transparent), transparent 70%), linear-gradient(180deg, var(--plate-2), var(--plate) 80%); }
.shero-top { display: flex; gap: 20px; align-items: center; padding: 26px 28px 8px; }
.shero .emblem { width: 84px; height: 84px; flex: none; }
.shero h1 { font-size: 60px; line-height: .95; }
.shero .kind { color: var(--lamp); font-weight: 600; margin-bottom: 4px; }
.shero .lead { margin: 6px 0 0; max-width: 64ch; font-size: 18px; }
.shero .facts { padding: 4px 28px 0; }
.parade { position: relative; display: flex; align-items: flex-end; gap: 0; padding: 10px 18px 0; margin-top: 10px; overflow-x: auto; scrollbar-width: thin; }
.parade::before { content: ""; position: absolute; left: 0; right: 0; bottom: 34px; height: 1px; background: var(--rule); }
.parade a { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; color: var(--dim); font-size: 12.5px; padding-bottom: 8px; }
.parade a:hover { text-decoration: none; color: var(--lamp); }
.parade a:hover img { transform: translateY(-4px); }
.parade img { width: var(--w, 112px); height: var(--w, 112px); object-fit: contain; object-position: bottom; transition: transform .15s; margin-bottom: 6px; }
.parade b { font: 700 13px/1 var(--f-display); color: var(--ink); background: var(--bg-deep); border: 1px solid var(--rule); border-radius: 99px; padding: 3px 8px; position: relative; z-index: 1; }
.parade a:hover b { border-color: var(--lamp); color: var(--lamp); }

/* ---------- jump bar ---------- */
.jump { position: sticky; top: calc(62px + env(safe-area-inset-top, 0px)); z-index: 10; display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 8px; padding: 8px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
.jump a { padding: 4px 12px; border-radius: 99px; font-size: 14.5px; color: var(--dim); border: 1px solid transparent; }
.jump a:hover { color: var(--lamp); border-color: var(--rule); text-decoration: none; }

/* ---------- node cards ("what you can do") ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; margin: 0 0 18px; }
.ncard { display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--rule-soft); background: var(--plate); color: var(--ink); overflow: hidden; transition: border-color .15s, transform .15s; }
.ncard:hover { text-decoration: none; border-color: var(--lamp-deep); transform: translateY(-2px); }
.ncard .stage { aspect-ratio: 4 / 3; border-radius: 0; }
.ncard .stage img { width: 86%; height: 92%; }
.ncard .stage.sm img { width: 60%; height: 64%; }
.ncard .lv { position: absolute; top: 10px; left: 10px; z-index: 2; font: 700 13px/1 var(--f-display); background: var(--bg-deep); color: var(--lamp); border: 1px solid var(--lamp-deep); border-radius: 99px; padding: 5px 9px 4px; }
.ncard .tag { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 12px; font-weight: 600; background: var(--bg-deep); color: var(--dim); border-radius: 99px; padding: 2px 8px; border: 1px solid var(--rule-soft); }
.ncard .body { padding: 10px 14px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ncard .nm { font: 700 18px/1.15 var(--f-display); }
.ncard .xp { font-size: 14px; color: var(--lamp); font-weight: 600; }
.ncard .ln { font-size: 14px; color: var(--dim); line-height: 1.4; }
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cards.compact .stage { aspect-ratio: 1; }
.cards.compact .nm { font-size: 16px; }

/* ---------- level timeline ---------- */
.timeline { position: relative; margin: 6px 0 22px; padding: 0 0 0 0; list-style: none; max-width: none !important; }
.timeline li { position: relative; display: grid; grid-template-columns: 64px 18px minmax(0, 1fr); gap: 0 12px; align-items: start; margin: 0; padding: 0 0 12px; }
.timeline li::before { content: ""; position: absolute; left: 82px; top: 18px; bottom: -4px; width: 2px; background: var(--rule); }
.timeline li:last-child::before { display: none; }
.timeline .tl { font: 700 22px/1 var(--f-display); color: var(--lamp); text-align: right; padding-top: 4px; font-variant-numeric: lining-nums; }
.timeline .dot { width: 14px; height: 14px; margin: 7px 0 0 2px; border-radius: 50%; background: var(--bg); border: 3px solid var(--lamp); position: relative; z-index: 1; }
.timeline .tx { display: flex; gap: 8px; align-items: center; padding-top: 2px; min-width: 0; }
.timeline .tx > span:last-child { flex: 1; min-width: 0; }
.timeline .tx a { flex: none; display: flex; }
.timeline .tx img { width: 36px; height: 36px; object-fit: contain; }
.tl-wrap { columns: 2 420px; column-gap: 32px; }
.tl-wrap .timeline li { break-inside: avoid; }

/* ---------- best methods ---------- */
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 18px; }
.method { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--plate); border: 1px solid var(--rule-soft); }
.method .stage { width: 72px; height: 72px; border-radius: 10px; }
.method .stage img { width: 88%; height: 88%; }
.method .rng { font-size: 13px; color: var(--dim); }
.method b { display: block; font: 700 17px/1.2 var(--f-display); }
.method .rate { font-size: 14px; color: var(--lamp); font-weight: 600; }

/* ---------- panel / tips ---------- */
.panel { background: var(--plate); border: 1px solid var(--rule-soft); border-radius: 12px; padding: 16px 20px; margin: 0 0 18px; }
.panel h3 { margin-top: 0; }
.panel ul { margin-bottom: 0; }
.tips { columns: 2 340px; column-gap: 34px; margin: 0; padding-left: 20px; max-width: none !important; }
.tips li { break-inside: avoid; margin-bottom: 8px; }

/* ---------- infobox ---------- */
.infobox { float: right; clear: right; width: 320px; margin: 0 0 18px 26px; background: var(--plate); border: 1px solid var(--rule); border-radius: 12px; font-size: 15px; overflow: hidden; }
.infobox > .hd { font: 700 19px var(--f-display); padding: 10px 14px; background: var(--plate-2); color: var(--lamp); border-bottom: 1px solid var(--rule); }
.infobox .pic { display: none; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th { text-align: left; font-weight: 500; width: 42%; padding: 6px 14px; color: var(--dim); vertical-align: top; font-size: 14.5px; }
.infobox td { padding: 6px 14px 6px 4px; vertical-align: top; }
.infobox tr + tr > * { border-top: 1px solid var(--rule-soft); }
.infobox .sec { background: var(--bg-deep); font: 700 14px var(--f-display); letter-spacing: .04em; text-align: left; padding: 6px 14px; color: var(--lamp); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--rule-soft); border-radius: 12px; background: var(--plate); }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { background: var(--plate-2); text-align: left; padding: 9px 12px; font: 700 14px var(--f-display); letter-spacing: .03em; color: var(--lamp); white-space: nowrap; border-bottom: 1px solid var(--rule); }
table.t td { padding: 7px 12px; border-top: 1px solid var(--rule-soft); vertical-align: middle; }
table.t tr:first-child td { border-top: 0; }
table.t td.n, table.t th.n { text-align: right; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--lamp) 7%, transparent); }
table.t tr.hide { display: none; }
table.t td .il { gap: 9px; }
.tools-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; align-items: center; }
.tools-row input, .tools-row select, .calc input, .calc select { height: 38px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--plate); color: var(--ink); font: inherit; font-size: 15px; min-width: 0; }
.tools-row .count { font-size: 14px; color: var(--dim); margin-left: auto; }

/* ---------- inline bits ---------- */
.ico { display: inline-block; vertical-align: -0.35em; flex: none; }
img.ico { object-fit: contain; }
.il { display: inline-flex; align-items: center; gap: 7px; }
.chip { display: inline-block; padding: 1px 10px; border-radius: 99px; font: 600 13px/20px var(--f-body); border: 1px solid currentColor; white-space: nowrap; }
.band-home { color: var(--band-home); } .band-middle { color: var(--band-middle); } .band-outer { color: var(--band-outer); } .band-frontier { color: var(--band-frontier); } .band-reserved { color: var(--band-reserved); }
.r-always { color: var(--r-always); } .r-common { color: var(--r-common); } .r-uncommon { color: var(--r-uncommon); } .r-rare, .r-shared { color: var(--r-rare); } .r-very_rare { color: var(--r-very_rare); font-weight: 700; }
.d-easy { color: var(--good); } .d-even { color: var(--warn); } .d-risky { color: var(--band-outer); } .d-deadly { color: var(--bad); }
.callout { border: 1px solid var(--rule-soft); border-left: 4px solid var(--lamp); background: var(--plate); padding: 12px 16px; margin: 0 0 16px; border-radius: 8px; max-width: 76ch; }
.callout.warn { border-left-color: var(--ember); }
.callout > :last-child { margin-bottom: 0; }
.say { border-left: 3px solid var(--lamp-deep); padding: 6px 14px; font-style: italic; margin: 4px 0 12px; max-width: 72ch; background: var(--plate); border-radius: 0 8px 8px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 0 0 16px; }
.card { display: block; padding: 14px 16px; background: var(--plate); border: 1px solid var(--rule-soft); border-radius: 10px; color: var(--ink); }
.card:hover { border-color: var(--lamp-deep); text-decoration: none; }
.card b { font: 700 18px var(--font-display, var(--f-display)); display: block; color: var(--lamp); }
.card span { font-size: 14.5px; color: var(--dim); display: block; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.stat { background: var(--plate); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 8px 16px; min-width: 110px; color: var(--ink); }
.stat b { display: block; font: 700 26px/1.1 var(--f-display); font-variant-numeric: lining-nums; color: var(--lamp); }
.stat span { font-size: 14px; color: var(--dim); }
.steps { counter-reset: s; list-style: none; padding: 0 !important; max-width: 90ch; }
.steps > li { counter-increment: s; position: relative; padding: 10px 14px 10px 54px; border: 1px solid var(--rule-soft); border-radius: 10px; background: var(--plate); margin-bottom: 8px; }
.steps > li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-deep); border: 2px solid var(--lamp); color: var(--lamp); font: 700 15px/26px var(--f-display); text-align: center; }
.steps .k { font: 700 14px var(--f-display); letter-spacing: .04em; color: var(--lamp); }
details { margin: 0 0 14px; }
summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; border-bottom: 1px solid var(--rule); }
.tabs button { background: transparent; border: 0; padding: 9px 16px; font: 700 16px var(--f-display); color: var(--dim); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--lamp); border-color: var(--lamp); }
.bar { height: 8px; background: var(--bg-deep); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--lamp); }
.toc { background: var(--plate); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 10px 18px; display: inline-block; margin: 0 0 16px; font-size: 15px; }
.toc b { font: 700 15px var(--f-display); color: var(--lamp); }
.toc ol { margin: 4px 0 0; padding-left: 18px; }

/* ---------- see also ---------- */
.seealso { margin: 40px 0 0; padding: 18px 0 0; border-top: 1px solid var(--rule); }
.seealso h2 { margin-top: 0 !important; font-size: 22px !important; }
.strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.strip a { flex: 0 0 148px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.strip a:hover { text-decoration: none; color: var(--lamp); }
.strip .stage { aspect-ratio: 1; border: 1px solid var(--rule-soft); }
.strip .stage img { width: 84%; height: 84%; }
.strip .stage.sm img { width: 58%; height: 58%; }
.strip b { font: 700 15px/1.2 var(--f-display); }
.strip span { font-size: 13px; color: var(--dim); margin-top: -4px; }

/* ---------- galleries ---------- */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin: 0 0 22px; }
.gal a { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--plate); border: 1px solid var(--rule-soft); color: var(--ink); }
.gal a:hover { text-decoration: none; border-color: var(--lamp-deep); }
.gal .stage { aspect-ratio: 1; border-radius: 0; }
.gal .stage img { width: 88%; height: 88%; }
.gal .body { padding: 9px 12px 11px; }
.gal b { display: block; font: 700 17px/1.2 var(--f-display); }
.gal span { font-size: 13.5px; color: var(--dim); }
.objgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin: 12px 0 22px; }
.objcard { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--plate); border: 1px solid var(--rule-soft); }
.objcard .stage { aspect-ratio: 1; border-radius: 0; }
.objcard .stage img { width: 86%; height: 86%; }
.objcard > div:last-child { padding: 9px 12px 12px; }
.objcard b { display: block; font: 700 17px/1.2 var(--f-display); }
.objcard span { color: var(--dim); font-size: 13.5px; }

/* ---------- portraits & sprite icons ---------- */
.por { border-radius: 10px; flex: none; background: var(--bg-deep); object-fit: contain; }
.il .por { border-radius: 7px; }
.spr { background-image: url(art/items.png); background-repeat: no-repeat; }
.tile { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; flex: none; background: radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--c) 55%, #fff) 0%, color-mix(in srgb, var(--c) 78%, #000) 100%); }
.sk { display: inline-flex; align-items: center; justify-content: center; border-radius: 24%; flex: none; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 66%, #000)); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .25), 0 1px 2px rgb(0 0 0 / .3); }
.sk svg { filter: drop-shadow(0 1px 1px rgb(0 0 0 / .4)); }

/* ---------- hover preview ---------- */
.pv { position: fixed; z-index: 50; width: 300px; pointer-events: none; background: var(--plate); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.pv.on { opacity: 1; transform: none; }
.pv .stage { aspect-ratio: 16 / 9; border-radius: 0; }
.pv .stage img { width: auto; height: 92%; }
.pv .stage.sm img { height: 62%; }
.pv .b { padding: 10px 14px 12px; }
.pv .k { font-size: 13px; color: var(--lamp); font-weight: 600; }
.pv b { display: block; font: 700 20px/1.15 var(--f-display); margin: 1px 0 4px; }
.pv p { margin: 0; font-size: 14px; color: var(--dim); line-height: 1.4; }
.pv .facts > div { min-width: 0; padding: 4px 9px 5px; }
.pv .facts dd { font-size: 15px; }
.pv .facts { margin-top: 8px; gap: 6px; }
@media (hover: none) { .pv { display: none; } }

/* ---------- calculators ---------- */
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; margin: 0 0 14px; max-width: 900px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--dim); }
.result { background: var(--plate); border: 1px solid var(--rule-soft); border-left: 4px solid var(--lamp); padding: 12px 18px; border-radius: 10px; max-width: 900px; }
.result dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; }
.result dt { font-size: 13.5px; color: var(--dim); }
.result dd { margin: 0; font: 700 24px var(--f-display); font-variant-numeric: lining-nums; color: var(--lamp); }

/* ---------- map ---------- */
.mapwrap { position: relative; border: 1px solid var(--rule); background: #1b3a47; border-radius: 12px; overflow: hidden; height: min(78vh, 760px); touch-action: none; cursor: grab; }
.mapwrap:active { cursor: grabbing; }
.mapinner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.mapinner img { display: block; user-select: none; -webkit-user-drag: none; max-width: none; }
.mk { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5); padding: 0; cursor: pointer; }
.mk.sq { border-radius: 2px; }
.mk:hover { z-index: 5; }
.rl { position: absolute; color: #fff; font: 700 15px "Alegreya SC", Georgia, serif; text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; pointer-events: none; letter-spacing: 0.04em; }
.mapctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 6; }
.mapctl button { width: 36px; height: 36px; font-size: 18px; background: var(--plate); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; }
.maptip { position: absolute; left: 10px; bottom: 10px; z-index: 6; background: var(--plate); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 12px; font-size: 14px; max-width: min(420px, 85%); }
.layers { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 14.5px; }
.layers label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1px solid var(--ink); }

/* ---------- home ---------- */
.banner { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; gap: 10px; margin: 0 0 22px; border-radius: 18px; overflow: hidden; border: 1px solid var(--rule); min-height: 380px; box-shadow: var(--shadow);
  background: linear-gradient(90deg, rgb(13 18 24 / .95) 0%, rgb(13 18 24 / .78) 38%, rgb(13 18 24 / .05) 75%), url(art/scene/valley.webp) 62% 62% / cover no-repeat; color: #ece4d0; }
.banner-tx { padding: 40px 0 36px 40px; position: relative; z-index: 2; }
.banner .eyebrow { font-weight: 600; color: #f1bf55; font-size: 16px; }
.banner h1 { font-size: 84px; line-height: .9; margin: 8px 0 14px; color: #f1bf55; letter-spacing: .03em; text-shadow: 0 4px 22px rgb(0 0 0 / .6); }
.banner p { font-size: 19px; margin: 0 0 22px; color: #e4dccb; max-width: 46ch; }
.banner .cast { position: relative; align-self: end; height: 100%; min-height: 300px; }
.banner .cast img { position: absolute; bottom: 0; object-fit: contain; filter: drop-shadow(0 10px 14px rgb(0 0 0 / .5)); }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; background: #f1bf55; color: #1a1408; font-weight: 700; border: 2px solid #f1bf55; font-size: 16px; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.alt { background: transparent; border-color: rgb(236 228 208 / .55); color: #ece4d0; }
.skillrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 18px; }
.skillrow a { position: relative; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--plate); border: 1px solid var(--rule-soft); color: var(--ink); }
.skillrow a:hover { text-decoration: none; border-color: var(--lamp-deep); }
.skillrow .stage { aspect-ratio: 5 / 4; border-radius: 0; }
.skillrow .stage img { width: 80%; height: 86%; }
.skillrow .sk { position: absolute; top: 8px; left: 8px; z-index: 2; }
.skillrow b { padding: 8px 12px 10px; font: 700 18px var(--f-display); }
.home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 0 0 18px; }
.home-cards a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 12px; background: var(--plate); border: 1px solid var(--rule-soft); color: var(--ink); }
.home-cards a:hover { text-decoration: none; border-color: var(--lamp-deep); }
.home-cards .stage { width: 64px; height: 64px; border-radius: 10px; }
.home-cards .stage img { width: 90%; height: 90%; }
.home-cards b { display: block; font: 700 18px/1.2 var(--f-display); color: var(--lamp); }
.home-cards span { font-size: 14px; color: var(--dim); }
.bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 0 0 18px; border-radius: 12px; overflow: hidden; border: 1px solid var(--rule-soft); }
.bandcard { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: color-mix(in srgb, currentColor 10%, var(--plate)); border-top: 5px solid currentColor; }
.bandcard:hover { text-decoration: none; background: color-mix(in srgb, currentColor 18%, var(--plate)); }
.bandcard b { font: 700 22px var(--f-display); }
.bandcard .lv { font-weight: 700; font-size: 14px; }
.bandcard span:last-child { color: var(--ink); font-size: 14.5px; }

/* ---------- footer ---------- */
.foot { margin: 56px 0 0; padding: 28px 0 30px; border-top: 1px solid var(--rule); color: var(--dim); font-size: 14.5px; }
.foot .cols { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 24px; }
.foot h4 { font: 700 16px var(--f-display); color: var(--lamp); margin: 0 0 8px; }
.foot ul { list-style: none; margin: 0; padding: 0 !important; }
.foot li { margin: 0 0 4px; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--link); }
.foot .brandline { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; color: var(--ink); font: 700 20px var(--f-display); }
.foot .brandline svg { width: 30px; height: 30px; }
.foot p { max-width: 42ch; margin: 0 0 8px; }
.foot .fine { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; max-width: none; }

/* ---------- motion ---------- */
.page { animation: rise .22s ease-out both; }
@keyframes rise { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page, .nav summary::after, .ncard, .parade img, .pv { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .foot .cols { grid-template-columns: 1fr 1fr; }
  .banner { grid-template-columns: 1fr; }
  .banner .cast { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; z-index: 25; left: 0; top: calc(62px + env(safe-area-inset-top, 0px)); bottom: 0; width: min(300px, 86vw); max-height: none; background: var(--bg-deep); transform: translateX(-105%); transition: transform 0.18s; box-shadow: var(--shadow); border-right: 1px solid var(--rule); }
  .nav.open { transform: none; }
  .menu-btn { display: inline-grid; }
  main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .infobox { float: none; width: 100%; margin: 0 0 18px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px; }
  .hero .stage { max-width: 320px; justify-self: center; }
  .hero h1 { font-size: 40px; }
  .shero-top { padding: 20px 18px 6px; gap: 14px; }
  .shero .emblem { width: 60px; height: 60px; }
  .shero h1 { font-size: 44px; }
  .shero .facts { padding: 4px 18px 0; }
  .brand small, .search kbd { display: none; }
  h1.title { font-size: 34px; }
  .banner h1 { font-size: 60px; }
  .banner-tx { padding: 26px 20px; }
  .tl-wrap { columns: 1; }
}
@media (max-width: 560px) {
  .brand b { font-size: 20px; }
  .brand-mark { width: 30px; height: 30px; }
  .top { gap: 8px; }
  .facts > div { min-width: 0; flex: 1 1 40%; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ncard .nm { font-size: 16px; }
  .ncard .body { padding: 8px 10px 10px; }
  .gal, .objgrid, .skillrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot .cols { grid-template-columns: 1fr; }
  .page h2 { font-size: 24px; }
  .timeline li { grid-template-columns: 44px 18px minmax(0, 1fr); gap: 0 8px; }
  .timeline li::before { left: 60px; }
  .timeline .tl { font-size: 18px; }
}

.hero.bare { grid-template-columns: minmax(0, 1fr); padding: 26px 28px; }
@media (max-width: 560px) {
  .shero-top { flex-direction: column; align-items: flex-start; }
  .shero .emblem { width: 52px; height: 52px; }
  .shero h1 { font-size: 40px; }
  .search input { padding-left: 34px; }
}

.stage.scene { background: var(--bg-deep); }
.stage.scene::after { display: none; }
.stage.scene img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.hero .stage.scene { aspect-ratio: 4 / 3; }
.banner { min-height: 420px; }

.rl.pl { font: italic 600 11px "Alegreya SC", Georgia, serif; color: #f6e8c0; letter-spacing: 0.02em; }
