.page-home {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
}

.page-home .site-header {
  flex: 0 0 auto;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.page-home .home-stage {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  touch-action: pan-x;
}

:root[data-theme="dark"] .page-home,
:root[data-theme="dark"] .page-home .home-stage {
  background: #000;
}

.home-showcase,
.home-filmstrip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.home-film-item {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: flex;
  width: max-content;
  height: max-content;
  align-items: center;
  justify-content: center;
  will-change: transform, filter, opacity;
  transform-origin: center;
  cursor: default;
}

.home-film-item.is-active {
  z-index: 3;
  cursor: pointer;
}

.home-film-item img {
  display: block;
  width: auto;
  max-width: min(23vw, 460px);
  height: auto;
  max-height: min(48vh, 500px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.home-film-item:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 8px;
}

.home-project-info {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  width: min(18vw, 220px);
  gap: 12px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(10px, 0.9vw, 13px);
  line-height: 1.28;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 140ms ease, transform 180ms ease;
}

.home-project-info strong {
  color: #111;
  font: inherit;
  font-weight: 400;
  text-transform: uppercase;
}

.home-project-info > span {
  color: #888;
}

:root[data-theme="dark"] .home-project-info strong {
  color: #fff;
}

.home-project-info-left {
  left: calc(50% - var(--home-focus-half-width, 230px) - 36px - min(18vw, 220px));
  text-align: right;
}

.home-project-info-right {
  right: calc(50% - var(--home-focus-half-width, 230px) - 36px - min(18vw, 220px));
  text-align: left;
}

.home-focus-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: var(--home-focus-width, 0px);
  height: var(--home-focus-height, 0px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 160ms ease, height 160ms ease;
}

.home-focus-corner {
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--ink);
  border-style: solid;
}

.home-focus-corner-tl {
  top: -10px;
  left: -10px;
  border-width: 1px 0 0 1px;
}

.home-focus-corner-tr {
  top: -10px;
  right: -10px;
  border-width: 1px 1px 0 0;
}

.home-focus-corner-bl {
  bottom: -10px;
  left: -10px;
  border-width: 0 0 1px 1px;
}

.home-focus-corner-br {
  right: -10px;
  bottom: -10px;
  border-width: 0 1px 1px 0;
}

.home-project-info.is-changing {
  opacity: 0;
  transform: translateY(calc(-50% + 5px));
}

.home-scroll-hint {
  position: absolute;
  right: 40px;
  bottom: 22px;
  z-index: 5;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  pointer-events: none;
}

@media (max-width: 900px) {
  .home-film-item img {
    max-width: 30vw;
    max-height: 44vh;
  }
  .home-project-info { width: 17vw; }
  .home-project-info-left { left: 22px; }
  .home-project-info-right { right: 22px; }
}

@media (max-width: 680px) {
  .page-home .site-header {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .home-film-item img {
    max-width: 56vw;
    max-height: 42vh;
  }
  .home-project-info {
    top: auto;
    bottom: 28px;
    width: calc(50% - 32px);
    gap: 7px;
    font-size: 10px;
    transform: none;
  }
  .home-project-info-left { left: 18px; }
  .home-project-info-right {
    right: 18px;
    text-align: right;
  }
  .home-project-info.is-changing { transform: translateY(4px); }
  .home-scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-project-info { transition: none; }
}
