/* cute vault: Mireya's reference sheet as a website.
   White fur ground, plum ink outlines, pink and lilac fur patches, lavender cloud edges. */

:root {
  --fur: #fffafd;
  --fur-2: #fbf0fb;
  --fur-3: #f3e6fb;
  --paper: #fff;
  --ink: #2a0b25;
  --ink-2: #5b3354;
  --ink-3: #7d5a77;
  --pink: #ff8fd0;
  --pink-2: #ffc4e6;
  --pink-hover: #ff7cc6;
  --pink-deep: #e2449f;
  --magenta: #a3196f;
  --lilac: #c99cf4;
  --lilac-2: #ece0fd;
  --violet: #8a4fd1;
  --violet-deep: #5b2a91;
  --cloud: #b6a8f2;
  --cloud-2: #c5b5f6;
  --cloud-3: #cbbdf7;
  --crystal-light: #ffa3d8;
  --crystal-deep: #b48af0;
  --danger: #b4123f;
  --error-wash: #ffe3ec;
  --code-bg: #2a0b25; /* = ink, kept separate so code can drift later */
  --code-fg: #fbe9f6;
  --syntax-string: #d9b8ff;
  --syntax-comment: #b393ad;
  --syntax-meta: #e9a6d4;
  --shadow-tint: 91 42 145; /* rgb(var(--shadow-tint) / .18) */
  --bar-glass: color-mix(in srgb, var(--fur) 92%, transparent);

  --line: 3px;
  --line-md: 2.5px;
  --line-sm: 2px;
  --blob: 22px 28px 20px 30px / 26px 20px 30px 22px;
  --blob-sm: 12px 16px 11px 15px / 15px 11px 16px 12px;
  --facet: 10px 26px 10px 26px;
  --r-field: 12px;
  --r-nub: 8px;
  --r-tile: 10px;
  --r-tray: 16px;
  --r-code: 6px;
  --r-code-block: 14px;
  --lift: 0 10px 24px -10px rgb(var(--shadow-tint) / 0.45), 0 2px 6px -2px rgb(var(--shadow-tint) / 0.25);
  --lift-hi: 0 18px 36px -12px rgb(var(--shadow-tint) / 0.5), 0 3px 8px -2px rgb(var(--shadow-tint) / 0.25);

  --display: "Grandstander", "Nunito", system-ui, sans-serif;
  --hand: "Gochi Hand", "Grandstander", "Nunito", system-ui, sans-serif;
  --text: "Nunito", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --fs-tiny: 0.75rem;
  --fs-micro: 0.8rem;
  --fs-meta: 0.85rem;
  --fs-small: 0.95rem;
  --fs-body: 1.0625rem;
  --fs-lead: 1.15rem;

  --topbar-h: 64px; /* overwritten live by trackHeight() */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fur);
  color: var(--ink);
  font: 400 var(--fs-body)/1.65 var(--text);
  overflow-x: clip;
  isolation: isolate;
}

/* lavender cloud edges, painted like the sheet's background */
body::before {
  content: "";
  position: fixed;
  inset: -10vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(44vmax 36vmax at 2% 4%, var(--cloud) 0%, transparent 72%),
    radial-gradient(30vmax 34vmax at 100% 0%, var(--cloud-2) 0%, transparent 68%),
    radial-gradient(44vmax 38vmax at 102% 96%, var(--cloud) 0%, transparent 72%),
    radial-gradient(30vmax 26vmax at -2% 100%, var(--cloud-3) 0%, transparent 70%);
  filter: url(#cloud-edge) blur(6px);
}
/* soft bokeh dots */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 7% 22%, var(--paper) 0 14px, transparent 16px),
    radial-gradient(circle at 12% 9%, rgb(255 255 255 / 0.8) 0 8px, transparent 10px),
    radial-gradient(circle at 93% 16%, rgb(255 255 255 / 0.85) 0 18px, transparent 21px),
    radial-gradient(circle at 96% 80%, rgb(255 255 255 / 0.8) 0 10px, transparent 12px),
    radial-gradient(circle at 4% 86%, rgb(255 255 255 / 0.7) 0 12px, transparent 14px);
  filter: blur(2px);
}

img { max-width: 100%; display: block; }
a { color: var(--magenta); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--violet-deep); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--pink-2); color: var(--ink); }
:target, [id^="release-"], div.thread > * { scroll-margin-top: calc(var(--topbar-h) + 16px); }

