/* Wizard Toolbox: the Spellbook skin. Loaded after app.css on every page, so
   the shared classes keep their markup and take this look: the Tiny5 pixel
   font, pixel textures on the bars and walls, ink edges and hard shadows,
   dark by default. docs/STYLEGUIDE.md says what each rule is for. The
   textures are drawn by build/pixel.mjs into /img/px/. */

/* Tiny5 with its digits redrawn on square corners so 0/8, 3/8/9 and 5/6 read
   apart (feedback: numbers hard to tell apart). */
@font-face {
  font-family: "Tiny5";
  font-style: normal;
  font-display: block;
  font-weight: 400;
  src: url(/fonts/tiny5-latin-400-normal.woff2) format("woff2");
}
/* Text under 24px: Departure Mono by Helena Zhang (OFL,
   public/fonts/LICENSE-departure-mono.txt). Lowercase 6 pixels tall and
   distinct digits, where Tiny5's 4-pixel lowercase blurs at small sizes
   (feedback: small text and numbers hard to read). size-adjust keeps its
   footprint close to Tiny5 so layouts do not move. Tiny5 stays on titles and
   headings. */
@font-face {
  font-family: "Departure Mono";
  font-style: normal;
  font-display: block;
  font-weight: 400;
  size-adjust: 85%;
  src: url(/fonts/departure-mono-latin-400-normal.woff2) format("woff2");
}
:root {
  --bg: #140e24;          /* wells you type in */
  --bg-deep: #120c22;     /* under the wall */
  --surface: #221a38;     /* pages, cards, sheets */
  --surface-2: #2f2452;   /* buttons and chips at rest */
  --glass: var(--surface);
  --edge: #07040d;
  --ink: #07040d;
  --rule: #3b2f63;
  --text: #f1edfb;
  --muted: #b0a7cc;
  --faint: #8279a3;
  --accent: #8b5cf6;
  --accent-strong: #a37ff8;
  --gold: #e8b44f;
  --pixel: "Tiny5", ui-monospace, monospace;
  --small: "Departure Mono", ui-monospace, monospace;
  /* Long reading text (FAQs, help, privacy and terms) stays in a plain face. */
  --read: "Archivo", "Segoe UI", system-ui, sans-serif;
  --display: var(--small);
  --body: var(--small);
  --mono: var(--small);
  /* Texture tiles, drawn at 2x so each texel is a 2px block. */
  --tex-wall: url(/img/px/wall.png?v=2);
  --tex-wall-size: 2304px 1792px;
  --tex-bar: url(/img/px/bar.png);
  --tex-desk: url(/img/px/desk.png);
  --tex-wood: url(/img/px/wood.png);
}

html { background: var(--bg-deep); }
body {
  font-family: var(--body);
  font-synthesis: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  /* The page wall: dark purple brick that scrolls with the page, like a real wall; no glows. */
  background: var(--tex-wall) 0 0 / var(--tex-wall-size) repeat, var(--bg-deep);
  image-rendering: pixelated;
}
img, canvas, video, iframe { image-rendering: auto; }
.px-icon { display: block; flex: none; image-rendering: pixelated; }

/* Pixel type has one weight: bold is never faked, size and colour carry rank. */
h1, h2, h3, h4, b, strong, th, .btn, button { font-weight: 400; }
h1, h2, h3 { font-family: var(--pixel); letter-spacing: 0.02em; }
h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
  text-shadow: 3px 3px 0 var(--ink);
}
h2 { font-size: 24px; line-height: 1.15; text-shadow: 2px 2px 0 var(--ink); }
h3 { font-size: 16px; }

/* Reading text keeps a plain face so paragraphs stay easy to read. */
.prose p, .prose li, .prose dd, .prose td, .faq p, .faq dd, .sp-about-body p, .sp-about-body li,
.info-body p, .info-body li, .info-body td, .legal p, .legal li {
  font-family: var(--read);
  -webkit-font-smoothing: antialiased;
}

