/* Corestone, "Amethyst": light lilac pages, deep violet ink, one gem per plugin. The brand and the shared pages wear
   amethyst; a plugin's pages take its gem's colour through --gem-* on <body> (lib/gems.mjs). */

@font-face { font-family: 'Gabarito'; src: url('fonts/gabarito-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Gabarito'; src: url('fonts/gabarito-latin-ext-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-600-normal.woff2') format('woff2'); font-weight: 600 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree-latin-ext-600-normal.woff2') format('woff2'); font-weight: 600 700; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root,
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f1ebfb;
  --surface: #fdfbff;
  --raised: #e9e0f8;
  --ink: #241044;
  --muted: #5e4d80;
  --line: #ddd0f2;
  --violet: #6a3fd1;
  --violet-ink: #ffffff;
  --amethyst: #9b6cf0;
  --glow: #f2a7e4;
  --shadow: 0 18px 40px -24px rgb(36 16 68 / 0.45);
  --shadow-big: 0 40px 80px -36px rgb(36 16 68 / 0.55);
  --halo: rgb(155 108 240 / 0.32);
  --halo-2: rgb(242 167 228 / 0.18);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #140d22;
  --surface: #1d1530;
  --raised: #271d3f;
  --ink: #efe8fb;
  --muted: #b3a6cc;
  --line: #34284f;
  --violet: #a888f7;
  --violet-ink: #160b30;
  --amethyst: #9b6cf0;
  --glow: #f2a7e4;
  --shadow: 0 18px 40px -24px rgb(0 0 0 / 0.7);
  --shadow-big: 0 40px 80px -36px rgb(0 0 0 / 0.8);
  --halo: rgb(155 108 240 / 0.24);
  --halo-2: rgb(155 108 240 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #140d22;
    --surface: #1d1530;
    --raised: #271d3f;
    --ink: #efe8fb;
    --muted: #b3a6cc;
    --line: #34284f;
    --violet: #a888f7;
    --violet-ink: #160b30;
    --amethyst: #9b6cf0;
    --glow: #f2a7e4;
    --shadow: 0 18px 40px -24px rgb(0 0 0 / 0.7);
    --shadow-big: 0 40px 80px -36px rgb(0 0 0 / 0.8);
    --halo: rgb(155 108 240 / 0.24);
    --halo-2: rgb(155 108 240 / 0.06);
  }
}

/* The accent: the plugin's gem on its pages and its card (data-gem, rules generated from lib/gems.mjs at the end of
   this sheet), the brand's violet everywhere else. */
body, [data-gem] {
  --accent: var(--gem-light, var(--violet));
  --accent-ink: var(--gem-ink-light, var(--violet-ink));
}
:root[data-theme='dark'] body, :root[data-theme='dark'] [data-gem] {
  --accent: var(--gem-dark, var(--violet));
  --accent-ink: var(--gem-ink-dark, var(--violet-ink));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) body, :root:not([data-theme='light']) [data-gem] {
    --accent: var(--gem-dark, var(--violet));
    --accent-ink: var(--gem-ink-dark, var(--violet-ink));
  }
}
[data-gem] { --halo: color-mix(in srgb, var(--accent) 28%, transparent); --halo-2: color-mix(in srgb, var(--glow) 16%, transparent); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 'Figtree', system-ui, sans-serif; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6rem; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 'Figtree', system-ui, sans-serif; overflow-wrap: break-word; }
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--amethyst); color: #fff; }
h1, h2, h3 { font-family: 'Gabarito', system-ui, sans-serif; font-weight: 800; line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 0.45em; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5.4rem); letter-spacing: -0.04em; line-height: 0.96; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.4rem); letter-spacing: -0.035em; }
h3 { font-size: 1.3rem; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.88em; padding: 0.12em 0.4em; border-radius: 6px; background: var(--raised); }
pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; padding: 1rem 1.1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
pre code { padding: 0; background: none; }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: 0.85em; padding: 0.05em 0.4em; border: 1px solid var(--line); border-radius: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 1.75rem; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 30; padding: 0.6rem 1rem; border-radius: 10px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 0.75rem; }
mark.todo { background: #ffe08a; color: #3a2a00; padding: 0 0.25em; border-radius: 4px; }

/* The bar: one rounded strip floating over the page, the brand, the plugins, search, language and theme. */
.bar-wrap { position: sticky; top: 0; z-index: 20; padding: 1rem 1rem 0; }
.bar { max-width: 72rem; margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; padding: 0.55rem 0.6rem 0.55rem 1.1rem; border-radius: 20px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font: 800 1.25rem 'Gabarito', sans-serif; letter-spacing: -0.02em; min-height: 44px; }
.logo { width: 26px; height: 26px; flex: none; }
.bar__menu { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.15rem; }
.nav a, .pmenu summary { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0 0.8rem; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; cursor: pointer; }
.nav a:hover, .pmenu summary:hover { color: var(--ink); background: var(--raised); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--raised); }
.pmenu { position: relative; }
.pmenu summary { list-style: none; }
.pmenu summary::-webkit-details-marker { display: none; }
.pmenu summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.pmenu[open] summary::after { transform: translateY(2px) rotate(225deg); }
.pmenu ul { position: absolute; top: calc(100% + 0.5rem); left: 0; z-index: 25; list-style: none; margin: 0; padding: 0.5rem; min-width: 20rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-big); }
.pmenu li a { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0.15rem 0.8rem; align-items: center; padding: 0.6rem 0.7rem; border-radius: 12px; color: var(--ink); text-decoration: none; }
.pmenu li a:hover { background: var(--raised); }
.pmenu li img { grid-row: span 2; width: 40px; height: 40px; object-fit: contain; }
.pmenu li b { font: 800 1.05rem 'Gabarito', sans-serif; overflow-wrap: anywhere; }
.pmenu li span { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.search-form { position: relative; display: flex; align-items: center; }
.search-form input { width: 12rem; min-height: 44px; padding: 0 2.6rem 0 0.95rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.95rem; }
.search-form input::placeholder { color: var(--muted); }
.search-form button { position: absolute; right: 4px; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.tools { display: flex; align-items: center; gap: 0.35rem; }
.lang { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.1rem; }
.lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 0.92rem; text-decoration: none; }
.lang a[aria-current='true'] { color: var(--ink); background: var(--raised); }
.theme-button, .menu-button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.menu-button { display: none; margin-left: auto; padding: 0 1rem; }

/* A plugin's own menu, under the bar on every page of that plugin: its gem, its name, its pages. */
.subnav { max-width: 72rem; margin: 0.75rem auto 0; padding: 0 1rem; }
.subnav__inner { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.subnav__name { display: inline-flex; align-items: center; gap: 0.55rem; font: 800 1.05rem 'Gabarito', sans-serif; color: var(--ink); text-decoration: none; padding-right: 0.5rem; }
.subnav__name img { width: 24px; height: 24px; }
.subnav ul { list-style: none; margin: 0; padding: 0.25rem; display: flex; gap: 0.15rem; border-radius: 14px; background: var(--raised); }
.subnav ul a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0 0.85rem; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.subnav ul a[aria-current='page'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.subnav ul a.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #2fb67b; box-shadow: 0 0 0 3px rgb(47 182 123 / 0.22); }

.notices { max-width: 72rem; margin: 0.75rem auto 0; padding: 0 1rem; display: grid; gap: 0.5rem; }
.notice { margin: 0; padding: 0.75rem 1rem; border-radius: 14px; background: var(--raised); color: var(--ink); }
.notice--draft { background: #ffe9a8; color: #3a2a00; }

/* Buttons: buying in the accent, trying out on a plain surface with a live dot. */
.btns { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 52px; padding: 0 1.6rem; border-radius: 16px; font-weight: 700; font-size: 1.02rem; text-decoration: none; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform 160ms ease, box-shadow 160ms ease; }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn--buy { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 16px 34px -16px var(--accent); }
.btn--try::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #2fb67b; box-shadow: 0 0 0 4px rgb(47 182 123 / 0.2); }
.btn--plain { box-shadow: none; background: transparent; }

/* The opening: the line in the middle, the gem below it in its own soft light. */
.hero { position: relative; text-align: center; padding: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) 1.75rem 0; overflow: hidden; }
.hero::before { content: ''; position: absolute; left: 50%; top: 58%; width: min(62rem, 120%); height: 38rem; transform: translate(-50%, -30%); background: radial-gradient(closest-side, var(--halo), var(--halo-2) 55%, transparent 75%); pointer-events: none; }
.hero > * { position: relative; }
.hero h1 { max-width: 14ch; margin: 0 auto; }
.hero .lead { max-width: 34em; margin: 1.6rem auto 0; color: var(--muted); font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem); }
.hero .btns { justify-content: center; }
.hero .meta { margin-top: 1.1rem; color: var(--muted); font-size: 0.95rem; }
.gem { position: relative; margin: -1.5rem auto 0; width: min(100%, 44rem); aspect-ratio: 16 / 11; }
.gem img, .gem canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 30px 40px color-mix(in srgb, var(--accent) 40%, transparent)); }
.gem canvas[hidden] { display: none; }
.gem.is-live img { visibility: hidden; }