.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stack { display: grid; gap: var(--gap, 8px); }
.stack.tight { --gap: 6px; }
.stack.loose { --gap: 14px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
.hand { font-family: var(--hand); font-weight: 400; color: var(--magenta); letter-spacing: 0.01em; }
.section-title { font: 400 2rem/1 var(--hand); color: var(--magenta); letter-spacing: 0.01em; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.section-title .icon { width: 30px; height: 30px; }
.page-title { font: 400 clamp(2rem, 4vw, 2.6rem)/1 var(--hand); color: var(--magenta); letter-spacing: 0.01em; }
.page-title .count { font: 700 1rem var(--display); color: var(--ink-3); margin-left: 0.4em; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }

/* ---------- inked outline: a wobbling plum line drawn on a layer behind content ---------- */
.inked { position: relative; border-radius: var(--blob); }
.inked::before {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--line) solid var(--ink);
  border-radius: inherit;
  filter: url(#wobble);
  pointer-events: none;
  z-index: 2;
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.6em 1.1em 0.5em;
  font: 700 1rem/1.1 var(--display);
  color: var(--ink);
  background: var(--bg);
  border: var(--line) solid var(--ink);
  border-radius: var(--blob-sm);
  box-shadow: var(--lift);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s;
  white-space: nowrap;
}
.btn .icon { margin-top: -0.1em; }
.btn:hover { --bg: var(--fur-2); color: var(--ink); transform: translateY(-2px) rotate(-0.6deg); box-shadow: var(--lift-hi); }
.btn:active { transform: translateY(1px) scale(0.97); box-shadow: var(--lift); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.pink { --bg: var(--pink); }
.btn.pink:hover { --bg: var(--pink-hover); }
.btn.small { min-height: 36px; padding: 0.4em 0.8em 0.3em; font-size: 0.9rem; border-width: var(--line-md); }
.btn.ghost { --bg: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { --bg: var(--lilac-2); border-color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.icon-only { padding: 0; width: 44px; min-height: 44px; }
.btn.small.icon-only { width: 36px; min-height: 36px; }
.btn.icon-sm { padding: 0; width: 32px; min-height: 32px; border-width: var(--line-sm); box-shadow: none; }
.btn.icon-sm:hover { --bg: var(--pink-2); transform: none; box-shadow: none; }
.btn.icon-sm .icon { width: 18px; height: 18px; margin: 0; }

/* the crystal: the one big download action */
.crystal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.85rem 1.1rem 0.85rem 0.9rem;
  font: 800 var(--fs-lead)/1.15 var(--display);
  color: var(--ink);
  text-decoration: none;
  margin-top: 28px;
  padding-left: 76px;
  background: linear-gradient(135deg, var(--crystal-light) 0%, var(--pink) 40%, var(--lilac) 80%, var(--crystal-deep) 100%);
  border: var(--line) solid var(--ink);
  border-radius: var(--facet);
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.crystal:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--lift-hi); }
.crystal:active { transform: scale(0.98); }
.crystal small { display: block; font: 600 var(--fs-meta)/1.3 var(--text); color: var(--ink-2); }
.crystal .gem { position: absolute; left: 6px; bottom: -6px; width: 62px; height: auto; filter: drop-shadow(0 4px 6px rgb(var(--shadow-tint) / 0.35)); transform: rotate(-8deg); transition: transform 0.5s var(--ease); }
.crystal:hover .gem { transform: rotate(-2deg) translateY(-4px) scale(1.05); }
.crystal .rest { position: absolute; width: 12px; height: 12px; color: var(--violet-deep); opacity: 0.8; }
.crystal .rest.a { left: 68px; top: -10px; }
.crystal .rest.b { left: -8px; top: 6px; width: 9px; height: 9px; color: var(--pink-deep); }
.crystal .spark { position: absolute; width: 16px; height: 16px; opacity: 0; pointer-events: none; color: var(--violet-deep); }
.crystal.burst .spark { animation: spark 0.9s var(--ease) forwards; }
.crystal .spark:nth-of-type(1) { right: 14px; top: -6px; }
.crystal .spark:nth-of-type(2) { right: -6px; top: 40%; --dx: 10px; }
.crystal .spark:nth-of-type(3) { right: 34%; bottom: -8px; --dy: 10px; }
@keyframes spark {
  0% { opacity: 0; transform: scale(0.2) rotate(0); }
  35% { opacity: 1; transform: translate(var(--dx, 4px), calc(-1 * var(--dy, 10px))) scale(1.2) rotate(45deg); }
  100% { opacity: 0; transform: translate(calc(2 * var(--dx, 4px)), calc(-2 * var(--dy, 10px))) scale(0.6) rotate(90deg); }
}

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 32px;
  padding: 0.25em 0.75em 0.15em 0.55em;
  font: 700 0.9rem/1 var(--display);
  color: var(--ink);
  background: var(--lilac-2);
  border: var(--line-sm) solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.25s var(--ease);
}
.chip .icon { width: 1.1em; height: 1.1em; margin-top: -0.1em; }
a.chip, button.chip { cursor: pointer; }
a.chip:hover, button.chip:hover { color: var(--ink); background: var(--pink-2); transform: translateY(-1px); }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip[aria-current="page"] { background: var(--pink); }
a.chip[aria-current="page"]:hover { background: var(--pink); }
.chip.sm { min-height: 26px; font-size: var(--fs-micro); padding-inline: 0.45em 0.65em; }
.chip.sm .icon { width: 1em; height: 1em; }
.chip.plain { cursor: inherit; background: var(--paper); }
.chip.more { background: var(--paper); border-style: dashed; padding-inline: 0.6em; }
.chip .n { margin-left: auto; padding-left: 0.4em; font: 700 var(--fs-micro)/1 var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chip-x { border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--ink); cursor: pointer; width: 1.1em; height: 1.1em; margin-right: -0.2em; }
.chip-x .icon { width: 100%; height: 100%; margin: 0; }

/* ---------- pills: status and version badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 0.3em; padding: 0.4em 0.65em 0.3em; font: 700 var(--fs-micro)/1 var(--display); color: var(--ink); background: var(--paper); border: var(--line-sm) solid var(--ink); border-radius: 999px; white-space: nowrap; }
.pill .icon { width: 1em; height: 1em; margin-top: -0.15em; }
.pill.published, .pill.latest { background: var(--pink); }
.pill.featured { background: var(--lilac); }
.pill.draft { border-style: dashed; background: var(--fur-2); color: var(--ink-2); }
.pill.ver { background: var(--paper); }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; border: var(--line-md) solid var(--ink); border-radius: 999px; background: var(--paper); }
.seg button { min-height: 38px; padding: 0 14px; border: 0; background: transparent; font: 700 0.9rem var(--display); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 0.4em; }
.seg button:first-child { border-radius: 999px 0 0 999px; }
.seg button:last-child { border-radius: 0 999px 999px 0; }
.seg button + button { border-left: var(--line-md) solid var(--ink); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--lilac-2); }
.seg button[aria-pressed="true"] { background: var(--pink); color: var(--ink); }
.seg button:focus-visible { outline-offset: -5px; }
.seg.neutral-first button:first-child[aria-pressed="true"] { background: var(--fur-3); }

/* ---------- topbar: the shared shell bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--bar-glass); backdrop-filter: blur(10px); border-bottom: var(--line) solid var(--ink); }
.topbar > .wrap { display: flex; align-items: center; gap: 14px; min-height: 64px; padding-block: 8px; }
.topbar .grow { flex: 1; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; }
.topbar nav a[aria-current="page"] { --bg: var(--lilac-2); border-color: var(--ink); }

.wordmark {
  position: relative;
  display: inline-block;
  font: 400 clamp(2.6rem, 7vw, 3.5rem)/0.9 var(--hand);
  color: var(--ink);
  text-decoration: none;
  padding: 0.18em 0.32em 0.22em 0.2em;
  isolation: isolate;
  transform: rotate(-3deg);
  transform-origin: left center;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark::before {
  content: "";
  position: absolute;
  inset: -8% -14% -14% -10%;
  z-index: -1;
  background: url(/art/splash.webp) center / 100% 100% no-repeat;
  transition: transform 0.6s var(--ease);
}
.wordmark:hover::before { transform: scale(1.04) rotate(2deg); }
.wordmark .rest-spark { position: absolute; color: var(--violet); }
.wordmark .rest-spark.a { width: 0.22em; height: 0.22em; right: -0.25em; bottom: 0.15em; }
.wordmark .rest-spark.b { width: 0.14em; height: 0.14em; left: -0.2em; top: 0.1em; color: var(--pink-deep); }
.wordmark .heart { position: relative; top: -0.75em; width: 0.32em; height: 0.32em; vertical-align: baseline; margin-left: 0.04em; color: var(--ink); }
.wordmark.sm { font-size: 1.9rem; flex: none; margin-right: 10px; padding: 0.12em 0.3em 0.16em 0.16em; }

.wordmark.sm .heart { top: -0.55em; }

.search { position: relative; flex: 1; max-width: 460px; min-width: 0; }
.search > .icon { position: absolute; left: 0.75em; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.search input { display: block; padding: 0.4em 2.4em; }
.search kbd { position: absolute; right: 0.8em; top: 50%; translate: 0 -50%; font: 600 var(--fs-micro) var(--mono); border: var(--line-sm) solid var(--ink-3); border-radius: 6px; padding: 0 0.4em; color: var(--ink-3); pointer-events: none; }
.search:focus-within kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
@media (hover: none) { .search kbd { display: none; } }

/* ---------- home: the board ---------- */
.board { position: relative; padding: 24px 0 24px; }
.banner { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 48px; padding: 6px 0 28px; }
.banner .brand { margin: 0; font: inherit; }
.banner .lede { max-width: 34ch; margin: 0 0 6px; font-size: var(--fs-lead); color: var(--ink-2); }

.board-grid { display: grid; gap: 20px; }
.board-grid > * { min-width: 0; }
@media (min-width: 1000px) {
  .board-grid:not(.solo) { grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
  .tags-nav { position: sticky; top: calc(var(--topbar-h) + 20px); }
  .tags-nav .chips { flex-direction: column; align-items: stretch; gap: 6px; }
  .tags-nav .chip { width: 100%; }
}
@media (max-width: 999px) {
  .tags-nav .section-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tags-nav .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 4px; scroll-padding-inline: 16px; margin-inline: -16px; padding-inline: 16px; }
  .tags-nav .chips::-webkit-scrollbar { display: none; }
  .tags-nav .chips > li { flex: none; }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.toolbar label.hand { font-size: 1.4rem; line-height: 1; }
.toolbar select { width: auto; }
.toolbar .seg button { padding: 0 12px; }
.results { margin: 0; font: 600 var(--fs-small)/1.5 var(--text); color: var(--ink-2); }
.results .chip { vertical-align: middle; margin-block: 2px; }
.results a:not(.chip) { font-weight: 700; }

ol.threads { list-style: none; margin: 0; padding: 6px clamp(10px, 2vw, 18px); }
li.thread {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 210px;
  gap: 16px;
  align-items: center;
  padding: 14px 8px;
  border-radius: var(--r-nub);
  transition: background-color 0.2s;
}
li.thread + li.thread { border-top: var(--line-sm) dotted var(--lilac); }
li.thread:hover { background: var(--fur-2); }
li.thread:has(a:focus-visible) { outline: 3px solid var(--violet); outline-offset: 2px; }
.tthumb { aspect-ratio: 16 / 10; border: var(--line-sm) solid var(--ink); border-radius: var(--r-tile); overflow: hidden; background: var(--fur-3); }
.tthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
li.thread:hover .tthumb img { transform: scale(1.04); }
.tthumb.empty { display: grid; place-items: center; background: var(--fur-2); }
.tthumb.empty .icon { width: 30px; height: 30px; }
.ttitle { font: 800 1.2rem/1.2 var(--display); }
.ttitle a { color: var(--ink); text-decoration: none; }
.ttitle a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-nub); }
.ttitle a:focus-visible { outline: none; }
li.thread:hover .ttitle a { color: var(--magenta); }
.tsum { margin: 2px 0 0; font-size: var(--fs-small); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
li.thread .chips { position: relative; z-index: 1; gap: 6px; margin-top: 8px; width: fit-content; }
.tmeta { display: grid; justify-items: end; gap: 4px; font-size: var(--fs-meta); color: var(--ink-3); text-align: right; }
.tmeta .pills { display: flex; gap: 6px; }
.tmeta .stats { justify-content: flex-end; }
li.thread.pinned { background: var(--fur-2); grid-template-columns: 160px minmax(0, 1fr) 210px; }
li.thread.pinned .ttitle { font-size: 1.4rem; }
li.thread.pinned .tsum { -webkit-line-clamp: 2; }
.thread .note { left: -4px; top: 4px; }

/* the grid layout: inked swatch cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(20px, 3vw, 34px); }
.card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--lift);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card > .clip { flex: 1; display: flex; flex-direction: column; overflow: hidden; border-radius: inherit; }
.card:nth-child(3n + 2) { --tilt: 0.6deg; }
.card:nth-child(3n) { --tilt: -0.5deg; }
.card { transform: rotate(var(--tilt, -0.3deg)); }
.card:hover { color: var(--ink); transform: translateY(-6px) rotate(0); box-shadow: var(--lift-hi); }
.card .thumb { position: relative; aspect-ratio: 16 / 10; background: var(--fur-3); border-bottom: var(--line) solid var(--ink); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.card:hover .thumb img { transform: scale(1.04); }
.card .thumb.empty { display: grid; place-items: center; background: var(--fur-2); }
.card .thumb.empty svg { width: 72px; height: 72px; color: var(--ink); opacity: 0.85; }
.card .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 64px;
  background: url(/art/fur-patch.webp) 0 calc(100% + 66px) / 480px auto repeat-x;
  transition: background-position 0.6s var(--ease);
}
.card:hover .body { background-position: -60px calc(100% + 44px); }
.card h2 { font-size: 1.45rem; font-weight: 800; }
.card p { margin: 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note { position: absolute; top: 14px; left: 14px; z-index: 3; padding: 0.15em 0.55em 0.25em; font: 400 1.45rem/1 var(--hand); color: var(--magenta); background: var(--fur); border: var(--line-sm) solid var(--ink); border-radius: var(--blob-sm); transform: rotate(-5deg); box-shadow: var(--lift); pointer-events: none; }
.card .meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.card .chips { gap: 6px; }
.when { display: inline-flex; align-items: center; gap: 8px; font: 600 var(--fs-meta) var(--text); color: var(--ink-3); white-space: nowrap; }

@media (min-width: 760px) {
  .grid > .card.featured { grid-column: 1 / -1; }
  .card.featured > .clip { flex-direction: row; }
  .card.featured .thumb { flex: 1.4; aspect-ratio: 16 / 9; min-height: 0; border-bottom: 0; border-right: var(--line) solid var(--ink); }
  .card.featured .body { flex: 1; padding: 26px 28px 80px; justify-content: center; }
  .card.featured .meta { margin-top: 10px; }
  .card.featured h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
  .card.featured p { -webkit-line-clamp: 6; font-size: var(--fs-body); }
}

.empty-state { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 40px 16px 64px; }
.empty-state img { width: min(280px, 64vw); height: auto; filter: drop-shadow(0 12px 18px rgb(var(--shadow-tint) / 0.18)); }
.empty-state :is(h1, h2), .signin h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.empty-state p { margin: 0; max-width: 42ch; color: var(--ink-2); }
.empty-state .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.site-foot { padding: 48px 0 40px; color: var(--ink-3); font-size: var(--fs-small); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-foot a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 0.3em; }
.site-foot a .icon { width: 1em; height: 1em; }
.site-foot .quiet { color: var(--ink-3); font-size: var(--fs-meta); }

/* ---------- project page ---------- */
.crumbs { position: relative; z-index: 1; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; padding: 0; margin: 20px 0 0; font: 700 var(--fs-small) var(--display); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: ""; width: 7px; height: 7px; border: solid var(--ink-3); border-width: 2px 2px 0 0; transform: rotate(45deg); margin-right: 8px; align-self: center; flex: none; }
.crumbs a { display: inline-flex; align-items: center; gap: 0.4em; color: var(--ink); text-decoration: none; }
.crumbs a:hover { color: var(--magenta); }
.crumbs .home .icon { transition: transform 0.3s var(--ease); }
.crumbs .home:hover .icon { transform: translateX(-3px); }
.crumbs [aria-current] { color: var(--ink-3); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero > *, div.thread > * { min-width: 0; }
.hero { grid-template-columns: minmax(0, 1fr); display: grid; gap: 28px; padding: 20px 0 28px; align-items: center; }
@media (min-width: 900px) { .hero:not(.bare) { grid-template-columns: 1.05fr 1fr; gap: 48px; } }
.hero .title { position: relative; isolation: isolate; display: table; font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; padding: 0.1em 0.2em; margin-left: -0.2em; }
/* long titles step down a size and keep a readable measure, so the splash stays a backdrop instead of a wall */
.hero .title.long { font-size: clamp(1.9rem, 3.6vw, 2.8rem); max-width: 30ch; }
.hero .title.long::before { inset: -14% -6% -16% -5%; opacity: 0.6; }
.hero .title::before { content: ""; position: absolute; inset: -32% -10% -34% -8%; z-index: -1; background: url(/art/splash.webp) center / 100% 100% no-repeat; opacity: 0.85; }
.hero .summary { margin: 18px 0 0; font-size: 1.2rem; color: var(--ink-2); max-width: 46ch; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 14px; font: 600 var(--fs-small) var(--text); color: var(--ink-3); }
.facts .stats { font-size: var(--fs-small); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.hero .chips { margin-top: 18px; }
.hero .cover { background: var(--paper); box-shadow: var(--lift-hi); overflow: hidden; transform: rotate(1.2deg); }
.hero .cover img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.draft-flag { display: inline-flex; gap: 0.5em; align-items: center; margin-top: 18px; padding: 0.4em 0.8em; font: 700 var(--fs-small) var(--display); border: var(--line-sm) dashed var(--ink); border-radius: var(--r-field); background: var(--fur-2); }
.jump { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px -0.8em; }

div.thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 40px; }
@media (min-width: 1000px) {
  div.thread {
    grid-template-columns: minmax(0, 1fr) 380px;
    column-gap: 56px;
    row-gap: 40px;
    grid-template-areas: "overview side" "gallery side" "changelog side" "related side";
    grid-template-rows: repeat(3, auto) 1fr;
  }
  #overview { grid-area: overview; }
  #gallery { grid-area: gallery; }
  #changelog { grid-area: changelog; }
  #related { grid-area: related; }
  .paws { grid-area: side; align-self: start; }
  .paws.stuck { position: sticky; top: calc(var(--topbar-h) + 20px); }
}

.paper { background: var(--paper); padding: clamp(22px, 4vw, 44px); box-shadow: var(--lift); }

/* writeup: Quill output, restyled in Mireya's world */
.prose.ql-editor { padding: 0; height: auto; overflow: visible; line-height: 1.7; font-size: var(--fs-body); font-family: var(--text); white-space: normal; }
.prose > * { max-width: 70ch; }
.prose p { margin: 0 0 0.9em; }
.prose h1, .prose h2, .prose h3 { margin: 1.6em 0 0.5em; font-family: var(--display); font-weight: 800; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose ol { padding-left: 1.6em; margin: 0 0 1em; }
.prose li { padding-left: 0.4em; margin-bottom: 0.25em; }
.prose li[data-list="bullet"] > .ql-ui::before {
  content: "";
  display: inline-block;
  width: 0.95em;
  height: 0.85em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 20.5S2 14.6 2 8a5 5 0 0 1 10-1.2A5 5 0 0 1 22 8c0 6.6-10 12.5-10 12.5z' fill='%23ff8fd0' stroke='%232a0b25' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  vertical-align: -0.05em;
}
.prose li[data-list="ordered"] > .ql-ui::before { font-family: var(--display); font-weight: 700; color: var(--magenta); }
.prose.ql-editor blockquote { margin: 1.2em 0; padding: 0.6em 1.1em; background: var(--lilac-2); border: var(--line-sm) solid var(--ink); border-radius: var(--blob-sm); font-style: italic; color: var(--ink-2); }
.prose a { color: var(--magenta); }
.prose img { border: var(--line) solid var(--ink); border-radius: var(--blob-sm); margin: 0.6em 0; height: auto; }
.prose iframe { width: 100%; max-width: 70ch; aspect-ratio: 16 / 9; border: var(--line) solid var(--ink); border-radius: var(--blob-sm); }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--fur-3); padding: 0.1em 0.35em; border-radius: var(--r-code); }
.prose.ql-editor .ql-code-block-container, .prose.ql-editor pre {
  position: relative;
  margin: 1.2em 0;
  padding: 1em 1.2em;
  max-width: 100%;
  overflow-x: auto;
  font: 0.9rem/1.6 var(--mono);
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--r-code-block);
  white-space: pre;
}
.prose select.ql-ui { display: none; }
.prose table { border-collapse: collapse; margin: 1.2em 0; font-size: var(--fs-small); display: block; overflow-x: auto; max-width: 100%; }
.prose td, .prose th { border: var(--line-sm) solid var(--ink); padding: 0.45em 0.8em; min-width: 4em; }
.prose tr:nth-child(odd) td { background: var(--fur-2); }
.prose .ql-size-small { font-size: 0.85em; }
.prose .ql-size-large { font-size: 1.4em; }
.prose .ql-size-huge { font-size: 2em; }

/* syntax colours, sampled from her fur */
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: var(--pink); }
.hljs-string, .hljs-attr, .hljs-template-variable { color: var(--syntax-string); }
.hljs-number, .hljs-literal, .hljs-symbol { color: var(--pink-2); }
.hljs-comment, .hljs-quote { color: var(--syntax-comment); font-style: italic; }
.hljs-title, .hljs-function .hljs-title, .hljs-section { color: var(--paper); font-weight: 600; }
.hljs-type, .hljs-class .hljs-title, .hljs-variable { color: var(--lilac); }
.hljs-meta, .hljs-tag { color: var(--syntax-meta); }

