/* Images tab — the Pictures / Art / Comics split chooser (renderer/media/images.js).
 *
 * A triptych over the whole Images view: a warm amber darkroom (real
 * photos), a cool violet atelier (drawn / rendered art) and a pink-neon
 * reading nook (comics), joined by glowing seams that carry the Hearth mark. Entering the tab
 * draws the seam top to bottom, then both halves unfold outward from it.
 * Hovering a half widens it, fans out three of its own thumbnails and wakes
 * its icon; picking one sweeps it across the view and hands over to the grid.
 */

.imgsplit {
  --split-ease: cubic-bezier(.2, .8, .2, 1);
  --split-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}
.imgsplit.hidden { display: none; }
/* While the split covers the view, skip painting the grid and sidebar under
   it (the split is opaque); they come back as it fades out. */
#view-images:has(> .imgsplit:not(.hidden):not(.is-leaving)) > :not(.imgsplit) { visibility: hidden; }

/* ─── one half ───────────────────────────────────────────────────────── */
.imgsplit-side {
  --side-accent: var(--accent-warm);
  --side-glow: rgba(245, 158, 11, .38);
  --side-tint: rgba(38, 20, 4, .55);
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: #07080c;
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: flex-grow .7s var(--split-ease), filter .5s ease, opacity .45s ease;
  -webkit-tap-highlight-color: transparent;
  /* card and title sizes follow the panel's own width (cqw) */
  container-type: inline-size;
}
.imgsplit-side[data-side="art"] {
  --side-accent: var(--accent);
  --side-glow: rgba(167, 139, 250, .42);
  --side-tint: rgba(18, 10, 40, .5);
}
.imgsplit-side[data-side="comics"] {
  --side-accent: var(--accent-pink);
  --side-glow: rgba(244, 114, 182, .4);
  --side-tint: rgba(40, 6, 28, .5);
}
.imgsplit-side:focus-visible { outline: none; }
.imgsplit-side:focus-visible .imgsplit-frame { opacity: 1; }

/* Painted backdrop — slow Ken Burns drift so the half is never a still. */
.imgsplit-bg {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  filter: brightness(.7) saturate(1.08);
  transform: scale(1.02);
  will-change: transform;
  animation: imgsplit-drift 22s ease-in-out infinite alternate;
  transition: filter .6s ease;
}
.imgsplit-side[data-side="photo"] .imgsplit-bg { background-image: var(--profile-bg-photo); }
.imgsplit-side[data-side="art"] .imgsplit-bg { background-image: var(--profile-bg-art); animation-delay: -11s; }
.imgsplit-side[data-side="comics"] .imgsplit-bg { background-image: var(--profile-bg-comics); animation-delay: -6s; }
@keyframes imgsplit-drift {
  from { transform: scale(1.02) translate3d(-1%, 0, 0); }
  to   { transform: scale(1.1)  translate3d(1.2%, -1.5%, 0); }
}

/* Tint + vignette, heavier toward the seam so the two halves read as one piece. */
.imgsplit-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 45%, transparent 0%, rgba(7, 8, 12, .55) 70%, rgba(7, 8, 12, .9) 100%),
    linear-gradient(to bottom, var(--side-tint), rgba(7, 8, 12, .2) 40%, rgba(7, 8, 12, .85));
  transition: opacity .6s ease;
}
.imgsplit-side::after {
  /* the light that sweeps across on hover */
  content: '';
  position: absolute;
  inset: -20% auto -20% -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .09), transparent);
  transform: skewX(-18deg) translateX(0);
  opacity: 0;
  pointer-events: none;
}

/* Accent edge light — wakes on hover / focus. */
.imgsplit-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--side-accent) 55%, transparent),
              inset 0 -120px 160px -80px var(--side-glow);
  opacity: 0;
  transition: opacity .45s ease;
}

/* ─── content column ─────────────────────────────────────────────────── */
.imgsplit-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px;
  max-width: 460px;
}

/* The centrepiece: three of this side's own images, picked at random every
   time the split opens and re-dealt one at a time while it stays open
   (images.js startDeal). Fanned at rest, spread wider on hover, under a
   spotlight in the side's colour. */
