/* 啪啦本舖: the site's own parts the kit does not draw (shared by every page).
   Chinese headings break between phrases (.ph), the menu rows that link to their pages, the
   line-art slider, the review cards' words, the works wall and its viewer, and 洛伊's helper. */

/* ---------- Chinese type */
:is(h1, h2, h3, .mo-wh__text, .footer__lede, .t-card) .ph { display: inline-block; }
:lang(zh) :is(h1, .t-h1) { line-height: 1.16; }
:lang(zh) :is(h2, .t-h2) { line-height: 1.24; }

/* ---------- menu rows: the name is the link to its own page */
.menu-rows .rows__name a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--dur, 200ms) var(--ease, ease); }
.menu-rows .rows__name a:hover, .menu-rows .rows__name a:focus-visible { background-size: 100% 1px; }
.menu-rows .rows__name a::after { content: " →"; color: var(--accent, var(--p-accent)); }
.rows__value s { color: var(--muted); font-weight: 400; margin-right: .4em; }

/* ---------- the line-art slider: the finished picture underneath, the drawing over it cut at --pos */
.ba { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--p-surface); aspect-ratio: var(--ba-ratio, 4 / 3); touch-action: pan-y; user-select: none; }
.ba > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba > .ba__before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.ba__handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); pointer-events: none; }
.ba__handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5' fill='none' stroke='%233a2a20' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 24px no-repeat;
  box-shadow: 0 1px 2px rgb(0 0 0 / .18); transition: transform var(--dur, 200ms) var(--ease, ease); }
.ba:hover .ba__handle::after, .ba:focus-within .ba__handle::after { transform: scale(1.06); }
.ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.ba:focus-within { outline: 2px solid var(--p-accent); outline-offset: 3px; }
.ba-pick { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.ba-pick .btn[aria-pressed="true"] { background: var(--p-ink); color: var(--p-bg); border-color: var(--p-ink); }

/* ---------- review cards: the buyer's words, then who and what */
.review { display: flex; flex-direction: column; gap: var(--s-4); }
.review > blockquote { margin: 0; font-size: var(--t-body); line-height: 1.75; }
.review__who { margin-top: auto; color: var(--muted); font-size: var(--t-small); }
.review__stars { color: var(--p-accent); letter-spacing: .12em; font-size: var(--t-small); }

/* ---------- the works wall: tiles that filter, and a viewer that opens one large */
.wall-filter { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.wall-filter .btn[aria-pressed="true"] { background: var(--p-ink); color: var(--p-bg); border-color: var(--p-ink); }
.works { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }
.works > a { display: block; position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-md); background: var(--p-surface); cursor: zoom-in; }
.works > a[hidden] { display: none; }
.works > a > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease, ease); }
.works > a:hover > img { transform: scale(1.03); }
.works > a:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 3px; }
@media (max-width: 1023px) { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.viewer { padding: 0; border: 0; max-width: none; max-height: none; width: 100vw; height: 100dvh; background: rgb(24 17 12 / .92); color: #fff; }
.viewer[open] { display: grid; place-items: center; }
.viewer::backdrop { background: transparent; }
.viewer img { max-width: min(92vw, 1400px); max-height: 84dvh; width: auto; height: auto; border-radius: var(--r-md); }
.viewer__bar { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; }
.viewer__bar button, .viewer__nav { all: unset; box-sizing: border-box; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .12); color: #fff; cursor: pointer; }
.viewer__bar button:hover, .viewer__nav:hover { background: rgb(255 255 255 / .22); }
.viewer__nav { position: fixed; top: 50%; margin-top: -24px; }
.viewer__nav--prev { left: 16px; } .viewer__nav--next { right: 16px; }
.viewer svg { width: 20px; height: 20px; }

/* ---------- 洛伊's helper: her face in the corner (640 and up), a small chat that answers the usual questions */
html:not([data-motion="off"]) .loy-fab.btn { position: fixed; z-index: 60; right: max(var(--gut), calc((100vw - var(--container, 1280px)) / 2)); bottom: 24px; gap: 10px; padding-left: 6px; box-shadow: 0 6px 20px rgb(58 42 32 / .16); }
.loy-fab.btn::before { content: ""; width: 36px; height: 36px; border-radius: 50%; background: url("img/loy-face.jpg") center / cover; flex: none; }
.loy-fab[aria-expanded="true"] { visibility: hidden; }
@media (max-width: 639px) { .loy-fab.btn { display: none; } }
.loy { position: fixed; inset: auto max(var(--gut), calc((100vw - var(--container, 1280px)) / 2)) 24px auto; z-index: 61; width: min(380px, calc(100vw - 32px)); max-height: min(620px, calc(100dvh - 120px)); margin: 0; padding: 0;
  border: 1px solid rgb(58 42 32 / .14); border-radius: 20px; background: var(--p-bg); color: var(--p-ink); box-shadow: 0 18px 48px rgb(58 42 32 / .22); overflow: hidden; }
.loy[open] { display: flex; flex-direction: column; }
@media (max-width: 639px) { .loy { inset: auto 16px calc(var(--bar, 0px) + 12px) 16px; width: auto; } }
.loy__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid rgb(58 42 32 / .1); background: var(--p-surface); }
.loy__head img { width: 44px; height: 44px; border-radius: 50%; }
.loy__head b { display: block; font: 500 16px/1.3 var(--font-display); }
.loy__head span { font-size: 13px; color: var(--p-muted); }
.loy__close { all: unset; margin-left: auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--p-muted); }
.loy__close:hover { background: rgb(58 42 32 / .08); color: var(--p-ink); }
.loy__close svg { width: 18px; height: 18px; }
.loy__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.loy__msg { max-width: 86%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--p-surface); font-size: 15px; line-height: 1.6; animation: loy-in 260ms var(--ease, ease) both; }
.loy__msg--me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--p-ink); color: var(--p-bg); }
.loy__msg a { display: inline-block; margin-top: 6px; color: var(--p-accent); font-weight: 500; text-underline-offset: 3px; }
.loy__typing { display: inline-flex; gap: 4px; padding: 14px; }
.loy__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--p-muted); animation: loy-dot 900ms infinite ease-in-out; }
.loy__typing i:nth-child(2) { animation-delay: 150ms; } .loy__typing i:nth-child(3) { animation-delay: 300ms; }
.loy__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid rgb(58 42 32 / .1); }
.loy__chips button { all: unset; box-sizing: border-box; min-height: 44px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgb(58 42 32 / .2); font-size: 14px; line-height: 1.4; cursor: pointer; transition: background var(--dur, 200ms); }
.loy__chips button:hover, .loy__chips button:focus-visible { background: var(--p-surface); border-color: var(--p-ink); }
@keyframes loy-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes loy-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .loy__msg { animation: none; } .loy__typing i { animation: none; opacity: .6; } }

