/* The focus image is centred at its intrinsic aspect with a horizontal rail. */
.v2-viewer {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #ffffff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(.33,1,.68,1), visibility 0s linear 200ms;
}
.v2-viewer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 300ms cubic-bezier(.33,1,.68,1);
}
.v2-viewer.no-anim { transition: none; }
/* The picture behind the client list: 200ms out, 300ms back (the destination state's transition wins). */
.v2-viewer > :is(.stage, .swipe-rail, .strip) {
  transition: opacity 300ms var(--ease-soft);
}
.v2-viewer.is-menu-overlap > :is(.stage, .swipe-rail, .strip) {
  opacity: 0;
  pointer-events: none;
  transition-duration: 200ms;
}
.v2-viewer .stage {
  --focus-ratio: .8;
  --focus-max-w: calc(var(--r5-layout-width, 100vw) - 32px);
  --focus-max-h: calc(100dvh - 32px);
  --focus-h: max(0px, min(var(--focus-max-h), var(--focus-max-w) / var(--focus-ratio)));
  position: absolute;
  inset: 0;
  margin: auto;
  width: calc(var(--focus-h) * var(--focus-ratio));
  height: var(--focus-h);
  touch-action: pan-y pinch-zoom;
}
.v2-viewer .stage:focus { outline: none; }
.v2-viewer .stage.is-zoomed { touch-action: auto; }
.v2-viewer .focus-media, .v2-viewer .focus-frame, .v2-viewer .focus-frame :is(img, video) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.v2-viewer .focus-frame { background: center / contain no-repeat; }
.v2-viewer .focus-frame :is(img, video) { object-fit: contain; opacity: 0; display: block; }
/* Steps are instant (README, Focus); the layer's own fade covers opening. */
.v2-viewer .focus-frame img { transition: none; }
.v2-viewer .focus-frame img.is-loaded, .v2-viewer .focus-frame video.is-on { opacity: 1; }
.v2-viewer .strip {
  position: absolute;
  inset: auto max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  height: 32px;
  overflow: auto hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.v2-viewer .strip-track { position: relative; display: flex; gap: 2px; width: max-content; }
.v2-viewer .thumb {
  flex: none;
  width: calc(32px * var(--thumb-ratio));
  height: 32px;
  padding: 0;
  opacity: .4;
  touch-action: manipulation;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.v2-viewer .thumb.is-active { opacity: 1; }
.v2-viewer .thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.v2-viewer .thumb:focus-visible { outline-offset: -1px; opacity: 1; }

.v2-focus-sentence {
  position: relative;
  width: fit-content;
  max-width: 100%;
  color: inherit;
  font: 300 12px/1.35 var(--serif, Georgia, "Times New Roman", serif);
  letter-spacing: .16px;
  font-feature-settings: var(--serif-features, "case" 1);
  pointer-events: auto;
  transition: opacity 300ms var(--ease-soft);
  --focus-client-start: 1.65em;
}
.v2-focus-head { position: relative; overflow-wrap: anywhere; margin: 0; font: inherit; }
/* Archive title prototypes: copies of the old and new title move while the real one waits, unseen, in place. */
.v2-focus-head.is-swapping > .v2-focus-who { opacity: 0; }
.v2-focus-ghost {
  position: absolute;
  inset: 0 auto auto 0;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.v2-focus-ghost .v2-focus-prefix { visibility: hidden; }
.v2-focus-head.is-swapping.swaps-prefix > .v2-focus-prefix { opacity: 0; }
.v2-focus-ghost.swaps-prefix .v2-focus-prefix { visibility: visible; }
.v2-focus-client {
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.v2-focus-client:focus-visible, .v2-focus-project-link:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.v2-focus-tag { font-size: .645em; white-space: nowrap; }
/* A study's kind at full size after its name ("Sony, Image Study"). */
#v2-title-mount .v2-focus-tag.is-inline { font-size: inherit; vertical-align: baseline; }
.v2-focus-projects {
  --v2-project-list-width: max(0px, calc(100vw - var(--v2-sentence-x, 0px) - var(--focus-client-start) - var(--v2-nav-end, 16px)));
  position: absolute;
  z-index: 1;
  inset: 100% auto auto var(--focus-client-start);
  width: max-content;
  max-width: min(300px, var(--v2-project-list-width));
  max-height: min(70dvh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: none;
}
.v2-focus-projects[data-state] { pointer-events: auto; }
.v2-focus-project-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding-inline: 8px;
  text-indent: -8px;
  overflow-wrap: anywhere;
}
.v2-focus-project-line {
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms var(--ease-soft);
}
.v2-focus-projects[data-state] .v2-focus-project-line {
  opacity: 1;
  transition: opacity 260ms var(--ease-soft);
}
.v2-focus-projects[data-state="open"] .v2-focus-project-line { transition-delay: var(--v2-project-enter-delay, 0ms); }
@starting-style {
  .v2-focus-sentence, .v2-focus-projects[data-state] .v2-focus-project-line { opacity: 0; }
}
.v2-focus-projects.has-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
}


/* Desktop pictures are full size (owner, 2026-11-29). One that would come near the top line's words or the
   strip keeps a 64px band clear on that side and centres in the space left (viewer.js syncClearance). */
@media (min-width: 600px) and (pointer: fine) {
  .v2-viewer .stage:is(.clears-top, .clears-bottom) {
    --focus-clear-top: 16px;
    --focus-clear-bottom: 16px;
    inset: calc(var(--focus-clear-top) - 16px) 0 calc(var(--focus-clear-bottom) - 16px);
    --focus-max-h: calc(100dvh - var(--focus-clear-top) - var(--focus-clear-bottom));
  }
  .v2-viewer .stage.clears-top { --focus-clear-top: calc(var(--v2-nav-top, 16px) + 48px); }
  .v2-viewer .stage.clears-bottom { --focus-clear-bottom: calc(var(--v2-bottom, 16px) + 48px); }
}

@media (min-width: 600px) and (pointer: coarse) {
  .v2-viewer .stage {
    --focus-max-h: calc(100dvh - 216px - 2 * max(env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px)));
    --focus-max-w: calc(var(--r5-layout-width, 100vw) - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)));
  }
  .v2-viewer .strip { height: 44px; bottom: var(--v2-bottom, 16px); }
  .v2-viewer .thumb { min-width: 44px; height: 44px; padding: 6px; }
}

