/* Mocha Bevel colours (JasmGui.java), as normal web text */
:root {
  --base: #1e1e2e; --mantle: #181825; --crust: #11111b; --surface: #313244; --overlay: #45475a;
  --text: #cdd6f4; --subtext: #a6adc8; --muted: #7f849c; --accent: #b4befe; --good: #a6e3a1; --link: #89dceb;
  --panel: #c6c6c6; --panel-text: #373737;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--base); color: var(--text); font: 16px/1.55 system-ui, sans-serif; }
header { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center; padding: 10px 16px;
  background: var(--mantle); border-bottom: 2px solid var(--crust); }
.logo { color: var(--text); font-weight: 700; text-decoration: none; margin-right: auto; }
.menu { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }
#search, #versions { background: var(--crust); color: var(--text); border: 1px solid var(--overlay); border-radius: 6px;
  padding: 6px 10px; font: inherit; }
#search { width: min(320px, 40vw); }
#results { position: absolute; top: 52px; right: 120px; width: min(460px, 92vw); background: var(--mantle);
  border: 1px solid var(--overlay); border-radius: 8px; display: none; max-height: 70vh; overflow: auto; }
#results a { display: block; padding: 8px 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--surface); }
#results a:hover, #results a.active { background: var(--surface); }
#results small { display: block; color: var(--muted); }
.layout { display: flex; max-width: 1200px; margin: 0 auto; }
.sidebar { width: 260px; flex: none; padding: 16px; position: sticky; top: 56px; align-self: flex-start;
  height: calc(100vh - 56px); overflow: auto; font-size: 15px; background: var(--mantle); }
.sidebar ul { list-style: none; margin: 0; padding-left: 14px; }
.sidebar > ul { padding-left: 0; }
.sidebar a { color: var(--subtext); text-decoration: none; }
.sidebar a:hover, .sidebar a.here { color: var(--accent); }
main { flex: 1; min-width: 0; padding: 16px 28px 64px; }
h1 { margin: 8px 0 4px; } h2 { margin-top: 1.8em; border-bottom: 1px solid var(--surface); }
a { color: var(--link); }
.tags { display: flex; gap: 6px; align-items: center; margin-bottom: 16px; font-size: 13px; }
.tag { padding: 1px 8px; border-radius: 10px; background: var(--surface); color: var(--subtext); text-decoration: none; }
.tag.current { background: var(--accent); color: var(--crust); }
.built { color: var(--muted); }
.notice { background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin: 10px 0; }
.column { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
img.item, img.picture, .slot img, .recipe-head img { image-rendering: pixelated; }
img.picture { max-width: 100%; height: auto; }
.table { overflow-x: auto; }
table { border-collapse: collapse; margin: 10px 0; }
th, td { border-bottom: 1px solid var(--overlay); padding: 4px 12px 4px 0; text-align: left; }
kbd { background: var(--surface); border: 1px solid var(--overlay); border-bottom-width: 3px; border-radius: 4px;
  padding: 0 6px; font: 14px monospace; }
.recipe { display: inline-block; background: var(--panel); color: var(--panel-text); border: 2px solid #fff;
  border-right-color: #555; border-bottom-color: #555; padding: 6px 10px 8px; margin: 6px 8px 6px 0; vertical-align: top; }
.recipe-head { display: flex; gap: 6px; align-items: center; font-size: 14px; margin-bottom: 4px; }
.recipe-head img { width: 20px; }
.recipe-body { display: flex; align-items: center; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 36px); }
.recipe .row { margin: 0; gap: 0; flex-wrap: nowrap; }
.slot { position: relative; width: 36px; height: 36px; background: #8b8b8b; border: 2px solid #373737;
  border-right-color: #fff; border-bottom-color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.slot img { width: 32px; }
.count { position: absolute; right: 1px; bottom: -2px; color: #fff; font: 700 13px monospace; text-shadow: 1px 1px #3f3f3f; }
.arrow { width: 0; height: 0; border: 9px solid transparent; border-left: 14px solid #8b8b8b; }
.note { margin: 6px 0 0; font-size: 13px; color: var(--panel-text); }
#tip { position: fixed; z-index: 10; pointer-events: none; background: #100010f0; color: #fff; border: 2px solid #2b0b5e;
  border-radius: 3px; padding: 2px 6px; font-size: 14px; display: none; }
@media (max-width: 800px) {
  .menu { display: block; }
  .sidebar { display: none; position: fixed; top: 52px; left: 0; bottom: 0; z-index: 4; background: var(--mantle);
    max-height: none; height: calc(100vh - 52px); height: calc(100dvh - 52px); width: 80vw; overscroll-behavior: contain; }
  body.menu-open .sidebar { display: block; }
  body.menu-open { overflow: hidden; }
  main { padding: 12px 14px 48px; }
  #results { right: 8px; }
  .logo { display: none; }
  header { gap: 8px; padding: 8px 10px; }
  #search { flex: 1; min-width: 0; width: auto; }
  #versions { max-width: 120px; }
  img.item { max-width: 20vw; height: auto; }
  img.picture { max-width: 100%; }
}

/* Small motion: pages fade in, menus and tooltips ease open, links and slots answer the mouse */
@view-transition { navigation: auto; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes slide-out { from { transform: none; } to { transform: translateX(-100%); } }
html { scroll-behavior: smooth; }
main { animation: rise .25s ease-out; }
#results { animation: rise .15s ease-out; }
#tip { animation: fade .12s ease-out; }
a, .tag, .sidebar a { transition: color .15s, background-color .15s, border-color .15s; }
.sidebar a { display: inline-flex; align-items: center; gap: 6px; padding: 1px 0; transition: color .15s, transform .15s; }
.sidebar a:hover { transform: translateX(2px); }
.sidebar a.here { font-weight: 600; }
#search, #versions { transition: border-color .15s, box-shadow .15s; }
#search:focus, #versions:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px #b4befe33; }
.tag:not(.current):hover { background: var(--overlay); color: var(--text); }
#results a { transition: background-color .12s; }
.slot::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; transition: opacity .1s; }
.slot:hover::after { opacity: .35; }
@media (max-width: 800px) {
  body.menu-open .sidebar { animation: slide .18s ease-out; }
  body.menu-closing .sidebar { display: block; animation: slide-out .14s ease-in forwards; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* Sidebar icons and folding groups */
.nav-icon { width: 18px; height: 18px; flex: none; image-rendering: pixelated; }
.sidebar summary { list-style: none; cursor: pointer; position: relative; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::before { content: ""; position: absolute; left: -13px; top: .62em; border: 4px solid transparent;
  border-left: 6px solid var(--muted); transition: transform .15s, border-color .15s; transform-origin: 3px 4px; }
.sidebar summary:hover::before { border-left-color: var(--accent); }
.sidebar details[open] > summary::before { transform: rotate(90deg); }
.sidebar details[open] > ul { animation: rise .15s ease-out; }
.sidebar > ul { padding-left: 14px; }
