@import url(fonts.css?v=24);

/* Cinnabar mockups: one stylesheet for every page.
   Sources for the values: docs/research/Reading and type.md, Forum UX.md, Motion and states.md, Interface psychology.md, Audit 27 Nov.md */

:root {
  /* Greys: ground, panels, raised, lines */
  --ground: oklch(0.185 0 0);
  --panel: oklch(0.235 0 0);
  --panel-2: oklch(0.275 0 0);
  --sunk: oklch(0.205 0 0);
  --line: oklch(0.31 0 0);
  --line-soft: oklch(0.275 0 0);
  --hover: oklch(0.26 0 0);      /* hover on a panel */
  --hover-2: oklch(0.31 0 0);     /* hover on something raised */
  --press: oklch(0.285 0 0);

  /* Text: titles, reading, secondary, labels. Nothing people read is below --text-3 (Lc 60). */
  --text: oklch(0.95 0 0);
  --text-1: oklch(0.90 0 0);
  --text-2: oklch(0.90 0 0);
  --text-3: oklch(0.77 0 0);
  --text-4: oklch(0.68 0 0);      /* signatures and line numbers only */

  /* Deep azure is structure (V3rm's method); the lighter azure is for small coloured text */
  --brand: #0071a5;
  --brand-hi: #0a83bd;
  --accent: oklch(0.74 0.11 235);
  --accent-hi: oklch(0.80 0.10 235);
  --like: oklch(0.80 0.17 150);
  --dislike: oklch(0.68 0.21 22);

  /* Name colours (owner, 28 Nov 2026): members light grey, the mid plan green, the top plan gold. Violet is kept for rare awards. */
  --name: oklch(0.86 0 0);
  --gold: oklch(0.86 0.15 85);
  --green: oklch(0.80 0.15 155);
  --violet: oklch(0.78 0.14 300);

  /* Type scale */
  --sans: 'Figtree', system-ui, sans-serif;
  --mono: 'Recursive', ui-monospace, monospace;
  --fs-xs: 12px; --fs-s: 13px; --fs-m: 14px; --fs-b: 16px; --fs-l: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --fs-read: 16.5px;

  /* Shape and size */
  --r-s: 6px; --r: 8px; --r-l: 8px;
  --ctl: 36px;
  --wrap: 1840px;
  --gut: clamp(14px, 2.6vw, 40px);

  /* Motion: short, answers the pointer, nothing moves on arrival */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --d-press: 60ms; --d-state: 140ms; --d-in: 140ms; --d-out: 90ms;
  --t: var(--d-state) var(--ease);
}
@media (max-width: 760px) { :root { --ctl: 44px; } }

* { box-sizing: border-box; }
html { background: var(--ground); color-scheme: dark; overscroll-behavior-x: none; overflow-x: clip; scroll-padding-top: calc(var(--hdr, 58px) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; padding-top: var(--hdr, 58px); font: 400 var(--fs-b)/1.55 var(--sans); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: clip; display: flex; flex-direction: column; }
body > .page { flex: 1 0 auto; }
a { color: var(--text); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.015em; }
h1 { font-size: var(--fs-2xl); line-height: 1.2; }
code, pre, .mono { font-family: var(--mono); font-variation-settings: "MONO" 1, "CASL" 0; }
[id] { scroll-margin-top: calc(var(--hdr, 58px) + 12px); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 20px; height: 20px; flex: none; }

/* One focus ring everywhere; corners stay as they are */
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Subtle crystal pattern behind every page, fading towards the bottom (owner, 26 Nov 2026) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .45;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.18) 100%); mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.18) 100%);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900' viewBox='0 0 900 900'%3E%3Cg transform='translate(306 164) rotate(-3)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.023' d='M0 -31 L19 0 L0 31 L-19 0 Z'/%3E%3Cpath fill-opacity='0.018' d='M0 -31 L19 0 L0 8 Z'/%3E%3C/g%3E%3Cg transform='translate(574 99) rotate(12)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.025' d='M0 -71 L44 0 L0 71 L-44 0 Z'/%3E%3Cpath fill-opacity='0.020' d='M0 -71 L44 0 L0 18 Z'/%3E%3C/g%3E%3Cg transform='translate(479 340) rotate(-4)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.030' d='M0 -39 L24 0 L0 39 L-24 0 Z'/%3E%3Cpath fill-opacity='0.024' d='M0 -39 L24 0 L0 10 Z'/%3E%3C/g%3E%3Cg transform='translate(88 456) rotate(26)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.045' d='M0 -32 L20 0 L0 32 L-20 0 Z'/%3E%3Cpath fill-opacity='0.036' d='M0 -32 L20 0 L0 8 Z'/%3E%3C/g%3E%3Cg transform='translate(388 718) rotate(4)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.024' d='M0 -50 L31 0 L0 50 L-31 0 Z'/%3E%3Cpath fill-opacity='0.019' d='M0 -50 L31 0 L0 13 Z'/%3E%3C/g%3E%3Cg transform='translate(841 78) rotate(-4)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.028' d='M0 -31 L19 0 L0 31 L-19 0 Z'/%3E%3Cpath fill-opacity='0.022' d='M0 -31 L19 0 L0 8 Z'/%3E%3C/g%3E%3Cg transform='translate(691 613) rotate(-15)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.023' d='M0 -69 L43 0 L0 69 L-43 0 Z'/%3E%3Cpath fill-opacity='0.018' d='M0 -69 L43 0 L0 17 Z'/%3E%3C/g%3E%3Cg transform='translate(758 297) rotate(7)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.025' d='M0 -75 L47 0 L0 75 L-47 0 Z'/%3E%3Cpath fill-opacity='0.020' d='M0 -75 L47 0 L0 19 Z'/%3E%3C/g%3E%3Cg transform='translate(40 164) rotate(-23)' fill='rgb(255,255,255)'%3E%3Cpath fill-opacity='0.034' d='M0 -54 L34 0 L0 54 L-34 0 Z'/%3E%3Cpath fill-opacity='0.027' d='M0 -54 L34 0 L0 14 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 900px 900px; }