/* No back-light, no cursor light: the pixel walls carry the mood. */
.lit, .lit-field, .lit-text { --lit-a: 0 !important; }
.lit::before, .lit::after, .lit-field::before, .lit-field::after { display: none !important; }
.lit { background-image: var(--lit-under, none); }

/* ---- Top bar: a textured pixel bar ---- */
.topbar {
  background: var(--tex-wall) 0 0 / var(--tex-wall-size) repeat, #241b3a;
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(7, 4, 13, 0.6);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar .brand-name, .topbar .crumb, .topbar .crumb-sep { text-shadow: 2px 2px 0 var(--ink); }
.brand-name { font-family: var(--pixel); letter-spacing: 0.04em; }
.brand-mark { background: transparent; border: 0; box-shadow: none; }
.brand-mark .px-icon { width: 24px; height: 24px; }
.nav-search, .nav-map { font-family: var(--small); }
.nav-search { background: var(--bg); }
.nav-search .px-icon, .nav-map .px-icon { width: 24px; height: 24px; }
.nav-search kbd { font-family: var(--small); }

/* ---- Footer: one plain line ---- */
.site-footer { background: transparent; border-top: 0; }
.site-footer .footer-link { text-shadow: 2px 2px 0 var(--ink); }

/* ---- Surfaces ---- */
.card, .tool-card, .panel, .dialog, .cmdk-panel {
  background-color: var(--surface);
}
.input, .make-input, select, textarea, input[type="text"], input[type="number"], input[type="search"], input[type="email"] {
  font-family: var(--small);
  background-color: var(--bg);
}
.btn, .seg-btn, .chip, .tool-chip, .check-chip, .icon-btn, .tab, kbd {
  font-family: var(--small);
  letter-spacing: 0.02em;
}

/* ---- The drop zone's glyph, drawn in pixels ---- */
.dropzone .glyphs > svg { visibility: hidden; }
.dropzone .glyphs { background: url(/img/px/upload.svg) center / 48px 48px no-repeat, var(--fill); image-rendering: pixelated; }

/* ---- Pixel icons in the section lists ---- */
.area-icon .px-icon { width: 48px; height: 48px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---- Studio frames: each studio's own colour (data-studio on the body,
   set in build/tool-page.mjs). The work area inside is untouched; the bars,
   rails and status line take the shared brick, the menu row a stripe of the
   colour, and the start screen sits on the brick wall. ---- */
body[data-studio="plum"] { --st-c: #c2459a; --st-on: #fff; }
body[data-studio="teal"] { --st-c: #2bb3a3; --st-on: var(--ink); }
body[data-studio="warm"] { --st-c: #c8823a; --st-on: var(--ink); }
body[data-studio="cyan"] { --st-c: #3fb8d8; --st-on: var(--ink); }
body[data-studio="grey"] { --st-c: #9a9aa8; --st-on: var(--ink); }
body[data-studio="green"] { --st-c: #4fb35f; --st-on: var(--ink); }
body[data-studio="yellow"] { --st-c: #e8c34f; --st-on: var(--ink); }
body[data-studio="grass"] { --st-c: #6ab04c; --st-on: var(--ink); }
/* One brick everywhere: the home page's wall, on the top bar and every studio; the studio's colour
   shows only in the stripe under the menu row and on Export. */
body[data-studio] { --st-tex: var(--tex-wall); background: var(--st-tex) 0 0 / var(--tex-wall-size) repeat, var(--bg-deep); }
body[data-studio] :is(.vs-menubar, .st-menubar) { background: transparent; box-shadow: none; border: 0; }
body[data-studio] :is(.vs-top, .st-toprow, .ls-topline) {
  background: var(--st-tex) 0 0 / var(--tex-wall-size) repeat;
  border-bottom: 2px solid var(--ink);
  box-shadow: inset 0 -3px 0 var(--st-c);
}
body[data-studio] :is(.vs-menubar, .st-menubar) :is(button, a, span, label) { text-shadow: 1px 1px 0 var(--ink); }
body[data-studio] :is(.vs-export, .st-export).btn { background: var(--st-c); color: var(--st-on); text-shadow: none; }
body[data-studio] :is(.vs-tabs, .st-tools, .st-options, .bs-rail, .ls-rail, .st-status, .ds-status, .cd-status) {
  background: linear-gradient(rgba(7, 4, 13, 0.45), rgba(7, 4, 13, 0.45)), var(--st-tex) 0 0 / var(--tex-wall-size) repeat;
}
body[data-studio] .st-start .dropzone { border-style: dashed; }

/* Wide screens draw the site at 90% (app.css, density); pixel icons are
   drawn back at full size so each texel stays a whole number of pixels. */
@media (min-width: 1000px) {
  svg.px-icon[data-px] { zoom: 1.1111; }
}

/* Python Blocks: block edges on whole pixels (the shapes are main.js's pixelRenderer). */
.pb-app .blocklyPath { shape-rendering: crispEdges; }
.pb-app .blocklyFieldRect, .pb-app .blocklyEditableField > rect, .pb-app .blocklyDropdownRect { rx: 0; ry: 0; }

/* ---- Dust portals (public/js/portal.js). The dust is its own layer of the
   page turn (portal-fx), above both pages; the old page's dust is dropped
   so it does not freeze into the turn. */
#wtb-portal { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2147483000; pointer-events: none; image-rendering: pixelated; view-transition-name: portal-fx; }
::view-transition-group(portal-fx) { animation: none; }
::view-transition-old(portal-fx) { display: none; }
::view-transition-new(portal-fx) { animation: none; }
html:is(.portal-open, .portal-close, .portal-sheet, .portal-unsheet)::view-transition-old(root),
html:is(.portal-open, .portal-close, .portal-sheet, .portal-unsheet)::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html:is(.portal-close, .portal-unsheet)::view-transition-old(root) { z-index: 1; }
/* No page transitions in this browser: the new page fades in over 160 ms. */
.no-vt main { animation: portal-fade 160ms linear backwards; }
@keyframes portal-fade { from { opacity: 0; } }
@keyframes portal-fade-out { to { opacity: 0; } }
/* Less motion: every page change is a 160 ms fade, no dust. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: 0s !important; }
  ::view-transition-old(root) { animation: portal-fade-out 160ms linear both !important; }
  ::view-transition-new(root) { animation: portal-fade 160ms linear both !important; }
}
.wtb-portal-pic { position: fixed; z-index: 2147483001; width: 72px; height: 72px; object-fit: contain; pointer-events: none; image-rendering: pixelated; transform: translate(-50%, -50%); }
@media (min-width: 1000px) { .wtb-portal-pic { zoom: 1.1111; } }

/* ---- Info pages as an open book (build/hub.mjs, spread): Feedback,
   Privacy, Terms, Licenses. The left page stays in view while the right
   page's text scrolls. */
.sb-spread-page { max-width: 1240px; }
.sb-spread { align-items: stretch; }
.sb-spread .sb-pg { padding: 30px 40px 40px; }
.sb-spread .sb-left { flex: 0 1 40%; }
.sb-spread .sb-leaf { position: sticky; top: 76px; }
.sb-spread .sb-right { flex: 1 1 60%; }
.sb-spread h1 { margin-top: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.sb-spread .prose { max-width: none; margin-top: 0; }
.sb-spread .prose h2 { color: #c9b2ff; scroll-margin-top: 90px; }
.sb-spread .sb-left .prose { font-size: 0.95rem; }
.sb-spread .address-card { margin: 22px 0 0; }
.sb-spread .fb-card { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.sb-spread .fb-card + .fb-card { margin-top: 0; }
.sb-backlink { display: inline-block; margin-top: 28px; color: var(--muted); text-decoration: none; }
.sb-backlink:hover { color: var(--gold); }
/* The home book's centred spine is not drawn on a spread. */
.sb-spread::before { display: none; }
/* Feedback: the book's trim, the notes in the book's pixel type, the
   browser switch explained in one line beside it. */
.sb-fb .sb-spread .sb-left, .sb-fb .sb-spread .sb-left .prose :not(h2) { font-family: var(--small); }
.sb-fb .sb-spread .sb-left .prose { font-size: 1rem; line-height: 1.5; }
.sb-fb .sb-spread .sb-pg { padding-bottom: 52px; }
html body.sb-fb .sb-ribbon { display: block; }
.sb-fb .sb-spread .sb-left .sb-pno { left: 40px; }
.sb-fb .sb-spread .sb-right .sb-pno { right: 40px; }
.sb-fb-head, .sb-fb-turn { display: none; }
.sb-fbch .fb-browser, .sb-fb .fb-browser { width: auto; gap: 12px; padding: 6px 12px 6px 0; }
.sb-fbch .fb-browser .toggle, .sb-fb .fb-browser .toggle { flex: 0 0 auto; }
.sb-fbch .fb-tip-btn, .sb-fb .fb-tip-btn { display: none; }
.sb-fbch .fb-tip-text, .sb-fb .fb-tip-text { position: static; visibility: visible; opacity: 1; width: auto; max-width: none; padding: 0; background: none; border: 0; box-shadow: none; color: var(--muted); }
@media (max-width: 820px) {
  .sb-spread { flex-direction: column; }
  .sb-fb .sb-spread.sb-fb-js .sb-left { display: none; }
  .sb-fb .sb-spread.sb-fb-js.is-notes .sb-left { display: block; }
  .sb-fb .sb-spread.sb-fb-js.is-notes .sb-right { display: none; }
  .sb-fb .sb-fb-js .sb-pg { transform-origin: left center; }
  .sb-fb .sb-fb-js .sb-fb-head { display: block; margin: 0 0 6px; font-family: var(--display); font-size: 1.8rem; text-transform: uppercase; color: var(--text); }
  .sb-fb .sb-fb-js .sb-fb-turn { display: inline-block; margin-top: 22px; padding: 8px 12px; font: inherit; color: var(--text); background: var(--surface-2); border: 2px solid var(--ink); cursor: pointer; }
  .sb-fb .sb-fb-js .sb-fb-turn:hover, .sb-fb .sb-fb-js .sb-fb-turn:focus-visible { background: var(--gold); color: var(--ink); outline: 0; }
  .sb-fb .sb-fb-js .sb-fb-turn[hidden] { display: none; }
  .sb-spread .sb-leaf { position: static; }
  .sb-spread .sb-pg { padding: 18px 16px 28px; flex-basis: auto; width: 100%; }
}

/* ---- The 404 as one book page: the hat vanishing over the cauldron, Seek a tool, the chapters. */
.sb-nf-page { max-width: 760px; }
.sb-nf .sb-pg { padding: 34px 40px 40px; text-align: center; }
.sb-nf .nf-pot { position: relative; width: 128px; height: 168px; margin: 0 auto 6px; }
.sb-nf .nf-stage { position: absolute; left: 16px; top: 0; z-index: 1; }
.sb-nf .nf-cauldron { position: absolute; left: 0; bottom: 0; width: 128px; height: 128px; image-rendering: pixelated; }
.sb-nf .lede { margin-left: auto; margin-right: auto; }
.sb-nf .sb-seek { margin: 18px auto 22px; max-width: 420px; }
.sb-nf .areas { justify-content: center; }

/* ---- The Feedback dialog as a book sheet (site.js): ink edge, a title bar
   with the page icon, a small close, and a 4-step dither in. */
dialog.fb-dialog { border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.6); animation: fb-sheet-in 120ms steps(4, end) backwards; }
@keyframes fb-sheet-in { from { opacity: 0; } }
.fb-dialog-head { min-height: 48px; padding: 6px 8px 6px 14px; background: var(--surface-2); border-bottom: 2px solid var(--ink); }
.fb-dialog-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 400; text-transform: none; text-shadow: 2px 2px 0 var(--ink); }
.fb-dialog-head h2 svg { flex: none; }
.fb-dialog-close { width: 32px; height: 32px; }

/* ---- The File Converter (/files/) on the bench as a sheet (build/shell.mjs). */
.bench-sheet-name { flex: 1; min-width: 0; font-size: 24px; line-height: 1.1; text-shadow: 2px 2px 0 var(--ink); }
.files-sheet > section { margin: 16px; }
.files-sheet > section > h1 { margin-top: 0; }
@media (max-width: 600px) { .bench-sheet-name { font-size: 16px; } }

/* ---- The Tool Map in pixels (build/map.mjs): square tiles with ink edges
   on hard shadows, section colours, square ends, a dark desk of pixel dots. */
/* The wall behind the map pans and zooms with it (--tm-k is the map's zoom, map.js). */
.tm-stage {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect width='2' height='2' fill='rgba(237,234,246,0.1)'/%3E%3C/svg%3E"), var(--tex-wall);
  background-size: var(--tm-gs, 32px) var(--tm-gs, 32px), calc(2304px * var(--tm-k, 1)) calc(1792px * var(--tm-k, 1));
  background-position: var(--tm-gx, 0px) var(--tm-gy, 0px), var(--tm-gx, 0px) var(--tm-gy, 0px);
  background-color: var(--bg-deep);
}
.tm-map :is(rect, svg) { shape-rendering: crispEdges; }
.tm-e { stroke-linecap: square; }
.tm-map .tm-node.tm-node rect.tm-shadow { fill: rgba(7, 4, 13, 0.6); stroke: none; }
.tm-node .tm-tile { stroke: var(--ink); stroke-width: 2; }
.tm-node.is-tool .tm-tile { fill: color-mix(in srgb, var(--c) 22%, #1b142e); stroke: var(--ink); stroke-opacity: 1; stroke-width: 2; }
.tm-node.is-parent .tm-tile { fill: color-mix(in srgb, var(--c) 38%, #1b142e); stroke-width: 2; stroke-opacity: 1; }
.tm-node.is-section .tm-tile { fill: var(--c); }
.tm-node.is-centre .tm-tile { fill: #4c1fb0; }
.tm-node.is-tool.is-hot .tm-tile { fill: var(--c); stroke: var(--ink); }
.tm-node:focus-visible .tm-tile { stroke: var(--gold); stroke-width: 3; }
.tm-node.is-hot .tm-body { filter: none; }
.tm-body.is-press .tm-tile { fill: var(--gold); stroke: var(--ink); }

/* ---- Inside the tools: Departure Mono for all but h1 and h2, which keep
   Tiny5. ---- */
main.tool, .studio-page main, .st-dialog {
  font-family: var(--small);
}
:is(main.tool, .studio-page main, .st-dialog) h3 { font-family: var(--small); }
/* The home book's cover title stays Tiny5. */
.sb-ctitle { font-family: var(--pixel); }


/* Minecraft Studio and its tools wear the site's own purple; the grass,
   dirt and stone look went on 2026-11-09. */
/* Contrast (2026-11-07): small grey notes on the lighter grey panels take the
   muted grey, and the block names on light bands (sand, snow) get a hard
   black outline. */
html.is-embed body[class*="tool-minecraft-"] :is(.mc-flat-out-help, .mc-txt-out-help, .mc-fw-out-help, .mc-motd-out-help, .mc-grad-out-help) { color: var(--muted); }
html.is-embed body[class*="tool-minecraft-"] .mc-flat-band-label { text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }

