/* Catalog reader on the home page (templates/partials/catalog.html, static/js/catalog.js) — owner, 2026-11-17.
   Dark "reading room": a thin lamp at the top lights the page; faint grain; the current page sits on two offset
   sheets with a floor shadow. Uses the site tokens from site.css. Decoration is aria-hidden; respects reduced motion. */
.cv { position: relative; overflow: hidden; isolation: isolate; padding-block: 120px; }
.cv__beam { position: absolute; inset-block-start: 0; inset-inline-start: 50%; width: 1500px; height: 1200px; transform: translateX(-50%);
  background: radial-gradient(ellipse 42% 58% at 50% 0%, rgba(214, 228, 255, .11) 0%, rgba(214, 228, 255, .045) 45%, rgba(214, 228, 255, 0) 75%);
  pointer-events: none; z-index: -1; }
.cv__lamp { position: absolute; inset-block-start: 0; inset-inline-start: 50%; width: 300px; height: 3px; transform: translateX(-50%);
  border-radius: 0 0 3px 3px; pointer-events: none; z-index: -1;
  background: linear-gradient(90deg, rgba(242, 245, 250, 0), rgba(242, 245, 250, .95) 30%, rgba(242, 245, 250, .95) 70%, rgba(242, 245, 250, 0));
  box-shadow: 0 0 28px 6px rgba(214, 228, 255, .32); }
[dir="rtl"] .cv__beam, [dir="rtl"] .cv__lamp { transform: translateX(50%); }
.cv__grain { position: absolute; inset: 0; background: url(/images/catalog/grain.png) 0 0 / 160px 160px; opacity: .55; pointer-events: none; z-index: -1; }

/* heading + spec list */
.cv__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px; }
.cv__copy { flex: 1 1 520px; max-width: 720px; }
.cv__eye { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.cv__dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 10px 2px rgba(140, 192, 255, .6); }
.cv__title { margin-block-start: 18px; color: #fff; font-size: clamp(36px, 5vw, 64px); letter-spacing: -.03em; line-height: 1.04; text-wrap: balance; }
.cv__muted { display: block; color: var(--on-night-2); }
.cv .lede { margin-block-start: 18px; max-width: 560px; }
.cv__spec { flex: 0 1 300px; margin: 0; font-size: 15px; }
.cv__spec div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding-block: 12px; border-block-start: 1px solid var(--night-line); }
.cv__spec div:last-child { border-block-end: 1px solid var(--night-line); }
.cv__spec dt { color: var(--on-night-2); font-size: 13px; }
.cv__spec dd { margin: 0; color: var(--on-night); font-variant-numeric: tabular-nums; }

/* chapters */
.cv__chaps { margin-block-start: 56px; display: flex; gap: 36px; overflow-x: auto; scrollbar-width: none; border-block-end: 1px solid var(--night-line); }
.cv__chaps::-webkit-scrollbar { display: none; }
.cv__chap { flex: none; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 56px;
  padding: 0 0 14px; border: 0; background: none; color: var(--on-night-2); font: inherit; text-align: start; cursor: pointer; transition: color .2s; }
.cv__chap:hover, .cv__chap[aria-pressed="true"] { color: var(--on-night); }
.cv__chap-t { display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 500; }
.cv__chap-n, .cv__chap-r { font-size: 12px; color: var(--on-night-2); font-variant-numeric: tabular-nums; }
.cv__chap-bar { position: absolute; inset-inline: 0; inset-block-end: -1px; height: 2px; }
.cv__chap[aria-pressed="true"] .cv__chap-bar { background: rgba(140, 192, 255, .22); }
.cv__chap-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--sky); transition: width .5s var(--ease); }

/* stage */
.cv__viewer { margin-block-start: 48px; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 26px; align-items: center; }
.cv__arrow, .cv__round { display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .04); color: var(--on-night); cursor: pointer;
  transition: background .2s, border-color .2s, opacity .2s, transform .2s var(--ease); }
