/* badui.slopped.site: the chrome. Hand-written; scripts/build.mjs doesn't touch it. Brand tokens and type as on
   slopped.site (slopped-brand). The idea: a registry office for bad controls. The chrome is plain, ruled and
   accessible, like a filing card; only what's inside the vitrine (the exhibit) is allowed to be bad. Each exhibit
   brings its own styles for its control, scoped under .c-<id>. */
@font-face { font-family: "Archivo Black"; src: url(/fonts/archivo-black-latin.woff2) format("woff2"); font-weight: 400 1000; font-display: swap; }
@font-face { font-family: "Archivo Black Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Helvetica-Bold"), local("Roboto Bold"), local("Roboto-Bold"), local("Noto Sans Bold"), local("NotoSans-Bold"); size-adjust: 112%; }
:root {
  color-scheme: light;
  --paper: #f4f1e8;
  --ink: #171815;
  --acid: #e3ff59;
  --muted: #6b6b62;
  --line: #d4d2c9;
  --panel: #ebe7dc;
  --card: #fbf9f3;
  --focus: #728600;
  --head: "Archivo Black", "Arial Black", "Archivo Black Fallback", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: inherit; }
:where(a, button, input, select, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
h1, h2, h3 { margin: 0; font-family: var(--head); font-weight: 1000; letter-spacing: -1.5px; line-height: 1.02; font-synthesis: none; }
img { max-width: 100%; }
.wrap { max-width: 1440px; margin: auto; padding: 0 5%; }
main:focus { outline: none; }
html:not(.can-install) [data-install] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* header: the masthead (slopped-brand, "Subsite header") */
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100px; border-bottom: 1px solid var(--line); }
.masthead { display: flex; align-items: center; min-width: 0; }
.masthead .brand { display: flex; align-items: center; min-height: 42px; flex: none; }
.masthead .brand img { display: block; width: auto; height: 30px; }
.site-name { display: inline-flex; align-items: center; min-height: 42px; margin-left: 16px; padding-left: 17px; background: linear-gradient(var(--line), var(--line)) left center / 1px 22px no-repeat; color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -.3px; text-decoration: none; white-space: nowrap; }
.site-name:hover { text-decoration: underline; text-underline-offset: 4px; }
nav { display: flex; align-items: center; gap: 4px 18px; font-size: 14px; }
nav a { display: inline-flex; align-items: center; min-height: 42px; text-decoration: none; white-space: nowrap; }
nav a:hover, nav a[aria-current] { text-decoration: underline; text-underline-offset: 5px; }
nav a[aria-current] { font-weight: 700; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 700 14px Arial, Helvetica, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; }
.pill:hover { background: var(--acid); }
.pill.dark { background: var(--ink); color: var(--paper); }
.pill.dark:hover { background: #33342f; }
.pill.install-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; min-height: 42px; padding: 0; }

/* page heads */
.intro { padding: 56px 0 30px; }
.intro h1 { max-width: 13ch; font-size: clamp(48px, 7.4vw, 112px); letter-spacing: -3px; }
.intro.narrow h1 { max-width: 16ch; font-size: clamp(42px, 5.4vw, 80px); }
.lede { max-width: 640px; margin: 20px 0 0; font-size: 21px; line-height: 1.4; letter-spacing: -.3px; }
.rules { max-width: 640px; margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.rules b { color: var(--ink); }

/* Bad UI of the day: the acid statement block */
.today { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 36px; align-items: center; margin: 18px 0 56px; padding: 30px; border-radius: 16px; background: var(--acid); }
.today-pic { display: block; overflow: hidden; aspect-ratio: 4 / 3; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card); transform: rotate(-1.2deg); }
.today-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.today h2 { font-size: 15px; letter-spacing: -.2px; font-family: Arial, Helvetica, sans-serif; font-weight: 900; }
.today-no { margin: 14px 0 0; font-size: 13px; font-weight: 700; }
.today-title { margin: 4px 0 0; font: 1000 clamp(32px, 4vw, 56px)/1 var(--head); letter-spacing: -2px; font-synthesis: none; }
.today-for { max-width: 520px; margin: 12px 0 20px; font-size: 17px; }

/* the registry */
.registry { padding-bottom: 40px; }
.reg-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-top: 26px; border-top: 1px solid var(--ink); }
.reg-head h2 { font-size: 38px; }
.reg-head h2 small { margin-left: 4px; color: var(--muted); font: 700 14px Arial, Helvetica, sans-serif; letter-spacing: 0; vertical-align: super; }
.filter { margin: 20px 0 6px; padding: 0; border: 0; }
.filter legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills label { position: relative; display: inline-flex; }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pills span { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 700; cursor: pointer; user-select: none; }
.pills span:hover { border-color: var(--ink); }
.pills small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pills input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pills input:checked + span small { color: var(--acid); }
.pills input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.status { min-height: 1.5em; margin: 8px 0 18px; color: var(--muted); font-size: 14px; }
.exhibits { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 34px 30px; margin: 0; padding: 0; list-style: none; }
.exhibits li[hidden] { display: none; }
.exhibits a { display: grid; gap: 6px; text-decoration: none; }
.ex-pic { display: block; overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); transition: transform .2s, border-color .2s; }
.ex-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.exhibits a:hover .ex-pic { border-color: var(--ink); transform: translateY(-4px); }
.exhibits a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.no-thumb { display: grid; place-items: center; width: 100%; height: 100%; color: var(--line); font: 1000 72px var(--head); }
.ex-no { color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.exhibits b { font-size: 18px; line-height: 1.2; letter-spacing: -.3px; }
.ex-for { color: var(--muted); font-size: 14px; line-height: 1.4; }
.ex-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; font-size: 12px; font-weight: 700; }
.kind { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 999px; font-size: 12px; font-weight: 700; }
.ex-diff { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 9px; height: 9px; border: 1.5px solid var(--ink); border-radius: 2px; }
.pips i.on { background: var(--ink); }

