/* GW2 Addon Risk Guide - presentation layer.
   Flat and outlined: every fill is a saturated ink colour at full strength,
   every panel is drawn with a near-black outline and a hard offset block
   instead of a blur. Two rules keep it from drifting back into generic dark
   dashboard: no gradients on surfaces, and no colour used at partial opacity
   over the background - a muted gold over black is just brown.

   Band colours are the one thing shared with the data model: every band id in
   BANDS must have a matching --band-<id> below, or a card renders unstyled. */
:root {
  --bg: #15181d;
  --panel: #222731;
  --panel-2: #2b313d;
  --ink-line: #0c0e12;          /* the outline every element is drawn with */
  --line: #3a4250;              /* internal rules, inside an outlined panel */
  --ink: #f4f6f9;
  --dim: #a7b0be;
  --faint: #7c8695;
  --gold: #ffc53d;
  --jade: #2fd38a;
  --ember: #ff7a2f;
  --tyrian: #ff5252;
  --sky: #4ec3ff;               /* the one cool ink: meta, never a risk band */
  --focus: #ffc53d;
  --band-low: #2fd38a;
  --band-moderate: #ffc53d;
  --band-elevated: #ff7a2f;
  --band-high: #ff5252;
  --r: 10px;
  /* One page width, shared by the masthead, the disclaimer and the catalog so
     they cannot drift out of alignment. The gutter is deliberately narrow:
     the catalog is a dense grid of cards, and width spent on margins is a
     column not shown. */
  --page: 1660px;
  --gutter: 18px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- masthead ---------- */
.mast { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 4px solid var(--ink-line); }
.mast-in {
  max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 22px; min-height: 66px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
/* The sigil's diamond is a rotated pseudo-element behind the glyph. isolation
   keeps the negative z-index inside .sigil instead of falling behind the bar. */
.sigil {
  position: relative; isolation: isolate; width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  color: var(--ink-line); font-weight: 900; font-size: 13px;
}
.sigil::before {
  content: ""; position: absolute; inset: 0; z-index: -1; transform: rotate(45deg);
  border-radius: 5px; background: var(--gold); border: 3px solid var(--ink-line);
}
.brand > span:last-child { font: 800 17px/1.15 var(--sans); letter-spacing: -.02em; }
.brand small {
  display: block; font: 700 10.5px/1.4 var(--sans); color: var(--faint);
  letter-spacing: .09em; text-transform: uppercase;
}
.tabs { display: flex; gap: 8px; margin-left: auto; }
.tabs a {
  padding: 8px 16px; font: 800 13.5px/1 var(--sans); color: var(--dim);
  text-decoration: none; border: 3px solid transparent; border-radius: 8px;
}
.tabs a:hover { color: var(--ink); border-color: var(--line); }
.tabs a[aria-current="page"] {
  background: var(--gold); color: var(--ink-line);
  border-color: var(--ink-line); box-shadow: 3px 3px 0 var(--ink-line);
}
.ghlink { font: 700 13px/1 var(--sans); color: var(--faint); text-decoration: none; }
.ghlink:hover { color: var(--ink); }

/* ---------- disclaimer ---------- */
.notice { max-width: var(--page); margin: 22px auto 0; padding: 0 var(--gutter); }
.notice-in {
  display: flex; gap: 14px; padding: 15px 18px; background: var(--panel);
  border: 4px solid var(--ink-line); border-radius: var(--r);
  box-shadow: 6px 6px 0 var(--ink-line);
}
.notice .ic {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 6px; background: var(--gold); color: var(--ink-line);
  font-size: 14px; font-weight: 900; border: 3px solid var(--ink-line);
}
.notice p { margin: 0; font-size: 13.5px; color: var(--dim); line-height: 1.5; }
.notice b { color: var(--gold); font-weight: 800; }
.notice cite { display: block; margin-top: 8px; font-style: normal; font-size: 12.5px; color: var(--faint); }
.notice cite a { color: var(--gold); font-weight: 600; text-underline-offset: 2px; }

/* ---------- overview ---------- */
.wrap { max-width: var(--page); margin: 0 auto; padding: 28px var(--gutter) 60px; }
.ov { display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; }
.ov h1 { margin: 0; font: 900 30px/1.1 var(--sans); letter-spacing: -.035em; }
.ov h1 span { color: var(--faint); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ov .gen { font: 600 12px/1 var(--sans); color: var(--faint); margin-left: auto; }

.distro {
  display: flex; height: 16px; gap: 3px; overflow: hidden;
  border: 4px solid var(--ink-line); border-radius: 8px; background: var(--ink-line);
}
.distro i { display: block; }
.pill .dot {
  width: 9px; height: 9px; transform: rotate(45deg); flex: none; border: 3px solid var(--ink-line);
}

/* ---------- toolbar ---------- */
.bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 22px 0 0;
  padding: 14px; background: var(--panel); border: 4px solid var(--ink-line);
  border-radius: var(--r); box-shadow: 6px 6px 0 var(--ink-line);
}
/* Grows to fill whatever the filters leave, but capped: past this width the
   search box only pushes controls onto a second row without becoming any
   more useful. */
.srch { position: relative; flex: 1 1 200px; max-width: 260px; }
.srch input {
  width: 100%; padding: 11px 12px 11px 38px; background: var(--bg);
  border: 3px solid var(--ink-line); border-radius: 8px;
  color: var(--ink); font: 600 14px/1 var(--sans);
}
.srch input::placeholder { color: var(--faint); font-weight: 500; }
.srch .mag {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-weight: 900;
}

.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill, .menubtn, .sel {
  padding: 10px 9px; border-radius: 8px; border: 3px solid var(--ink-line);
  background: var(--bg); font: 800 13px/1 var(--sans); color: var(--dim);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: .02em;
}
/* Native select chrome adds width the other controls do not carry. */
.sel { font-size: 12.5px; }
.menubtn { border-style: dashed; background: transparent; }
.pill:hover, .menubtn:hover, .sel:hover { color: var(--ink); box-shadow: 3px 3px 0 var(--ink-line); transform: translate(-2px, -2px); }
/* A pressed band pill fills with its own colour - the filter reads as the
   thing it filters to, rather than as a generic selected state. */
.pill[aria-pressed="true"] { color: var(--ink-line); box-shadow: 3px 3px 0 var(--ink-line); }
.pill[aria-pressed="true"].b-low { background: var(--band-low); }
.pill[aria-pressed="true"].b-moderate { background: var(--band-moderate); }
.pill[aria-pressed="true"].b-elevated { background: var(--band-elevated); }
.pill[aria-pressed="true"].b-high { background: var(--band-high); }

.menubtn .n {
  background: var(--gold); color: var(--ink-line); border-radius: 99px;
  padding: 1px 7px; font-size: 11px; font-weight: 900; margin-left: 6px;
}
/* The conduct menu carries the assessment axis, so its count badge is drawn
   in the one cool ink rather than in gold - the same ink the badge on the
   card uses, and never one a risk band could claim. */
.menubtn.v-btn .n { background: var(--sky); }
.menubtn[aria-expanded="true"] { border-style: solid; color: var(--ink); }

/* A filter menu: a disclosure, not a row of permanent controls. Two of these
   exist (signals, conduct) and only one is ever open. */
.menu { position: relative; }
.menupop {
  position: absolute; top: calc(100% + 9px); left: 0; z-index: 30; width: 310px;
  max-height: 340px; overflow-y: auto; padding: 8px;
  background: var(--panel-2); border: 4px solid var(--ink-line);
  border-radius: 9px; box-shadow: 6px 6px 0 var(--ink-line);
}
.menupop[hidden] { display: none; }
.menupop label {
  display: flex; gap: 9px; align-items: flex-start; padding: 7px 8px;
  border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--dim); cursor: pointer;
}
.menupop label:hover { background: var(--bg); color: var(--ink); }
.menupop input { margin: 3px 0 0; accent-color: var(--gold); }
/* Conduct rows: tier name on the left behind a sky dot, count hard right, so
   the ladder reads as a ladder and the distribution is still scannable. */
.menupop.v-pop { width: 260px; }
.menupop.v-pop input { accent-color: var(--sky); }
.menupop.v-pop label { align-items: center; text-transform: uppercase; font-weight: 800; letter-spacing: .02em; }
.menupop.v-pop .dot {
  width: 9px; height: 9px; flex: none; transform: rotate(45deg);
  background: var(--sky); border: 3px solid var(--ink-line);
}
.menupop.v-pop b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }

.resline { display: flex; align-items: baseline; gap: 10px; margin: 20px 2px; font: 600 13px/1.4 var(--sans); color: var(--dim); }
.resline b { color: var(--ink); font-weight: 900; font-size: 15px; }
.resline .clear {
  margin-left: auto; color: var(--gold); font: 800 12px/1 var(--sans);
  text-transform: uppercase; letter-spacing: .05em;
  background: none; border: 0; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.resline .clear:hover { color: var(--ink); }

.empty { color: var(--dim); padding: 40px 0; text-align: center; font-weight: 600; }
.loading { color: var(--faint); font-weight: 600; }

/* ---------- cards ---------- */
/* Rows are equalised (the grid default): every card in a row bottoms out on
   the same line, so the meta strips form a continuous rule across the grid.
   The cost is empty space on cards with few signal chips. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.card {
  position: relative; overflow: hidden; width: 100%; text-align: left;
  background: var(--panel); border: 4px solid var(--ink-line); border-radius: var(--r);
  padding: 22px 16px 14px; display: flex; flex-direction: column; gap: 11px;
  font: inherit; color: inherit; cursor: pointer;
  box-shadow: 6px 6px 0 var(--ink-line);
  transition: transform .1s, box-shadow .1s;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 var(--ink-line); }
/* The band is a solid capped strip across the top, drawn from the card itself
   so the renderer does not have to emit an extra element for it. */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 9px;
  border-bottom: 4px solid var(--ink-line);
}
.card.b-low::before { background: var(--band-low); }
.card.b-moderate::before { background: var(--band-moderate); }
.card.b-elevated::before { background: var(--band-elevated); }
.card.b-high::before { background: var(--band-high); }

