/* base: nest.css */
/* nest.css — the base theme: tokens, the elements, and the classes modules share (card, stack,
   row, field, notice, badge, tile...). Each module keeps its own look in its own stylesheet
   (its manifest's styles), built on these tokens; an application restyles both. */
:root {
  --bg: #f8f7f4; --surface: #ffffff; --text: #1d1c1a; --muted: #5f5b53;
  --border: #dedad0; --accent: #8a2b1f; --accent-text: #ffffff; --focus: #1f4f8a;
  --ok: #2d6a3e; --danger: #a32121;
  --radius: 8px; --gap: 1rem; --max: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413; --surface: #1e1d1b; --text: #ecebe6; --muted: #a6a196;
    --border: #34312c; --accent: #e0806f; --accent-text: #151413; --focus: #8db6ea;
    --ok: #7cc48e; --danger: #f08a8a;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--font);
  display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding-block: 1.5rem 3rem; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 1rem; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; min-height: 3.5rem; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; margin: 0; padding: 0; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding-block: 1rem; }

h1, h2, h3 { line-height: 1.25; margin: 1.5rem 0 .75rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-top: .5rem; }
p { margin: .5rem 0 1rem; }
code, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem; overflow-x: auto; }
img, video { max-width: 100%; height: auto; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-block: var(--gap); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.muted { color: var(--muted); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

button, .button { font: inherit; cursor: pointer; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-text); border-radius: var(--radius); padding: .5rem 1rem; min-height: 2.5rem;
  text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; min-height: 2.5rem; }
textarea { min-height: 6rem; resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

.notice { border-left: 4px solid var(--accent); background: var(--surface); padding: .75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0; }
.notice.ok { border-color: var(--ok); } .notice.danger { border-color: var(--danger); }

/* htmx: indicators without the inline styles htmx would inject. */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.narrow { max-width: 28rem; margin-inline: auto; }
button.link { background: none; border: none; color: var(--muted); padding: .25rem .4rem; min-height: auto; }
button.link:hover, button.link.current { color: var(--text); text-decoration: underline; }
.language { gap: 0; }
.field { margin-bottom: 1rem; }
.field .hint, .field .error { display: block; margin-top: .25rem; font-size: .875rem; }
.field .hint { color: var(--muted); }
.field .error { color: var(--danger); }
.field .req { color: var(--danger); }
.field.check { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.field.check input { width: auto; min-height: auto; }
.field.check label { margin: 0; font-weight: 400; }
[aria-invalid="true"] { border-color: var(--danger); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.between { justify-content: space-between; }
form.search { display: flex; gap: .5rem; margin-block: 1rem; }
form.search input { flex: 1; }
.tile { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--accent); }
.letters { display: flex; flex-wrap: wrap; gap: .25rem; margin-block: 1rem; }
.letters a { min-width: 2.25rem; text-align: center; padding: .35rem .5rem; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.letters a[aria-current="page"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
ol.results { padding-left: 1.25rem; } ol.results li { margin-bottom: 1rem; } ol.results p { margin: .25rem 0; }
mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 2px; }
.pager { margin-top: 1.5rem; }
.danger-zone { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; } label.check { font-weight: 400; display: inline-flex; gap: .35rem; align-items: center; }
label.check input { width: auto; min-height: auto; }
.badge { display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: 999px; background: var(--border); color: var(--text); vertical-align: middle; }
form.inline { display: inline; }
/* numbers in tables, and a change for the better or the worse (the game's benchmark) */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.better { color: var(--ok); } .worse { color: var(--danger); }
progress { width: 100%; max-width: 32rem; }
/* the language switch: its choices apart, in any theme */
.language { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; }

/* slate: slate.css */
/* slate.css — on base's stylesheet: a modern, dark-first page. Tokens (dark, then a light
   variant by day), a header that stays on top, rounded shapes with depth. */
:root {
  --bg: #0f1720; --surface: #16202b; --text: #e6edf3; --muted: #93a1b0;
  --border: #243241; --accent: #4cc2b5; --accent-text: #06231f; --focus: #8ab4ff;
  --ok: #5fd38d; --danger: #ff7b72;
  --radius: 14px; --max: 74rem;
  --font: Inter, "Segoe UI Variable", system-ui, -apple-system, Roboto, sans-serif;
  --shadow: 0 1px 0 rgb(0 0 0 / .25), 0 10px 30px rgb(0 0 0 / .25);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f6f9; --surface: #ffffff; --text: #13202c; --muted: #56687a;
    --border: #d6dee6; --accent: #0f8f84; --accent-text: #ffffff; --focus: #2554c7;
    --ok: #1d7f45; --danger: #c4312a;
    --shadow: 0 1px 0 rgb(16 24 32 / .04), 0 10px 28px rgb(16 24 32 / .08);
  }
}
body { letter-spacing: -.003em; }
h1, h2, h3 { letter-spacing: -.02em; font-weight: 700; }

/* the header stays on top, the page passing under it */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
.brand { display: inline-flex; align-items: center; gap: .55rem; letter-spacing: -.01em; }
.brand::before { content: ""; width: .8rem; height: .8rem; border-radius: 4px; flex: none;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--focus))); }
nav a { border-radius: 999px; padding: .2rem .6rem; }
nav a:hover, nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }

