/* Homepage: the Blocks showcase. Loaded after first paint — the section is far below the fold. */
/* ---------- Blocks: the pieces novels are made of ---------- */
.blocks { background: linear-gradient(180deg, var(--paper), var(--paper-warm)); }
.blocks__head { display: grid; gap: var(--s5); margin-bottom: var(--s10); }
@media (min-width: 1000px) { .blocks__head { grid-template-columns: 1fr minmax(0, 32rem); align-items: end; gap: var(--s12); } }
.blocks__stage { display: grid; gap: var(--s6); align-items: start; }
@media (min-width: 1000px) { .blocks__stage { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--s10); } }
.blocks__lib { border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 30px 60px -45px rgba(33,26,18,.5); overflow: hidden; }
.blocks__libhead { display: grid; gap: .6rem; margin: 0; padding: var(--s5) var(--s5) var(--s3); font-family: var(--serif); font-size: 1.2rem; }
.blocks__find { padding: .6rem .8rem; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font: 400 .82rem/1 var(--sans); color: var(--fg-muted); }
.blocks__list { list-style: none; margin: 0; padding: var(--s2); display: grid; gap: 2px; max-height: 560px; overflow-y: auto; scrollbar-width: thin; }
.blocks__list button { display: grid; gap: .15rem; width: 100%; padding: .65rem .8rem; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; color: var(--fg); cursor: pointer; transition: background-color var(--d-ink); }
.blocks__list button b { font-weight: 500; font-size: .95rem; }
.blocks__list button span { font-size: .78rem; line-height: 1.35; color: var(--fg-muted); }
.blocks__list button:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.blocks__list button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.blocks__list button[aria-selected="true"] span { color: #cfc3ad; }
.blocks__list button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: -2px; }
@media (max-width: 999px) {
  .blocks__list { grid-auto-flow: column; grid-auto-columns: max-content; max-height: none; overflow-x: auto; overflow-y: hidden; }
  .blocks__list button span { display: none; }
  .blocks__libhead { display: none; }
}
.blocks__book { position: relative; padding: clamp(14px, 3vw, 40px); border-radius: var(--radius-lg); background: radial-gradient(80% 70% at 50% 0%, rgba(185,68,52,.08), transparent 70%), #e8dfcd; box-shadow: inset 0 0 0 1px var(--line); }
.blocks__tag { position: absolute; top: 14px; left: 14px; z-index: 1; padding: .3rem .6rem; border-radius: var(--pill); background: rgba(33,26,18,.78); color: var(--paper); font: 500 .6875rem/1.2 var(--mono); letter-spacing: .03em; max-width: calc(100% - 28px); }
.blocks__page { position: relative; max-width: 560px; min-height: 640px; margin: 28px auto 0; padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 60px); background: #fbf7ee; border-radius: 2px 6px 6px 2px; box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 40px 70px -40px rgba(33,26,18,.55), 0 2px 6px rgba(33,26,18,.08); font-family: var(--serif); font-size: clamp(.98rem, .9rem + .2vw, 1.08rem); line-height: 1.65; color: #2a221a; }
.blocks__page::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 24px; background: linear-gradient(90deg, rgba(33,26,18,.08), transparent); pointer-events: none; }
.blocks__running { display: flex; justify-content: space-between; margin: 0 0 1.4em; font: italic 400 .8rem/1 var(--serif); color: #8a7d6c; }
.blocks__prose { margin: 0; text-indent: 1.4em; hyphens: auto; }
.blocks__prose:first-of-type { text-indent: 0; }
.blocks__panel { margin: 1.4em 0; }
.blocks__group { margin: 0 0 .8em; font: 500 .62rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--terracotta); text-align: center; }
.blocks__more { margin: var(--s8) 0 0; max-width: 72ch; font-size: .9375rem; color: var(--fg-2); }