.imgsplit-fan {
  --card-w: clamp(84px, 27cqw, 168px);
  --card-h: calc(var(--card-w) * 1.27);
  --fan-x: calc(var(--card-w) * .7);
  position: relative;
  width: calc(var(--card-w) + var(--fan-x) * 2 + 40px);
  max-width: 100%;
  height: calc(var(--card-h) + 44px);
  margin-bottom: 10px;
}
.imgsplit-fan::before {
  /* spotlight */
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  height: 170%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--side-glow), transparent 72%);
  opacity: .75;
  transition: opacity .6s ease, transform .7s var(--split-ease);
  pointer-events: none;
}
.imgsplit-card {
  --tx: 0px; --ty: 0px; --r: 0deg; --s: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  height: var(--card-h);
  margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2);
  transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(var(--s));
  transition: transform .7s var(--split-ease), box-shadow .6s ease, filter .6s ease;
}
.imgsplit-card .imgsplit-photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d0e14;
}
.imgsplit-card .imgsplit-photo::after {
  /* glass: a soft top-left sheen + inner shade, so a thumbnail reads as a print */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), transparent 38%),
              linear-gradient(to top, rgba(0, 0, 0, .28), transparent 35%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 18px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.imgsplit-card img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%; /* people photos: keep faces in frame */
  opacity: 0;
  transition: opacity .55s ease, transform 6s ease-out;
}
.imgsplit-card img.is-ready { opacity: 1; }
.imgsplit-card img.is-incoming { opacity: 0; transform: scale(1.08); }
.imgsplit-card img.is-outgoing { opacity: 0; }
.imgsplit-card.is-dealing { animation: imgsplit-deal .75s var(--split-ease); }
@keyframes imgsplit-deal {
  0%   { transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(var(--s)); }
  40%  { transform: translate(var(--tx), calc(var(--ty) - 14px)) rotate(calc(var(--r) * -.4)) scale(calc(var(--s) * 1.04)); }
  100% { transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(var(--s)); }
}

/* Pictures = polaroids with a strip of tape. */
.imgsplit-side[data-side="photo"] .imgsplit-card {
  padding: 9px 9px 34px;
  border-radius: 3px;
  background:
    radial-gradient(120% 90% at 30% 10%, #fffdf7, #f1ebdd 60%, #e4dac6);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .35), 0 16px 34px rgba(0, 0, 0, .6);
}
.imgsplit-side[data-side="photo"] .imgsplit-card::before {
  content: '';
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -10px;
  width: 58px;
  height: 20px;
  margin-left: -29px;
  transform: rotate(-4deg);
  background: linear-gradient(180deg, rgba(255, 246, 214, .72), rgba(236, 222, 180, .6));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent 0);
          mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent 0);
}
/* Art = a gilded frame around a dark mat. */
.imgsplit-side[data-side="art"] .imgsplit-card {
  padding: 12px;
  border-radius: 2px;
  background: linear-gradient(145deg, #c9a45c 0%, #7a5a26 22%, #e8cf8e 48%, #6d4f1f 74%, #b8903f 100%);
  box-shadow:
    inset 0 0 0 2px rgba(40, 26, 8, .8),
    inset 0 0 0 5px rgba(255, 230, 170, .35),
    inset 0 0 0 7px rgba(30, 18, 4, .85),
    0 2px 3px rgba(0, 0, 0, .4), 0 18px 38px rgba(0, 0, 0, .65);
}
.imgsplit-side[data-side="art"] .imgsplit-card .imgsplit-photo {
  box-shadow: 0 0 0 4px #15101c;
}

/* Comics = a comic in a clear bag on a backing board. */
.imgsplit-side[data-side="comics"] .imgsplit-card {
  padding: 5px 5px 5px;
  border-radius: 3px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .1) 40%, rgba(255, 255, 255, .26));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 2px 3px rgba(0, 0, 0, .35), 0 16px 34px rgba(0, 0, 0, .6);
}
.imgsplit-side[data-side="comics"] .imgsplit-card::before {
  /* the bag's folded flap along the top, and one long glint down the plastic */
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: 3px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .28) 0 9px, rgba(255, 255, 255, .5) 9px 10px, transparent 10px),
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .22) 38%, transparent 46%);
  pointer-events: none;
}
.imgsplit-side[data-side="comics"] .imgsplit-card img { object-position: 50% 0; } /* covers: keep the masthead */