/* shapes with depth */
.card { border-radius: var(--radius); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--border) 70%, transparent); }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
button, .button { border-radius: 999px; padding-inline: 1.1rem; font-weight: 600; }
input, select, textarea { border-radius: 10px; }
.badge { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }
.notice { border-radius: 10px; }
.site-footer { border-top: 1px solid var(--border); }

/* admin: preview.css */
/* preview.css — the bar an administrator previewing a theme sees, in any theme (site pages). */
.theme-preview-bar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; max-width: calc(100% - 2rem);
  padding: .6rem 1rem; border-radius: 10px; font: .9rem/1.4 system-ui, sans-serif;
  background: #1d1c1a; color: #f4f2ec; box-shadow: 0 8px 28px rgb(0 0 0 / .3); }
.theme-preview-bar a { color: #ffd38a; }

/* notifications: toasts.css */
/* toasts.css — the notifications module's base look, on the theme's tokens. */
.toasts { position: fixed; z-index: 200; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem;
  width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .75rem; padding: .7rem .8rem .7rem 1rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--muted);
  border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, .16); animation: toast-in .22s ease-out; }
.toast-success { border-left-color: var(--ok); }
.toast-info { border-left-color: var(--focus); }
.toast-warning { border-left-color: #b7791f; }
.toast-error { border-left-color: var(--danger); }
.toast-text { flex: 1; line-height: 1.4; }
.toast-text::before { font-weight: 700; margin-right: .4rem; }
.toast-success .toast-text::before { content: "✓"; color: var(--ok); }
.toast-warning .toast-text::before { content: "!"; color: #b7791f; }
.toast-error .toast-text::before { content: "✕"; color: var(--danger); }
.toast-close { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1;
  padding: 0 .2rem; min-height: 0; cursor: pointer; }
.toast-close:hover { color: var(--text); }
.toast-leaving { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.5rem); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(1rem); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast-leaving { animation: none; } }
@media (max-width: 40rem) { .toasts { left: 1rem; right: 1rem; width: auto; bottom: .75rem; } }

/* registry: registry.css */
/* registry.css — the catalog's look, on the theme's tokens. */
.registry-hero { padding-block: .5rem 1.5rem; }
.registry-hero .lead { font-size: 1.15rem; max-width: 46rem; }
.registry-search { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.registry-search input { flex: 1 1 18rem; }
.registry-search select { flex: 0 1 12rem; width: auto; }
.registry-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.registry-item { padding: .85rem 1rem; margin: 0; }
.registry-item p { margin: .35rem 0 0; }
.registry-name { font-weight: 700; font-size: 1.05rem; margin-right: .4rem; }
.registry-files td:first-child { overflow-wrap: anywhere; }
pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; }
.registry-shot img, .registry-swatch { display: block; width: 100%; max-width: 36rem; height: auto; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1.25rem; }
.registry-about p { white-space: pre-line; max-width: 46rem; }

