/* iPad landscape only: keep the toolbar above a viewport-sized 3D scene.
   Fine-pointer desktop layouts retain their original geometry and disclosure. */
@media (orientation:landscape) and (min-width:1024px) and (max-width:1366px) and (min-height:600px) and (max-height:1024px) and (pointer:coarse) {
  #works {
    --tablet-works-title-size: clamp(64px, 9dvh, 82px);
    min-height: 100dvh;
    padding-top: calc(var(--tablet-nav-height, 72px) + 32px);
    padding-bottom: 32px;
  }

  #works .works-title {
    margin: 0 auto 32px;
    font-size: var(--tablet-works-title-size);
    line-height: 1;
  }

  #works .works-toolbar {
    margin: 0 var(--content-edge);
    gap: 24px;
    flex-wrap: nowrap;
    align-items: center;
    scroll-margin-top: calc(var(--tablet-nav-height, 72px) + 16px);
  }

  #works .wg-filter-panel {
    max-width: calc(100% - 176px);
    padding: 5px;
    gap: 4px;
  }

  #works .wg-filter {
    min-height: 44px;
    padding: 10px 17px;
    font-size: 14px;
    line-height: 24px;
  }

  #works .wg-filter sup {
    margin-left: 4px;
    font-size: 9px;
  }

  #works .wg-view-switch {
    flex: none;
    gap: 22px;
  }

  #works .wg-view-button {
    min-height: 44px;
    font-size: 14px;
  }

  #works .works-gallery {
    margin-top: 24px;
    /* Overrides the JS custom-property minimum without overwriting its value. */
    min-height: 0;
  }

  #works .wg-space {
    --wg-ring-radius-scale: 1.4;
    --wg-ring-tilt: 22deg;
    --wg-scene-height: max(240px, calc(100dvh - var(--tablet-nav-height, 72px) - 32px - var(--tablet-works-title-size) - 32px - 54px - 24px - 32px));
    --wg-focus-preview-max-height: min(430px, calc(var(--wg-scene-height) - 48px));
    height: var(--wg-scene-height);
  }

  #works .wg-space[data-view=ring] {
    --wg-scene-height: max(240px, calc(100dvh - var(--tablet-nav-height, 72px) - 32px - var(--tablet-works-title-size) - 32px - 54px - 24px - 32px));
  }

  #works .wg-space[data-view=ring] .wg-preview {
    --wg-preview-max-height: min(272px, 35.2dvh);
    width: clamp(208px, 22.4vw, 336px);
  }

  /* Preserve the previous orbit where a narrower or taller tablet needs side clearance. */
  @media (max-width:1179px), (min-height:851px) {
    #works .wg-space { --wg-ring-radius-scale:1.2; --wg-ring-tilt:24deg; }
  }

  #works .wg-space[data-view=focus] {
    top: 0;
  }

  #works .wg-space[data-view=focus] .wg-preview {
    top: 50%;
    left: var(--content-edge);
    width: 44%;
    max-width: 520px;
    transform: translateY(-50%);
  }

  #works .wg-drag-hint {
    font-size: 12px;
  }

  /* The archive remains a natural page when the visitor chooses the grid. */
  #works.wg-is-grid {
    height: auto;
    min-height: 100dvh;
    padding-bottom: 32px;
  }

  #works .wg-grid {
    padding-top: 0;
    padding-bottom: 24px;
  }
}