/* Layout: header, page and footer share one container */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.page { padding-top: 26px; padding-bottom: 72px; }

/* ---------- Header ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: oklch(0.155 0 0); border-bottom: 1px solid var(--line); }
.top .in { display: flex; align-items: center; gap: 28px; height: 58px; }
.wordmark { display: flex; align-items: center; height: 44px; color: var(--text); font: 700 21px/1 'Unbounded', var(--sans); letter-spacing: -0.03em; }
.top nav { display: flex; height: 100%; }
.top nav a { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 13px; color: var(--text-2); font-size: 15px; font-weight: 600; position: relative; transition: color var(--t); }
.top nav a svg.i { width: 19px; height: 19px; color: var(--text-3); transition: color var(--t); }
.top nav a[aria-current="page"] { color: var(--text); }
.top nav a[aria-current="page"] svg.i { color: var(--text); }
.top nav a[aria-current="page"] { font-weight: 700; }
.top nav a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); }
.top .me { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.search { display: flex; align-items: center; gap: 8px; width: 260px; height: var(--ctl); padding: 0 12px; margin-right: 10px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-m); transition: border-color var(--t), color var(--t); }
.search svg.i { width: 17px; height: 17px; }
.search kbd { margin-left: auto; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font: 600 11px/1.5 var(--sans); color: var(--text-3); }
.hl { position: relative; display: flex; align-items: center; gap: 7px; height: var(--ctl); padding: 0 10px; border-radius: var(--r); color: var(--text-2); font-size: var(--fs-m); font-weight: 600; transition: color var(--t), background-color var(--t); }
.hl svg.i { width: 19px; height: 19px; }
.cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.top .self { display: flex; margin-left: 8px; border-radius: 50%; }
.top .self .av { width: 34px; height: 34px; }
@media (max-width: 1240px) { .hl .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .hl { padding: 0 9px; } .hl svg.i { width: 21px; height: 21px; } .hl .cnt { position: absolute; top: 2px; right: 0; } }
@media (max-width: 1060px) { .search { width: var(--ctl); padding: 0; justify-content: center; margin-right: 4px; } .search .lbl, .search kbd { display: none; } .top .in { gap: 16px; } .top nav a { padding: 0 10px; } }
@media (max-width: 900px) {
  .top { transition: transform 200ms var(--ease); }
  .top.tuck { transform: translateY(-100%); }
  .top .in { flex-wrap: wrap; height: auto; column-gap: 8px; }
  .wordmark { height: 52px; font-size: 19px; }
  .top nav { order: 3; width: calc(100% + 2 * var(--gut)); height: 44px; margin: 0 calc(-1 * var(--gut)); border-top: 1px solid var(--line); }
  .top nav a { flex: 1 1 0; min-width: 0; justify-content: center; gap: 6px; padding: 0 4px; font-size: var(--fs-m); }
  .top nav a svg.i { width: 18px; height: 18px; }
  .top nav .desk, .top nav .lbl-long { display: none; }
  .search { border-color: transparent; background: none; color: var(--text-2); }
  .top .self .av { width: 32px; height: 32px; }
  .search, .hl { width: 40px; }
  .hl { justify-content: center; padding: 0; }
}

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); background: oklch(0.155 0 0); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-top: 22px; padding-bottom: 26px; font-size: var(--fs-s); color: var(--text-3); }
.foot a { color: var(--text-3); }
.foot .wordmark { height: auto; font-size: 15px; color: var(--text-2); margin-right: 8px; }
.foot .grow { flex: 1; }

/* ---------- Avatars and names ---------- */
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden; background: var(--avbg, var(--panel-2)); display: grid; place-items: center; font-weight: 800; color: #fff; }
.av img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.u { color: var(--name); font-weight: 700; }
.u.green { color: var(--green); } .u.gold { color: var(--gold); }
.team-logo { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; flex: none; font-size: 11px; font-weight: 900; color: #fff; }

/* Userbar: 350 by 19, the old forum signature strip */
.userbar { --c: var(--gold); display: flex; align-items: center; justify-content: space-between; width: 350px; max-width: 100%; height: 19px; padding: 0 6px; border: 1px solid oklch(0.15 0 0);
  background: linear-gradient(to bottom, rgba(255,255,255,.18) 0 50%, rgba(0,0,0,0) 50%), repeating-linear-gradient(135deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px), linear-gradient(90deg, color-mix(in oklch, var(--c) 40%, black), var(--c));
  font: 400 8px/1 'Silkscreen', monospace; letter-spacing: .5px; text-transform: uppercase; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; -webkit-font-smoothing: none; }

/* ---------- Awards: pixel icons. Shape says which, colour says the level ---------- */
.awards { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.aw { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; position: relative; }
.aw svg { width: 100%; height: 100%; shape-rendering: crispEdges; display: block; }
.aw.rare { --rare: oklch(0.64 0.19 295); background: oklch(0.21 0.05 295); box-shadow: inset 0 0 0 1px var(--rare);
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px); }
.aw.rare svg { width: 76%; height: 76%; }
.aw.s22 { width: 22px; height: 22px; }
.aw.s22:not(.rare) svg { width: 20px; height: 20px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl); padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: var(--fs-m); font-weight: 700; white-space: nowrap; transition: background-color var(--t), border-color var(--t), color var(--t), transform var(--d-press) var(--ease); }
.btn svg.i { width: 18px; height: 18px; }
.btn.main { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.sm { height: 32px; padding: 0 10px; font-size: var(--fs-s); }
.ib { display: grid; place-items: center; width: var(--ctl); height: var(--ctl); border-radius: var(--r); border: 0; background: none; color: var(--text-2); transition: background-color var(--t), color var(--t), transform var(--d-press) var(--ease); }
.btn:active, .act:active, .vote button:active, .pager a:active, .ib:active { transform: scale(.97); transition-duration: var(--d-press); }

/* ---------- Panels: azure top edge, flat top corners (V3rm's red bars, in azure) ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: 0 0 var(--r-l) var(--r-l); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.panel > h2, .ptitle-row { display: flex; align-items: center; gap: 8px; padding: 14px 18px 0; font-size: 15px; }
.panel > h2 svg.i { width: 18px; height: 18px; color: var(--text-3); }
.panel > h2 .aside { margin-left: auto; font-size: var(--fs-s); font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.link-more { color: var(--accent-hi); font-size: var(--fs-m); font-weight: 700; }

/* ---------- Like and dislike, side by side ---------- */
.vote { display: inline-flex; height: var(--ctl); }
.vote button { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--line); background: none; color: var(--text-3); font-size: var(--fs-m); font-weight: 700; transition: background-color var(--t), border-color var(--t), color var(--t), transform var(--d-press) var(--ease); }
.vote button:focus-visible { z-index: 2; outline-offset: -2px; }
.vote .up { border-radius: var(--r) 0 0 var(--r); }
.vote .down { border-radius: 0 var(--r) var(--r) 0; margin-left: -1px; }
.vote svg.i { width: 18px; height: 18px; }
.vote .up svg.i { color: var(--like); } .vote .down svg.i { color: var(--dislike); }
.vote b { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1ch; }
.vote .ic { display: inline-flex; } .vote .ic.on { display: none; }
.vote button.on .ic.off { display: none; } .vote button.on .ic.on { display: inline-flex; }
.vote .up.on { z-index: 1; border-color: oklch(0.48 0.11 150); background: oklch(0.26 0.06 150); color: var(--text); }
.vote .down.on { z-index: 1; border-color: oklch(0.5 0.14 22); background: oklch(0.27 0.07 22); color: var(--text); }