/* Facts: what can be checked, in plain numbers. */
.facts { list-style: none; max-width: 72rem; margin: -1.5rem auto 0; padding: 0 1rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; position: relative; }
.facts li { background: var(--surface); border-radius: 22px; padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }
.facts strong { display: block; font: 800 2.2rem/1 'Gabarito', sans-serif; letter-spacing: -0.03em; color: var(--accent); }
.facts span { display: block; margin-top: 0.5rem; color: var(--muted); font-size: 0.95rem; line-height: 1.4; }

/* A block of the page: a heading and what follows it, on the page's own width. */
.block { max-width: 72rem; margin: 0 auto; padding: clamp(4rem, 3rem + 4vw, 7.5rem) 1.75rem 0; }
.block > h2 { max-width: 20ch; }
.block > .lead { max-width: 38em; color: var(--muted); font-size: 1.15rem; }

/* The plugin catalogue: one card per plugin, in its gem's colour. */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; margin-top: 2rem; }
.card { position: relative; display: flex; flex-direction: column; padding: 1.75rem; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.card::before { content: ''; position: absolute; right: -4rem; top: -4rem; width: 14rem; height: 14rem; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
.card__gem { position: relative; width: 96px; height: 96px; object-fit: contain; margin-bottom: 1rem; }
.card h3 { position: relative; font-size: 1.9rem; letter-spacing: -0.03em; }
.card h3 a { color: inherit; text-decoration: none; }
.card p { position: relative; color: var(--muted); }
.card__price { position: relative; margin-top: auto; padding-top: 0.5rem; font-weight: 700; color: var(--ink); }
.card .btns { position: relative; margin-top: 1rem; }
.card .btn { flex: 1 1 auto; min-height: 46px; padding: 0 1.1rem; font-size: 0.97rem; }
.card .btn--buy { flex-basis: 100%; }
.card--soon { background: transparent; box-shadow: none; border: 2px dashed var(--line); justify-content: center; }

.principles, .prose ul.principles { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.principles li { padding: 1.4rem 1.5rem; border-radius: 22px; background: var(--surface); color: var(--muted); line-height: 1.5; }
.principles li strong:first-child { display: block; margin-bottom: 0.35rem; color: var(--ink); font: 800 1.15rem 'Gabarito', sans-serif; }

/* The story: the text scrolls, the screenshot stays beside it and changes with the step in view. */
.story { margin-top: 1rem; }
:root[data-js='true'] .story { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4rem; }
.step { padding: 2rem 0; display: flex; flex-direction: column; justify-content: center; transition: opacity 300ms ease; }
:root[data-js='true'] .step { min-height: 70vh; padding: 0; }
:root[data-js='true'] .step { opacity: 0.38; }
:root[data-js='true'] .step.is-on { opacity: 1; }
.step h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); }
.step > p { color: var(--muted); font-size: 1.12rem; max-width: 30em; }
.step ul { padding-left: 1.15rem; color: var(--muted); max-width: 32em; }
.step li { margin: 0.3rem 0; }
.step li::marker { color: var(--accent); }
.step img { display: block; max-width: 44rem; margin-top: 1.25rem; border-radius: 18px; border: 4px solid var(--surface); box-shadow: var(--shadow); }
:root[data-js='true'] .step img { display: none; }
.pin { display: none; }
:root[data-js='true'] .pin { display: block; position: sticky; top: 7rem; align-self: start; }
.pin img { display: block; width: 100%; border-radius: 22px; border: 6px solid var(--surface); box-shadow: var(--shadow-big); }
.pin figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.95rem; text-align: center; }

