/* The Monty blog (/blog/). The top stays as Robert liked it (20 Oct): the intro with search on the left, this week's
   guide on the desk, and the Start here route. Under it, every guide is a card with its words on a solid panel under
   the cover, never laid over the picture (21 Oct 2026). Also the "Keep reading" cards under each article.
   Tokens come from brand.css. */


.lib { padding-top: 58px; }
.lib .label { letter-spacing: 0; text-transform: none; font-size: 14px; font-weight: 600; color: var(--secondary); }

/* MARK: Hero: the intro on the left, this week's guide open on the desk on the right */
.lib-hero { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center;
  max-width: 1360px; margin: 0 auto; padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(24px, 3vw, 40px); }
.lib-intro { display: grid; gap: 20px; }
.lib-intro h1 { font-size: clamp(46px, 5.6vw, 80px); line-height: 1; letter-spacing: -.048em; }
.lib-intro .lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--secondary); max-width: 30em; }
.lib-search { position: relative; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px 0 18px; border-radius: 16px; cursor: text;
  background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); transition: box-shadow .2s, background .2s; }
.lib-search:hover { background: rgba(255,255,255,.07); }
.lib-search:focus-within { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1.5px rgba(179,188,255,.7), 0 0 0 5px rgba(179,188,255,.12); }
.lib-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--secondary); stroke-width: 1.6; stroke-linecap: round; }
.lib-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 500 17px var(--sys); }
.lib-search input::placeholder { color: var(--tertiary); }
.lib-search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); cursor: pointer; }
.lib-search kbd { font: 500 12px var(--mono); color: var(--tertiary); padding: 3px 8px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.lib-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 2px 0 0; font-size: 14.5px; color: var(--tertiary); }
.lib-stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lib-stats [data-lib-read] { color: #86e3bb; font-weight: 600; }

.desk { position: relative; display: block; border-radius: 30px; overflow: hidden; isolation: isolate; color: var(--text); text-decoration: none; cursor: pointer;
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.9), inset 0 0 0 1px rgba(255,255,255,.08); transform: perspective(1600px) rotateY(-5deg); transform-origin: 0 50%;
  transition: transform .7s var(--spring), box-shadow .4s; }
.desk:hover { transform: perspective(1600px) rotateY(0deg) translateY(-4px); box-shadow: 0 60px 120px -40px rgba(0,0,0,.95), 0 0 0 1px rgba(var(--c),.5), 0 0 80px -10px rgba(var(--c),.35); }
.desk-art { display: block; aspect-ratio: 16 / 10; }
.desk-art img, .desk-art svg { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; display: block; transition: transform 1.2s var(--ease-out); }
.desk:hover .desk-art img { transform: scale(1.03); }
.desk-text { position: absolute; left: 0; top: 0; bottom: 0; width: 56%; display: grid; align-content: end; gap: 12px; padding: clamp(22px, 3vw, 36px);
  background: linear-gradient(90deg, rgba(6,7,11,.94) 0%, rgba(6,7,11,.75) 60%, transparent 100%); }
