/* What People Made: shared styles for the gallery and the detail pages. */
:root {
  color-scheme: light;
  --paper: oklch(100% 0 0);
  --paper-2: oklch(96.8% 0.003 90);
  --paper-3: oklch(93.5% 0.004 90);
  --ink: oklch(19% 0.006 70);
  --ink-2: oklch(42% 0.007 70);
  --ink-3: oklch(52% 0.006 70);
  --rule: oklch(91.5% 0.004 85);
  --accent: oklch(58% 0.19 36);
  /* one colour per topic (build_site.py TOPICS) */
  --games: oklch(52% 0.17 295);
  --art: oklch(56% 0.18 352);
  --apps: oklch(52% 0.15 258);
  --life: oklch(60% 0.14 68);
  --learning: oklch(54% 0.12 200);
  --gadgets: oklch(55% 0.15 38);
  --science: oklch(50% 0.12 158);
  --work: oklch(50% 0.09 105);
  --stage: var(--paper-2);  /* the Featured band */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --radius: .7rem;
}

@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease-out); }

html { font-size: clamp(16px, 1.15vw, 24px); }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: .25rem; }
.label {
  margin: 0;
  font-size: .8rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Shell + sidebar ---------- */
.shell { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 1.7rem;
  padding: 1.9rem 1.2rem 1.4rem 1.7rem;
  border-right: 1px solid var(--rule);
}
.mast { margin: 0; line-height: 0; }
.mast a { display: inline-block; border-radius: .3rem; }
.mast img { display: block; width: auto; height: 2.6rem; }  /* the enso, assets/logo.svg */

.nav { display: grid; gap: .05rem; }
.nav-group { display: grid; gap: .05rem; margin-top: 1.2rem; }
.nav-label { margin: 0 0 .3rem; font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.nav-item {
  display: grid; grid-template-columns: 1rem 1fr auto; align-items: center; gap: .6rem;
  margin-left: -.55rem; padding: .4rem .55rem;
  border-radius: .45rem; text-decoration: none; font-size: .97rem;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.nav-item:hover { background: var(--paper-2); }
.nav-item .dot { justify-self: center; width: .6rem; height: .6rem; border-radius: 50%; background: var(--c, var(--ink)); }
.nav-item .ico { width: 1.05rem; height: 1.05rem; color: var(--ink-2); }
.nav-item .count { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav-item[aria-current="true"] { background: var(--ink); color: var(--paper); }
.nav-item[aria-current="true"] .ico { color: var(--paper); }
.nav-item[aria-current="true"] .count { color: color-mix(in oklch, var(--paper) 62%, var(--ink)); }
.nav-item[aria-current="true"] .dot { box-shadow: 0 0 0 2px var(--paper); }
.side-foot { margin-top: auto; display: grid; gap: 1rem; font-size: .85rem; line-height: 1.5; color: var(--ink-3); }
.side-links { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.side-links a { text-decoration: none; }
.side-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .18em; }

.subscribe { display: grid; gap: .45rem; margin: 0; }
.side .subscribe { padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.subscribe-title {
  margin: 0; font-family: var(--serif); font-size: 1.1rem; font-weight: 520; line-height: 1.15; letter-spacing: -.01em;
  color: var(--ink); font-variation-settings: "opsz" 72, "SOFT" 30;
}
.subscribe-line { margin: 0 0 .35rem; font-size: .85rem; line-height: 1.45; color: var(--ink-2); text-wrap: balance; }
.subscribe > span { display: grid; gap: .4rem; }  /* field over button, so a whole address fits */
.subscribe input {
  min-width: 0; height: 2.4rem; padding: 0 .75rem; border: 1px solid color-mix(in oklch, var(--ink) 18%, transparent);
  border-radius: .5rem; background: var(--paper); font: inherit; font-size: .85rem; color: var(--ink);
  transition: border-color .2s var(--ease-out);
}
.subscribe input:hover { border-color: color-mix(in oklch, var(--ink) 36%, transparent); }
.subscribe input:focus { outline: none; border-color: var(--ink); }
.subscribe input:is(:autofill, :-webkit-autofill) { box-shadow: 0 0 0 2rem var(--paper) inset; -webkit-text-fill-color: var(--ink); }  /* no blue fill */
.subscribe input::placeholder { color: var(--ink-3); }
.subscribe button {
  height: 2.4rem; padding: 0 .75rem; border: 0; border-radius: .5rem; cursor: pointer;
  background: var(--ink); color: var(--paper); font: inherit; font-size: .9rem; font-weight: 600;
  transition: background-color .2s var(--ease-out);
}
.subscribe button:hover { background: color-mix(in oklch, var(--ink) 82%, var(--paper)); }
.foot { display: none; }

.sponsor {
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .15rem .7rem; align-items: center;
  padding: .8rem .9rem; border: 1px solid var(--rule); border-radius: var(--radius);
  text-decoration: none; color: var(--ink-2);
}
.sponsor img { grid-row: span 2; width: 2.2rem; height: 2.2rem; border-radius: .5rem; object-fit: cover; }
.sponsor > span { grid-column: 2; min-width: 0; }
.sponsor.nologo { grid-template-columns: minmax(0, 1fr); }
.sponsor.nologo > span { grid-column: 1; }
.sponsor b { color: var(--ink); font-weight: 650; }
.sponsor .tag { margin-left: .45rem; font-size: .7rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.sponsor:hover { border-color: var(--ink-3); }

.main { min-width: 0; container-type: inline-size; }

/* ---------- Front-page opener ---------- */
/* The headline runs across the width in two lines. After "things" sits a Featured picture, after "people" the
   faces of whoever made the first Featured picks (build_site.py thing_html, faces_html), each kept on the
   line with its word (.nb) so neither starts a line on its own. Sized by the width, but never taller than a
   fifth of the screen, so Featured still fits in the first screen on wide, short windows. To its right, on
   the last line's baseline, the dateline (build_site.py dateline_html). */
.intro {
  display: flex; align-items: last baseline; justify-content: space-between; gap: .6rem 2rem;
  padding: 1.7rem clamp(1rem, 2.6vw, 2.6rem) 0;
}
.intro-title {
  margin: 0; min-width: 0;
  font-family: var(--serif); font-weight: 440; font-size: clamp(2.3rem, min(7cqi, 10vh), 6.6rem); line-height: 1; letter-spacing: -.03em;
  font-variation-settings: "opsz" 144, "SOFT" 30; text-wrap: balance;
}
.intro-title em { font-weight: 480; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; letter-spacing: -.02em; }
.intro .nb { white-space: nowrap; }
.dateline { flex: none; display: grid; justify-items: end; gap: .2rem; margin: 0; text-align: right; }
.dateline a {
  text-decoration: none; font-family: var(--serif); font-size: 1.45rem; font-weight: 460; line-height: 1.1;
  letter-spacing: -.01em; font-variation-settings: "opsz" 72, "SOFT" 30;
}
.dateline a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; }
.thing, .faces { display: inline-flex; vertical-align: .02em; }
.thing {
  width: 1.6em; height: .74em; overflow: hidden; border-radius: 999px; background: var(--paper-2);
  outline: 1px solid color-mix(in oklch, var(--ink) 8%, transparent); outline-offset: -1px;
}
.thing img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.thing:hover img { transform: scale(1.08); }
.faces a { display: block; transition: transform .3s var(--ease-out); }
.faces a + a { margin-left: -.2em; }
.faces a:hover { transform: translateY(-.06em); }
.faces img {
  display: block; width: .74em; height: .74em; border-radius: 50%; object-fit: cover;
  background: var(--paper-3); box-shadow: 0 0 0 .05em var(--paper);
}

/* ---------- Featured: cinema ---------- */
/* One pick at a time on a light band: the picture or video loop sits sharp on the right, and to its left the
   band is a blurred, washed-out copy of the same picture, so a wide screen shows its colours instead of an
   empty stretch. The sharp picture dissolves into that wash across its left half and up from its foot. The
   mask sits on the wash (an image), never on the video: Safari ignores a mask on a playing video.
   Height-bounded (--h) so the topic rows still show in the first screen. Thumbnails of all the picks run
   along the foot; the current one's bar is the clock. */
.cine {
  --fg: var(--ink); --fg-2: var(--ink-2); --fg-rule: color-mix(in oklab, var(--ink) 16%, transparent);
  --h: clamp(24rem, 56vh, 34rem);
  position: relative; display: grid; min-height: var(--h); margin-top: 1.5rem; overflow: hidden; isolation: isolate;
  background: var(--stage); color: var(--fg);
}
.cine-slide {
  grid-area: 1 / 1; position: relative; display: grid; align-content: center; min-height: 0;
  padding: 2.2rem clamp(1rem, 2.6vw, 2.6rem) 6rem;
  opacity: 0; visibility: hidden; transition: opacity 1s var(--ease-out), visibility 0s 1s;
}
.cine-slide.on { z-index: 1; opacity: 1; visibility: visible; transition: opacity 1s var(--ease-out); }
.cine-media { --pw: min(64%, calc(var(--h) * 2)); position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.cine-media.fit { --pw: min(64%, calc(var(--h) * var(--ar))); }  /* a tall picture gets a box its own shape, so the fade meets its edge */
.cine-frame { position: absolute; top: 0; right: 0; bottom: 0; width: var(--pw); overflow: hidden; }
.cine-frame .pic, .cine-frame .clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cine-frame .clip { opacity: 0; transition: opacity .6s var(--ease-out); }
.cine-frame .clip.ready { opacity: 1; }
.wash {
  position: absolute; inset: 0; pointer-events: none;
  --m: linear-gradient(to left, transparent calc(var(--pw) * .45), rgb(0 0 0 / .12) calc(var(--pw) * .56),
         rgb(0 0 0 / .45) calc(var(--pw) * .7), rgb(0 0 0 / .82) calc(var(--pw) * .86), #000 var(--pw)),
       linear-gradient(to top, #000, rgb(0 0 0 / .5) 14%, transparent 32%);
  -webkit-mask-image: var(--m); mask-image: var(--m);
}
.wash img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(2.5rem) saturate(1.4); transform: scale(1.25);
}
.wash::after { content: ""; position: absolute; inset: 0; background: color-mix(in oklab, var(--stage) 78%, transparent); }
.cine-text { display: grid; justify-items: start; gap: .8rem; max-width: 32rem; min-width: 0; }
.cine-label { margin: 0; font-size: .9rem; font-weight: 600; color: var(--c); }
.cine-title {
  margin: 0; font-family: var(--serif); font-weight: 460; font-size: 2.45rem; line-height: 1.04; letter-spacing: -.022em;
  font-variation-settings: "opsz" 144, "SOFT" 30; text-wrap: balance;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.cine-title a { text-decoration: none; }
.cine-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
.cine-desc {
  margin: 0; max-width: 44ch; font-size: 1.02rem; line-height: 1.5; color: var(--fg-2); text-wrap: pretty;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.slide-by { margin: 0; display: flex; align-items: center; gap: .55rem; min-width: 0; font-size: .85rem; color: var(--fg-2); }
.slide-by img { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; object-fit: cover; background: var(--fg-rule); }
.slide-by > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-by > span span { opacity: .7; }
.slide-go {
  margin-top: .35rem; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.05rem;
  border-radius: 999px; background: var(--fg); color: var(--paper);
  font-size: .9rem; font-weight: 650; text-decoration: none;
  transition: gap .3s var(--ease-out);
}
.slide-go:hover { gap: .7rem; }
.cine-nav {
  position: absolute; right: clamp(1rem, 2.6vw, 2.6rem); bottom: 1.3rem; z-index: 3;
  display: flex; gap: .55rem; max-width: calc(100% - 2 * clamp(1rem, 2.6vw, 2.6rem));
}
.cine-nav button {
  flex: 0 1 5.6rem; min-width: 0; display: grid; gap: .45rem; padding: 0; border: 0; background: none; cursor: pointer;
  opacity: .5; transition: opacity .3s var(--ease-out);
}
.cine-nav button:hover, .cine-nav button[aria-current="true"] { opacity: 1; }
.cine-nav img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: .35rem;
  outline: 1px solid var(--fg-rule); outline-offset: -1px; transition: outline-color .3s var(--ease-out);
}
.cine-nav button[aria-current="true"] img { outline: 2px solid var(--fg); outline-offset: -2px; }
.cine-nav .cine-bar { position: relative; display: block; height: .2rem; overflow: hidden; border-radius: 999px; background: var(--fg-rule); }
.cine-nav .cine-bar::after { content: ""; position: absolute; inset: 0; background: var(--fg); transform: scaleX(0); transform-origin: left; }
.cine-nav button[aria-current="true"] .cine-bar::after { transform: none; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drift { from { transform: scale(1.06); } to { transform: scale(1); } }
@container (max-width: 52rem) {
  .cine { height: auto; }
  .cine-slide { align-content: start; padding: 0 1rem 3.4rem; }
  .cine-media { position: relative; inset: auto; z-index: 0; aspect-ratio: 16 / 9; margin: 0 -1rem 1.1rem; }
  .cine-frame { width: 100%; }
  .wash { --m: linear-gradient(to top, #000, transparent 35%); }  /* text sits below the picture here: a plain fade into the band */
  .wash img { display: none; }
  .wash::after { background: var(--stage); }
  .cine-title { font-size: 1.65rem; }
  .cine-nav { left: 1rem; right: 1rem; bottom: 1.2rem; max-width: none; gap: .3rem; }
  .cine-nav button { flex: 1; opacity: 1; }
  .cine-nav img { display: none; }
}

/* ---------- Topic rows (the front page's overview) ---------- */
.shelves { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.8rem; padding: .3rem clamp(1rem, 2.6vw, 2.6rem) 3.5rem; }
.shelf-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; margin-bottom: 1rem; }
.shelf-head :is(h2, h3) {
  margin: 0; font-family: var(--serif); font-weight: 480; font-size: 1.65rem; line-height: 1.1; letter-spacing: -.015em;
  font-variation-settings: "opsz" 144, "SOFT" 20;
}
.shelf-head :is(h2, h3) a { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.shelf-head :is(h2, h3) a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; }
.shelf-head .dot { flex: none; width: .62rem; height: .62rem; border-radius: 50%; background: var(--c); }
.shelf-all {
  display: inline-flex; gap: .4rem; padding: .4rem .9rem;
  border: 1px solid var(--rule); border-radius: 999px; white-space: nowrap;
  font-size: .9rem; font-weight: 650; text-decoration: none; color: var(--ink);
  transition: border-color .2s var(--ease-out), gap .3s var(--ease-out);
}
.shelf-all:hover { border-color: var(--c); gap: .6rem; }
.shelf-row { --per: 4; display: grid; grid-template-columns: repeat(var(--per), minmax(0, 1fr)); gap: clamp(1rem, 1.6vw, 1.6rem); }
.shelf-row > .tile { margin: 0; align-content: start; }
.shelf-row > .tile:nth-child(n + 5) { display: none; }
.shelf .tile-media { aspect-ratio: 4 / 3; }
.shelf .tile-media > img:first-child { height: 100%; max-height: none; object-fit: cover; }
.shelf .cover { min-height: 0; padding: 1.1rem 1.1rem 2.8rem; }
.shelf .cover blockquote {
  font-size: 1.15rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden;
}
.shelf .tile figcaption a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 1.02rem; }
.shelf .tile-meta .cat { display: none; }
@container (min-width: 92rem) {
  .shelf-row { --per: 5; }
  .shelf-row > .tile:nth-child(5) { display: grid; }
}

/* A day's page (site/day/<date>.html): the date, the days either side, then its picks. */
.day-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .8rem 1.5rem;
  padding: 2.1rem clamp(1rem, 2.6vw, 2.6rem) 1.6rem;
}
.day-title {
  margin: 0; font-family: var(--serif); font-weight: 460; font-size: 2.45rem; line-height: 1.04; letter-spacing: -.022em;
  font-variation-settings: "opsz" 144, "SOFT" 20;
}
.day-nav { display: flex; gap: .6rem; }
.day-nav a {
  display: inline-flex; gap: .4rem; padding: .4rem .9rem; border: 1px solid var(--rule); border-radius: 999px;
  white-space: nowrap; font-size: .9rem; font-weight: 650; text-decoration: none; color: var(--ink);
  transition: border-color .2s var(--ease-out);
}
.day-nav a:hover { border-color: var(--ink-3); }

/* The front page shows the overview; a topic, search or filter (html.browsing, set by site.js and before
   first paint by head_html) swaps it for the full gallery. */
.browsing .intro, .browsing .cine, .browsing .shelves { display: none; }
.js:not(.browsing) .browse, .js:not(.browsing) .sort { display: none; }
.more-bar { display: flex; align-items: center; gap: 1rem; padding: 0 clamp(1rem, 2.6vw, 2.6rem) 3.5rem; }
.more-count { font-size: .9rem; color: var(--ink-3); }

/* ---------- Gallery header ---------- */
.bar {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: end; gap: 1rem 2rem;
  padding: 1.9rem clamp(1rem, 2.6vw, 2.6rem) 1.5rem;
}
.section-title {
  margin: 0;
  font-family: var(--serif); font-weight: 480; font-size: 2.1rem; line-height: 1.05; letter-spacing: -.018em;
  font-variation-settings: "opsz" 144, "SOFT" 20;
}
.section-sub { margin: .4rem 0 0; color: var(--ink-2); }
.section-sub:empty { display: none; }
.section-sub .clear {
  appearance: none; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 650; color: var(--ink); text-decoration: underline; text-underline-offset: .18em;
}
.tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.search {
  display: flex; align-items: center; gap: .5rem;
  width: min(15rem, 100%); padding: .45rem .55rem .45rem .8rem;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper);
  transition: border-color .2s var(--ease-out);
}
.search:focus-within { border-color: var(--ink-3); }
.search svg { width: 1rem; height: 1rem; flex: none; color: var(--ink-3); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font: inherit; font-size: .95rem; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  font: inherit; font-size: .8rem; color: var(--ink-3);
  padding: 0 .4rem; border: 1px solid var(--rule); border-radius: .3rem;
}
.sort { display: inline-flex; padding: .2rem; border-radius: 999px; background: var(--paper-2); }
.sort button {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .9rem; color: var(--ink-2);
  padding: .32rem .85rem; border-radius: 999px; white-space: nowrap;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.sort button[aria-checked="true"] { background: var(--paper); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px oklch(20% 0.02 60 / .12); }
.btn.surprise { padding-block: .42rem; white-space: nowrap; }

.facets {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  padding: 0 clamp(1rem, 2.6vw, 2.6rem) 1.5rem;
}
.facets-label { flex: none; margin-right: .35rem; white-space: nowrap; font-size: .85rem; font-weight: 600; color: var(--ink-3); }
.chip {
  appearance: none; cursor: pointer; white-space: nowrap;
  padding: .3rem .8rem; border: 1px solid var(--rule); border-radius: 999px; background: transparent;
  font: inherit; font-size: .85rem; color: var(--ink-2);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out), background-color .2s var(--ease-out), opacity .2s var(--ease-out);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip .n { margin-left: .4rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] .n { color: color-mix(in oklch, var(--paper) 62%, var(--ink)); }
.chip.none:not([aria-pressed="true"]) { opacity: .4; }

/* ---------- Gallery grid ---------- */
/* Without JS the grid is CSS columns. site.js rebuilds it as ordered columns (.masonry) so
   "Latest" and "Most saved" read left to right, not down each column. */
.grid {
  --col-min: 15.5rem; --cols-max: 4; --gap: clamp(1rem, 1.6vw, 1.6rem);
  columns: var(--cols-max) var(--col-min); column-gap: var(--gap);
  padding: 0 clamp(1rem, 2.6vw, 2.6rem) 3rem;
}
.js .grid:not(.masonry) { visibility: hidden; }
.grid.masonry {
  columns: auto; display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr));
  gap: var(--gap); align-items: start;
}
.col { display: grid; gap: 1.7rem; align-content: start; min-width: 0; }
.tile { break-inside: avoid; margin: 0 0 1.7rem; display: grid; gap: .6rem; }
.masonry .tile { margin: 0; }
.tile-media {
  position: relative; display: block; overflow: hidden; text-decoration: none;
  border-radius: var(--radius); background: var(--paper-2);
  outline: 1px solid color-mix(in oklch, var(--ink) 7%, transparent); outline-offset: -1px;
}
.tile-media > img:first-child {
  display: block; width: 100%; height: auto; max-height: 30rem; object-fit: cover;
  transition: transform .9s var(--ease-out);
}
.tile-media:hover > img:first-child { transform: scale(1.03); }
.badge {
  position: absolute; top: .6rem; right: .6rem;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem .2rem .45rem; border-radius: 999px;
  background: oklch(18% 0.015 60 / .78); color: oklch(97% 0.01 85);
  font-size: .8rem; font-weight: 650; font-variant-numeric: tabular-nums;
}
.badge svg { width: .6rem; height: .6rem; }
.tile-avatar {
  position: absolute; left: .6rem; bottom: .6rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px oklch(98% 0.01 85 / .9);
  background: var(--paper-3);
  transition: opacity .25s var(--ease-out);
}
.tile-desc {
  position: absolute; inset: auto 0 0; margin: 0; padding: 2.4rem .9rem .9rem;
  font-size: .85rem; line-height: 1.4; color: oklch(97% 0.01 85);
  background: linear-gradient(transparent, oklch(15% 0.015 60 / .88));
  opacity: 0; transform: translateY(.4rem); pointer-events: none;
  transition: opacity .25s var(--ease-out), transform .4s var(--ease-out);
}
.tile-desc > span:first-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.tile-saves { display: block; margin-top: .5rem; font-size: .75rem; font-weight: 650; letter-spacing: .02em; opacity: .85; }
@media (hover: hover) {
  .tile:hover .tile-desc, .tile:focus-within .tile-desc { opacity: 1; transform: none; }
  .tile:hover .tile-avatar, .tile:focus-within .tile-avatar { opacity: 0; }
}
.cover {
  display: grid; align-content: center;
  min-height: 15rem; padding: 1.5rem 1.3rem 3.2rem;
  background: color-mix(in oklab, var(--c) 13%, var(--paper));
  color: color-mix(in oklab, var(--c) 55%, var(--ink));
}
.cover blockquote {
  margin: 0;
  font-family: var(--serif); font-size: 1.35rem; line-height: 1.22; font-weight: 450;
  font-variation-settings: "opsz" 96, "SOFT" 60;
  text-wrap: pretty;
}
.cover blockquote::before { content: "“"; }
.cover blockquote::after { content: "”"; }
.tile figcaption { display: grid; gap: .2rem; padding: 0 .1rem; }
.tile figcaption a {
  font-size: 1.1rem; line-height: 1.32; font-weight: 520; text-decoration: none; text-wrap: pretty;
}
.tile figcaption a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .16em; }
.tile-meta { font-size: .8rem; color: var(--ink-3); display: flex; gap: .4rem; flex-wrap: wrap; }
.tile-meta .cat { color: var(--c); font-weight: 650; }
.grid[data-scope]:not([data-scope="all"]) .tile-meta .cat { display: none; }
/* Likes, reposts and saves of the post, for a feel of its reach. */
.counts { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.counts > span { display: inline-flex; align-items: center; gap: .25rem; }
.counts svg { width: .95em; height: .95em; flex: none; }
.cine-counts { font-size: .85rem; color: var(--fg-2); }

.empty { padding: 2rem clamp(1rem, 2.6vw, 2.6rem) 4rem; max-width: 36rem; }
.empty p { margin: 0 0 1rem; font-family: var(--serif); font-size: 1.5rem; line-height: 1.25; color: var(--ink-2); }
.prose { padding: 2.2rem clamp(1rem, 2.6vw, 2.6rem) 4rem; max-width: 42rem; }  /* privacy.html */
.prose h1 {
  margin: 0; font-family: var(--serif); font-weight: 480; font-size: 2.2rem; line-height: 1.1; letter-spacing: -.015em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.prose h2 {
  margin: 2.2rem 0 .5rem; font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.2;
  font-variation-settings: "opsz" 72, "SOFT" 30;
}
.prose p { margin: 0 0 .8rem; color: var(--ink-2); }
.prose a { color: var(--ink); text-underline-offset: .18em; }
.prose .updated { margin: .6rem 0 0; font-size: .85rem; color: var(--ink-3); }
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  appearance: none; cursor: pointer; text-decoration: none;
  padding: .55rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper);
  font: inherit; font-size: .95rem; font-weight: 650; color: var(--ink);
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in oklch, var(--ink) 85%, var(--paper)); }
.btn svg { width: .95rem; height: .95rem; }

/* ---------- Detail page ---------- */
.split { display: grid; grid-template-columns: minmax(19rem, 25rem) minmax(0, 1fr); min-height: 100vh; }
.info {
  display: flex; flex-direction: column; gap: 1.3rem;
  padding: 1.9rem clamp(1rem, 2.2vw, 2.2rem) 2.5rem;
  border-right: 1px solid var(--rule);
}
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .85rem; color: var(--ink-3); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.kicker { margin: 0; font-size: .9rem; font-weight: 600; color: var(--c); }
.kicker-tags { color: var(--ink-3); }
.kicker-tags a { text-decoration: none; }
.kicker-tags a:hover { text-decoration: underline; text-underline-offset: .2em; }
.title {
  margin: -.6rem 0 0;
  font-family: var(--serif); font-weight: 480; font-size: 2rem; line-height: 1.1; letter-spacing: -.015em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  text-wrap: balance;
}
.desc { margin: 0; font-size: 1.05rem; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  border: 1px solid var(--rule); border-radius: var(--radius);
}
.stats > div { display: grid; gap: .05rem; padding: .6rem .85rem; min-width: 0; }
.stats > div + div { border-left: 1px solid var(--rule); }
.stats b {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.15; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.stats span { font-size: .8rem; color: var(--ink-3); }
.facts { margin: 0; display: grid; border-top: 1px solid var(--rule); }
.facts > div {
  display: grid; grid-template-columns: 6.2rem 1fr; gap: 1rem; align-items: baseline;
  padding: .55rem 0; border-bottom: 1px solid var(--rule); font-size: .95rem;
}
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.facts dd a { text-decoration: none; }
.facts dd a:hover { text-decoration: underline; text-underline-offset: .18em; }

.post { display: grid; gap: .65rem; padding: 1rem 1.1rem 1.05rem; border-radius: var(--radius); background: var(--paper-2); }
.post-head { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) auto; align-items: center; gap: .65rem; }
.avatar { display: block; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--rule); object-fit: cover; }
.who { min-width: 0; text-decoration: none; line-height: 1.25; }
.who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: .95rem; }
.who span { color: var(--ink-3); font-size: .85rem; }
.who:hover b { text-decoration: underline; text-underline-offset: .15em; }
.xlogo { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: .35rem; color: var(--ink); }
.xlogo:hover { background: var(--paper-3); }
.xlogo svg { width: .95rem; height: .95rem; }
.post-text { margin: 0; overflow-wrap: anywhere; }
.post-text a { text-decoration-color: color-mix(in oklch, var(--ink) 30%, transparent); text-underline-offset: .16em; }
.post-foot { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; color: var(--ink-3); }
.post-foot a { text-decoration: none; }
.post-foot a:hover { color: var(--ink); }
.post-foot .view { margin-left: auto; font-weight: 650; color: var(--ink-2); }
.post-foot .view::after { content: " ↗"; }

.pager {
  margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 1.2rem 1rem;
  padding-top: 1rem; font-size: .9rem;
}
.pager a { display: grid; gap: .1rem; text-decoration: none; color: var(--ink-2); }
.pager a span { font-size: .8rem; color: var(--ink-3); }
.pager a:hover { color: var(--ink); }
.pager a[rel="prev"] { grid-row: 1; grid-column: 1; }
.pager a[rel="next"] { grid-row: 1; grid-column: 2; text-align: right; }
.pager .random {
  grid-row: 2; grid-column: 1 / -1; justify-self: start; padding: .35rem .8rem;
  border: 1px solid var(--rule); border-radius: 999px; font-size: .85rem; font-weight: 650;
  transition: border-color .2s var(--ease-out);
}
.pager .random:hover { border-color: var(--ink-3); }

.stage {
  position: sticky; top: 0; height: 100vh;
  display: grid; place-items: center; overflow-y: auto;
  padding: clamp(1rem, 3vw, 3rem);
  background: var(--paper-2);
}
.stage-inner { position: relative; width: min(100%, 60rem); display: grid; gap: 1rem; }
.stage-media { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--paper-3); }
.stage-media img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; background: var(--paper-3); }
.stage-gallery { display: grid; gap: 1rem; }
.play {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: .6rem;
  border: 0; cursor: pointer; background: linear-gradient(transparent 40%, oklch(15% 0.01 60 / .55));
  color: oklch(98% 0.01 85); font: inherit;
}
.play .ring {
  display: grid; place-items: center; width: 4.2rem; height: 4.2rem; border-radius: 50%;
  background: oklch(98% 0.01 85 / .92); color: oklch(20% 0.02 60);
  transition: transform .3s var(--ease-out);
}
.play:hover .ring { transform: scale(1.06); }
.play .ring svg { width: 1.3rem; height: 1.3rem; margin-left: .2rem; }
.stage-note { margin: 0; font-size: .8rem; color: var(--ink-3); text-align: center; }
.stage-embed { width: min(100%, 34rem); margin: 0 auto; }
.stage-embed.behind { position: absolute; inset: 0 0 auto; opacity: 0; }  /* drawn ahead, until play (site.js); X sets its frame visible, so not visibility */
.stage-inner:has(> .stage-embed.behind) { overflow: clip; }  /* so it adds no scrolling meanwhile */
.play.waiting .ring { animation: wait .8s ease-in-out infinite alternate; }  /* pressed before X was ready */
@keyframes wait { to { opacity: .55; } }
.stage .cover {
  min-height: 24rem; padding: 2.5rem; border-radius: var(--radius);
  background: color-mix(in oklab, var(--c) 13%, var(--paper));
}
.stage .cover blockquote { font-size: 2rem; }

