/* Lab page, on top of the site's style.css (Look A). Tokens come from DESIGN.md. */
:root { --hover:#f7f7f6; --tile:#f3f3f2; --scrim:rgba(20,20,20,.38); --focus:#1a5fb4; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.lab-head { padding: 56px 0 24px; }
.lab-head h1 { font-size: clamp(40px, 6vw, 60px); }
.lab-head .lede { margin-top: 16px; }
.lab-count { margin-top: 14px; font-size: 15px; color: var(--muted); }
.lab-count b { color: var(--ink); font-weight: 600; }

/* filter bar */
.bar { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; gap: 12px; align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #dcdcdc; font-size: 14px; color: var(--body); white-space: nowrap; }
.cat:hover { border-color: var(--ink); }
.cat[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.cat[aria-pressed="true"] .n { color: #bdbdbd; }
.search { position: relative; flex: 0 0 220px; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search input { width: 100%; height: 34px; border: 1px solid #dcdcdc; border-radius: 8px; padding: 0 10px 0 34px; font: inherit; font-size: 14px; }
.search input:focus { border-color: var(--ink); outline: none; }
.sort { height: 34px; border: 1px solid #dcdcdc; border-radius: 8px; padding: 0 8px; font: inherit; font-size: 14px; background: #fff; }

.results { padding: 8px 0 72px; min-height: 40vh; }
.empty { padding: 48px 0; color: var(--muted); font-size: 16px; }
.empty button { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cat-name { color: var(--muted); }
.meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* tile: a build with no picture yet */
.tile { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 14px 16px; background: var(--tile); color: var(--ink); }
.tile svg { color: #8a8a8a; }
.tile .big { font: 700 28px/1 "Inter Tight", Inter, sans-serif; letter-spacing: -.02em; }
.tile .lbl { margin-top: 6px; font-size: 13px; line-height: 1.35; color: #5a5a5a; }
.thumb .tile { padding: 8px 10px; }
.thumb .tile .big { font-size: 17px; }
.thumb .tile .lbl { display: none; }

/* D: feed */
.feed { list-style: none; }
.entry { display: grid; grid-template-columns: 180px minmax(0, 720px); gap: 40px; padding: 44px 0; border-bottom: 1px solid var(--line); }
.entry .when { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; position: sticky; top: 76px; align-self: start; }
.entry .when .cat-name { display: block; margin-top: 6px; }
.entry h2 { font: 600 26px/1.2 "Inter Tight", Inter, sans-serif; letter-spacing: -.01em; }
.entry h2 .anchor { text-decoration: none; }
.entry h2 .anchor:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.entry:target h2 .anchor { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.entry { scroll-margin-top: 72px; }
.entry .h { margin-top: 10px; font-size: 17px; line-height: 1.6; color: var(--body); }
.entry .media { margin-top: 20px; }
.entry .story { margin-top: 16px; font-size: 16px; line-height: 1.7; color: var(--body); }
.entry .kstat { margin-top: 16px; }
.more { margin-top: 8px; font-size: 15px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* the number line under a story */
.kstat { display: flex; align-items: baseline; gap: 10px; }
.kstat b { font: 700 22px/1 "Inter Tight", Inter, sans-serif; }
.kstat span { font-size: 14px; color: var(--muted); }

/* media blocks */
.frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #111; }
.frame > img, .frame > video, .frame > iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.frame.light { background: var(--tile); }
.frame .tile { position: absolute; inset: 0; padding: 22px 24px; }
.frame .tile .big { font-size: 44px; }
.frame .tile .lbl { font-size: 15px; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.optn { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid #dcdcdc; font-size: 13px; color: var(--body); }
.optn:hover { border-color: var(--ink); }
.optn[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--ink); }
.caption { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* compare slider */
.cmp .after { clip-path: inset(0 0 0 var(--x, 50%)); }
.cmp .handle { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); pointer-events: none; }
.cmp .knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.cmp input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; touch-action: pan-y; }
.cmp .tag { position: absolute; top: 10px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(20,20,20,.7); padding: 4px 8px; border-radius: 6px; pointer-events: none; }
.cmp .tag.l { left: 10px; } .cmp .tag.r { right: 10px; }
.cmp:focus-within .handle { background: var(--focus); }

/* audio */
.tracks { list-style: none; border: 1px solid var(--card); border-radius: 12px; overflow: hidden; }
.track { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 14px 16px; align-items: center; }
.track + .track { border-top: 1px solid var(--line); }
.pp { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.pp:hover { background: #333; }
.track .tt { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.track .tt b { font-weight: 600; }
.track .tt span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.track .nn { font-size: 13px; color: var(--muted); }
.wavebox { position: relative; height: 40px; margin-top: 8px; cursor: pointer; }
.wavebox img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: .25; }
.wavebox .done { position: absolute; inset: 0; overflow: hidden; width: var(--p, 0%); }
.wavebox .done img { width: var(--w, 100%); max-width: none; opacity: 1; }

/* play */
.playcover { position: absolute; inset: 0; display: grid; place-items: center; }
.playcover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.6); }
.playbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; }
.playbtn:hover { background: #f1f1f1; }

@media (max-width: 960px) {
  .entry { grid-template-columns: 1fr; gap: 10px; }
  .entry .when { position: static; display: flex; gap: 12px; }
  .entry .when .cat-name { margin: 0; }
}
@media (max-width: 760px) {
  .lab-head { padding: 32px 0 16px; }
  .bar .wrap { flex-wrap: wrap; }
  .search { flex: 1 1 100%; order: -1; }
  .sort { display: none; }
  .entry { padding: 32px 0; }
  .entry h2 { font-size: 22px; }
}

.tile.ico { align-items: center; justify-content: center; }
.numcard { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 12px; background: var(--tile); }
.numcard svg { color: #8a8a8a; flex: 0 0 auto; }
.numcard b { display: block; font: 700 30px/1 "Inter Tight", Inter, sans-serif; letter-spacing: -.02em; }
.numcard span { display: block; margin-top: 6px; font-size: 14px; color: #5a5a5a; }
.entry .story + .kstat { margin-top: 18px; }
@media (max-width: 760px) { .cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg,#000 85%,transparent); mask-image: linear-gradient(90deg,#000 85%,transparent); } .cats::-webkit-scrollbar { display: none; } }

/* home page: the range strip that leads into the Lab */
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.fcard .thumb { border-radius: 12px; }
.fcard .t { font: 600 17px/1.3 "Inter Tight", Inter, sans-serif; }
.fcard:hover .t { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.areas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.area { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid #dcdcdc; border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--body); }
.area:hover { border-color: var(--ink); color: var(--ink); }
.area svg { color: #6a6a6a; }
.area .n { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .feat { grid-template-columns: 1fr; } }
.lab-intro { font-size: 18px; line-height: 1.6; color: var(--body); max-width: 62ch; margin: -6px 0 22px; }
.thumb { display: block; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; background: var(--tile); border: 1px solid var(--card); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.frame.playing { aspect-ratio: auto; height: min(80vh, 600px); }

/* pause for silent loops, Stop for a running game, stories that fold away on phones */
.vbtn { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(20,20,20,.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.stop { margin-left: 14px; min-height: 24px; padding: 2px 0; font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; cursor: pointer; }
.readmore { display: none; }
@media (max-width: 760px) {
  .js .readmore { display: inline-block; margin-top: 10px; min-height: 32px; padding: 4px 0; font: 600 15px/1.4 Inter, sans-serif; color: var(--ink); background: none; border: 0; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; cursor: pointer; }
  .js .entry:not(.open) .more-body { display: none; }
}