/* one exhibit */
.ex-head { padding: 46px 0 26px; }
.ex-head h1 { max-width: 18ch; font-size: clamp(40px, 5.6vw, 84px); letter-spacing: -2.5px; }
.ex-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.ex-main { min-width: 0; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }
.readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; }
.readout-label { font-size: 14px; font-weight: 700; }
.readout output { font: 1000 26px/1.1 var(--head); letter-spacing: -.8px; font-synthesis: none; overflow-wrap: anywhere; }
.readout-how { color: var(--muted); font-size: 13px; }
body[data-how=bad] .readout-how::before { content: "✓ "; color: var(--ink); }
.hatch { flex: 0 1 auto; }
.hatch > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; user-select: none; }
.hatch > summary::-webkit-details-marker { display: none; }
.hatch > summary::before { content: "↷"; margin-right: 8px; font-size: 16px; }
.hatch > summary:hover { background: var(--acid); }
.hatch[open] > summary { background: var(--ink); color: var(--paper); }
.hatch[open] { flex-basis: 100%; }
.plain { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-top: 12px; padding: 18px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--card); }
.plain label { flex-basis: 100%; font-size: 14px; font-weight: 700; }
.plain input:not([type=range]), .plain select { min-height: 46px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; color: var(--ink); font: 17px Arial, Helvetica, sans-serif; }
.plain input[type=text], .plain input[type=email], .plain input[type=tel] { flex: 1 1 240px; min-width: 0; }
.plain input[type=number] { width: 120px; }
.plain input[type=color] { width: 80px; padding: 4px; }
.plain-row { display: flex; flex: 1 1 260px; align-items: center; gap: 14px; min-width: 0; }
.plain-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--ink); }
.plain-hint { flex-basis: 100%; order: 3; color: var(--muted); font-size: 13px; }
.plain-note { flex: 1 1 200px; margin: 0; font-size: 15px; }
.plain-error { flex-basis: 100%; order: 4; margin: 0; color: #a3271b; font-size: 14px; font-weight: 700; }
.plain-error:empty { display: none; }

.vitrine { position: relative; display: grid; place-items: center; min-height: 380px; padding: clamp(14px, 3.5vw, 40px); border: 1.5px solid var(--ink); border-radius: 16px; background: var(--card); overflow: hidden; }
.stage { width: 100%; min-width: 0; container-type: inline-size; }
.stage[aria-busy=true]::after { content: "Unpacking the exhibit…"; color: var(--muted); }
.broken { color: var(--muted); }
.say { min-height: 1.5em; margin: 12px 0 0; font-size: 15px; }

/* the exhibit card: a ruled filing card */
.card { border: 1.5px solid var(--ink); border-radius: 6px; background: var(--card); }
.card dl { margin: 0; }
.card div { display: grid; gap: 2px; padding: 12px 16px; }
.card div + div { border-top: 1px solid var(--line); }
.card dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.card dd { margin: 0; font-size: 15px; line-height: 1.45; }
.card dd .pips { margin-right: 8px; vertical-align: -1px; }
.card a { text-decoration: underline; text-underline-offset: 3px; }
.card a, .steps a { min-height: 24px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 46px 0 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.steps a { display: grid; gap: 2px; padding: 6px 0; font-size: 18px; font-weight: 700; letter-spacing: -.3px; text-decoration: none; }
.steps a span { color: var(--muted); font-size: 12px; letter-spacing: 0; }
.steps a:hover { text-decoration: underline; text-underline-offset: 4px; }
.steps a[rel=next] { text-align: right; }

/* about and random */
.prose { max-width: 720px; padding-bottom: 40px; font-size: 17px; }
.prose h2 { margin: 36px 0 12px; font-size: 30px; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose .kinds { padding: 0; list-style: none; }
.prose .kinds li { padding: 10px 0; border-top: 1px solid var(--line); }
.prose .kinds span { color: var(--muted); font-size: 13px; font-weight: 700; }
.plain-list { columns: 2 300px; padding: 0 0 40px 20px; }
.plain-list a { display: inline-block; min-height: 32px; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 30px; padding: 26px 0 35px; border-top: 1px solid var(--line); }
.foot-logo { display: inline-flex; align-items: center; min-height: 42px; }
footer img { display: block; width: auto; height: 25px; }
footer p { max-width: 560px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
footer p a { display: inline-block; min-height: 24px; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 980px) {
  .ex-grid { grid-template-columns: 1fr; }
  .card { max-width: 640px; }
}
@media (max-width: 760px) {
  header { height: 80px; }
  .masthead .brand img { height: 24px; }
  .site-name { margin-left: 12px; padding-left: 13px; }
  nav { gap: 4px 12px; }
  .intro { padding: 36px 0 22px; }
  .intro h1 { letter-spacing: -2px; }
  .lede { font-size: 18px; }
  .today { grid-template-columns: 1fr; gap: 22px; padding: 22px; margin-bottom: 40px; }
  .reg-head h2 { font-size: 30px; }
  .exhibits { grid-template-columns: 1fr; }
  .ex-head { padding: 30px 0 20px; }
  .vitrine { min-height: 320px; border-radius: 12px; }
  .steps { grid-template-columns: 1fr; gap: 6px; }
  .steps a[rel=next] { text-align: left; }
  footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  footer p { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .exhibits a:hover .ex-pic { transform: none; }
}