.chead { display: flex; gap: 12px; align-items: flex-start; }
.ctitle { flex: 1; min-width: 0; }
.ctitle .owner { font: 700 12px/1.3 var(--sans); color: var(--faint); display: block; }
.ctitle .nm {
  font: 900 18px/1.2 var(--sans); letter-spacing: -.03em; display: block; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* The score is a filled chip in the band colour, not coloured text. */
.score {
  flex: none; text-align: center; min-width: 56px; padding: 5px 8px;
  border-radius: 8px; border: 3px solid var(--ink-line); color: var(--ink-line);
}
.b-low .score { background: var(--band-low); }
.b-moderate .score { background: var(--band-moderate); }
.b-elevated .score { background: var(--band-elevated); }
.b-high .score { background: var(--band-high); }
.score .n { font: 900 22px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.04em; display: block; }
.score .lb {
  font: 900 9px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em;
  margin-top: 3px; display: block; opacity: .75;
}

.desc {
  font-size: 13.5px; color: var(--dim); margin: 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.desc em { color: var(--faint); }

.sigs { display: flex; flex-wrap: wrap; gap: 6px; }
/* Signal chips are solid stickers, not tints: at 13% opacity they all blurred
   into the same muddy colour and stopped distinguishing anything. */
.sig {
  font: 800 11px/1 var(--sans); padding: 5px 9px; border-radius: 6px;
  border: 3px solid var(--ink-line); background: var(--panel-2); color: var(--dim);
  text-transform: uppercase; letter-spacing: .04em;
}
.sig.w-hi { background: var(--tyrian); color: var(--ink-line); }
.sig.w-md { background: var(--ember); color: var(--ink-line); }
.sig.w-neg { background: var(--jade); color: var(--ink-line); }

/* Conduct assessment. Deliberately the only chip on a card drawn in the cool
   ink and left unfilled: it is the maintainer's judgment, not a score, and it
   must not be mistaken for one at a glance. */
.vbadge {
  font: 800 11px/1 var(--sans); padding: 5px 9px; border-radius: 6px;
  border: 3px solid var(--sky); background: transparent; color: var(--sky);
  text-transform: uppercase; letter-spacing: .04em;
}

.vaxes { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.vax {
  font: 700 12px/1 var(--sans); color: var(--dim);
  border: 3px solid var(--line); border-radius: 6px; padding: 7px 10px;
}
.vax b { color: var(--sky); text-transform: uppercase; letter-spacing: .04em; }

.vrat { margin: 10px 0; color: var(--ink); }
.vev { margin: 10px 0; color: var(--dim); font-style: italic; }
.vstale { margin: 10px 0; color: var(--ember); font: 700 13px/1.5 var(--sans); }
.vcontest {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline;
  margin: 12px 0 0; font: 700 12px/1 var(--sans);
}
.vcontest a { color: var(--sky); }
.vdate { color: var(--faint); }

.cmeta {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font: 700 12px/1 var(--sans); color: var(--faint);
  border-top: 3px solid var(--line); padding-top: 12px; margin-top: auto;
}
.cmeta .it { display: flex; align-items: center; gap: 6px; }
/* The star count is the first .it the renderer emits. */
.cmeta .it:first-child { color: var(--gold); }
.cmeta .lang::before {
  content: ""; width: 9px; height: 9px; transform: rotate(45deg);
  background: var(--sky); border: 3px solid var(--ink-line);
}
.cmeta .why { margin-left: auto; color: var(--gold); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.card:hover .cmeta .why { color: var(--ink); }
.cmeta .warn { color: var(--ember); }

/* ---------- detail drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(6, 7, 9, .72); z-index: 50; border: 0; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 51;
  background: var(--panel); border-left: 4px solid var(--ink-line);
  display: flex; flex-direction: column;
}
.drawer[hidden], .scrim[hidden] { display: none; }
.dhead { padding: 20px 24px 18px; border-bottom: 4px solid var(--ink-line); position: relative; }
.dhead .x {
  position: absolute; top: 16px; right: 18px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--bg); border: 3px solid var(--ink-line); color: var(--dim);
  font-size: 15px; font-weight: 900; cursor: pointer;
}
.dhead .x:hover { background: var(--gold); color: var(--ink-line); box-shadow: 3px 3px 0 var(--ink-line); transform: translate(-2px, -2px); }
.dhead .owner { font: 700 12.5px/1.3 var(--sans); color: var(--faint); }
.dhead h2 { margin: 2px 0 0; font: 900 24px/1.15 var(--sans); letter-spacing: -.035em; padding-right: 44px; }
.dhead .desc { -webkit-line-clamp: unset; margin: 10px 0 0; font-size: 13.5px; }

.dscore {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 13px 15px;
  border-radius: 9px; background: var(--bg); border: 3px solid var(--ink-line);
}
.dscore .n { font: 900 32px/1 var(--sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dscore .of { font-size: 12px; color: var(--faint); font-weight: 700; }
.dscore .txt { flex: 1; }
.dscore .bnd { font: 900 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; display: block; }
.dscore .sub { font-size: 12px; color: var(--dim); margin-top: 4px; display: block; font-weight: 600; }
.b-low .dscore .n, .b-low .dscore .bnd { color: var(--band-low); }
.b-moderate .dscore .n, .b-moderate .dscore .bnd { color: var(--band-moderate); }
.b-elevated .dscore .n, .b-elevated .dscore .bnd { color: var(--band-elevated); }
.b-high .dscore .n, .b-high .dscore .bnd { color: var(--band-high); }

.dmeta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.dmeta span {
  font: 800 11.5px/1 var(--sans); color: var(--dim); background: var(--panel-2);
  border: 3px solid var(--ink-line); padding: 6px 9px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}
.dmeta .warn { background: var(--ember); color: var(--ink-line); }

.dbody { overflow-y: auto; padding: 18px 24px 30px; }
.dbody h3 {
  font: 900 11.5px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em;
  color: var(--faint); margin: 0 0 14px;
}
.dbody h3 + .drow { border-top: 0; }
.dbody h3:not(:first-child) { margin-top: 26px; padding-top: 20px; border-top: 3px solid var(--line); }
.dnote { font-size: 13px; color: var(--dim); margin: 0; line-height: 1.55; }

.override {
  font: 700 12.5px/1.5 var(--sans); color: var(--ink);
  background: var(--panel-2); border: 3px solid var(--ember);
  border-radius: 8px; padding: 10px 12px; margin: 0 0 16px;
}

.drow { display: flex; gap: 13px; padding: 13px 0; border-bottom: 3px solid var(--line); }
.drow:last-child { border-bottom: 0; }
/* The weight chip is the drawer's version of the signal sticker: same solid
   fills, same outline, so a row's severity reads before any of its text. */
.dwt {
  flex: none; width: 44px; height: 28px; display: grid; place-items: center;
  border-radius: 6px; border: 3px solid var(--ink-line);
  font-variant-numeric: tabular-nums; font: 900 14px/1 var(--sans);
  color: var(--ink-line); background: var(--ember);
}
.dwt.hi { background: var(--tyrian); }
.dwt.lo { background: var(--panel-2); color: var(--dim); }
.dwt.neg { background: var(--jade); }
.drb { flex: 1; min-width: 0; }
.drb .lb { font: 800 13.5px/1.3 var(--sans); display: block; margin-bottom: 4px; }
.drb .ex { font-size: 13px; color: var(--dim); margin: 0; line-height: 1.5; }
.drb .ev {
  font-size: 11.5px; color: var(--dim); margin: 8px 0 0; line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg); border: 3px solid var(--ink-line); border-radius: 6px; padding: 7px 9px;
  overflow-wrap: anywhere;
}

.quote {
  margin: 10px 0 0; padding: 11px 13px; border-left: 4px solid var(--gold);
  background: var(--bg); border-radius: 0 6px 6px 0;
}
.quote p { margin: 0; font-size: 12.5px; font-style: italic; color: var(--dim); line-height: 1.5; }
.quote cite { display: block; margin-top: 7px; font-style: normal; font-size: 11.5px; }
.quote cite a { color: var(--gold); font-weight: 700; text-underline-offset: 2px; }

/* ---------- policy page ---------- */
.clause { border-bottom: 3px solid var(--line); padding: 24px 0; max-width: 46rem; }
.clause:last-child { border-bottom: 0; }
.clause h2 { margin: 0 0 12px; font: 900 19px/1.2 var(--sans); letter-spacing: -.025em; }
.clause .quote { margin-top: 0; }
.clause .quote p { font-size: 14px; }
.cite { font-size: 12.5px; color: var(--faint); margin: 10px 0 0; font-weight: 600; }
.cite a { color: var(--gold); font-weight: 700; text-underline-offset: 2px; }

@media (max-width: 640px) {
  .mast-in { min-height: 0; padding: 10px 16px; gap: 12px; }
  .tabs { margin-left: 0; width: 100%; overflow-x: auto; }
  .ghlink { display: none; }
  .wrap, .notice { padding-left: 16px; padding-right: 16px; }
  .ov .gen { margin-left: 0; width: 100%; }
  .grid { grid-template-columns: 1fr; }
  /* The offset blocks eat horizontal room that a phone does not have. */
  .notice-in, .bar, .card { box-shadow: 4px 4px 0 var(--ink-line); }
}

/* ---------- dropdowns ---------- */
/* The closed box is ours everywhere: strip the native control and draw the
   caret, so a select sits in the toolbar as just another outlined chip. */
.sel {
  appearance: none; padding-right: 30px; background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 2px), calc(100% - 11px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
/* The popup is OS chrome until the browser lets us style it. Where it does
   (Chromium's base-select), the list is drawn in the same outline plus hard
   offset block as .menupop, so both dropdown kinds read as one family; where
   it does not, the closed box above is still ours and the list is native. */
@supports (appearance: base-select) {
  /* base-select draws its own ::picker-icon, so the hand-drawn caret above
     would be a second arrow. */
  .sel, .sel::picker(select) { appearance: base-select; }
  .sel { background-image: none; padding-right: 9px; }
  .sel::picker-icon { color: var(--gold); transition: none; }
  .sel::picker(select) {
    margin-top: 9px; padding: 6px; border: 4px solid var(--ink-line);
    border-radius: 9px; background: var(--panel-2);
    box-shadow: 6px 6px 0 var(--ink-line);
  }
  .sel option {
    display: flex; align-items: center; gap: 9px; padding: 8px 9px;
    border-radius: 6px; background: transparent; color: var(--dim);
    font: 800 12.5px/1 var(--sans); text-transform: uppercase; letter-spacing: .02em;
  }
  .sel option:hover, .sel option:focus { background: var(--bg); color: var(--ink); }
  /* The page-wide focus ring sits 2px outside its element; inside a picker
     that is 2px into the neighbouring row, so pull it back in. */
  .sel option:focus-visible { outline-offset: -3px; }
  .sel option:checked { color: var(--ink); }
  .sel option::checkmark { content: "\2713"; color: var(--gold); font-weight: 900; }
}
