/* averr.ing — project rules on top of supram (neon). Unlayered, so it wins.

   The look is the Web Tiles family's (webtil.es, appmosphe.re): ink lines,
   round corners, hard shadows, a ground that goes from one colour to another
   with pale shapes on it. Here the ground goes from green to aqua and the
   shapes are verifiers' seals.

   No off-white and no warm grey, anywhere: grounds are white or a colour,
   neutrals are supram's cool ones. */
:root {
  /* the family's colours (DASL's), and mu's pink */
  --green: #00ff75;
  --aqua: #2fe6d0;
  --blue: #39dbff;
  --purple: #cd76ea;
  --pink: #ffbdf2;
  --red: #ff5e5e;
  /* soft fills of the same */
  --tint-green: #d9ffe9;
  --tint-aqua: #d4fbf6;
  --tint-blue: #d6f6ff;
  --tint-purple: #f3e0fb;
  --tint-pink: #ffe5f9;
  --tint-red: #ffe0e4;
  /* the ground of the header and the footer */
  --ground-from: #9af9a8;
  --ground-mid: #7ef3c0;
  --ground-to: #6fe9e0;
  --ghost: 1;

  --edge: var(--fg);
  --line: 2px;
  --radius: 14px;
  --drop: 4px;
  --page-max: 62rem;

  --link: #006b4f;
  --link-hover: #00503b;
  --focus: #007a5a;
  --accent: var(--green);
  --selection: var(--green);
  --surface: var(--tint-green);
  --on-fill: #101214;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground-from: #0b5a2a;
    --ground-mid: #07604a;
    --ground-to: #075f66;
    --ghost: 0.3;
    --tint-green: #10301e;
    --tint-aqua: #0e302d;
    --tint-blue: #0f2c36;
    --tint-purple: #2d1838;
    --tint-pink: #381a31;
    --tint-red: #3a1519;
    --link: #6ff0b0;
    --link-hover: #a6f7cf;
    --focus: #6ff0b0;
  }
}

.page { align-content: start; min-block-size: 100dvh; grid-template-rows: auto 1fr auto; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
::selection { background: var(--green); color: var(--on-fill); }

/* ── the ground ──────────────────────────────────────────────────────── */
.site-header, .site-footer {
  position: relative;
  isolation: isolate;
  background: linear-gradient(100deg, var(--ground-from) 0%, var(--ground-mid) 50%, var(--ground-to) 100%) var(--ground-mid);
  color: var(--fg);
}
.site-header::before, .site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: var(--ghost);
  background-image: url("img/ghost-a.svg"), url("img/ghost-b.svg"), url("img/ghost-c.svg");
  background-repeat: no-repeat;
  background-position: left -5rem top -8rem, right 14% bottom -9rem, left 48% top -5rem;
  background-size: 19rem auto, 15rem auto, 9rem auto;
  pointer-events: none;
  overflow: hidden;
}
.site-header { border-bottom: 3px solid var(--edge); overflow: hidden; }
.site-footer { border-top: 3px solid var(--edge); overflow: hidden; }
.site-footer::before { background-position: left 8% top -4rem, right -3rem bottom -6rem, left 60% top -5rem; background-size: 11rem auto, 13rem auto, 7rem auto; }
.site-header a, .site-footer a { color: inherit; }

/* ── type ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: var(--tracking-tight); margin: 0; }
h1 { font-size: var(--text-2xl); font-weight: 800; line-height: 1.05; }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
p { margin: 0; }
.label, h2.label { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin: 0; }
.handle { font-family: var(--font-mono); font-size: 0.86em; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.site-header .handle { color: var(--fg); }
a.handle:hover { text-decoration: underline; }
.meta { font-size: var(--text-sm); color: var(--muted); }
.empty { color: var(--muted); }
.said { max-width: 70ch; white-space: pre-line; overflow-wrap: anywhere; }
.narrow { max-width: 28rem; }
.mb-3 { margin-bottom: var(--space-3); }
.mt-6 { margin-top: var(--space-6); }
.grow { flex: 1 1 14rem; }

/* A small label with a hard shadow: the family's leaning labels, level here. */
.tag {
  display: inline-block;
  width: fit-content;
  padding: 0.25em 0.8em;
  background: var(--tag, var(--bg));
  color: var(--fg);
  border: var(--line) solid var(--edge);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--edge);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: var(--leading-snug);
}
.tag-green { --tag: var(--green); color: var(--on-fill); }
.tag-blue { --tag: var(--blue); color: var(--on-fill); }
.tag-purple { --tag: var(--purple); color: var(--on-fill); }

/* A label says what something is. It is flat and square-cornered so that it
   never reads as something to press: what can be pressed has an ink outline. */
.chip {
  display: inline-block;
  padding: 0.25em 0.6em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
  color: var(--fg);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
}
.chip-root { background: var(--fg); color: var(--bg); }
.chip-you { background: var(--pink); color: var(--on-fill); }
.st-open { background: var(--blue); color: var(--on-fill); }
.st-ok { background: var(--green); color: var(--on-fill); }