/* gallery */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.shot { padding: 0; border: 0; background: var(--paper); cursor: zoom-in; overflow: hidden; box-shadow: var(--lift); transition: transform 0.4s var(--ease); }
.shot:nth-child(even) { transform: rotate(0.8deg); }
.shot:nth-child(odd) { transform: rotate(-0.6deg); }
.shot:hover { transform: rotate(0) translateY(-4px); }
.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.lightbox { width: min(1100px, 100% - 24px); max-height: calc(100dvh - 24px); padding: 0; border: var(--line) solid var(--ink); border-radius: var(--blob); background: var(--paper); box-shadow: var(--lift-hi); }
.lightbox::backdrop { background: color-mix(in srgb, var(--ink) 60%, transparent); backdrop-filter: blur(6px); }
.lightbox img { width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; background: var(--fur-2); }
.lightbox .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; }
.lightbox .bar p { margin: 0; color: var(--ink-2); }

/* downloads column */
.paws { display: grid; gap: 20px; }
.paws > .paper { padding: 22px; }
.paws .section-title { margin-bottom: 16px; }
.releases { display: grid; gap: 14px; }
.release { border: var(--line-sm) solid var(--ink); border-radius: var(--blob-sm); background: var(--fur); }
.release > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 14px; cursor: pointer; list-style: none; font: 800 1.1rem var(--display); }
.release > summary::-webkit-details-marker { display: none; }
.release > summary .chev { margin-left: auto; transition: transform 0.3s var(--ease); }
.release[open] > summary .chev { transform: rotate(180deg); }
.release > summary time, .rfacts { font: 600 var(--fs-meta) var(--text); color: var(--ink-3); }
.release .inner { padding: 0 14px 14px; display: grid; gap: 12px; }
.release .notes { margin: 0; white-space: pre-wrap; color: var(--ink-2); font-size: var(--fs-small); }
.release.empty { border: var(--line-sm) dashed var(--ink-3); padding: 12px 14px; }
.older { margin: 6px 0 -6px; font-size: 1.4rem; line-height: 1; }