.more { padding: 2.4rem clamp(1rem, 2.6vw, 2.6rem) 3rem; border-top: 1px solid var(--rule); }
.more-title { margin: 0 0 1.3rem; font-family: var(--serif); font-weight: 480; font-size: 1.5rem; }
.more .grid { --col-min: 13rem; padding: 0; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .tile { animation: rise .8s var(--ease-out) both; animation-delay: min(calc(var(--i, 0) * 35ms), 600ms); }
  .grid.relayout .tile { animation: none; }
  @keyframes rise { from { opacity: 0; transform: translateY(.8rem); } }
  /* Featured: the segment fill is the clock (its animationend steps the slide), so with reduced motion
     nothing moves by itself; hover, focus or a hidden tab pause it. */
  .cine.playing .cine-nav [aria-current="true"] .cine-bar::after { animation: fill var(--dwell, 7s) linear both; }
  .cine.paused .cine-nav .cine-bar::after, .cine.paused .pic { animation-play-state: paused; }
  .cine-slide.on .pic { animation: drift calc(var(--dwell, 7s) + 2s) linear both; }
  .cine-slide.on .cine-text > * { animation: rise .8s var(--ease-out) both; }
  .cine.moved .cine-slide.on .cine-text > * { animation-delay: .25s; }
  .cine.moved .cine-slide.on .cine-text > :nth-child(2) { animation-delay: .31s; }
  .cine.moved .cine-slide.on .cine-text > :nth-child(3) { animation-delay: .37s; }
  .cine.moved .cine-slide.on .cine-text > :nth-child(n + 4) { animation-delay: .43s; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .cine-slide, .cine-slide.on { transition: none; }
}

/* ---------- Narrow screens ---------- */
@container (max-width: 62rem) {
  .bar { grid-template-columns: minmax(0, 1fr); }
  .tools { justify-content: flex-start; }
  .search { flex: 1; width: auto; min-width: 12rem; }
}
@media (max-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .info { border-right: 0; order: 2; }
  .stage { position: static; height: auto; order: 1; padding: 1rem; }
}
@media (max-width: 56rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static; height: auto; overflow: visible;
    gap: 1rem; padding: 1.3rem 1rem 1rem;
    border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .mast img { height: 2.2rem; }
  .subscribe input { font-size: 1rem; }  /* under 16px, iPhones zoom in on focus */
  .nav { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: none; }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .nav-item {
    margin: 0; padding: .35rem .8rem; white-space: nowrap;
    grid-template-columns: auto auto auto; gap: .45rem;
    border: 1px solid var(--rule); border-radius: 999px;
  }
  .nav-item .dot { width: .5rem; height: .5rem; }
  .nav-item .ico { width: .95rem; height: .95rem; }
  .side-foot { display: none; }
  .foot {
    display: grid; gap: 1rem; margin: 0 1rem; padding: 1.4rem 0 2.2rem;
    border-top: 1px solid var(--rule); font-size: .9rem; line-height: 1.5; color: var(--ink-3);
  }
  .bar { padding: 1.3rem 1rem 1rem; }
  .intro { flex-direction: column-reverse; align-items: start; padding: 1.4rem 1rem 0; }
  .dateline { display: flex; align-items: baseline; gap: .6rem; }
  .dateline a { font-size: 1.05rem; }
  .shelves { gap: 2.2rem; padding: .2rem 0 2.5rem; }
  .shelves-end { padding: 0 1rem; }
  .day-head { padding: 1.6rem 1rem 1.2rem; }
  .day-title { font-size: 1.9rem; }
  .shelf-head { padding: 0 1rem; }
  .shelf-head :is(h2, h3) { font-size: 1.4rem; }
  .shelf-all { padding: .3rem .75rem; font-size: .85rem; }
  /* on phones a topic row scrolls sideways, App Store style, and shows all its picks */
  .shelf-row {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 1rem; padding: 0 1rem; scrollbar-width: none;
  }
  .shelf-row > .tile, .shelf-row > .tile:nth-child(n + 5) { display: grid; scroll-snap-align: start; }
  .more-bar { padding: 0 1rem 2.5rem; }
  .facets { flex-wrap: nowrap; overflow-x: auto; padding: 0 1rem 1rem; scrollbar-width: none; }
  .grid { --col-min: 9.5rem; --cols-max: 2; padding: 0 1rem 2.5rem; }
  .tile figcaption a { font-size: 1rem; }
  .section-title { font-size: 1.75rem; }
  .title { font-size: 1.75rem; }
}
