/* Home page: the jigsaw gallery (docs/jigsaw-spec.md section 21), layered over style.css */
.intro { padding: 34px 0 20px; }
.intro h1 span { color: var(--gold); }
.lead { max-width: 62ch; margin: 8px 0 0; color: var(--dim); font-size: 17px; }

/* a jigsaw card: an arcade cartridge with the picture on top */
.jcard {
  display: flex; flex-direction: column; min-width: 0; border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text);
  border: 2px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: 0 6px 0 #0b0418;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.jcard:hover, .jcard:focus-visible { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 9px 0 #0b0418, 0 0 34px -10px var(--gold); outline: none; }
.jimg { position: relative; display: block; margin: 8px 8px 0; aspect-ratio: 16 / 10; border-radius: 10px; border: 2px solid #0b0418; overflow: hidden; background: #000; }
.jimg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transition: transform 0.6s ease; }
.jcard:hover .jimg img { transform: scale(1.05); }
.jbody { display: grid; gap: 4px; padding: 11px 13px 14px; }
.jbody b { font: 900 17px/1.2 var(--display); letter-spacing: -0.01em; }
.jbody small { color: var(--dim); font-size: 13px; line-height: 1.4; }
.jbody .credit { display: block; margin-top: 2px; font-size: 11.5px; opacity: 0.8; }
.badge {
  position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 6px;
  font: 400 10.5px var(--pixel); letter-spacing: 0.08em; text-transform: uppercase; background: var(--pink); color: #fff;
}
.badge.gold { background: var(--gold); color: var(--ink); }

/* solved and in-progress levels, added by home.js */
.prog { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.prog i { font: 400 10px var(--pixel); font-style: normal; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 5px; }
.prog .won { background: var(--gold); color: var(--ink); }
.prog .won::before { content: "✓ "; }
.prog .part { background: rgba(255, 225, 77, 0.2); color: var(--text); }
.prog .part::before { content: "◐ "; }

/* featured picture beside today's jigsaw */
.lead-row { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.jcard.spot { border-color: var(--gold); box-shadow: 0 6px 0 #0b0418, 0 0 40px -14px var(--gold); }
.spot .jimg { aspect-ratio: 16 / 9; }
.spot .jbody { gap: 6px; padding: 14px 16px 18px; }
.spot .jbody b { font-size: clamp(22px, 3vw, 30px); }
.spot .jbody small { font-size: 15px; }
.today .jimg { flex: 1; aspect-ratio: auto; min-height: 170px; }
.play {
  justify-self: start; margin-top: 8px; padding: 9px 16px; border-radius: 12px; background: var(--gold); color: var(--ink);
  font: 400 13px var(--pixel); letter-spacing: 0.06em; text-transform: uppercase; box-shadow: 0 4px 0 #b08e06;
}
.play.blue { background: var(--blue); box-shadow: 0 4px 0 #1386a3; }

/* category bar: pinned under the header while scrolling */
.cats {
  position: sticky; top: var(--top-h, 68px); z-index: 5; display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 8px;
  margin: 26px calc(-1 * clamp(16px, 4vw, 40px)) 0; padding: 12px clamp(16px, 4vw, 40px);
  overflow-x: auto; scrollbar-width: none;
  --band: color-mix(in srgb, var(--bg) 92%, transparent);
  background: var(--band); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); /* the band runs the full width of the screen */
}
.cats::-webkit-scrollbar { display: none; }
.cats a {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; text-decoration: none;
  font: 700 14px var(--display); color: var(--text); background: var(--panel-2); border: 2px solid var(--line); border-radius: 999px; box-shadow: 0 3px 0 #0b0418;
}
.cats a i { font: 400 11px var(--pixel); font-style: normal; color: var(--gold); }
.cats a:hover, .cats a:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; }
.cats a:active { transform: translateY(2px); box-shadow: 0 1px 0 #0b0418; }

.jcat { padding-top: 26px; }
.jcat h2 { font: 400 15px var(--pixel); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }
.jcat h2 span { color: var(--dim); }
.blurb { margin: 4px 0 14px; color: var(--dim); font-size: 14.5px; }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.jgrid.small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.jgrid.small .jbody b { font-size: 15px; }
.home .more { padding: 44px 0 40px; }

@media (max-width: 860px) {
  .lead-row { grid-template-columns: 1fr; }
  .today { flex-direction: row; }
  .today .jimg { flex: 0 0 42%; min-height: 0; margin: 8px 0 8px 8px; aspect-ratio: 16 / 10; }
  .today .jbody { align-content: center; }
}
@media (max-width: 560px) {
  .intro { padding: 22px 0 16px; }
  .lead { font-size: 15px; }
  .home nav a.nav-cta { padding: 7px 10px; font-size: 11.5px; }
  .jgrid, .jgrid.small { grid-template-columns: 1fr 1fr; gap: 10px; }
  .jbody { padding: 9px 10px 12px; }
  .jbody b { font-size: 14.5px; }
  .jbody small { font-size: 12px; }
  .jgrid.small .jbody small { display: none; }
  .cats { margin-top: 18px; padding-top: 10px; padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .jcard, .jimg img { transition: none; }
  .jcard:hover { transform: none; }
  .jcard:hover .jimg img { transform: none; }
}
