/* Blue Book Nights — premium layer (18.11.2026). Loaded after style.css on every page.
   The home first screen (.hero) is not touched here: it is another session's work. */

/* ---------- 1. the living first screen of a case (premium.js builds .live) ---------- */
.painting .live { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity 1.4s ease; pointer-events: none; container-type: size; }
.painting .live.on { opacity: 1; }
.painting .live .ly { position: absolute; inset: 0; will-change: transform; }
/* the layer images sit exactly where the still picture is (same file, same cover); masks cover the same way */
.painting .live .ly > img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: cover; animation: none;
  -webkit-mask-size: cover; mask-size: cover; -webkit-mask-position: 50% 50%; mask-position: 50% 50%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.painting .live .ly-patch { opacity: 0; will-change: opacity; }
/* the living layers are placed in the painting's own 16:9 box (cover, centred) */
.painting .live .pic { position: absolute; left: 50%; top: 50%; width: max(100cqw, 177.7778cqh); aspect-ratio: 16 / 9; transform: translate(-50%, -50%); }
.painting figcaption { z-index: 2; }

/* living layers: quiet, slow, and only where their source is in the painting */
.live .life { position: absolute; display: block; pointer-events: none; }
/* chimney smoke: a thin plume rising from the chimney top, widening and fading, drifting with the light wind */
.live .smoke { width: 3.6%; height: 12%; transform: translate(-50%, -100%) skewX(-12deg); transform-origin: 50% 100%; overflow: hidden; opacity: .3;
  -webkit-mask-image: radial-gradient(42% 100% at 50% 100%, #000 0%, rgba(0,0,0,.55) 45%, transparent 100%);
  mask-image: radial-gradient(42% 100% at 50% 100%, #000 0%, rgba(0,0,0,.55) 45%, transparent 100%); }
.live .smoke::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 200%;
  background: url(img/live/smoke-512.webp) 0 0 / 100% 50% repeat-y; animation: pr-smoke-rise 18s linear infinite; }
@keyframes pr-smoke-rise { from { transform: translateY(0); } to { transform: translateY(-50%); } }
/* valley fog: one wide band sliding very slowly along the valley, behind the truck */
.live .fog { overflow: hidden; opacity: .2; mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(farthest-side at 60% 55%, #000 30%, transparent 100%);
  mask-image: radial-gradient(farthest-side at 60% 55%, #000 30%, transparent 100%); }
.live .fog::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 200%;
  background: url(img/live/fog-1024.webp) 0 0 / 50% 100% repeat-x; animation: pr-fog-drift 150s linear infinite; }
@keyframes pr-fog-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* the craft's red lights: a slow, shallow breath of their own glow (never a blink) */
.live .glow { background: radial-gradient(50% 50% at 50% 50%, rgba(255, 70, 40, .55), rgba(255, 50, 30, 0) 100%);
  mix-blend-mode: screen; opacity: .0; animation: pr-breath 9s ease-in-out infinite alternate; }
.live .glow.soft { animation-delay: -1.2s; }
@keyframes pr-breath { from { opacity: .0; } to { opacity: .32; } }

@media (prefers-reduced-motion: reduce) { .painting .live { display: none; } }

/* ---------- 2. page to page: the card picture flows into the painting ---------- */
@view-transition { navigation: auto; }
.painting { view-transition-name: painting; }
.top { view-transition-name: top; }
::view-transition-group(painting) { animation-duration: .72s; animation-timing-function: cubic-bezier(.22, .72, .18, 1); }
::view-transition-old(painting), ::view-transition-new(painting) { height: 100%; width: 100%; object-fit: cover; overflow: clip; }
::view-transition-old(painting) { animation: pr-vt-out .4s ease both; }
::view-transition-new(painting) { animation: pr-vt-in .5s .08s ease both; }
::view-transition-old(root) { animation: pr-vt-out .32s ease both; }
::view-transition-new(root) { animation: pr-vt-in .42s .1s ease both; }
@keyframes pr-vt-out { to { opacity: 0; } }
@keyframes pr-vt-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- 3. polish below the first screen (one language of controls, rhythm, the next file, the footer) ---------- */
/* the film poster label speaks the folder language too (yellow paper, blue type) */
.watch .poster { box-shadow: 0 22px 46px -22px rgba(0, 0, 0, .8); }
.watch .poster img { transition: transform 1.2s cubic-bezier(.23, 1, .32, 1), filter .4s ease; }
.watch .poster:hover img { transform: scale(1.025); filter: brightness(1.06); }
.watch .poster span { background: linear-gradient(180deg, #ffe6a8 0%, #f1d58e 48%, #ddbd6e 100%); color: #0b2046;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 -8px 24px -10px rgba(255, 154, 46, .55); }
.watch .poster:hover span { background: linear-gradient(180deg, #fff0c4 0%, #ffe09e 100%); }
.story .actions { gap: 14px 16px; }
.story .actions .btn { margin-top: 7px; font-size: 18px; padding: 0 17px; gap: 9px; }

/* closing of a case page: one calm block, not five loose lines */
.closing { gap: 22px; }
.sec.closing { padding-top: 34px; }
.sec:has(> p.note:only-child) { padding: 26px 0; }
.closing .tip { padding: 22px 24px; border: 1px solid var(--rule); background: linear-gradient(90deg, rgba(255, 154, 46, .07), rgba(255, 154, 46, 0) 60%); }
.closing .tip .quiet { color: var(--paper-lit); }

/* the next file: two paintings, the title on them; the painting flows into the next case page */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 12px; }
.pager > a:not(.pg) { align-self: center; justify-self: start; padding: 10px 0; }
.pager > .next:only-child, .pager > a:not(.pg) + .next { justify-self: stretch; }
.pg { position: relative; display: block; overflow: hidden; aspect-ratio: 21 / 9; text-decoration: none; background: var(--night-2); isolation: isolate;
  box-shadow: 0 0 0 1px rgba(159, 184, 216, .16), 0 24px 50px -28px rgba(0, 0, 0, .9); transition: box-shadow .4s ease; }
.pg .pg-pic, .pg .pg-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pg .pg-pic img { transition: transform 1.4s cubic-bezier(.23, 1, .32, 1), filter .5s ease; filter: brightness(.82) saturate(.95); }
.pg::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(3, 10, 26, .92) 0%, rgba(3, 10, 26, .35) 45%, rgba(3, 10, 26, 0) 75%); }
.pg .pg-k, .pg .pg-h { position: absolute; left: 22px; right: 22px; z-index: 2; }
.pg .pg-k { bottom: 64px; font-family: var(--f-type); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper-lit); }
.pg .pg-h { bottom: 20px; font-family: var(--f-head); font-weight: 800; font-size: clamp(26px, 2.6vw, 38px); letter-spacing: .02em; text-transform: uppercase; line-height: 1; color: var(--moon); }
.pg.next .pg-k, .pg.next .pg-h { text-align: right; }
.pg:hover { box-shadow: 0 0 0 1px rgba(255, 154, 46, .55), 0 28px 60px -26px rgba(255, 154, 46, .45); }
.pg:hover .pg-pic img { transform: scale(1.04); filter: brightness(.95) saturate(1); }
.pg:focus-visible { outline: 3px solid var(--paper-lit); outline-offset: 3px; }

/* case cards on the front page: the whole card answers the hover, the title warms like the lamp */
.case h3 a { transition: color .3s ease; }
.case:hover h3 a { color: var(--paper-lit); }
.case .plate { box-shadow: 0 0 0 1px rgba(159, 184, 216, .12), 0 26px 50px -30px rgba(0, 0, 0, .9); transition: box-shadow .45s ease; }
.case:hover .plate { box-shadow: 0 0 0 1px rgba(255, 154, 46, .45), 0 30px 60px -28px rgba(255, 154, 46, .38); }

/* the footer: a low warm horizon, like the last light over the hills */
.foot { position: relative; border-top-color: transparent; }
.foot::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, rgba(159, 184, 216, 0), rgba(159, 184, 216, .28) 22%, rgba(255, 154, 46, .7) 50%, rgba(159, 184, 216, .28) 78%, rgba(159, 184, 216, 0)); }
.foot::after { content: ''; position: absolute; left: 20%; right: 20%; top: -60px; height: 60px; pointer-events: none;
  background: radial-gradient(50% 100% at 50% 100%, rgba(255, 154, 46, .09), rgba(255, 154, 46, 0)); }
.foot .links a { transition: color .25s ease; }

/* sections of a case page settle in as they come up (scroll-driven, no script); still for reduced motion */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .wrap > .sec:not(.first), .method, .watch .chapters li, .sources > li {
      animation: pr-settle-in linear both; animation-timeline: view(); animation-range: entry 0% entry 38%; }
    @keyframes pr-settle-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  }
}

@media (max-width: 700px) {
  .pager { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pg { aspect-ratio: 16 / 9; }
  .pg.next .pg-k, .pg.next .pg-h { text-align: left; }
  .closing .tip { padding: 18px; }
}