.tree { list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: var(--line-sm) dotted var(--lilac); margin-left: 9px; }
.tree .leaf { display: flex; align-items: center; gap: 4px; }
.tree .leaf > .file { flex: 1; min-width: 0; }
.tree details > summary { display: flex; align-items: center; gap: 6px; padding: 5px 4px; cursor: pointer; list-style: none; font-weight: 700; border-radius: var(--r-nub); }
.tree details > summary::-webkit-details-marker { display: none; }
.tree details > summary:hover { background: var(--lilac-2); }
.tree summary .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree summary .dl { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font: 700 var(--fs-micro)/1 var(--display); color: var(--magenta); text-decoration: none; opacity: 0; transition: opacity 0.2s; }
.tree summary .dl:hover { background: var(--pink-2); }
.tree summary:hover .dl, .tree summary .dl:focus-visible { opacity: 1; }
.tree .file { display: flex; align-items: center; gap: 6px; padding: 4px 4px; border-radius: var(--r-nub); color: var(--ink); text-decoration: none; }
.tree .file:hover { background: var(--pink-2); color: var(--ink); }
.tree .file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .file .size { color: var(--ink-3); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.tree .file .dl { opacity: 0; transition: opacity 0.2s; }
.tree .file:hover .dl, .tree .file:focus-visible .dl { opacity: 1; }
.tree .icon { width: 18px; height: 18px; }

.everything { display: grid; gap: 12px; }
.everything .section-title { margin: 0; }
.everything p { margin: 0; font-size: var(--fs-small); color: var(--ink-2); }

/* changelog */
.changelog { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.paper.log { padding: 18px 22px; display: grid; gap: 6px; justify-items: start; }
.loghead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.loghead h3 { font-size: 1.2rem; font-weight: 800; }
.loghead time { font: 600 var(--fs-meta) var(--text); color: var(--ink-3); }
.log .notes { margin: 0; white-space: pre-wrap; color: var(--ink-2); font-size: var(--fs-small); }
.log .notes.none { color: var(--ink-3); }
.log a { font: 700 var(--fs-small) var(--display); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; translate: -50% 0; z-index: 50; display: grid; gap: 8px; width: min(440px, 100% - 32px); }
.toast { padding: 12px 16px; font-weight: 600; background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--blob-sm); box-shadow: var(--lift-hi); animation: toast 0.45s var(--ease); }
.toast.error { background: var(--error-wash); }
@keyframes toast { from { transform: translateY(16px); opacity: 0; } }

/* ---------- forms ---------- */
label { font: 700 var(--fs-small) var(--display); }
.field { display: grid; gap: 6px; }
.field .hint { font: 400 var(--fs-meta) var(--text); color: var(--ink-3); }
:where(input[type="text"], input[type="url"], input[type="search"], input:not([type]), textarea, select) {
  width: 100%;
  min-height: 44px;
  padding: 0.55em 0.8em;
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
  background: var(--paper);
  border: var(--line-md) solid var(--ink);
  border-radius: var(--r-field);
  transition: box-shadow 0.2s, border-color 0.2s;
}
:where(input[type="search"]) { appearance: none; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
:where(select) { appearance: none; padding-right: 2.2em; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a0b25' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 0.7em center / 1em no-repeat; cursor: pointer; }
:where(textarea) { resize: vertical; min-height: 88px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
:where(input, textarea, select):focus { outline: none; border-color: var(--violet-deep); box-shadow: 0 0 0 4px var(--lilac-2), 0 0 0 6px var(--lilac); }

.skeleton { display: block; height: 1em; border-radius: var(--r-nub); background: linear-gradient(90deg, var(--fur-3), var(--pink-2), var(--fur-3)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 640px) {
  .topbar > .wrap { gap: 10px; min-height: 0; }
  .topbar nav { display: none; }
  .wordmark.sm { font-size: 1.6rem; }
  .board { padding-top: 16px; }
  .banner { padding-bottom: 18px; }
  li.thread, li.thread.pinned { grid-template-columns: 72px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 12px 4px; }
  .ttitle { font-size: var(--fs-lead); }
  li.thread.pinned .ttitle { font-size: 1.25rem; }
  .tsum { font-size: var(--fs-meta); line-height: 1.45; }
  li.thread .chips { margin-top: 5px; }
  .toolbar { gap: 10px; }
  .results { flex-basis: 100%; }
  .toolbar .grow { display: none; }
  .toolbar select { flex: 1; min-width: 0; }
  .tmeta { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 12px; text-align: left; }
  .tmeta .stats { gap: 4px 18px; }
  li.thread.pinned .tmeta { grid-column: 1 / -1; }
  li.thread .note { display: none; }
  .card .note { top: auto; bottom: 12px; }
  .card .thumb.empty { aspect-ratio: 16 / 5; }
  .hero .cover { transform: none; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ---------- page transitions ---------- */
[tabindex="-1"]:focus { outline: none; }

::view-transition-group(*) { animation-duration: 0.5s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: 0.22s ease-in both vt-out; }
::view-transition-new(root) { animation: 0.5s var(--ease) 0.06s both vt-in; }
::view-transition-group(cover), ::view-transition-group(title) { animation-duration: 0.6s; z-index: 10; }
::view-transition-old(cover), ::view-transition-new(cover) { height: 100%; object-fit: cover; overflow: clip; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); filter: blur(3px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- counters ---------- */
.stats { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 22px; margin: 0; font: 600 var(--fs-meta)/1.4 var(--text); color: var(--ink-3); }
.stats > span { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.stats > span + span::before { content: ""; position: absolute; left: -13px; width: 4px; height: 4px; border-radius: 50%; background: var(--lilac); }
.stats .icon { width: 1.1em; height: 1.1em; color: var(--magenta); }
.torrent-links { justify-self: center; display: flex; gap: 22px; }
.torrent-link { display: inline-flex; align-items: center; gap: 6px; font: 600 0.9rem var(--text); color: var(--ink-2); }
.torrent-link:hover { color: var(--magenta); }
.torrent-link .icon { width: 1.1em; height: 1.1em; color: var(--magenta); }

/* ---------- accessibility ---------- */
@media (forced-colors: active) {
  .chip[aria-current="true"], .chip[aria-current="page"], .chip[aria-pressed="true"], .seg button[aria-pressed="true"] { outline: 3px solid CanvasText; outline-offset: -5px; }
  .switch input:checked + .track { background: Highlight; }
}
@media (hover: none) {
  .tree .file .dl, .tree summary .dl { opacity: 1; }
  .tree .file, .tree details > summary { min-height: 44px; }
}