/* resting fan: back-left, back-right, front-centre */
.imgsplit-card:nth-child(1) { --tx: calc(var(--fan-x) * -1); --ty: 14px; --r: -11deg; --s: .9; z-index: 1; filter: brightness(.82); }
.imgsplit-card:nth-child(2) { --tx: var(--fan-x);           --ty: 14px; --r: 10deg;  --s: .9; z-index: 2; filter: brightness(.82); }
.imgsplit-card:nth-child(3) { --tx: 0px;                    --ty: 0px;  --r: -1.5deg; --s: 1; z-index: 3; }
/* two images: a pair; one image: just the front card */
.imgsplit-fan[data-n="2"] .imgsplit-card:nth-child(1) { --tx: calc(var(--fan-x) * -.55); --r: -6deg; --s: 1; }
.imgsplit-fan[data-n="2"] .imgsplit-card:nth-child(2) { --tx: calc(var(--fan-x) * .55);  --r: 6deg;  --s: 1; filter: none; }
.imgsplit-fan[data-n="1"] .imgsplit-card:nth-child(1) { --tx: 0px; --ty: 0px; --r: -2deg; --s: 1; filter: none; }

/* The custom icon, stamped over the bottom corner of the stack. */
.imgsplit-icon {
  position: absolute;
  z-index: 5;
  left: calc(50% + var(--card-w) / 2 - 44px);
  bottom: -6px;
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .65));
  animation: imgsplit-bob 4.8s ease-in-out infinite;
}
/* no images on this side yet: the icon is the whole picture */
.imgsplit-fan[data-n="0"] .imgsplit-icon {
  left: 50%;
  bottom: 50%;
  width: 150px;
  height: 150px;
  margin: 0 0 -75px -75px;
}
.imgsplit-side[data-side="art"] .imgsplit-icon { animation-delay: -2.4s; }
.imgsplit-icon img { display: block; width: 100%; height: 100%; }
.imgsplit-icon::before {
  /* camera: the shutter flash; palette: a splash of its own colour */
  content: '';
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, .95) 0%, rgba(255, 196, 94, .35) 30%, transparent 62%);
  opacity: 0;
  transform: scale(.3);
  pointer-events: none;
}
.imgsplit-side[data-side="comics"] .imgsplit-icon::before {
  /* a halftone starburst */
  border-radius: 0;
  background: radial-gradient(circle, rgba(244, 114, 182, .85) 0 1.5px, transparent 2px) 0 0 / 7px 7px;
  -webkit-mask: conic-gradient(from 0deg, #000 0 10deg, transparent 10deg 20deg, #000 20deg 30deg, transparent 30deg 40deg, #000 40deg 50deg, transparent 50deg 60deg, #000 60deg 70deg, transparent 70deg 80deg, #000 80deg 90deg, transparent 90deg 100deg, #000 100deg 110deg, transparent 110deg 120deg, #000 120deg 130deg, transparent 130deg 140deg, #000 140deg 150deg, transparent 150deg 160deg, #000 160deg 170deg, transparent 170deg 180deg, #000 180deg 190deg, transparent 190deg 200deg, #000 200deg 210deg, transparent 210deg 220deg, #000 220deg 230deg, transparent 230deg 240deg, #000 240deg 250deg, transparent 250deg 260deg, #000 260deg 270deg, transparent 270deg 280deg, #000 280deg 290deg, transparent 290deg 300deg, #000 300deg 310deg, transparent 310deg 320deg, #000 320deg 330deg, transparent 330deg 340deg, #000 340deg 350deg, transparent 350deg 360deg);
          mask: conic-gradient(from 0deg, #000 0 10deg, transparent 10deg 20deg, #000 20deg 30deg, transparent 30deg 40deg, #000 40deg 50deg, transparent 50deg 60deg, #000 60deg 70deg, transparent 70deg 80deg, #000 80deg 90deg, transparent 90deg 100deg, #000 100deg 110deg, transparent 110deg 120deg, #000 120deg 130deg, transparent 130deg 140deg, #000 140deg 150deg, transparent 150deg 160deg, #000 160deg 170deg, transparent 170deg 180deg, #000 180deg 190deg, transparent 190deg 200deg, #000 200deg 210deg, transparent 210deg 220deg, #000 220deg 230deg, transparent 230deg 240deg, #000 240deg 250deg, transparent 250deg 260deg, #000 260deg 270deg, transparent 270deg 280deg, #000 280deg 290deg, transparent 290deg 300deg, #000 300deg 310deg, transparent 310deg 320deg, #000 320deg 330deg, transparent 330deg 340deg, #000 340deg 350deg, transparent 350deg 360deg);
}
.imgsplit-side[data-side="art"] .imgsplit-icon::before {
  background: conic-gradient(from 30deg, rgba(167, 139, 250, .0), rgba(167, 139, 250, .55), rgba(6, 182, 212, .5), rgba(244, 114, 182, .55), rgba(245, 158, 11, .45), rgba(167, 139, 250, 0));
  -webkit-mask: radial-gradient(circle, transparent 28%, #000 30%, #000 50%, transparent 62%);
          mask: radial-gradient(circle, transparent 28%, #000 30%, #000 50%, transparent 62%);
}
@keyframes imgsplit-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-2deg); }
}

.imgsplit-kicker {
  margin-top: 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--side-accent);
}
.imgsplit-title {
  font-family: var(--split-serif);
  font-size: clamp(32px, 11cqw, 76px);
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  letter-spacing: -.01em;
  color: #fbf7ef;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .6);
  transition: letter-spacing .7s var(--split-ease), color .5s ease;
}
.imgsplit-sub {
  font-size: 14px;
  color: rgba(231, 236, 243, .78);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
}
.imgsplit-count {
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
  background: rgba(7, 8, 12, .72);
  border: 1px solid color-mix(in srgb, var(--side-accent) 45%, transparent);
  transition: background .4s ease, border-color .4s ease;
}