.desk-k { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: rgb(var(--c)); }
.desk-k i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c)); box-shadow: 0 0 10px rgb(var(--c)); }
.desk-text b { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.1; letter-spacing: -.03em; font-weight: 600; text-wrap: balance; }
.desk-d { font-size: 15px; line-height: 1.5; color: var(--secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desk-m { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--tertiary); }
.desk-go { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--text); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.desk-go .arr { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .3s var(--spring); }
.desk:hover .desk-go .arr { transform: translateX(3px); }

/* MARK: The reading route: Start here, in order, with ticks for what you've read */
.route { margin: clamp(40px, 5vw, 64px) auto 0; max-width: 1360px; padding: clamp(24px, 3vw, 36px); border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.route-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.route-head h2 { margin-top: 8px; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.03em; }
.route-head .mute { color: var(--tertiary); }
.route-progress { margin: 0; font-size: 14.5px; color: var(--secondary); }
.route-progress b { color: #86e3bb; }
.route-list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: r; }
.route-list::before { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; z-index: 0; background: linear-gradient(90deg, rgba(255,179,107,.35), rgba(255,143,192,.35), rgba(179,188,255,.35), rgba(134,227,187,.35)); }
.route-list li { position: relative; z-index: 1; }
.route-list a { display: grid; grid-template-columns: auto 64px 1fr auto; align-items: center; gap: 14px; height: 100%; padding: 14px 16px 14px 14px; border-radius: 20px; color: var(--text); text-decoration: none; cursor: pointer;
  background: #0d0f16; box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); transition: box-shadow .25s, transform .4s var(--spring), background .25s; }
.route-list a:hover { transform: translateY(-3px); background: #11131c; box-shadow: inset 0 0 0 1px rgba(var(--c),.6), 0 20px 50px -20px rgba(var(--c),.45); }
.route-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--sys); color: rgb(var(--c)); box-shadow: inset 0 0 0 1.5px rgba(var(--c),.6); }
.route-art { width: 64px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 24px -8px rgba(0,0,0,.8); }
.route-art img, .route-art svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.route-t { display: grid; gap: 4px; min-width: 0; }
.route-t b { font-size: 15.5px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.route-t span { font-size: 13px; color: var(--tertiary); }
.route-tick { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14); }
.route-tick svg { width: 13px; height: 13px; fill: none; stroke: transparent; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.route-list a.is-read .route-tick { background: #86e3bb; box-shadow: 0 0 14px rgba(134,227,187,.6); }
.route-list a.is-read .route-tick svg { stroke: #0b0d14; }


.card-k { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: rgb(var(--t, var(--c))); }
.card-k i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--t, var(--c))); box-shadow: 0 0 10px rgba(var(--t, var(--c)), .8); flex: none; }
.lib .mute { color: var(--tertiary); }
.card-go .arr, .related-head .arr { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .3s var(--spring); }
.card:hover .card-go .arr { transform: translateX(3px); }

/* MARK: All guides: topics, search, and the grid of cards */
.all { max-width: 1360px; margin: clamp(56px, 7vw, 96px) auto 0; scroll-margin-top: 90px; }
.all-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.all-head h2 { font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.035em; scroll-margin-top: 90px; }
.all-head h2 .mute { font-weight: 500; font-variant-numeric: tabular-nums; }
.all-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { appearance: none; border: 0; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: 999px; font: 500 14.5px var(--sys); color: var(--secondary);
  background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); cursor: pointer; transition: color .2s, background .2s, box-shadow .2s; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c)); }
.chip:hover { color: var(--text); background: rgba(255,255,255,.08); }
.chip.on { color: var(--ink); background: var(--text); box-shadow: none; }
.lib-none { text-align: center; color: var(--secondary); font-size: 17px; margin: 28px 0 0; }
.lib-empty { max-width: 1360px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) 0; display: grid; gap: 10px; }
.lib-empty h2 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.035em; }
.lib-empty p { margin: 0; color: var(--secondary); font-size: 17px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.card { position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; isolation: isolate; color: var(--text); text-decoration: none; cursor: pointer;
  background: #0f1118; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: transform .45s var(--spring), box-shadow .3s; }
.card[hidden] { display: none; }
.card:hover, .card:focus-visible { transform: translateY(-5px); box-shadow: inset 0 0 0 1px rgba(var(--c), .55), 0 30px 70px -30px rgba(0,0,0,.95), 0 0 60px -20px rgba(var(--c), .45); outline: none; }
.card-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #11131b; }
.card-art img, .card-art svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% 50%; display: block; transition: transform 1s var(--ease-out); }
.card:hover .card-art img { transform: scale(1.045); }
.card-read { position: absolute; right: 12px; top: 12px; display: none; align-items: center; gap: 4px; padding: 4px 10px 4px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #0b0d14; background: #86e3bb; }
.card-read svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card.is-read .card-read { display: inline-flex; }
.card-body { flex: 1; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; padding: 20px 22px 22px; }
.card-t { font-size: 20px; line-height: 1.22; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.card-d { font-size: 15px; line-height: 1.5; color: var(--secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-m { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 13.5px; color: var(--tertiary); }
.card-go { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.card-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.card-meter i { display: block; height: 100%; width: var(--read, 0%); background: rgb(var(--c)); box-shadow: 0 0 8px rgb(var(--c)); }

/* Keep reading, under each article */
.related { max-width: 1360px; margin: 0 auto clamp(60px, 8vw, 100px); padding: 0 var(--gutter); }
.related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.related-head h2 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.03em; }
.related-head a { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--secondary); text-decoration: none; cursor: pointer; transition: color .2s; }
.related-head a:hover { color: var(--text); }

@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .lib-hero { grid-template-columns: 1fr; }
  .desk { transform: none; }
  .route-list { grid-template-columns: 1fr; }
  .route-list::before { display: none; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .desk-text { position: static; width: auto; background: #0d0f16; }
  .desk-art { aspect-ratio: 16 / 9; }
  .all-head { align-items: flex-start; }
  .chips { flex-wrap: nowrap; overflow-x: auto; max-width: calc(100% + 2 * var(--gutter)); scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .card-t { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .card, .desk, .route-list a, .card-art img { transition: none; } }