/* ---------- Menus ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 10; display: flex; flex-direction: column; min-width: 190px; padding: 6px; border-radius: 10px; background: var(--panel-2); border: 1px solid oklch(0.38 0 0); box-shadow: 0 12px 30px rgba(0,0,0,.5);
  opacity: 1; transform: none; transition: opacity var(--d-in) var(--ease), transform var(--d-in) var(--ease); }
.menu[hidden] { display: none; }
.menu.opening { opacity: 0; transform: translateY(4px); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-s); background: none; color: var(--text); font-size: var(--fs-m); font-weight: 600; text-align: left; white-space: nowrap; }
.menu button:focus-visible, .menu a:focus-visible { background: var(--hover-2); outline: none; }
.menu svg.i { width: 18px; height: 18px; color: var(--text-3); }
.menu hr { width: 100%; margin: 5px 0; border: 0; border-top: 1px solid oklch(0.38 0 0); }
.menu .danger, .menu .danger svg.i { color: oklch(0.78 0.12 22); }
@media (max-width: 760px) { .menu button, .menu a { height: 44px; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow: hidden; }
.tabs button { flex: none; height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--text-3); font-size: 15px; font-weight: 700; transition: color var(--t), border-color var(--t); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.tabs button .c { margin-left: 6px; font-size: var(--fs-s); color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
[role="tabpanel"][hidden] { display: none; }

/* ---------- Pager ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; }
.pager a, .pager b { display: grid; place-items: center; min-width: var(--ctl); height: var(--ctl); padding: 0 11px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line); color: var(--text-2); font-weight: 700; font-size: var(--fs-m); font-variant-numeric: tabular-nums; transition: background-color var(--t), border-color var(--t), color var(--t), transform var(--d-press) var(--ease); }
.pager b { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Hover: only where a fine pointer can hover, so nothing stays lit after a tap ---------- */
@media (hover: hover) and (pointer: fine) {
  .top nav a:hover, .top nav a:hover svg.i { color: var(--text); }
  .search:hover { border-color: oklch(0.40 0 0); color: var(--text-2); }
  .hl:hover { color: var(--text); background: var(--panel); }
  .foot a:hover { color: var(--text); }
  .btn:hover { background: var(--hover-2); border-color: oklch(0.38 0 0); }
  .btn.main:hover { background: var(--brand-hi); border-color: var(--brand-hi); }
  .btn.ghost:hover { background: var(--panel-2); border-color: transparent; color: var(--text); }
  .ib:hover { background: var(--panel-2); color: var(--text); }
  .vote button:hover { background: var(--hover); color: var(--text); }
  .vote .up.on:hover { background: oklch(0.29 0.07 150); } .vote .down.on:hover { background: oklch(0.30 0.08 22); }
  .menu button:hover, .menu a:hover { background: var(--hover-2); }
  .tabs button:hover { color: var(--text-2); }
  .pager a:hover { background: var(--panel-2); color: var(--text); border-color: oklch(0.38 0 0); }
  .link-more:hover { color: var(--text); }
}
/* Touch: a brief pressed state instead (a touchstart listener in mock.js makes iOS show :active) */
@media (hover: none) {
  .btn:active, .vote button:active, .pager a:active { background: var(--hover-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: color, background-color, border-color, opacity !important; }
  .btn:active, .act:active, .vote button:active, .pager a:active, .ib:active { transform: none; }
  .menu.opening { transform: none; }
}

/* Quiet is the default (owner, 28 Nov 2026: the plain look, with blue where it used white; set in tools/site_parts.py). ?azure=bars and ?azure=edges show the other trials. */
html[data-azure="quiet"] .panel { border-top: 1px solid var(--line); border-radius: var(--r-l); }
html[data-azure="bars"] .panel { border-top: 1px solid var(--line); border-radius: var(--r-l); overflow: clip; }
html[data-azure="bars"] .cat h2 { margin: 0; padding: 9px 18px; border-radius: var(--r-l) var(--r-l) 0 0; background: var(--brand); color: #fff; font-size: var(--fs-m); }
html[data-azure="bars"] .cat .panel { border-top: 0; border-radius: 0 0 var(--r-l) var(--r-l); }
html[data-azure="bars"] .panel > h2 { margin: 0 0 4px; padding: 10px 18px; background: var(--brand); color: #fff; font-size: var(--fs-m); }
html[data-azure="bars"] .panel > h2 svg.i, html[data-azure="bars"] .panel > h2 .aside { color: rgba(255,255,255,.85); }
html[data-azure="bars"] .pmeta { padding-top: 6px; padding-bottom: 6px; background: color-mix(in oklch, var(--brand) 40%, var(--panel)); }
html[data-azure="bars"] .pmeta, html[data-azure="bars"] .pmeta a { color: rgba(255,255,255,.88); }
html[data-azure="bars"] .ph { margin-top: 10px; }
html[data-azure="edges"] .top, html[data-azure="bars"] .top { border-bottom: 2px solid var(--brand); }
html[data-azure="edges"] .top nav a[aria-current="page"]::after, html[data-azure="bars"] .top nav a[aria-current="page"]::after { display: none; }