/* Tables: the tested environments and any table of the wiki. */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
tr:last-child td { border-bottom: 0; }
.tested { min-width: 38rem; }
.passed { display: inline-flex; align-items: center; gap: 0.45em; font-weight: 700; color: #1f7a52; white-space: nowrap; }
:root[data-theme='dark'] .passed { color: #5fd49c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .passed { color: #5fd49c; } }
.passed::before { content: ''; width: 0.55em; height: 0.55em; border-radius: 50%; background: currentColor; }

/* Price as a ticket: the amount on the stub, what it includes on the rest. */
.ticket { display: grid; grid-template-columns: 19rem 1fr; margin-top: 2rem; border-radius: 30px; background: var(--surface); box-shadow: var(--shadow-big); overflow: hidden; }
.ticket__stub { padding: 2.5rem 2.2rem; background: var(--accent); color: var(--accent-ink); border-right: 3px dashed var(--bg); }
.ticket__stub small { font-weight: 600; }
.ticket__amount { font: 800 3.8rem/1 'Gabarito', sans-serif; letter-spacing: -0.04em; margin: 0.4rem 0 0.6rem; white-space: nowrap; }
.ticket__amount small { font: 600 1.1rem 'Figtree', sans-serif; letter-spacing: 0; }
.ticket__stub p { margin: 0; }
.ticket__body { padding: 2.5rem; }
.ticket__body ul { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1.5rem; }
.ticket__body li { position: relative; padding-left: 1.7rem; color: var(--muted); }
.ticket__body li::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 0.75em; height: 0.75em; border-radius: 3px; background: linear-gradient(135deg, var(--glow), var(--accent)); transform: rotate(45deg) scale(0.85); }
.ticket__body .btns { margin-top: 0; }

/* Questions as tiles. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; margin-top: 2rem; }
.tile { padding: 1.6rem 1.75rem; border-radius: 24px; background: var(--surface); }
.tile h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.tile p, .tile ul { color: var(--muted); margin: 0; }

/* Plain text on a page: prose sections, the text pages, the wiki. */
.prose > * { max-width: 44rem; }
.prose > .table-scroll, .prose > pre, .prose > .tiles, .prose > .ticket, .prose > .principles, .prose > .catalog { max-width: none; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.3rem 0; }
.prose .principles li::marker { content: none; }
.prose li::marker { color: var(--accent); }
.prose img { border-radius: 16px; box-shadow: var(--shadow); }
.prose blockquote { margin: 1.2rem 0; padding: 0.9rem 1.2rem; border-radius: 16px; background: var(--raised); }
.page { max-width: 48rem; margin: 0 auto; padding: clamp(3rem, 2rem + 3vw, 5rem) 1.75rem 0; }
.page h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); }
.page .lead { color: var(--muted); font-size: 1.2rem; }
.page .search-page { padding: 0; }
.page .search-page label { display: block; font-weight: 700; margin-bottom: 0.5rem; }
.page h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); }

