/* Archivo, hosted on this site (SIL Open Font License, see assets/fonts/OFL.txt). Variable: weight 100-900, width 62-125%. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/*
  BleachedPixels
  COLOUR  soft warm white ground, the logo red, near-black ink for text
  TYPE    Archivo (wide 900 for titles, regular for text)
*/
:root {
  --white: #ffffff;
  --bg: #f6efe2;
  --surface: #fcf8f0;
  --snow: #eee5d6;
  --red: #ca0708;
  --red-deep: #9a0506;
  --red-soft: #f7e3df;
  --ink: #161314;
  --muted: #6f6869;
  --line: #e6dccb;
  --grid: #ece3d4;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1200px;
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--red); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
main:focus { outline: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 max(4vw, 18px); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(4vw, 18px);
  background: rgba(246, 239, 226, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { display: block; height: 38px; width: auto; }
.logo-name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.logo-name b { font-weight: 900; color: var(--red); }
.nav { display: flex; gap: 6px; }
.nav a {
  text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 14px; border-radius: 999px; color: var(--muted);
}
.nav a:hover { color: var(--ink); background: var(--snow); }
.nav a.on { color: var(--red); background: var(--red-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 0 22px; border-radius: 999px; border: 2px solid var(--red);
  background: var(--red); color: #fff; font: 700 15px var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn:active { transform: translateY(1px); }
.btn.line { background: transparent; color: var(--red); }
.btn.line:hover { background: var(--red-soft); }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.stat { padding: 26px max(2vw, 14px); border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: clamp(28px, 4vw, 44px); font-weight: 900; font-stretch: 125%; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.stat:first-child b { color: var(--red); }

/* ---------- sections ---------- */
.section { padding: clamp(40px, 6vw, 80px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
h1, h2 { margin: 0; font-weight: 900; font-stretch: 125%; letter-spacing: -.02em; line-height: 1.05; text-wrap: balance; }
h1 { font-size: clamp(34px, 5vw, 52px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
.sec-head p, .lead { margin: 6px 0 0; color: var(--muted); }
.more { font-weight: 700; color: var(--red); text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.page-head { padding: clamp(32px, 5vw, 56px) 0 24px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 22px; }
.search {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  font: 16px var(--font); width: min(260px, 100%);
}
.search:focus { border-color: var(--ink); outline: none; }
.spacer { flex: 1; }

/* ---------- Projects grid: gallery frames ---------- */
/* Each card: thin black frame, cream mat around the whole drawing (never cropped), black caption below. */
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.work {
  display: flex; flex-direction: column; text-decoration: none; position: relative;
  border: 1px solid #161314; border-radius: 3px; overflow: hidden; background: #161314;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px rgba(0, 0, 0, .25);
  transition: transform .18s ease, box-shadow .18s ease;
}
.work:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px #fcf8f0, 0 16px 32px rgba(0, 0, 0, .35); }
.work-img {
  position: relative; aspect-ratio: 1; background: #fcf8f0;
  box-shadow: inset 0 0 0 10px #fcf8f0, inset 0 0 0 11px rgba(22, 19, 20, .14);   /* cream mat + hairline */
}
.work-img img {
  position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px);
  object-fit: contain; image-rendering: pixelated;
}
.work h3 { margin: 0; padding: 10px 12px 2px; background: #161314; color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.work .meta { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 11px; background: #161314; color: rgba(255, 255, 255, .7); font-size: 13px; }
.work .meta b { color: #fff; font-weight: 700; }
@media (max-width: 600px) {
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .work-img { box-shadow: inset 0 0 0 7px #fcf8f0, inset 0 0 0 8px rgba(22, 19, 20, .14); }
  .work-img img { inset: 13px; width: calc(100% - 26px); height: calc(100% - 26px); }
  .work h3 { font-size: 13px; padding: 8px 9px 1px; }
  .work .meta { font-size: 11px; padding: 0 9px 8px; gap: 5px; }
}

/* ---------- empty states ---------- */
.empty {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; position: relative;
}
.slot {
  aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 6px; display: grid; place-items: center;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 12px 12px;
}
.slot i { width: 12px; height: 12px; background: var(--red); opacity: .25; }
.empty-note {
  grid-column: 1 / -1; text-align: center; padding: 8px 0 0; color: var(--muted);
}
.empty-note b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 4px; }
@media (max-width: 600px) { .empty { grid-template-columns: repeat(2, minmax(0, 1fr)); } .empty .slot:nth-child(3) { display: none; } }
.empty-rows { border: 2px dashed var(--line); border-radius: 6px; padding: 28px 20px; text-align: center; color: var(--muted); }
.empty-rows b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 4px; }

/* ---------- painters ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.pod { border: 1px solid var(--line); border-radius: 6px; padding: 18px; position: relative; overflow: hidden; }
.pod .place { font-weight: 900; font-stretch: 125%; font-size: 40px; line-height: 1; color: var(--line); }
.pod.p1 { border-color: var(--red); background: var(--red); color: #fff; }
.pod.p1 .place { color: rgba(255,255,255,.45); }
.pod .who { font-weight: 800; font-size: 19px; margin-top: 12px; }
.pod .uid { opacity: .7; font-weight: 400; font-size: 14px; }
.pod .px { font-variant-numeric: tabular-nums; margin-top: 2px; }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } }
table.rank { width: 100%; border-collapse: collapse; }
table.rank th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 2px solid var(--ink); }
table.rank td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
table.rank tr:hover td { background: var(--snow); }
table.rank .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rank .pos { width: 3ch; color: var(--muted); font-variant-numeric: tabular-nums; }
.name { font-weight: 700; }
.uid { color: var(--muted); font-size: 14px; }
.member { display: inline-block; width: 8px; height: 8px; background: var(--red); margin-left: 6px; vertical-align: middle; }
.barcol { width: 32%; }
.bar { height: 10px; background: var(--snow); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); }
@media (max-width: 640px) { .barcol, .hide-sm { display: none; } }

/* ---------- work page ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 64px; }
@media (max-width: 860px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.viewer {
  border: 1px solid var(--line); border-radius: 6px; min-height: 380px; display: grid; place-items: center; padding: 24px; overflow: auto; cursor: zoom-in;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px;
}
.viewer img { width: 100%; max-height: 72vh; object-fit: contain; }
.viewer.zoomed { cursor: zoom-out; place-items: start; }
.viewer.zoomed img { max-height: none; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 20px 0; }
.facts div { background: var(--surface); padding: 14px 16px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 2px 0 0; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.facts div:first-child dd { color: var(--red); }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.back { display: inline-flex; gap: 8px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 14px; }
.back:hover { color: var(--red); }


/* ---------- footer ---------- */
.foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 24px max(4vw, 18px); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot-mark { width: 10px; height: 10px; background: var(--red); }
.foot-links { margin-left: auto; display: flex; gap: 16px; }
.foot a { color: var(--ink); }

@media (max-width: 520px) {
  .nav a { padding: 8px 10px; font-size: 14px; }
  .logo-name { font-size: 15px; }
  .hero-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- refinements ---------- */
.btn, .chip { white-space: nowrap; }
.pod.p1 .uid { color: #fff; opacity: .75; }
.empty { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.empty .slot:nth-child(4) { display: grid; }
@media (max-width: 900px) { .empty { grid-template-columns: repeat(3, minmax(0, 1fr)); } .empty .slot:nth-child(4) { display: none; } }
@media (max-width: 600px) { .empty { grid-template-columns: repeat(2, minmax(0, 1fr)); } .empty .slot:nth-child(n+3) { display: none; } }

/* ================= V3: globe hero ================= */
.hero { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: 0 24px; padding: 0 0 0 max(4vw, 18px); min-height: min(640px, calc(100vh - 64px)); }
.hero-copy { padding: 40px 0; position: relative; z-index: 2; }
.mega { font-size: clamp(48px, 7.4vw, 104px); line-height: .9; letter-spacing: -.03em; margin: 0 0 22px; }
.mega span { color: var(--red); }
.hero-copy p { margin: 0 0 26px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45; max-width: 32ch; }
.globe-box { position: relative; height: min(640px, calc(100vh - 64px)); min-height: 420px; overflow: hidden; }
.globe-box > canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.g-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 13px; line-height: 1.35; max-width: 220px; }
.g-tip b { display: block; font-size: 14px; }
.g-tip span { opacity: .75; }
.g-read { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; font-size: 13px; color: var(--muted); background: rgba(252,248,240,.94); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.g-read b { color: var(--red); }
.g-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(252,248,240,.94); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; text-align: center; color: var(--muted); font-size: 14px; pointer-events: none; }
.g-empty b { display: block; color: var(--ink); font-size: 16px; }
.g-panel { position: absolute; z-index: 4; left: 50%; bottom: 56px; transform: translateX(-50%); width: min(560px, calc(100% - 28px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 40px rgba(22,19,20,.12); padding: 16px; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }
.g-card { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: center; }
.g-reveal { width: 160px; height: 160px; image-rendering: pixelated; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 8px 8px; border-radius: 6px; }
.g-info b { display: block; font-size: 20px; font-weight: 900; font-stretch: 125%; line-height: 1.1; margin-bottom: 4px; }
.g-info span { display: block; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.g-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.g-zhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.g-zhead b { display: block; font-size: 18px; font-weight: 900; }
.g-zhead span { color: var(--muted); font-size: 14px; }
.g-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; max-height: 196px; overflow-y: auto; }
.g-list a { text-decoration: none; font-size: 13px; }
.g-list a:hover b { color: var(--red); }
.g-list b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.g-list span { color: var(--muted); }
.g-thumb { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.g-thumb img { max-width: 100%; max-height: 100%; }
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .hero-copy { padding: 28px max(4vw, 18px) 8px; order: 2; }
  .globe-box { order: 1; height: 380px; min-height: 0; }
  .g-card { grid-template-columns: 96px minmax(0, 1fr); }
  .g-reveal { width: 96px; height: 96px; }
  .g-panel { bottom: 10px; }
}

/* tags */
.tag { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 700; color: var(--red); background: var(--red-soft); padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

/* ================= officer import tool ================= */
.kicker { color: var(--red); font-weight: 700; font-size: 14px; }
.imp code { background: var(--snow); padding: 1px 6px; border-radius: 4px; }
.imp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .imp-grid { grid-template-columns: minmax(0, 1fr); } }
.imp-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 0 0 16px; }
.imp-form legend { font-weight: 800; padding: 0 6px; display: flex; align-items: center; gap: 8px; }
.imp-form legend span { display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--red); color: #fff; font-size: 13px; }
.imp-form label { display: block; font-weight: 600; font-size: 14px; margin-top: 10px; }
.imp-form input:not([type=checkbox]):not([type=file]), .imp-form select, .imp-form textarea {
  display: block; width: 100%; margin-top: 6px; font: 16px var(--font); padding: 10px 12px; min-height: 44px;
  border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.imp-form textarea { font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
.imp-form input:focus, .imp-form select:focus, .imp-form textarea:focus { border-color: var(--ink); outline: none; }
.imp-form .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.imp-form .hint { margin: 0; color: var(--muted); font-size: 14px; }
.imp-form .check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.imp-form .check input { width: 18px; height: 18px; accent-color: var(--red); }
.drop { position: relative; display: grid !important; place-items: center; gap: 6px; text-align: center; min-height: 150px; border: 2px dashed var(--line); border-radius: 8px; padding: 16px; cursor: pointer; color: var(--muted); font-weight: 400 !important;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 12px 12px; }
.drop:hover, .drop.over { border-color: var(--red); }
.drop b { color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { max-width: 100%; max-height: 180px; }
.imp-side { position: sticky; top: 84px; }
.imp-side h2 { font-size: 22px; margin-bottom: 12px; }
.imp-check { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.imp-stat { background: var(--surface); padding: 12px 14px; }
.imp-stat b { display: block; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.imp-stat span { color: var(--muted); font-size: 13px; }
.imp-warn { color: var(--red-deep); background: var(--red-soft); padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.imp-ok { color: #1d6b3a; background: #e8f5ec; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.imp-side table.rank { margin: 8px 0 4px; font-size: 14px; }
.imp-side table.rank td { padding: 8px 10px; }
.imp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.imp-code { background: var(--ink); color: #f6eef0; border-radius: 8px; padding: 14px; font-size: 12.5px; line-height: 1.5; overflow-x: auto; max-height: 320px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--red); cursor: pointer; }
.imp .section { padding-top: 40px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; z-index: 60; transition: .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- utilities (replace former inline styles) ---------- */
.page-head.tight { padding-bottom: 16px; }
.page-body { padding-bottom: 64px; }
.contrib { margin-top: 24px; }

/* ---------- social icons ---------- */
.top-right { display: flex; align-items: center; gap: 12px; }
.socials { display: flex; gap: 6px; }
.social {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  color: var(--muted); text-decoration: none; transition: color .15s, background .15s;
}
.social svg { width: 20px; height: 20px; fill: currentColor; }
a.social:hover { color: var(--red); background: var(--red-soft); }
.social[aria-disabled="true"] { opacity: .35; cursor: default; }
.hero-socials { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.hero-socials .social { width: 44px; height: 44px; border: 1.5px solid var(--line); background: var(--surface); }
.hero-socials .social svg { width: 22px; height: 22px; }
@media (max-width: 640px) { .top .socials { display: none; } }

/* ---------- globe hover preview ---------- */
.g-tip { max-width: 300px; width: max-content; }
.g-tip .g-tip-img { display: block; margin: 6px 0 8px; line-height: 0; }
.g-tip .g-tip-img img { display: block; width: 160px; height: auto; max-width: none; image-rendering: pixelated; background: rgba(255,255,255,.06); border-radius: 3px; }
.g-tip .g-tip-row { display: flex; gap: 6px; margin: 4px 0 8px; }
.g-tip .g-tip-row img { width: 46px; height: 46px; object-fit: contain; image-rendering: pixelated; background: rgba(255,255,255,.06); border-radius: 3px; }
.foot-logo { display: block; height: 22px; width: auto; }

/* ---------- project numbers ---------- */
.num { color: var(--red); font-variant-numeric: tabular-nums; }
.imp-form .num-title { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.imp-form .num-title + .hint { margin-top: 6px; }

/* ---------- home: everything fits in one screen, no scrolling ---------- */
body.is-home { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.is-home .top, body.is-home .foot { flex: none; }
body.is-home main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.is-home .stats { flex: none; }
body.is-home .hero { flex: 1; min-height: 0; border-bottom: 1px solid var(--line); }
body.is-home .globe-box { height: auto; min-height: 0; align-self: stretch; }
body.is-home .mega { font-size: clamp(44px, min(7.4vw, 11vh), 104px); }
body.is-home .stat { padding: clamp(10px, 2.2vh, 26px) max(2vw, 14px); }
body.is-home .stat b { font-size: clamp(24px, min(4vw, 5vh), 44px); }
body.is-home .foot { padding-top: 14px; padding-bottom: 14px; }
@media (max-width: 860px) {
  body.is-home .hero { grid-template-rows: minmax(0, 1fr) auto; }
  body.is-home .globe-box { height: auto; }
  body.is-home .hero-copy { padding: 14px max(4vw, 18px) 12px; }
  body.is-home .hero-copy p { font-size: 15px; margin-bottom: 14px; }
  body.is-home .mega { font-size: clamp(36px, min(11vw, 6vh), 56px); margin-bottom: 10px; }
  body.is-home .hero-actions .btn { min-height: 42px; }
  body.is-home .hero-socials { margin-top: 10px; }
  body.is-home .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.is-home .stat { border-right: 1px solid var(--line); border-bottom: 0; padding: 10px 8px; }
  body.is-home .stat:last-child { border-right: 0; }
  body.is-home .stat span { font-size: 11px; line-height: 1.2; display: block; }
  body.is-home .stat b { font-size: 17px; font-stretch: 100%; }
  body.is-home .foot { font-size: 12px; gap: 8px; }
}
/* Very short screens (landscape phones): let the page scroll rather than crush it. */
@media (max-height: 520px) {
  body.is-home { height: auto; overflow: visible; display: block; }
  body.is-home .hero { min-height: 480px; }
  body.is-home .globe-box { height: 420px; }
}

/* ---------- logo watermark behind the title ---------- */
.mega-wrap { position: relative; isolation: isolate; }
.mega-mark {
  position: absolute; z-index: -1; pointer-events: none; user-select: none;
  height: 150%; width: auto; left: 38%; top: 50%; transform: translate(-50%, -50%);
  opacity: .09;
}

/* ---------- dive window sized to the drawing (globe.js fitCard) ---------- */
.g-panel { max-width: calc(100% - 28px); max-height: calc(100% - 28px); overflow: auto; }
.g-card { grid-template-columns: auto minmax(0, 1fr); }
.g-card.stack { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.g-card.stack .g-info { justify-self: stretch; }
.g-card .g-reveal { display: block; width: 160px; height: 160px; border-radius: 4px; }
@media (max-width: 860px) { .g-card:not(.stack) { grid-template-columns: auto minmax(0, 1fr); } }

/* ---------- admin: site folder ---------- */
.adm-card { max-width: 640px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 24px; }
.adm-card h2 { font-size: 24px; margin-bottom: 8px; }
.adm-card p { margin: 0 0 12px; color: var(--muted); }
.adm-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 14px 16px; }
.adm-bar b { display: block; }
.adm-bar span { color: var(--muted); font-size: 14px; }
.adm-note { color: var(--muted); font-size: 14px; margin: 10px 0 24px; }
.adm-note code { background: var(--snow); padding: 1px 6px; border-radius: 4px; }
.adm-list td { vertical-align: middle; }
.adm-thumb { position: relative; display: block; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fcf8f0; }
.adm-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.adm-thumb i { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.adm-acts { white-space: nowrap; }
.adm-acts .btn + .btn { margin-left: 6px; }
.btn.line.danger { color: var(--red-deep); border-color: var(--line); }
.btn.line.danger:hover { border-color: var(--red); background: var(--red-soft); }
.group { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- footer always at the bottom of the window, even on short pages ---------- */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > .top, body > .foot { flex: none; }

/* ---------- Projects: drawings on cream with a thin black border ---------- */

/* ---------- Guild red theme (#8A0A14) on every page ---------- */
/* Light text, buttons and logo on red. Light "islands" (globe, cards, forms) keep a dark-on-cream palette. */
body {
  --bg: #8a0a14; --ink: #fcf8f0; --muted: rgba(252, 248, 240, .78); --line: rgba(252, 248, 240, .22);
  background: var(--bg); color: var(--ink);
}
body .top { background: #f1e7d6; border-bottom: 1px solid #161314; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
body .logo-name { color: #161314; }
body .logo-name b { color: #8a0a14; }
body .mega-mark { filter: brightness(0) invert(1); }   /* header and footer logos stay red on the parchment bands */
body .mega-mark { opacity: .12; }
body .mega, body .mega span { color: #fff; }
body .social { color: rgba(252, 248, 240, .85); }
body a.social:hover { color: #fff; background: rgba(255, 255, 255, .14); }

body .stat:first-child b { color: #8a0a14; }
body .foot a { color: #8a0a14; }
body :focus-visible { outline-color: #fcf8f0; }
body .globe-box { --ink: #161314; --muted: #6f6869; --line: #e6dccb; color: var(--ink); }
body .globe-box .g-read { color: var(--muted); }

/* ---------- red theme: light islands (dark text on cream) ---------- */
.facts, .viewer, .imp-check, .adm-card, .adm-bar, .adm-thumb,
.imp-form input:not([type=checkbox]):not([type=file]), .imp-form select, .imp-form textarea {
  --ink: #161314; --muted: #6f6869; --line: #e6dccb; color: var(--ink);
}
.viewer { background-color: #fcf8f0; }
.adm-note code, .imp code { background: rgba(255, 255, 255, .14); color: #fff; }
#toast, .imp-code { background: #161314; color: #fcf8f0; }

/* ---------- red theme: Projects ---------- */
.num, .more, .kicker, .linkbtn { color: #ffc9cf; }
.back:hover, .more:hover { color: #fff; }
.chip { background: transparent; color: #fcf8f0; border-color: rgba(252, 248, 240, .35); }
.chip:hover { border-color: #fcf8f0; }
.chip.on { background: #fcf8f0; border-color: #fcf8f0; color: #8a0a14; }
.search { background: transparent; color: #fcf8f0; border-color: rgba(252, 248, 240, .35); }
.search::placeholder { color: rgba(252, 248, 240, .6); }
.search:focus { border-color: #fcf8f0; }
.slot i { background: #fcf8f0; }

/* ---------- red theme: Leaderboards and project page ---------- */
.pod.p1 { background: #fcf8f0; border-color: #fcf8f0; color: #8a0a14; }
.pod.p1 .place { color: rgba(138, 10, 20, .35); }
.pod.p1 .uid { color: #8a0a14; }
table.rank tr:hover td { background: rgba(255, 255, 255, .06); }
.bar { background: rgba(255, 255, 255, .14); }
.bar i { background: #fcf8f0; }
.member { background: #fcf8f0; }
.facts div:first-child dd { color: #ca0708; }

/* ---------- red theme: admin ---------- */
.imp-form legend span { background: #fcf8f0; color: #8a0a14; }
.drop:hover, .drop.over { border-color: #fcf8f0; }
.btn.line.danger { color: #ffc9cf; border-color: rgba(252, 248, 240, .35); }
.btn.line.danger:hover { color: #fff; border-color: #fcf8f0; background: rgba(255, 255, 255, .1); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- red theme: buttons inside cream boxes (globe window, admin cards) ---------- */
/* The default buttons are cream on red; on a cream box they switch back to red so they stay visible. */

/* ---------- leaderboard: sortable Pixels / Projects headers ---------- */
.th-sort {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; margin: -4px -6px;
  font: inherit; color: inherit; cursor: pointer; border-radius: 6px;
}
.th-sort span { opacity: .55; font-size: 12px; }
.th-sort:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.th-sort.on { color: #fff; font-weight: 800; }
.th-sort.on span { opacity: 1; }


/* ---------- 18+ gate ---------- */
body.gated { overflow: hidden; }
.age-gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(60, 4, 9, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.age-card {
  --ink: #161314; --muted: #6f6869; --line: #e6dccb; color: var(--ink);
  width: min(440px, 100%); background: #fcf8f0; border-radius: 14px; padding: 28px 24px; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.age-logo { display: block; margin: 0 auto 12px; width: 84px; height: auto; }
.age-card h2 { font-size: 30px; color: #8a0a14; margin-bottom: 8px; }
.age-card p { margin: 0 0 20px; color: var(--muted); }
.age-acts { display: flex; flex-direction: column; gap: 10px; }

/* ---------- legal notice ---------- */
.legal .page-body { max-width: 720px; }
.legal h2 { font-size: 22px; margin: 28px 0 8px; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 12px; color: var(--muted); }
.legal a { color: #fff; }

/* ---------- globe: idle showcase (angular card + thin line to the project) ---------- */
/* Card: square corners, cream-white, thin black outline. Inside: the drawing in its own black-outlined frame,
   then the project info and the button in a second black-outlined box. */
.g-show {
  position: absolute; z-index: 4; display: flex; flex-direction: column; gap: 8px;
  background: #fcf8f0; color: #161314; border: 1px solid #161314; border-radius: 0; padding: 9px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .22); animation: showIn .45s ease-out both;
}
.g-show-frame { display: grid; place-items: center; border: 1px solid #161314; padding: 8px; background: #fff; }
.g-show-frame img { display: block; image-rendering: pixelated; }
.g-show-info { border: 1px solid #161314; padding: 9px 10px 10px; }
.g-show-info b { display: block; font-size: 18px; font-weight: 900; font-stretch: 125%; line-height: 1.1; margin-bottom: 4px; }
.g-show-info span { display: block; color: #6f6869; font-size: 13px; font-variant-numeric: tabular-nums; }
.g-show-info .btn { margin-top: 10px; border-radius: 0; }
.g-show.row { flex-direction: row; align-items: stretch; }
.g-show.row .g-show-frame { flex: none; }
.g-show.row .g-show-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.g-show.row .g-show-info b { font-size: 15px; }
.g-show.row .g-show-info .btn { margin-top: 6px; min-height: 32px; padding: 0 12px; font-size: 13px; align-self: flex-start; }
.g-show.out, .g-arrow.out { animation: showOut .5s ease-in forwards .2s; pointer-events: none; }
@keyframes showIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes showOut { to { opacity: 0; } }

.g-arrow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.g-arrow path, .g-arrow circle { fill: none; stroke: #fcf8f0; stroke-width: 1.25; stroke-linecap: square; stroke-linejoin: miter;
  filter: drop-shadow(0 0 1.5px rgba(40, 0, 6, .9)); }
.g-arrow .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: arrowDraw .5s ease-out forwards; }
.g-arrow .dot { fill: #fcf8f0; stroke: none; }
.g-arrow .ring { transform-box: fill-box; transform-origin: center; animation: ringPulse 1.8s ease-out infinite .6s; }
@keyframes arrowDraw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes ringPulse { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .g-show, .g-arrow .line, .g-arrow .ring { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

/* =====================================================================
   DA: square corners, thin black outlines (#161314) and a hard offset shadow on every frame,
   matching the globe showcase card. Palette: guild red #8a0a14, cream #fcf8f0, ink #161314.
   ===================================================================== */
/* buttons: cream with red text (primary), black with cream text (secondary) */
.btn { border-radius: 0; border: 1px solid #161314; background: #fcf8f0; color: #8a0a14; box-shadow: 3px 3px 0 rgba(0, 0, 0, .3); }
.btn:hover { background: #fff; border-color: #161314; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .3); }
.btn.line { background: #161314; color: #fcf8f0; border-color: #161314; }
.btn.line:hover { background: #2a2526; border-color: #161314; }
.btn.sm { box-shadow: 2px 2px 0 rgba(0, 0, 0, .3); }
/* inside cream boxes (globe window, showcase, admin cards, 18+ gate) the primary button turns red */
.globe-box .btn, .adm-card .btn, .adm-bar .btn, .age-card .btn { background: #8a0a14; border-color: #161314; color: #fff; }
.globe-box .btn:hover, .adm-card .btn:hover, .adm-bar .btn:hover, .age-card .btn:hover { background: #6e0810; border-color: #161314; }
.globe-box .btn.line, .adm-card .btn.line, .adm-bar .btn.line, .age-card .btn.line { background: #161314; color: #fcf8f0; border-color: #161314; }
.globe-box .btn.line:hover, .adm-card .btn.line:hover, .adm-bar .btn.line:hover, .age-card .btn.line:hover { background: #2a2526; }
.btn.line.danger { background: #161314; color: #ffc9cf; border-color: #161314; }
.btn.line.danger:hover { background: #8a0a14; color: #fff; }

/* header navigation and social icons */
.nav a { border-radius: 0; border: 1px solid transparent; }
.nav a:hover { background: rgba(0, 0, 0, .18); }
.nav a.on { background: #fcf8f0; color: #8a0a14; border-color: #161314; box-shadow: 2px 2px 0 rgba(0, 0, 0, .3); }
.social { border-radius: 0; }
.hero-socials .social { background: #161314; border: 1px solid #161314; color: #fcf8f0; box-shadow: 2px 2px 0 rgba(0, 0, 0, .3); }
.hero-socials a.social:hover { background: #fcf8f0; color: #8a0a14; }

/* sort chips and search */
.chip { border-radius: 0; background: #161314; color: #fcf8f0; border: 1px solid #161314; }
.chip:hover { border-color: #fcf8f0; }
.chip.on { background: #fcf8f0; color: #8a0a14; border-color: #161314; box-shadow: 2px 2px 0 rgba(0, 0, 0, .3); }
.search { border-radius: 0; background: #161314; color: #fcf8f0; border: 1px solid #161314; }
.search:focus { border-color: #fcf8f0; }

/* project cards */
.work { border-radius: 0; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }
.work:hover { box-shadow: 0 0 0 1px #fcf8f0, 6px 6px 0 rgba(0, 0, 0, .3); }

/* leaderboard: cream podium cards (1st in black) and the table as a cream framed sheet */
.pod { border-radius: 0; border: 1px solid #161314; background: #fcf8f0; color: #161314; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }
.pod .place { color: rgba(22, 19, 20, .16); }
.pod .uid { color: #6f6869; opacity: 1; }
.pod.p1 { background: #161314; color: #fcf8f0; border-color: #161314; }
.pod.p1 .place { color: rgba(252, 248, 240, .25); }
.pod.p1 .uid { color: rgba(252, 248, 240, .7); }
table.rank {
  --ink: #161314; --muted: #6f6869; --line: #e6dccb; color: var(--ink);
  background: #fcf8f0; border: 1px solid #161314; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3);
}
table.rank th { color: #6f6869; border-bottom: 1px solid #161314; }
table.rank tr:hover td { background: #f3ece0; }
.bar { background: #ece3d4; border-radius: 0; }
.bar i { background: #8a0a14; }
.member { background: #8a0a14; }
.th-sort { border-radius: 0; }
.th-sort:hover { color: #161314; background: rgba(0, 0, 0, .06); }
.th-sort.on { color: #8a0a14; }

/* project page */
.viewer { border-radius: 0; border: 1px solid #161314; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }
.facts { border-radius: 0; border: 1px solid #161314; background: #161314; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }

/* globe windows, tooltips, empty states */
.g-panel { border-radius: 0; border: 1px solid #161314; box-shadow: 6px 6px 0 rgba(0, 0, 0, .25); }
.g-tip { border-radius: 0; border: 1px solid #000; }
.g-thumb, .g-reveal { border-radius: 0; border: 1px solid #161314; }
.g-read, .g-empty { border-radius: 0; border-color: #161314; }
.empty-rows, .slot { border-radius: 0; }
.tag { border-radius: 0; }
#toast { border-radius: 0; border: 1px solid #fcf8f0; }

/* admin */
.adm-card, .adm-bar { border-radius: 0; border: 1px solid #161314; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }
.adm-thumb { border-radius: 0; border-color: #161314; }
.imp-form fieldset { border-radius: 0; }
.imp-form input:not([type=checkbox]):not([type=file]), .imp-form select, .imp-form textarea { border-radius: 0; border: 1px solid #161314; }
.imp-check { border-radius: 0; border-color: #161314; background: #161314; }
.imp-code, .imp-warn, .imp-ok, .drop { border-radius: 0; }

/* 18+ gate */
.age-card { border-radius: 0; border: 1px solid #161314; box-shadow: 8px 8px 0 rgba(0, 0, 0, .3); }

/* ---------- white header: nav links as DA buttons, dark social icons ---------- */
.top .nav { gap: 8px; }
.top .nav a {
  color: #161314; background: #fff; border: 1px solid #161314; border-radius: 0;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .25); transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
.top .nav a:hover { background: #fcf8f0; color: #8a0a14; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(0, 0, 0, .25); }
.top .nav a.on { background: #8a0a14; color: #fff; border-color: #161314; box-shadow: 2px 2px 0 rgba(0, 0, 0, .25); }
.top .social { color: #161314; }
.top a.social:hover { color: #8a0a14; background: #fcf8f0; }
.top .social[aria-disabled="true"] { opacity: .3; }
.top :focus-visible { outline-color: #8a0a14; }
@media (max-width: 520px) { .top .nav { gap: 6px; } .top .nav a { padding: 7px 9px; } }

/* ---------- globe hover bubble: white, black text, black outline ---------- */
.g-tip { background: #fff; color: #161314; border: 1px solid #161314; box-shadow: 4px 4px 0 rgba(0, 0, 0, .25); }
.g-tip span { color: #6f6869; opacity: 1; }
.g-tip .g-tip-img img, .g-tip .g-tip-row img { background: #fcf8f0; border: 1px solid #161314; border-radius: 0; }

/* ---------- top 3: light gold, silver and bronze (podium and table rows) ---------- */
.pod.p1, .pod.p2, .pod.p3 { color: #161314; border-color: #161314; }
.pod.p1 { background: linear-gradient(135deg, #f6e7b4, #e9cf7a); }
.pod.p2 { background: linear-gradient(135deg, #f1f2f4, #cfd3d8); }
.pod.p3 { background: linear-gradient(135deg, #f1d9c2, #d6a77d); }
.pod.p1 .place, .pod.p2 .place, .pod.p3 .place { color: rgba(22, 19, 20, .22); }
.pod.p1 .uid, .pod.p2 .uid, .pod.p3 .uid { color: rgba(22, 19, 20, .6); }
table.rank tr.top1 td { background: #f8ecc4; }
table.rank tr.top2 td { background: #eceef1; }
table.rank tr.top3 td { background: #f3dfcc; }
table.rank tr.top1 .bar i { background: #b8912a; }
table.rank tr.top2 .bar i { background: #8a9099; }
table.rank tr.top3 .bar i { background: #a8673a; }
table.rank tr.top1:hover td, table.rank tr.top2:hover td, table.rank tr.top3:hover td { filter: brightness(.97); }

/* ---------- page transitions ---------- */
/* Inside the site: the page fades and settles in (site.js adds .page-out before switching). */
main { transition: opacity .18s ease, transform .18s ease; }
main.page-out { opacity: 0; transform: translateY(6px); }
main.page-in { animation: pageIn .42s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
/* Between the site and the admin (full page loads): a soft cross-fade in browsers that support it. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .22s ease both vtOut; }
::view-transition-new(root) { animation: .38s cubic-bezier(.2, .7, .2, 1) both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  main, main.page-in { transition: none; animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- parchment bands (#f1e7d6): header and footer frame the page ---------- */
body .foot { background: #f1e7d6; color: #4a4243; border-top: 1px solid #161314; box-shadow: 0 -3px 0 rgba(0, 0, 0, .18); }
body .foot a:hover { color: #161314; }
.foot .social { color: #161314; }
.foot a.social:hover { color: #8a0a14; background: #fcf8f0; }
.foot .social[aria-disabled="true"] { opacity: .3; }
.foot :focus-visible { outline-color: #8a0a14; }

/* ---------- home figures: cream cards with black outline and hard shadow ---------- */
.stats { gap: 14px; padding: 0 max(4vw, 18px) 4px; border-bottom: 0; }
.stat { background: #fcf8f0; color: #161314; border: 1px solid #161314; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }
.stat:last-child { border-right: 1px solid #161314; }
.stat span { color: #6f6869; }
body.is-home .stats { padding-bottom: clamp(10px, 1.8vh, 18px); }
body.is-home .hero { border-bottom: 0; }
@media (max-width: 860px) {
  body.is-home .stats { gap: 8px; padding: 0 12px 10px; }
  body.is-home .stat, body.is-home .stat:last-child { border: 1px solid #161314; box-shadow: 3px 3px 0 rgba(0, 0, 0, .3); padding: 8px; }
}

/* ---------- admin: project numbers readable on the cream list ---------- */
.adm-list td.num { color: #161314; font-weight: 800; }

/* ---------- top contributor badge (project page) ---------- */
.top-badge { display: inline-block; width: 14px; height: 18px; margin-left: 6px; vertical-align: -3px; }

/* ---------- podium: guild emblem behind the names, in gold / silver / bronze ---------- */
/* The emblem PNG is used as a mask, so it takes the metal gradient as its colour. */
.pod > * { position: relative; z-index: 1; }
.pod.p1::after, .pod.p2::after, .pod.p3::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  right: -14px; top: 50%; width: 150px; height: 150px; transform: translateY(-50%);
  -webkit-mask: url("../img/podium-emblem.png") center / contain no-repeat; mask: url("../img/podium-emblem.png") center / contain no-repeat;
}
.pod.p1::after { background: linear-gradient(160deg, #f7e08a 0%, #d4a933 45%, #a67c1a 100%); }
.pod.p2::after { background: linear-gradient(160deg, #ffffff 0%, #b9bec6 45%, #868d97 100%); }
.pod.p3::after { background: linear-gradient(160deg, #f0c39a 0%, #b9773f 45%, #8a5326 100%); }
.pod .who, .pod .px { text-shadow: 0 0 6px rgba(255, 255, 255, .65); }
@media (max-width: 640px) { .pod.p1::after, .pod.p2::after, .pod.p3::after { width: 120px; height: 120px; right: -6px; } }

/* ---------- project page: zoom then drag to pan (no scrollbars), discreet Unzoom button ---------- */
.viewer { position: relative; display: block; padding: 0; overflow: hidden; cursor: default; }
.viewer-pane { width: 100%;
  display: grid; place-items: center; min-height: 380px; max-height: 78vh; padding: 24px; overflow: hidden;
  cursor: zoom-in; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.viewer-pane img { -webkit-user-drag: none; }
.viewer.zoomed .viewer-pane { display: block; width: 100%; cursor: grab; touch-action: none; height: min(78vh, 640px); }
.viewer.zoomed.dragging .viewer-pane { cursor: grabbing; }
.viewer.zoomed .viewer-pane img { display: block; max-width: none; max-height: none; }
.unzoom {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: none;
  padding: 5px 10px; font: 700 12px var(--font); letter-spacing: .02em;
  background: rgba(22, 19, 20, .78); color: #fcf8f0; border: 1px solid #161314; border-radius: 0; cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .25); transition: background .15s;
}
.unzoom:hover { background: #161314; }
.viewer.zoomed .unzoom { display: inline-flex; }

/* ---------- leaderboard: Leads column (projects led) ---------- */
.leads .lead-count {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: #8a0a14;
}
.leads .lead-none { color: #b9aea4; }
@media (max-width: 640px) {
  #lb-table table.rank { font-size: 13px; table-layout: auto; }
  #lb-table table.rank th, #lb-table table.rank td { padding: 9px 4px; }
  #lb-table table.rank th { font-size: 11px; }
  #lb-table table.rank td:nth-child(2) { overflow-wrap: anywhere; }
  #lb-table .th-sort { gap: 2px; padding: 2px 3px; margin: -2px -3px; }
  #lb-table .th-sort span { font-size: 10px; }
}
