/* QAPOW: comic-book look, kept loud only where it matters. */
:root {
  --ink: #111111;
  --paper: #FFF8E6;
  --white: #FFFFFF;
  --muted: #444444;
  --blue: #1F56B3;
  --blue-dot: #2F6FD0;
  --red: #F0552B;
  --yellow: #FFD928;
  --link-hover: #B8321A;
  --display: "Bangers", "Impact", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: var(--ink); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--yellow); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header and footer */
.site-header { background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--red); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--yellow); }
.brand:hover { color: var(--yellow); }
.brand img { width: 40px; height: 40px; }
.brand span { font-family: var(--display); font-size: 32px; letter-spacing: 2px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a { color: var(--paper); text-decoration: none; font-weight: 600; padding: 12px 14px; }
.site-nav a:hover { color: var(--yellow); }
.site-footer { background: var(--ink); color: var(--paper); margin-top: 64px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 24px; font-size: 15px; }
.site-footer a { color: var(--yellow); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* Shared pieces */
.dots { background-color: var(--blue); background-image: radial-gradient(var(--blue-dot) 3px, transparent 3.5px); background-size: 14px 14px; border-bottom: 4px solid var(--ink); }
.display { font-family: var(--display); font-weight: 400; letter-spacing: 1px; }
.shout { color: var(--yellow); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 4px 4px 0 var(--ink); line-height: 1; margin: 0; }
h2.display { font-size: 36px; margin: 0; }
.panel { background: var(--white); border: 3px solid var(--ink); padding: 24px; }
.panel h2 { margin: 0; font-size: 18px; font-weight: 800; }
.panel p { margin: 8px 0 0; }
.btn { display: inline-block; font: inherit; font-family: var(--display); font-size: 26px; letter-spacing: 1px; text-decoration: none; color: var(--ink); background: var(--yellow); border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 10px 26px; cursor: pointer; }
.btn:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.tag { display: inline-block; border: 2px solid var(--ink); color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .5px; padding: 2px 7px; text-transform: uppercase; }
.shot { background-color: #DCE7F7; background-image: radial-gradient(#C3D5F0 2px, transparent 2.5px); background-size: 10px 10px; display: flex; align-items: center; justify-content: center; color: #3A4A66; font-size: 13px; font-weight: 600; aspect-ratio: 16 / 9; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }

/* Home: hero */
.hero .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-top: 40px; padding-bottom: 40px; }
.hero-text { flex: 1 1 380px; min-width: 0; }
.hero-text h1 { font-size: 64px; }
.hero-text p { margin: 14px 0 0; max-width: 480px; font-size: 18px; color: var(--white); font-weight: 500; }
.feature { flex: 1 1 520px; min-width: 0; display: flex; flex-wrap: wrap; text-decoration: none; color: var(--ink); background: var(--white); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.feature:hover { color: var(--ink); }
.feature .shot { flex: 1 1 260px; aspect-ratio: auto; min-height: 200px; }
.feature-body { flex: 1 1 220px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.feature-body .tag { align-self: flex-start; }
.feature-body .name { font-family: var(--display); font-size: 36px; letter-spacing: 1px; line-height: 1.1; }
.feature-body .go { margin-top: auto; font-weight: 800; }

/* Home: what's new */
.news { margin: 14px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.news a { overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 2px; height: 100%; text-decoration: none; color: var(--ink); background: var(--white); border: 2px solid var(--ink); padding: 12px 14px; }
.news .meta { font-size: 13px; font-weight: 600; color: var(--muted); }
.news .what { font-weight: 800; }

/* Home: catalog */
section.block { padding-top: 48px; }
.catalog-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.controls input, .controls select { font: inherit; font-size: 16px; padding: 10px 12px; min-height: 44px; border: 2px solid var(--ink); background: var(--white); }
.controls input { width: 240px; max-width: 70vw; }
.chips { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-weight: 600; font-size: 15px; min-height: 44px; padding: 8px 16px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.chip .n { opacity: .75; }
.grid { margin: 20px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.grid li { display: flex; }
.grid li[hidden] { display: none; }
.card { flex: 1; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--white); border: 3px solid var(--ink); transition: transform .12s, box-shadow .12s; }
.card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 6px 0 var(--ink); }
.card .shot { border-bottom: 3px solid var(--ink); position: relative; }
.card .shot .tag { position: absolute; top: 8px; left: 8px; }
.card .new { position: absolute; top: 8px; right: 8px; background: var(--ink); color: var(--yellow); font-size: 12px; font-weight: 800; padding: 3px 7px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.card-body .name { font-weight: 800; font-size: 18px; }
.card-body .desc { font-size: 14px; color: #333333; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body .meta { font-size: 13px; color: var(--muted); }
.empty { margin: 20px 0 0; padding: 24px; background: var(--white); border: 2px dashed var(--ink); }
.about-row { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.about-row h2.display { font-size: 30px; }

/* Project page */
.p-hero .wrap { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.p-hero .text { flex: 1 1 420px; min-width: 0; }
.p-hero h1 { font-size: 88px; margin-top: 16px; }
.p-hero .lede { margin: 16px 0 0; max-width: 540px; font-size: 20px; color: var(--white); font-weight: 600; }
.p-hero .cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.p-hero .cta span { color: var(--white); font-weight: 600; font-size: 15px; }
.p-hero .shot { flex: 1 1 420px; min-width: 0; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); aspect-ratio: 16 / 10; }
.p-main { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 48px; }
.p-content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.p-content h2.display { font-size: 40px; }
.p-content p { font-size: 17px; margin: 12px 0 0; }
.p-content ul.features { margin: 12px 0 0; padding-left: 22px; font-size: 17px; }
.keys { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.keys div { display: flex; gap: 12px; align-items: center; background: var(--white); border: 3px solid var(--ink); padding: 10px 12px; }
.keys kbd { font-family: ui-monospace, monospace; font-weight: 700; background: var(--yellow); border: 2px solid var(--ink); padding: 2px 8px; white-space: nowrap; }
.versions { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.versions li { overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; background: var(--white); border: 2px solid var(--ink); padding: 10px 14px; }
.versions .v { font-weight: 800; min-width: 72px; }
.versions .d { font-size: 14px; color: var(--muted); min-width: 90px; }
.shots { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shots .shot { border: 3px solid var(--ink); }
.p-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.download { border-width: 4px; box-shadow: 6px 6px 0 var(--ink); }
.download h2 { font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: 1px; }
.dl-file { margin-top: 14px; display: block; text-align: center; text-decoration: none; background: var(--red); color: var(--ink); font-weight: 800; font-size: 18px; padding: 14px; border: 3px solid var(--ink); overflow-wrap: anywhere; }
.dl-file:hover { color: var(--ink); background: #FF6A42; }
.download dl { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.download dt { font-weight: 800; }
.download dd { margin: 0; }
.download .note { font-size: 14px; color: var(--muted); }
.download .sum { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.thanks { margin-top: 14px; background: var(--paper); border: 3px solid var(--ink); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.thanks[hidden] { display: none; }
.thanks strong { font-size: 16px; }
.thanks form { display: flex; flex-direction: column; gap: 8px; }
.thanks .row { display: flex; flex-wrap: wrap; gap: 8px; }
.thanks input[type=email] { flex: 1 1 160px; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; min-height: 44px; border: 2px solid var(--ink); }
.thanks button { font: inherit; cursor: pointer; min-height: 44px; }
.thanks .sub { font-weight: 800; background: var(--yellow); border: 2px solid var(--ink); padding: 10px 16px; }
.thanks .fine { font-size: 13px; color: var(--muted); }
.thanks .nope { align-self: flex-start; background: none; border: none; text-decoration: underline; padding: 10px 0; font-size: 14px; }
.related { margin: 10px 0 0; padding: 0; list-style: none; }
.related a { display: block; padding: 10px 0; font-weight: 600; }
.related span { font-weight: 400; color: var(--muted); }

/* Plain text pages */
.prose { max-width: 760px; padding-top: 48px; }
.prose h1 { font-size: 56px; }
.prose h2 { font-size: 22px; margin: 32px 0 0; }
.prose p, .prose li { font-size: 17px; }

@media (max-width: 600px) {
  .hero-text h1 { font-size: 48px; }
  .p-hero h1 { font-size: 64px; }
  .btn { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
  .card:hover, .btn:hover { transform: none; }
}