/* ─── the seam ───────────────────────────────────────────────────────── */
.imgsplit-seam {
  /* a zero-width flex item between the halves, so it rides the boundary
     as the hovered half widens */
  position: relative;
  z-index: 10;
  flex: 0 0 0;
  width: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.imgsplit-seam::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  --seam-a: #f59e0b;
  --seam-b: #a78bfa;
  background: linear-gradient(to bottom, transparent, var(--seam-a) 18%, #fde68a 50%, var(--seam-b) 82%, transparent);
  box-shadow: 0 0 18px 2px color-mix(in srgb, var(--seam-a) 45%, transparent), 0 0 34px 4px color-mix(in srgb, var(--seam-b) 30%, transparent);
  transform-origin: top;
}
.imgsplit-seam[data-between="art-comics"]::before { --seam-a: #a78bfa; --seam-b: #f472b6; }
.imgsplit-seam[data-between="art-comics"]::after { animation-delay: -1.8s; }
.imgsplit-seam::after {
  /* an ember that rides down the seam */
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 90px;
  margin-left: -3px;
  border-radius: 3px;
  background: linear-gradient(to bottom, transparent, #fff7df, transparent);
  filter: blur(1px);
  animation: imgsplit-ember 3.6s linear infinite;
}
@keyframes imgsplit-ember {
  from { transform: translateY(-100px); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  to   { transform: translateY(calc(100vh)); opacity: 0; }
}
.imgsplit-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #241a12, #0b0c11 70%);
  border: 1px solid rgba(253, 230, 138, .35);
  box-shadow: 0 0 0 6px rgba(7, 8, 12, .65), 0 0 28px rgba(245, 158, 11, .45);
  animation: imgsplit-glow 3.2s ease-in-out infinite;
}
.imgsplit-mark img { width: 40px; height: 40px; }
@keyframes imgsplit-glow {
  0%, 100% { box-shadow: 0 0 0 6px rgba(7, 8, 12, .65), 0 0 22px rgba(245, 158, 11, .35); }
  50%      { box-shadow: 0 0 0 6px rgba(7, 8, 12, .65), 0 0 38px rgba(245, 158, 11, .6); }
}

/* ─── entrance: seam draws, halves unfold outward from it ───────────── */
.imgsplit.is-entering .imgsplit-seam::before { animation: imgsplit-draw .55s var(--split-ease) both; }
.imgsplit.is-entering .imgsplit-mark { animation: imgsplit-pop .5s .35s cubic-bezier(.3, 1.6, .5, 1) both, imgsplit-glow 3.2s 1s ease-in-out infinite; }
/* Each panel opens from behind a veil that slides off toward its outer edge
   (Pictures left, Comics right, Art from its centre out). Transform only, so
   it runs on the compositor; animating a clip would repaint every panel on
   every frame. */
.imgsplit-veil {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  pointer-events: none;
  visibility: hidden;
}
.imgsplit-veil i { flex: 1 1 0; background: #07080c; will-change: transform; }
.imgsplit.is-priming .imgsplit-veil,
.imgsplit.is-entering .imgsplit-veil { visibility: visible; }
.imgsplit-side[data-side="art"] .imgsplit-veil i:first-child { transform-origin: left center; }
.imgsplit-side[data-side="art"] .imgsplit-veil i:last-child { transform-origin: right center; }
/* photo/comics: both halves travel together as one veil */
.imgsplit-side[data-side="photo"] .imgsplit-veil { transform-origin: left center; will-change: transform; }
.imgsplit-side[data-side="comics"] .imgsplit-veil { transform-origin: right center; will-change: transform; }
.imgsplit.is-entering .imgsplit-side[data-side="photo"] .imgsplit-veil,
.imgsplit.is-entering .imgsplit-side[data-side="comics"] .imgsplit-veil { animation: imgsplit-veil-x .8s .3s var(--split-ease) both; }
.imgsplit.is-entering .imgsplit-side[data-side="art"] .imgsplit-veil i { animation: imgsplit-veil-x .8s .38s var(--split-ease) both; }
/* priming: a blank stage while the art decodes (first open only) */
.imgsplit.is-priming .imgsplit-content,
.imgsplit.is-priming .imgsplit-seam { opacity: 0; }
.imgsplit.is-entering .imgsplit-content > * { animation: imgsplit-rise .7s var(--split-ease) both; }
.imgsplit.is-entering .imgsplit-content > :nth-child(1) { animation-delay: .55s; }
.imgsplit.is-entering .imgsplit-content > :nth-child(2) { animation-delay: .65s; }
.imgsplit.is-entering .imgsplit-content > :nth-child(3) { animation-delay: .72s; }
.imgsplit.is-entering .imgsplit-content > :nth-child(4) { animation-delay: .79s; }
.imgsplit.is-entering .imgsplit-content > :nth-child(5) { animation-delay: .86s; }
@keyframes imgsplit-draw   { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes imgsplit-pop    { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes imgsplit-veil-x { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes imgsplit-veil-y { from { transform: scaleY(1); } to { transform: scaleY(0); } }
@keyframes imgsplit-rise   { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── hover / focus: the half you are on takes the stage ────────────── */
@media (hover: hover) {
  .imgsplit:not(.is-choosing) .imgsplit-side:hover,
  .imgsplit:not(.is-choosing) .imgsplit-side:focus-visible { flex-grow: 1.6; }
  .imgsplit:not(.is-choosing):has(.imgsplit-side:hover) .imgsplit-side:not(:hover) { filter: saturate(.35) brightness(.55); }
  .imgsplit-side:hover .imgsplit-bg { filter: brightness(.8) saturate(1.2); }
  .imgsplit-side:hover .imgsplit-frame { opacity: 1; }
  .imgsplit-side:hover::after { animation: imgsplit-sheen 1.1s ease-out; }
  .imgsplit-side:hover .imgsplit-title { letter-spacing: .03em; color: #fff; }
  .imgsplit-side:hover .imgsplit-count { background: color-mix(in srgb, var(--side-accent) 28%, rgba(7, 8, 12, .6)); border-color: var(--side-accent); }

  .imgsplit-side:hover .imgsplit-fan { --fan-x: calc(var(--card-w) * .88); }
  .imgsplit-side:hover .imgsplit-fan::before { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  .imgsplit-side:hover .imgsplit-card:nth-child(1),
  .imgsplit-side:hover .imgsplit-card:nth-child(2) { filter: none; --ty: 22px; }
  .imgsplit-side:hover .imgsplit-card:nth-child(1) { --r: -15deg; }
  .imgsplit-side:hover .imgsplit-card:nth-child(2) { --r: 14deg; }
  .imgsplit-side:hover .imgsplit-card:nth-child(3) { --ty: -14px; --r: 0deg; --s: 1.1; }
  .imgsplit-side:hover .imgsplit-fan[data-n="2"] .imgsplit-card { --ty: -8px; --s: 1.06; }
  .imgsplit-side:hover .imgsplit-fan[data-n="1"] .imgsplit-card { --ty: -10px; --r: 0deg; --s: 1.1; }
  .imgsplit-side:hover .imgsplit-card img { transform: scale(1.06); }

  .imgsplit-side[data-side="photo"]:hover .imgsplit-icon { animation: imgsplit-snap .9s var(--split-ease); }
  .imgsplit-side[data-side="photo"]:hover .imgsplit-icon::before { animation: imgsplit-flash .9s .18s ease-out; }
  .imgsplit-side[data-side="art"]:hover .imgsplit-icon { animation: imgsplit-swing 1.1s var(--split-ease); }
  .imgsplit-side[data-side="art"]:hover .imgsplit-icon::before { animation: imgsplit-splash 1.1s .1s ease-out; }
  .imgsplit-side[data-side="comics"]:hover .imgsplit-icon { animation: imgsplit-pow .9s var(--split-ease); }
  .imgsplit-side[data-side="comics"]:hover .imgsplit-icon::before { animation: imgsplit-burst .8s .12s ease-out; }
}
/* comic: a POW — squash, pop, settle */
@keyframes imgsplit-pow {
  0%   { transform: none; }
  20%  { transform: translateY(2px) scale(1.12, .86); }
  45%  { transform: translateY(-12px) rotate(-8deg) scale(1.14); }
  70%  { transform: translateY(-4px) rotate(4deg) scale(1.02); }
  100% { transform: translateY(-4px) rotate(0deg) scale(1.04); }
}
@keyframes imgsplit-burst {
  0%   { opacity: 0; transform: scale(.3) rotate(0deg); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.4) rotate(45deg); }
}
@keyframes imgsplit-sheen { from { transform: skewX(-18deg) translateX(0); opacity: 1; } to { transform: skewX(-18deg) translateX(420%); opacity: 0; } }
/* camera: raise to the eye, click */
@keyframes imgsplit-snap {
  0%   { transform: none; }
  25%  { transform: translateY(-10px) rotate(-6deg) scale(1.08); }
  40%  { transform: translateY(-10px) rotate(-6deg) scale(1.02); }
  55%  { transform: translateY(-10px) rotate(-6deg) scale(1.1); }
  100% { transform: translateY(-4px) rotate(0deg) scale(1.04); }
}
@keyframes imgsplit-flash {
  0%   { opacity: 0; transform: scale(.3); }
  20%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}
/* palette: a painter's flourish */
@keyframes imgsplit-swing {
  0%   { transform: none; }
  30%  { transform: translateY(-8px) rotate(14deg) scale(1.08); }
  60%  { transform: translateY(-8px) rotate(-8deg) scale(1.06); }
  100% { transform: translateY(-4px) rotate(0deg) scale(1.04); }
}
@keyframes imgsplit-splash {
  0%   { opacity: 0; transform: scale(.4) rotate(0deg); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.35) rotate(160deg); }
}

/* ─── choosing: the picked half sweeps across, then hands over ──────── */
.imgsplit.is-choosing .imgsplit-side { pointer-events: none; }
.imgsplit.is-choosing .imgsplit-side.is-chosen { flex-grow: 30; }
.imgsplit.is-choosing .imgsplit-side:not(.is-chosen) { flex-grow: .0001; opacity: 0; }
.imgsplit.is-choosing .imgsplit-seam { opacity: 0; }
.imgsplit.is-choosing .imgsplit-side.is-chosen .imgsplit-bg { filter: brightness(.9) saturate(1.2); }
.imgsplit.is-leaving { animation: imgsplit-leave .45s ease-in both; }
@keyframes imgsplit-leave { to { opacity: 0; transform: scale(1.03); } }

/* ─── the Showing switch in the sidebar ──────────────────────────────── */
.imgsplit-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.imgsplit-switch button {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.imgsplit-switch button img { width: 22px; height: 22px; }
.imgsplit-switch button small { font-size: 10px; font-weight: 500; color: var(--text-mute); }
.imgsplit-switch button:hover { background: var(--surface-2); color: var(--text); }
.imgsplit-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.imgsplit-switch button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--sw-accent, var(--accent)); }
.imgsplit-switch button[data-side="photo"] { --sw-accent: var(--accent-warm); }
.imgsplit-switch button[data-side="art"] { --sw-accent: var(--accent); }
.imgsplit-switch button[data-side="comics"] { --sw-accent: var(--accent-pink); }
.imgsplit-switch button[data-side="all"] { --sw-accent: var(--accent-2); }
.imgsplit-switch .imgsplit-all-glyph { display: flex; height: 22px; align-items: center; }
.imgsplit-switch .imgsplit-all-glyph img { width: 16px; height: 16px; margin: 0 -2px; }
.imgsplit-reopen { width: 100%; margin-top: 8px; }

/* ─── phone: panels stack as bands, each a row; seams turn sideways ─── */
@media (max-width: 760px) {
  .imgsplit { flex-direction: column; }
  .imgsplit-side { container-type: normal; }
  .imgsplit-seam { width: auto; height: 0; }
  .imgsplit-seam::before { top: -1px; bottom: auto; left: 0; right: 0; width: auto; height: 2px; background: linear-gradient(to right, transparent, var(--seam-a) 18%, #fde68a 50%, var(--seam-b) 82%, transparent); transform-origin: left; }
  .imgsplit-seam::after { display: none; }
  .imgsplit-mark { left: auto; right: 18px; width: 40px; height: 40px; margin: -20px 0 0; }
  .imgsplit-mark img { width: 26px; height: 26px; }
  .imgsplit.is-entering .imgsplit-seam::before { animation-name: imgsplit-draw-x; }
  .imgsplit-veil { flex-direction: column; }
  .imgsplit-side[data-side="photo"] .imgsplit-veil { transform-origin: center top; }
  .imgsplit-side[data-side="comics"] .imgsplit-veil { transform-origin: center bottom; }
  .imgsplit-side[data-side="art"] .imgsplit-veil i:first-child { transform-origin: center top; }
  .imgsplit-side[data-side="art"] .imgsplit-veil i:last-child { transform-origin: center bottom; }
  .imgsplit.is-entering .imgsplit-side[data-side="photo"] .imgsplit-veil,
  .imgsplit.is-entering .imgsplit-side[data-side="comics"] .imgsplit-veil,
  .imgsplit.is-entering .imgsplit-side[data-side="art"] .imgsplit-veil i { animation-name: imgsplit-veil-y; }
  .imgsplit-content {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto auto;
    align-items: center;
    justify-items: start;
    column-gap: 12px;
    row-gap: 2px;
    width: 100%;
    max-width: none;
    padding: 12px 64px 12px 14px;
    text-align: left;
  }
  .imgsplit-fan { grid-row: 1 / 5; --card-w: 70px; --card-h: 89px; --fan-x: 34px; width: 150px; height: 110px; margin: 0; }
  .imgsplit-side[data-side="photo"] .imgsplit-card { padding: 4px 4px 14px; }
  .imgsplit-side[data-side="photo"] .imgsplit-card::before { width: 30px; height: 10px; margin-left: -15px; top: -5px; }
  .imgsplit-side[data-side="art"] .imgsplit-card { padding: 6px; }
  .imgsplit-side[data-side="comics"] .imgsplit-card { padding: 3px; }
  .imgsplit-icon { width: 40px; height: 40px; left: calc(50% + var(--card-w) / 2 - 22px); bottom: 0; }
  .imgsplit-fan[data-n="0"] .imgsplit-icon { width: 80px; height: 80px; margin: 0 0 -40px -40px; }
  .imgsplit-kicker { margin-top: 0; font-size: 10px; }
  .imgsplit-title { font-size: 34px; }
  .imgsplit-sub { font-size: 12px; }
  .imgsplit-count { margin-top: 4px; padding: 3px 10px; font-size: 11px; }
}
@keyframes imgsplit-draw-x   { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .imgsplit *, .imgsplit *::before, .imgsplit *::after, .imgsplit { animation: none !important; }
  .imgsplit-side, .imgsplit-card, .imgsplit-card img, .imgsplit-title, .imgsplit-seam { transition: none !important; }
  .imgsplit-veil { display: none; }
}

/* ── Lane bar (the dock at the top of the Images and Comics grids) ──
   The pills are the same .vlane-btn the video lanes use, so they inherit that
   module's shape; only the lane colours belong to this side of the app.
   Behaviour: paintLaneBars() in media/images.js. Frame: media/dock.css. */
.ilane-photo  { --lane-rgb: 245, 158, 11; }
.ilane-art    { --lane-rgb: 167, 139, 250; }
.ilane-comics { --lane-rgb: 52, 211, 153; }
.ilane-all    { --lane-rgb: 148, 163, 184; }
