:root {
  --paper: #f4efe4;
  --card: #fffdf8;
  --ink: #17140f;
  --muted: #7a7264;
  --hot: #ff5a1f;
  --gutter: clamp(16px, 4vw, 32px);
  --px: "Pixelify Sans", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 2px; }
.wrap { width: min(1240px, 100% - var(--gutter) * 2); margin-inline: auto; }

/* header */
.bar { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 2px solid var(--ink); }
.bar__in { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 1.5rem var(--px); }
.logo b { color: var(--hot); }
.logo img { image-rendering: pixelated; }
.bar__count { font-weight: 600; color: var(--muted); font-size: .95rem; }

/* tools */
.tools { display: flex; gap: 10px; margin: 28px 0 12px; }
.tools input, .tools select { height: 44px; border: 2px solid var(--ink); background: var(--card); padding: 0 14px; border-radius: 0; }
.tools input { flex: 1; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tag { padding: 5px 12px; border: 2px solid var(--ink); background: transparent; cursor: pointer; font-weight: 600; font-size: .88rem; }
.tag[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card { display: block; text-decoration: none; background: var(--card); border: 2px solid var(--ink); transition: transform .1s, box-shadow .1s; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.card__img { position: relative; aspect-ratio: 16/9; background: #222; border-bottom: 2px solid var(--ink); overflow: hidden; }
.card__img img, .card__img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__img video { opacity: 0; }
.card__img.on video { opacity: 1; }
.card__body { padding: 10px 12px 12px; }
.card__title { margin: 0; font: 700 1.05rem/1.2 var(--sans); }
.card__line { margin: 3px 0 0; color: var(--muted); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card { display: flex; flex-direction: column; }
.card__body { flex: 1; display: flex; flex-direction: column; }
.card__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; font-size: .78rem; font-weight: 600; }
.card__price { font: 700 1.4rem/1 var(--sans); letter-spacing: -.01em; color: var(--hot); white-space: nowrap; }
.card__meta span { padding: 1px 7px; border: 1.5px solid var(--ink); }
.empty { color: var(--muted); padding: 30px 0; }
.more { display: block; margin: 28px auto 0; padding: 10px 26px; border: 2px solid var(--ink); background: var(--card); font-weight: 700; cursor: pointer; }
.more:hover { background: var(--ink); color: var(--paper); }

#home { padding-bottom: 56px; }

/* ---------- mod page (showcase) ---------- */
.mp { --bg: var(--card); --fg: var(--ink); --ac: var(--hot); --ac2: var(--ink); --pn: #fff; background: var(--bg); color: var(--fg); }
.mp h1, .mp h2, .mp h3 { margin: 0; line-height: 1.04; }
.mp__top { padding: 22px 0 0; }
.back { display: inline-flex; gap: 8px; font: 600 1rem var(--px); text-decoration: none; }
.back:hover { color: var(--ac); }
.mp__hero { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: 28px 0 clamp(32px, 4vw, 48px); }
.mp__kicker { margin: 0 0 14px; font: 600 1.05rem var(--px); color: var(--ac); }
.mp__title { font: 700 clamp(2.6rem, 6.5vw, 5rem)/1.02 var(--px); }
.mp__tagline { font-size: clamp(1.1rem, 1.8vw, 1.3rem); font-weight: 500; margin: 16px 0 26px; opacity: .9; }
.mp__buy { border: 2px solid currentColor; background: var(--pn); padding: 18px; display: grid; gap: 14px; box-shadow: 6px 6px 0 var(--ac2); }
.price { font: 700 1.9rem var(--sans); letter-spacing: -.01em; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .btn { flex: 1 1 auto; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border: 2px solid currentColor; background: transparent;
  font-weight: 700; line-height: 1; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 currentColor; transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 currentColor; }
.btn--go { background: var(--ac); color: var(--bg); border-color: var(--fg); box-shadow: 3px 3px 0 var(--fg); }
.mp--dark .btn--go { color: #10161b; }
.btn[aria-disabled="true"] { background: transparent; color: inherit; border-style: dashed; box-shadow: none; opacity: .75; pointer-events: none; }
.spec { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1.5px solid currentColor; padding-top: 12px; font-size: .92rem; }
.spec dt { opacity: .7; font-size: .78rem; }
.spec dd { margin: 0; font-weight: 700; }
.spec div + div { padding-left: 12px; border-left: 1.5px solid currentColor; }
.mp__video { border: 2px solid currentColor; box-shadow: 10px 10px 0 var(--ac2); background: #000; aspect-ratio: 16/9; }
.mp__video video, .mp__video img { width: 100%; height: 100%; object-fit: contain; }

.mp__sec { padding: clamp(40px, 6vw, 68px) 0; border-top: 2px solid currentColor; }
.mp__sec h2 { font: 700 clamp(1.8rem, 3.6vw, 2.5rem) var(--px); margin-bottom: 24px; }
.eyebrow { margin: 0 0 10px; font: 600 1rem var(--px); color: var(--ac); }
.eyebrow::before { content: "■ "; }
.mp__sum { font-size: clamp(1.08rem, 1.7vw, 1.25rem); max-width: 62ch; margin: 0 0 26px; }
.loop { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; counter-reset: l; }
.loop li { position: relative; counter-increment: l; padding: 12px 18px; margin: 0 26px 12px 0; background: var(--pn); border: 2px solid currentColor; font: 600 1.1rem var(--px); }
.loop li::before { content: counter(l, decimal-leading-zero) " "; color: var(--ac); }
.loop li:not(:last-child)::after { content: "→"; position: absolute; right: -20px; top: 50%; transform: translateY(-50%); font: 700 1rem var(--sans); }
.loop li:last-child { background: var(--ac); color: var(--bg); }
.mp--dark .loop li:last-child { color: #10161b; }
.loop li:last-child::before { color: inherit; }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.feats li { background: var(--pn); border: 2px solid currentColor; padding: 20px; }
.feats h3 { font-size: 1.12rem; margin-bottom: 8px; }
.feats h3::before { content: "■ "; color: var(--ac); font-size: .8em; }
.feats p { margin: 0; opacity: .85; font-size: .96rem; }
.gal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.gal button { position: relative; grid-column: span 2; padding: 0; border: 2px solid currentColor; background: #000; aspect-ratio: 16/9; overflow: hidden; cursor: zoom-in; }
.gal button:nth-child(1), .gal button:nth-child(2) { grid-column: span 3; }
.gal img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gal button:hover img { transform: scale(1.04); }
.gal span { position: absolute; inset: auto 0 0; padding: 22px 10px 8px; font-size: .82rem; text-align: left; color: #fff; background: linear-gradient(transparent, #000c); opacity: 0; transition: opacity .2s; }
.gal button:hover span, .gal button:focus-visible span { opacity: 1; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.keys li { display: flex; align-items: center; gap: 14px; }
kbd { min-width: 46px; padding: 6px 12px; text-align: center; font: 600 .95rem var(--px); background: var(--pn); border: 2px solid currentColor; box-shadow: 0 3px 0 currentColor; }
.inst { margin: 0; padding-left: 22px; }
.inst li { margin: 6px 0; }
.mp code { border: 1.5px solid currentColor; padding: 1px 6px; }
.mp__next { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 30px 0 50px; border-top: 2px solid currentColor; }
.mp__next a { text-decoration: none; font: 600 1.15rem var(--px); }
.mp__next a:hover { color: var(--ac); }
.mp__next small { display: block; font: 400 .8rem var(--sans); opacity: .7; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: #0b0a08f2; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 20px; }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; min-width: 0; }
.lightbox img { max-height: 82vh; width: auto; border: 2px solid #fff; }
.lightbox figcaption { color: #eee; font-size: .95rem; text-align: center; }
.lightbox__nav, .lightbox__x { background: #fff; color: #000; border: 0; width: 46px; height: 46px; font-size: 1.6rem; line-height: 1; font-weight: 700; cursor: pointer; }
.lightbox__x { position: absolute; top: 16px; right: 16px; font-size: 1.1rem; }

/* footer */
.foot { border-top: 2px solid var(--ink); padding: 20px 0 28px; font-size: .88rem; color: var(--muted); }
.foot__in { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot__legal { margin-left: auto; }
#contact:empty { display: none; }

@media (max-width: 960px) {
  .mp__hero, .twocol { grid-template-columns: 1fr; }
  .feats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .foot__legal { margin-left: 0; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card__line { display: none; }
  .feats { grid-template-columns: 1fr; }
  .gal { grid-template-columns: 1fr 1fr; }
  .gal button, .gal button:nth-child(2) { grid-column: span 1; }
  .gal button:nth-child(1) { grid-column: span 2; }
  .lightbox { grid-template-columns: 1fr; padding: 60px 8px 8px; }
  .lightbox__nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* shop */
.buy-err { margin: 0; padding: 8px 10px; border: 2px solid #c0392b; background: #fdecea; color: #7a1d14; font-size: .9rem; }
.btn:disabled { opacity: .7; cursor: progress; }
.foot a { color: inherit; font-weight: 600; }

/* thanks / download page + terms */
.thanks { --bg: var(--paper); --fg: var(--ink); --ac: var(--hot); --ac2: var(--ink); --pn: var(--card); max-width: 760px; padding: 48px 0 72px; }
.thanks h1 { font: 700 clamp(2rem, 5vw, 3rem)/1.08 var(--px); margin: 0 0 22px; }
.thanks h2 { font: 700 1.6rem var(--px); margin: 34px 0 12px; }
.thanks p, .thanks li { font-size: 1.05rem; }
.thanks .btn--go { color: var(--ink); }