@media (max-width: 599.98px) {
  .v2-viewer .stage {
    --focus-max-w: calc(100vw - var(--v2-nav-start, 16px) - var(--v2-nav-end, 16px));
    --focus-max-h: calc(100dvh - var(--nav-h, 56px) - var(--v2-bottom, 16px) - 56px);
    inset: var(--nav-h, 56px) var(--v2-nav-end, 16px) calc(var(--v2-bottom, 16px) + 56px) var(--v2-nav-start, 16px);
  }
  .v2-viewer .strip {
    inset: auto calc(var(--v2-nav-end, 16px) - 2px) calc(var(--v2-bottom, 16px) - 6px) calc(var(--v2-nav-start, 16px) - 2px);
    height: calc(var(--v2-strip-img, 32px) + 12px);
  }
  /* The phone swipe: a native sideways scroller, one full-width slide per
     picture. The finger moves it 1:1 and iOS supplies the flick, the snap and the bounce at the ends. */
  .v2-viewer .swipe-rail {
    position: absolute;
    inset: var(--nav-h, 56px) 0 calc(var(--v2-bottom, 16px) + 56px) 0;
    display: flex;
    overflow: auto hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  .v2-viewer .swipe-rail[hidden] { display: none; }
  .v2-viewer .swipe-rail::-webkit-scrollbar { display: none; }
  /* Zoomed in, a sideways drag pans the picture instead of changing it. */
  .v2-viewer .swipe-rail.is-zoomed { overflow: hidden; }
  /* One picture per swipe, however hard the flick (owner, 2026-11-30). */
  .v2-viewer .swipe-slide { position: relative; flex: none; width: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
  .v2-viewer .swipe-slide > .stage,
  .v2-viewer .swipe-frame {
    inset: 0 var(--v2-nav-end, 16px) 0 var(--v2-nav-start, 16px);
    touch-action: auto;
  }
  .v2-viewer .swipe-frame {
    --focus-max-w: calc(100vw - var(--v2-nav-start, 16px) - var(--v2-nav-end, 16px));
    --focus-max-h: calc(100dvh - var(--nav-h, 56px) - var(--v2-bottom, 16px) - 56px);
    --focus-h: max(0px, min(var(--focus-max-h), var(--focus-max-w) / var(--focus-ratio)));
    position: absolute;
    margin: auto;
    width: calc(var(--focus-h) * var(--focus-ratio));
    height: var(--focus-h);
    background: center / contain no-repeat;
  }
  .v2-viewer .swipe-img { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
  .v2-viewer .swipe-img.is-loaded { opacity: 1; }
  /* The live picture lands on the identical still beneath it, so it needs no placeholder of its own.
     !important beats the inline placeholder; without it the tiny placeholder tiled across the picture. */
  .v2-viewer .swipe-slide .focus-frame { background: none !important; }
  .v2-viewer .strip-track { gap: 0; }
  .v2-viewer .thumb {
    /* 4px between pictures (owner, 2026-11-29: tighter); the tap area stays 44px tall. */
    width: calc(var(--v2-strip-img, 32px) * var(--thumb-ratio) + 4px);
    height: calc(var(--v2-strip-img, 32px) + 12px);
    padding: 6px 2px;
  }
}

@media (pointer: coarse) {
  .v2-focus-head { touch-action: manipulation; }
  .v2-focus-client { position: relative; }
  .v2-focus-client::before {
    content: "";
    position: absolute;
    inset-block: -14px;
    inset-inline-start: 0;
    inline-size: max(100%, 44px);
    min-block-size: 44px;
  }
  .v2-focus-projects { min-width: min(220px, var(--v2-project-list-width)); }
  /* 20px rows: the desktop rhythm (16px lines) with a little air; each row stays a full-width tap target. */
  .v2-focus-project-link { min-height: 20px; display: grid; align-content: center; }
  .v2-viewer .thumb:active, .v2-focus-client:active { opacity: .5; }
}


/* Link hover, no underline (owner, 2026-12-02, picked "Others fade" on ?ask=hover): in the client list the
   other rows fade and the one under the pointer stays; the logo, Information and the client name dim.
   Opacity only, 150ms in, 200ms out. Open states need no mark: the list shows, and Information reads Close. */
@media (hover: hover) and (pointer: fine) {
  :is(.v2-nav a, .v2-focus-client, .v2-focus-project-link) { transition: opacity 200ms var(--ease-soft); }
  :is(.v2-nav a, .v2-focus-client):hover,
  .v2-focus-projects:has(.v2-focus-project-link:hover) .v2-focus-project-link:not(:hover) {
    opacity: .45;
    transition-duration: 150ms;
  }
}