/* Text messages */
.bk-texts { display: grid; gap: .45rem; padding: 1rem; border-radius: 18px; background: #f1ece2; font-family: var(--sans); font-size: .9rem; line-height: 1.35; }
.bk-texts__day { margin: 0 0 .3rem; text-align: center; font-size: .7rem; color: #8a7d6c; }
.bk-msg { max-width: 76%; margin: 0; padding: .55rem .85rem; border-radius: 18px; }
.bk-msg--them { justify-self: start; background: #e2dccf; color: #2a221a; border-bottom-left-radius: 5px; }
.bk-msg--me { justify-self: end; background: #3b6b5a; color: #fff; border-bottom-right-radius: 5px; }
.bk-msg--typing { display: inline-flex; gap: 4px; padding: .7rem .85rem; }
.bk-msg--typing i { width: 6px; height: 6px; border-radius: 50%; background: #8a7d6c; }
html.motion .bk-msg--typing i { animation: bk-dot 1.2s ease-in-out infinite; } .bk-msg--typing i:nth-child(2) { animation-delay: .15s; } .bk-msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bk-dot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
/* Social post */
.bk-post { display: grid; gap: .6rem; padding: 1rem; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(33,26,18,.1); font-family: var(--sans); font-size: .88rem; line-height: 1.45; }
.bk-post__head { display: flex; align-items: center; gap: .6rem; }
.bk-post__head b { display: block; font-size: .88rem; } .bk-post__head i { font-style: normal; font-size: .75rem; color: #8a7d6c; }
.bk-post__av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #2a221a; color: #f3ecdd; font-size: .7rem; font-weight: 600; }
.bk-post p { margin: 0; }
.bk-post__img { height: 120px; border-radius: 10px; background: linear-gradient(180deg, #2b3b50 0%, #6d7f8f 45%, #c98a4b 70%, #3a2c22 100%); }
.bk-post__react { display: flex; gap: 1.2rem; font-size: .8rem; color: #6e6152; }
.bk-post__comment { padding-top: .5rem; border-top: 1px solid rgba(33,26,18,.08); font-size: .82rem; } .bk-post__comment b { margin-right: .35rem; }
/* Email */
.bk-email { padding: 1rem 1.1rem; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px rgba(33,26,18,.1); font-size: .95rem; }
.bk-email dl { margin: 0 0 .9rem; padding-bottom: .7rem; border-bottom: 1px solid rgba(33,26,18,.1); display: grid; gap: .25rem; font-family: var(--sans); font-size: .8rem; }
.bk-email dl div { display: grid; grid-template-columns: 4.5rem 1fr; } .bk-email dt { color: #8a7d6c; } .bk-email dd { margin: 0; }
.bk-email p { margin: 0 0 .6em; }
/* Letter + diary */
.bk-letter { padding: 1.2rem 1.4rem; background: #f6efdf; box-shadow: 0 10px 24px -16px rgba(33,26,18,.5); transform: rotate(-.6deg); font-style: italic; }
.bk-letter p { margin: 0 0 .7em; } .bk-letter__date { text-align: right; } .bk-letter__sign { text-align: right; margin: 1em 0 0 !important; }
.bk-diary { padding: 1rem 1.2rem 1rem 2.2rem; background: repeating-linear-gradient(180deg, transparent 0 1.6rem, rgba(59,107,90,.18) 1.6rem calc(1.6rem + 1px)), #fbf8f0; border-left: 2px solid rgba(185,68,52,.35); font-style: italic; line-height: 1.6rem; }
.bk-diary p { margin: 0 0 .5rem; } .bk-diary__date { font-style: normal; font-weight: 500; }
/* Written note */
.bk-note-wrap { display: grid; place-items: center; padding: .6rem 0; }
.bk-sticky { margin: 0; width: min(78%, 260px); padding: 1.2rem 1.1rem 1.4rem; background: #f3dc7e; box-shadow: 0 16px 24px -14px rgba(33,26,18,.55); transform: rotate(2.5deg); font-style: italic; font-size: 1.25rem; line-height: 1.3; }
.bk-sticky span { display: block; margin-top: .5rem; text-align: right; font-size: 1rem; }
/* Case file */
.bk-case { padding: 1rem 1.1rem; border-radius: 4px; background: #f1ead8; box-shadow: inset 0 0 0 1px rgba(33,26,18,.15); font-family: var(--mono); font-size: .82rem; line-height: 1.7; }
.bk-case p { margin: 0 0 .7em; }
.bk-case__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-bottom: .5rem; border-bottom: 1px dashed rgba(33,26,18,.3); }
.bk-case__head span { color: #a63a2b; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.bk-case mark { color: transparent; background: linear-gradient(#1d1813, #1d1813) no-repeat left center / calc(var(--redact, 1) * 100%) 82%; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size .6s var(--e-settle); }
/* News */
.bk-news { padding: 1rem 1.1rem; background: #f2ede1; box-shadow: 0 10px 24px -18px rgba(33,26,18,.5); transform: rotate(.5deg); }
.bk-news p { margin: 0; }
.bk-news__mast { padding-bottom: .4rem; border-bottom: 3px double #2a221a; text-align: center; font-weight: 600; font-size: 1.3rem; letter-spacing: .02em; }
.bk-news__head { margin: .6rem 0 .2rem !important; font-size: 1.55rem; line-height: 1.1; font-weight: 500; }
.bk-news__by { font: 500 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #6e6152; margin-bottom: .6rem !important; }
.bk-news__body { columns: 2; column-gap: 1.2rem; font-size: .88rem; line-height: 1.5; text-align: justify; hyphens: auto; }
@media (max-width: 520px) { .bk-news__body { columns: 1; } }
/* Sign */
.bk-sign { margin: .4rem auto; max-width: 320px; padding: 1.2rem; border: 3px solid #2a221a; border-radius: 4px; text-align: center; background: #fff; box-shadow: 0 0 0 6px #fff, 0 0 0 7px rgba(33,26,18,.2); }
.bk-sign p { margin: 0; } .bk-sign__top { font: 600 .7rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #a63a2b; }
.bk-sign__big { margin: .5rem 0 !important; font: 700 1.5rem/1.1 var(--sans); text-transform: uppercase; letter-spacing: .02em; }
.bk-sign__small { font-size: .85rem; font-style: italic; }
/* Recipe + stat + timeline + verse */
.bk-recipe { padding: 1rem 1.2rem; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(33,26,18,.15); }
.bk-recipe__title { margin: 0 0 .5rem; font-size: 1.25rem; font-style: italic; text-align: center; }
.bk-recipe ul, .bk-recipe ol { margin: 0 0 .6rem; padding-left: 1.2rem; font-size: .92rem; } .bk-recipe ul { columns: 2; }
.bk-stat { padding: 1rem 1.1rem; border-top: 3px solid #7a2e24; border-bottom: 3px solid #7a2e24; background: #f6ecdc; font-size: .9rem; }
.bk-stat p { margin: 0 0 .5rem; } .bk-stat__name { font-size: 1.4rem; font-variant: small-caps; color: #7a2e24; margin: 0 !important; }
.bk-stat__sub { font-style: italic; color: #6e6152; }
.bk-stat__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; margin: .6rem 0; padding: .5rem 0; border-block: 1px solid rgba(122,46,36,.35); text-align: center; }
.bk-stat__grid dt { font: 600 .66rem/1 var(--sans); color: #7a2e24; } .bk-stat__grid dd { margin: .25rem 0 0; font-family: var(--mono); }
.bk-timeline { list-style: none; margin: 0; padding: 0 0 0 1.2rem; border-left: 2px solid rgba(185,68,52,.4); display: grid; gap: .9rem; }
.bk-timeline li { position: relative; } .bk-timeline li::before { content: ''; position: absolute; left: calc(-1.2rem - 6px); top: .45em; width: 10px; height: 10px; border-radius: 50%; background: #fbf7ee; box-shadow: inset 0 0 0 2px var(--terracotta); }
.bk-timeline b { display: block; font: 500 .7rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta); }
.bk-verse { padding: .4rem 0 .4rem 2.4rem; font-style: italic; } .bk-verse p { margin: 0; } .bk-verse p:nth-child(even) { padding-left: 1.4rem; }
.blocks__slot { display: grid; margin: 1.4em 0; }
.blocks__slot > .blocks__panel { grid-area: 1 / 1; margin: 0; }
.blocks__slot > .blocks__panel[hidden] { display: block !important; visibility: hidden; }
.blocks__page { min-height: 0; }
.blocks__slot > .blocks__panel { align-self: center; }
@media (max-width: 600px) { .blocks__page { margin-top: 48px; } }