.cv__arrow:hover:not(:disabled), .cv__round:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .42); }
.cv__arrow:active:not(:disabled), .cv__round:active { transform: scale(.96); }
.cv__arrow:disabled { opacity: .3; cursor: default; }
.cv__round { width: 48px; height: 48px; }
.cv__round--sm { width: 44px; height: 44px; }
.cv__book { position: relative; }
.cv__book::after { content: ""; position: absolute; inset-inline: 8%; inset-block-end: -54px; height: 64px; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, 0) 70%); filter: blur(6px); }
.cv__sheet { position: absolute; inset: 0; border-radius: 10px; transform-origin: 50% 100%; }
.cv__sheet--2 { transform: translateY(20px) scale(.93); background: #0b1530; border: 1px solid rgba(255, 255, 255, .05); }
.cv__sheet--1 { transform: translateY(10px) scale(.965); background: #101c3a; border: 1px solid rgba(255, 255, 255, .07); }
.cv__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--night-2);
  border: 1px solid rgba(255, 255, 255, .10); box-shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px rgba(0, 0, 0, .5); }
.cv__frame:focus-visible { outline: 2px solid var(--sky); outline-offset: 4px; }
.cv__pg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: translate3d(4%, 0, 0) scale(.97);
  transition: opacity .45s var(--ease), transform .7s var(--ease); }
.cv__pg.is-before { transform: translate3d(-4%, 0, 0) scale(.97); }
.cv__pg.is-on { opacity: 1; transform: none; }
.cv__sheen { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, 0) 22%); pointer-events: none; }