/* the menu reads like a café menu: names in the display face */
.menu-rows .rows__name { font-family: var(--font-display); font-size: var(--t-lead); line-height: 1.3; }
.ba__label { display: block; margin-top: var(--s-3); }
.menu-rows .rows__name a { display: inline-block; padding-block: 13px; margin-block: -13px; }
.faq__pic { margin: 0; overflow: hidden; border-radius: var(--r-lg); background: var(--p-surface); }
.faq__pic > img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* on a phone the menu's one picture gives way to a small picture on each row */
.menu-thumb { display: none; }
@media (max-width: 639px) {
  .menu-rows > li:has(> .menu-thumb) { grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: var(--s-4); }
  .menu-rows .menu-thumb { display: block; grid-column: 1; grid-row: 1 / span 2; width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-md); }
  .menu-rows > li:has(> .menu-thumb) .rows__name { grid-column: 2; grid-row: 1; }
  .menu-rows > li:has(> .menu-thumb) .rows__value { grid-column: 3; grid-row: 1; }
  .menu-rows > li:has(> .menu-thumb) > p { grid-column: 2 / span 2; grid-row: 2; }
}
.section-head--row > .wall-filter { display: flex; flex-wrap: wrap; flex: none; justify-content: flex-end; }
@media (max-width: 1023px) { .section-head--row > .wall-filter { justify-content: flex-start; flex: 1 1 100%; } }
.wall-filter .btn, .ba-pick .btn { width: auto; }
@media (min-width: 1280px) { html #faq .faq__pic { min-height: 520px; } }
@media (max-width: 639px) { .menu-rows .rows__value s { display: none; } }