.faq h2 { margin-top: 2rem; }
.faq__item { margin: 0.6rem 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; font: 800 1.1rem 'Gabarito', sans-serif; letter-spacing: -0.01em; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: '+'; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq__item[open] summary::after { content: '−'; }
.faq__answer { padding: 0 1.3rem 1.1rem; color: var(--muted); }
.faq__answer > :last-child { margin-bottom: 0; }

/* The wiki: its pages on the left, the page in the middle, its sections on the right. */
.wiki { max-width: 80rem; margin: 0 auto; padding: 2rem 1.75rem 0; display: grid; grid-template-columns: 15rem minmax(0, 1fr) 13rem; gap: 2.5rem; align-items: start; }
.wiki__nav { position: sticky; top: 7rem; }
.wiki__name { font: 800 1rem 'Gabarito', sans-serif; margin: 0 0 0.6rem 0.6rem; }
.wiki__nav ol { list-style: none; margin: 0; padding: 0; }
.wiki__nav a { display: block; padding: 0.45rem 0.65rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.wiki__nav a:hover { color: var(--ink); background: var(--raised); }
.wiki__nav a[aria-current='page'] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.wiki__toggle { display: none; width: 100%; min-height: 48px; justify-content: space-between; align-items: center; padding: 0 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.wiki__toggle::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.wiki__toggle[aria-expanded='true']::after { transform: rotate(225deg); }
.wiki__page { min-width: 0; }
.wiki__page h1 { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); }
.wiki__page h2 { font-size: clamp(1.5rem, 1.2rem + 0.9vw, 2rem); scroll-margin-top: 7rem; }
.wiki__toc { position: sticky; top: 7rem; font-size: 0.92rem; }
.wiki__toc p { font-weight: 700; margin-bottom: 0.5rem; }
.wiki__toc ul { list-style: none; margin: 0; padding: 0 0 0 0.75rem; border-left: 2px solid var(--line); }
.wiki__toc a { display: block; padding: 0.25rem 0; color: var(--muted); text-decoration: none; }
.wiki__toc a:hover { color: var(--accent); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; max-width: none; }
.pager a { display: flex; flex-direction: column; padding: 1rem 1.2rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 700; }
.pager a span { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.pager__next { grid-column: 2; text-align: right; }

/* Search: the box and its results. */
.search-page { max-width: 48rem; margin: 0 auto; padding: 3rem 1.75rem 0; }
.search-page input { width: 100%; min-height: 56px; padding: 0 1.2rem; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.1rem; box-shadow: var(--shadow); }
.search-status { color: var(--muted); margin: 1.2rem 0; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.search-results li { padding: 1rem 1.2rem; border-radius: 16px; background: var(--surface); }
.search-results a { font: 800 1.1rem 'Gabarito', sans-serif; text-decoration: none; }
.search-results p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* The footer. */
.foot { margin-top: clamp(5rem, 4rem + 4vw, 8rem); padding: 2.5rem 1.75rem 3rem; border-top: 1px solid var(--line); }
.foot__inner { max-width: 72rem; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: flex-start; }
.foot__brand { margin-right: auto; }
.foot__brand p { margin: 0.25rem 0 0; color: var(--muted); }
.foot__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.foot__links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.foot__links a:hover { color: var(--ink); }
.foot__copy { width: 100%; margin: 0; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 64rem) {
  .wiki { grid-template-columns: 14rem minmax(0, 1fr); }
  .wiki__toc { display: none; }
}

@media (max-width: 56rem) {
  :root[data-js='true'] .menu-button { display: inline-flex; }
  .bar { flex-wrap: wrap; }
  .bar__menu { flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0.6rem; margin: 0; padding: 0.4rem 0 0.5rem; }
  :root[data-js='true'] .bar__menu:not([data-open='true']) { display: none; }
  .bar__menu[data-open='true'] { max-height: calc(100dvh - 6rem); overflow-y: auto; overscroll-behavior: contain; }
  .nav { flex-direction: column; align-items: stretch; }
  .nav a, .pmenu summary { width: 100%; }
  .pmenu ul { position: static; min-width: 0; box-shadow: none; margin-top: 0.25rem; }
  .search-form input { width: 100%; }
  .tools { justify-content: space-between; }
  .facts { grid-template-columns: 1fr 1fr; margin-top: 0; }
  :root[data-js='true'] .story { grid-template-columns: 1fr; gap: 0; }
  :root[data-js='true'] .pin { display: none; }
  :root[data-js='true'] .step { min-height: 0; padding: 2rem 0; opacity: 1; }
  :root[data-js='true'] .step img { display: block; }
  .ticket { grid-template-columns: 1fr; }
  .ticket__stub { border-right: 0; border-bottom: 3px dashed var(--bg); }
  .ticket__body ul { grid-template-columns: 1fr; }
  .wiki { grid-template-columns: 1fr; gap: 1rem; padding-top: 1rem; }
  .wiki__nav { position: static; }
  .wiki__name { display: none; }
  :root[data-js='true'] .wiki__toggle { display: flex; }
  :root[data-js='true'] .wiki__nav ol:not([data-open='true']) { display: none; }
  .wiki__nav ol { margin-top: 0.5rem; }
}

@media (max-width: 30rem) {
  .wrap, .block, .hero, .page, .wiki, .search-page { padding-left: 1rem; padding-right: 1rem; }
  .bar-wrap { padding: 0.6rem 0.6rem 0; }
  .facts { padding: 0 1rem; }
  .facts li { padding: 1.1rem; }
  .facts strong { font-size: 1.7rem; }
  .card { padding: 1.4rem; }
  .ticket__stub, .ticket__body { padding: 1.75rem 1.4rem; }
  .ticket__amount { font-size: 3rem; }
  .btn { width: 100%; }
  .subnav ul { overflow-x: auto; max-width: 100%; }
  .subnav ul a { padding: 0 0.6rem; font-size: 0.9rem; }
  .subnav ul a.live::before { width: 7px; height: 7px; }
}

/* Motion: the gem turning and the story lighting up; nothing for those who turned motion off. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  :root[data-js='true'] .step { opacity: 1; }
}

/* The gems (lib/gems.mjs), generated at build time. */
[data-gem="amethyst"] { --gem-light: #6a3fd1; --gem-dark: #a888f7; --gem-ink-light: #ffffff; --gem-ink-dark: #160b30; --glow: #f2a7e4; }
[data-gem="emerald"] { --gem-light: #0f7247; --gem-dark: #3fd696; --gem-ink-light: #ffffff; --gem-ink-dark: #03190f; --glow: #9ef0c8; }
[data-gem="diamond"] { --gem-light: #0b6a84; --gem-dark: #5ccfec; --gem-ink-light: #ffffff; --gem-ink-dark: #031c24; --glow: #b6f3ff; }
[data-gem="ruby"] { --gem-light: #ad2238; --gem-dark: #ff8494; --gem-ink-light: #ffffff; --gem-ink-dark: #2a060e; --glow: #ffb3c0; }