/* ── header & footer ─────────────────────────────────────────────────── */
.header-row { gap: var(--space-2) var(--space-3); align-items: center; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--text-md);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}
.brand .mark { flex: none; width: 2.5rem; height: 2.5rem; }
/* Looking an account up is one field with its own glass, next to the name of
   the site; signing in is a button at the far end. */
.find {
  display: flex; align-items: center; flex: 0 1 17rem; min-width: 0; margin-inline-end: auto;
  background: #fff; color: var(--edge); border: 2px solid var(--edge); border-radius: 999px; padding-inline: 1em 0.25em;
}
.find:focus-within { outline: 3px solid var(--edge); outline-offset: 2px; }
.find input[type="search"] {
  flex: 1 1 auto; min-width: 0; width: 100%; border: 0; border-radius: 0; background: none; box-shadow: none;
  padding: 0.4em 0; outline: none; font-size: var(--text-sm, 0.92rem);
}
.find button.find-go {
  flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0;
  border: 0; border-radius: 999px; background: none; box-shadow: none; color: inherit; transform: none;
}
.find button.find-go:hover { background: var(--green); }
.me { gap: var(--space-2); flex-wrap: nowrap; }
.me .who { max-width: 14rem; }

@media (max-width: 34rem) {
  .find { order: 3; flex-basis: 100%; }
}

.group-head { display: flex; align-items: center; gap: var(--space-3); padding-block: var(--space-3) var(--space-2); }
.group-head .stack { --stack-gap: var(--space-1); min-width: 0; }
.group-head h1 { overflow-wrap: anywhere; }
.bio { max-width: 60ch; white-space: pre-line; overflow-wrap: anywhere; font-size: var(--text-sm, 0.92rem); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.bio-short { -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; color: var(--muted); }
.tags { gap: 0.4rem; align-items: center; }
.tabs { gap: 0.4rem; padding-block: var(--space-1) var(--space-3); }
.tabs a {
  padding: 0.3rem 0.9rem;
  border: var(--line) solid var(--edge);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--edge);
  background: var(--bg);
  color: var(--fg);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.tabs a:hover { background: var(--pink); color: var(--on-fill); }
.tabs a[aria-current] { background: var(--fg); color: var(--bg); }
.count { display: inline-block; min-width: 1.4em; padding: 0 0.35em; border-radius: 999px; background: var(--green); color: var(--on-fill); text-align: center; font-size: 0.85em; }

/* ── people ──────────────────────────────────────────────────────────── */
.avatar {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: var(--line) solid var(--edge);
  background: var(--bg);
  object-fit: cover;
}
.avatar-none { display: inline-grid; place-items: center; background: var(--aqua); color: var(--on-fill); font-weight: 800; font-size: 0.9em; }
.avatar-lg { width: 3.25rem; height: 3.25rem; }
.avatar-xl { width: 5rem; height: 5rem; border-width: 3px; box-shadow: var(--drop) var(--drop) 0 var(--edge); font-size: 1.8rem; }
.who { display: inline-flex; align-items: center; gap: 0.5em; min-width: 0; color: var(--fg); text-decoration: none; }
.who-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:hover .who-name { text-decoration: underline; }
.who-small { display: inline; color: inherit; }
.who-small .who-name { font-weight: 600; white-space: normal; }

/* ── forms ───────────────────────────────────────────────────────────── */
input:not([type="checkbox"], [type="radio"], [type="hidden"]), textarea, select {
  font: inherit;
  font-size: var(--text-sm);
  padding: 0.45em 0.7em;
  border: var(--line) solid var(--edge);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  max-width: 100%;
  min-width: 0;
}
textarea { width: 100%; resize: vertical; }
:is(input, textarea, select):focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
label { display: block; font-size: var(--text-sm); font-weight: 600; }
label > :is(input:not([type="checkbox"], [type="radio"]), textarea, select) { display: block; width: 100%; margin-top: 0.25em; font-weight: 400; }
label.check { display: flex; gap: 0.5em; align-items: baseline; font-weight: 400; font-size: var(--text-base); }
fieldset { border: 0; padding: 0; margin: 0; --stack-gap: var(--space-1); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-2); }

button, .button {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 0.4em 0.9em;
  border: var(--line) solid var(--edge);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--edge);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: var(--leading-snug);
  transition: translate 80ms, box-shadow 80ms;
}
a.button, a.button:hover { color: var(--fg); }
:is(button, .button).primary { background: var(--green); color: var(--on-fill); }
:is(button, .button).danger { background: var(--red); color: var(--on-fill); }
:is(button, .button).quiet { box-shadow: none; border-width: 1.5px; font-weight: 600; }
:is(button, .button):hover:not(:disabled, .quiet) { translate: -1px -1px; box-shadow: 4px 4px 0 var(--edge); }
:is(button, .button):active:not(:disabled, .quiet) { translate: 2px 2px; box-shadow: 1px 1px 0 var(--edge); }
:is(button, .button).quiet:hover { background: var(--pink); color: var(--on-fill); }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.inline-form input { width: 12rem; }
.actions { gap: 0.5rem; align-items: center; }