/* counter · scrubber · actions */
.cv__bar { margin: 64px auto 0; max-width: 1000px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.cv__count { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.cv__num { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.cv__num strong { font-size: 34px; font-weight: 600; letter-spacing: -.02em; color: var(--on-night); }
.cv__num span, .cv__cname { font-size: 15px; color: var(--on-night-2); }
.cv__cname { font-size: 13px; }
.cv__scrub { position: relative; height: 44px; }
.cv__track, .cv__fill { position: absolute; inset-inline-start: 0; top: 21px; height: 2px; border-radius: 2px; }
.cv__track { inset-inline-end: 0; background: rgba(255, 255, 255, .16); }
.cv__fill { width: 0; background: var(--sky); transition: width .5s var(--ease); }
.cv__tick { position: absolute; top: 15px; width: 1px; height: 14px; background: rgba(255, 255, 255, .3); }
.cv__range { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.cv__knob { position: absolute; top: 14px; left: 0; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--on-night);
  box-shadow: 0 0 0 5px rgba(140, 192, 255, .22); pointer-events: none; transition: left .5s var(--ease), box-shadow .2s; }
.cv__range:focus-visible + .cv__knob { box-shadow: 0 0 0 6px rgba(140, 192, 255, .55); }
.cv__acts { display: flex; align-items: center; gap: 10px; }
.cv .btn svg { flex: none; }
.cv .btn--outline-light { background: transparent; }
.cv .btn--outline-light:hover { background: #fff; color: var(--ink); }
.cv__dl { gap: 8px; }

/* thumbnails of the current chapter */
.cv__film { margin: 36px auto 0; max-width: 1000px; display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.cv__th { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--on-night-2); font: 12px/1 var(--font); font-variant-numeric: tabular-nums; }
.cv__th[hidden] { display: none; }
.cv__th img { width: 120px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--night-2);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .10), 0 8px 18px rgba(0, 0, 0, .35); opacity: .5;
  transition: opacity .25s, transform .35s var(--ease), box-shadow .25s; }
.cv__th:hover img { opacity: .9; }
.cv__th[aria-current="page"] { color: var(--on-night); }
.cv__th[aria-current="page"] img { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 1.5px var(--sky), 0 8px 18px rgba(0, 0, 0, .35); }

.cv__phone { display: none; }
.cv__foot { margin-block-start: 56px; padding-block-start: 24px; border-block-start: 1px solid var(--night-line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.cv__foot p { margin: 0; font-size: 15px; color: var(--on-night-2); }

/* full screen (native <dialog>: focus stays inside, Esc closes) */
.cv__dlg { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 18px 24px 28px; border: 0;
  background: rgba(4, 8, 18, .96); color: var(--on-night); box-sizing: border-box; }
.cv__dlg[open] { display: flex; flex-direction: column; gap: 18px; }
.cv__dlg::backdrop { background: rgba(4, 8, 18, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cv__dlg-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.cv__dlg-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.cv__dlg-title span[data-cv-chap] { color: var(--on-night-2); }
.cv__dlg-acts { display: flex; align-items: center; gap: 12px; }
.cv__dlg-n { font-size: 15px; color: var(--on-night-2); font-variant-numeric: tabular-nums; }
.cv__dlg-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; grid-template-rows: minmax(0, 1fr); gap: 20px; align-items: center; }
.cv__dlg-pg { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cv__dlg-pg img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.cv__dlg-hint { display: none; margin: 0; text-align: center; font-size: 13px; color: var(--on-night-2); }

@media (max-width: 1068px) {
  .cv__viewer { grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 16px; }
  .cv__viewer .cv__arrow { width: 52px; height: 52px; }
  .cv__bar { grid-template-columns: auto minmax(0, 1fr); }
  .cv__acts { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 734px) {
  .cv { padding-block: 72px 64px; }
  .cv__beam { width: 700px; height: 900px; }
  .cv__lamp { width: 160px; }
  .cv__head { gap: 18px; }
  .cv__copy { flex-basis: 100%; }
  .cv__title { font-size: 38px; line-height: 1.06; }
  .cv .lede { font-size: 17px; }
  .cv__spec { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0 16px; }
  .cv__spec div { display: flex; gap: 6px; padding: 0; border: 0; }
  .cv__spec div:last-child { border: 0; }
  .cv__spec dt, .cv__spec dd { font-size: 13px; color: var(--on-night-2); }
  .cv__spec dt::after { content: ":"; }
  .cv__chaps { margin: 24px calc(var(--gutter) * -1) 0; padding-inline: var(--gutter); gap: 8px; border: 0; }
  .cv__chap { min-height: 44px; padding: 0 16px; justify-content: center; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .04); white-space: nowrap; }
  .cv__chap[aria-pressed="true"] { background: var(--on-night); border-color: var(--on-night); color: var(--night); }
  .cv__chap-n, .cv__chap-r, .cv__chap-bar { display: none; }
  .cv__chap-t { font-size: 14px; }
  .cv__viewer { margin-block-start: 28px; display: block; }
  .cv__viewer > .cv__arrow { display: none; }
  .cv__sheet { border-radius: 8px; }
  .cv__sheet--2 { transform: translateY(14px) scale(.92); }
  .cv__sheet--1 { transform: translateY(7px) scale(.96); }
  .cv__frame { border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .5); }
  .cv__book::after { inset-block-end: -34px; height: 40px; }
  .cv__bar { margin-block-start: 40px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
  .cv__count { min-width: 0; align-items: center; text-align: center; }
  .cv__num strong { font-size: 26px; }
  .cv__acts { display: none; }
  .cv__film { margin: 8px calc(var(--gutter) * -1) 0; padding-inline: var(--gutter); gap: 10px; }
  .cv__th img { width: 96px; }
  .cv__phone { display: flex; flex-direction: column; gap: 10px; margin-block-start: 22px; }
  .cv__phone .btn { min-height: 50px; gap: 8px; }
  .cv__foot { margin-block-start: 32px; }
  .cv__dlg { padding: 16px; }
  .cv__dlg[open] { justify-content: center; }
  .cv__dlg-top { position: absolute; inset-block-start: 16px; inset-inline: 16px; }
  .cv__dlg-title, .cv__dlg-acts .btn { display: none; }
  .cv__dlg-acts { width: 100%; justify-content: space-between; }
  .cv__dlg-stage { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .cv__dlg-pg { order: -1; width: 100%; height: auto; }
  .cv__dlg-hint { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .cv__pg, .cv__fill, .cv__knob, .cv__chap-bar i, .cv__th img { transition: none; }
  .cv__pg, .cv__pg.is-before { transform: none; }
}