details.more { position: relative; }
details.more > summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.4em 0.9em;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--bg);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { background: var(--fg); color: var(--bg); }
details.more > form { margin-top: 0.5rem; }

/* ── panels, cards, rows ─────────────────────────────────────────────── */
.panel { padding: var(--space-3); border: var(--line) solid var(--edge); border-radius: var(--radius); margin-bottom: var(--space-4); }
.panel.cluster { align-items: end; gap: var(--space-2); }
.panel-green { background: var(--tint-green); }
.panel-blue { background: var(--tint-blue); }
.panel-purple { background: var(--tint-purple); }
.panel-pink { background: var(--tint-pink); }
.admin .panel { margin-bottom: 0; }
.admin { --stack-gap: var(--space-4); max-width: 44rem; }

.flash { padding: 0.6em 1em; margin-bottom: var(--space-4); border: var(--line) solid var(--edge); border-radius: 10px; font-weight: 600; }
.flash-ok { background: var(--green); color: var(--on-fill); }
.flash-error { background: var(--tint-red); box-shadow: 4px 4px 0 var(--red); }
.flash-warn { background: var(--tint-pink); box-shadow: 4px 4px 0 var(--pink); font-weight: 400; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: calc(var(--space-3) + var(--drop)); padding-right: var(--drop); }
.card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3);
  border: var(--line) solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--drop) var(--drop) 0 var(--shade, var(--green));
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: translate 80ms, box-shadow 80ms;
}
a.card:hover { color: var(--fg); translate: -1px -1px; box-shadow: calc(var(--drop) + 1px) calc(var(--drop) + 1px) 0 var(--shade, var(--green)); }
.card .stack { --stack-gap: 0.2rem; min-width: 0; }
.card strong { overflow-wrap: anywhere; line-height: 1.2; }
.card-grid > :nth-child(4n + 2) { --shade: var(--blue); }
.card-grid > :nth-child(4n + 3) { --shade: var(--purple); }
.card-grid > :nth-child(4n) { --shade: var(--pink); }
.card-with-actions { display: grid; gap: 0.6rem; align-content: start; }
.card-with-actions .card { box-shadow: var(--drop) var(--drop) 0 var(--shade, var(--green)); }

.rows { list-style: none; margin: 0 0 var(--space-4); padding: 0; border: var(--line) solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: 0.7rem var(--space-3); margin: 0; }
.row + .row, .rows > .empty + .row { border-top: 1.5px solid var(--hairline); }
.rows > .empty { padding: 0.7rem var(--space-3); }
.row > .who { flex: 1 1 14rem; }
.row > .meta { flex: 0 1 auto; }
.row-block { display: grid; gap: 0.5rem; }
.criteria { margin: 0; padding-left: 1.2em; font-size: var(--text-sm); }
.criteria li { margin: 0; }

/* ── policy and the editor ───────────────────────────────────────────── */
.policy { margin-bottom: var(--space-4); }
.prose :is(h2, h3) { margin-top: 1.4em; margin-bottom: 0.4em; }
.prose p { margin-block: 0 0.8em; }
.prose blockquote { margin: 0 0 0.8em; padding: 0.1em 0 0.1em 1em; border-left: 4px solid var(--green); }
.prose hr { border: 0; border-top: 3px solid var(--edge); margin-block: 1.5em; }
.editor { border: var(--line) solid var(--edge); border-radius: var(--radius); box-shadow: var(--drop) var(--drop) 0 var(--green); background: var(--bg); overflow: clip; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; padding: 0.5rem; background: var(--tint-green); border-bottom: var(--line) solid var(--edge); position: sticky; top: 0; z-index: 1; }
.editor-gap { width: 0.6rem; }
.tool { box-shadow: none; border-width: 1.5px; padding: 0.25em 0.6em; border-radius: 8px; font-weight: 600; min-width: 2.1em; }
.tool:hover:not(:disabled) { translate: none; box-shadow: none; background: var(--pink); color: var(--on-fill); }
.tool:active:not(:disabled) { translate: none; box-shadow: none; }
.tool[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.tool-bold { font-weight: 800; }
.tool-italic { font-style: italic; }
.editor-body { max-width: none; }
.editor-body .ProseMirror { min-height: 18rem; padding: var(--space-3) var(--space-4); outline: none; white-space: pre-wrap; word-wrap: break-word; }
.editor-body .ProseMirror > :first-child { margin-top: 0; }
.editor-body .ProseMirror a { cursor: text; }

.site-footer .cluster { gap: var(--space-2) var(--space-4); }
.icon-link { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; }
.icon-link:hover { background: var(--bg); }
.icon-link .dolly { width: 1.6rem; height: 1.6rem; }
